Binary representation of floating point numbers

2005-12-06 Thread 63q2o4i02
Hi, I'm using python to run some lab equipment using PyVisa. When I read a list of values from the equipment, one of the fields is 32 bits of flags, but the value is returned as a floating point number, either in ASCII format, or pure binary. In either case, since I'm using PyVisa, it converts t

Re: Binary representation of floating point numbers

2005-12-06 Thread 63q2o4i02
Hi, okay, let me be more concise. The lab equipment has two formatting modes, ascii, and float. In ascii mode, it returns strings that represent the numeric value, so e.g. 3.14 is returned as '3.14'. PyVisa, when set to read ascii mode, will convert these strings to float with "visa.read_values

Re: Binary representation of floating point numbers

2005-12-06 Thread 63q2o4i02
Ok, I figured it out... The only way to get the flags is as a float, either through an ascii string or a true float. The value of the float, however, is representable as 24 bits of normal binary. So for example, the value returned is +4.608400E+04 which is really an int, 46084, which is more eas

Re: Binary representation of floating point numbers

2005-12-06 Thread 63q2o4i02
Actually that's probably the easiest way. I may want to use shorter variable names :) thanks michael -- http://mail.python.org/mailman/listinfo/python-list

Re: Binary representation of floating point numbers

2005-12-07 Thread 63q2o4i02
That looks pretty cool. I'll try it out. thanks Michael -- http://mail.python.org/mailman/listinfo/python-list

Moving a package in cygwin

2005-12-08 Thread 63q2o4i02
Hi, I'm using python 2.4 and windows XP. I have two packages in the windows version of python in site-packages. They are PyVisa and ctypes, and both live in c:\python24\lib\site-packages I'd like to move these to the cygwin version of python on the same system. I tried copying the PyVisa and ct

Re: Moving a package in cygwin

2005-12-09 Thread 63q2o4i02
Ok, thanks. I actually hadn't considered the build system, figuring that function names, etc., would somehow magically be "exported" to anyone wanting to use the .pyd library. Michael -- http://mail.python.org/mailman/listinfo/python-list

Fancy GUI with Python

2006-05-28 Thread 63q2o4i02
Hi all. I just downloaded and installed the new Office suite from MS with their new 'ribbon' based UI. I think it's pretty cool and AFT* for a new UI paradigm. I hope it sticks. Anyway, I'm wondering how to implement a gui like this with Python. I don't think wx or qt or gtk or tkinter support

Storing nothing in a dictionary and passing it to a function

2006-06-05 Thread 63q2o4i02
Hi, I'm writing a hand-written recursive decent parser for SPICE syntax parsing. In one case I have one function that handles a bunch of similar cases (you pass the name and the number of tokens you're looking for). In another case I have a function that handles a different set of tokens and so

Re: a good programming text editor (not IDE)

2006-06-17 Thread 63q2o4i02
Istvan Albert wrote: > Scott David Daniels wrote: > > > To paraphrase someone else (their identity lost in my mental fog) about > > learning VI: > > "The two weeks you'll spend hating vi (or vim) as you learn it will > > be repaid in another month, ad the rest is pure profit." > > Time

Re: a good programming text editor (not IDE)

2006-06-17 Thread 63q2o4i02
> > Cream is a package built on top of vim that presents a more "Windows > friendly" face to the vim/gvim editor. Cool thanks, I'll check it out. -- http://mail.python.org/mailman/listinfo/python-list

Interactive debugging

2006-06-25 Thread 63q2o4i02
Hi, is there a way in python to place some sort of keyboard() type statement which stops the script and puts you back at the console? I'm looking for something like in matlab, where you place a keyboard() command (I think), then you're in debug mode in the console, and you type continue to re-ente

Self-identifying functions and macro-ish behavior

2006-02-14 Thread 63q2o4i02
Hi, I was wondering how I may get a python function to know what its name is without me having to write it manually? For example: def func1(): print 'func1' return True def func2(): print 'func2' return True should be more like def func1(): print return T

Python vs. Lisp -- please explain

2006-02-18 Thread 63q2o4i02
Hi, I've been thinking about Python vs. Lisp. I've been learning Python the past few months and like it very much. A few years ago I had an AI class where we had to use Lisp, and I absolutely hated it, having learned C++ a few years prior. They didn't teach Lisp at all and instead expected us to

Re: Python vs. Lisp -- please explain

2006-02-19 Thread 63q2o4i02
Cool, thank you. That's the answer I was looking for :) -- http://mail.python.org/mailman/listinfo/python-list

Re: Python vs. Lisp -- please explain

2006-02-19 Thread 63q2o4i02
Great, thanks for a very complete answer. michael -- http://mail.python.org/mailman/listinfo/python-list

Re: Python vs. Lisp -- please explain

2006-02-19 Thread 63q2o4i02
Great, thank you and everyone for this nice discussion. Michael -- http://mail.python.org/mailman/listinfo/python-list

Why does stack.inspect take so long?

2006-05-15 Thread 63q2o4i02
Hi, I've written a top-down recursive decent parser for SPICE circuit descriptions. For debugging purposes, I wanted each production rule/function to know what its own name was, so at the beginning of each rule/function, I make a call to inspect.stack()[0][3] (I think...) and that fetches the name

Re: Why does stack.inspect take so long?

2006-05-15 Thread 63q2o4i02
Tim Peters wrote: > [EMAIL PROTECTED] > > Hi, I've written a top-down recursive decent parser for SPICE circuit > > descriptions. For debugging purposes, I wanted each production ... > > Any clues? > > It should go much faster to use a function that doesn't crawl the > entire call stack. For e

Using python for a CAD program

2006-05-15 Thread 63q2o4i02
Hi, I'm interested in using python to start writing a CAD program for electrical design. I just got done reading Steven Rubin's book, I've used "real" EDA tools, and I have an MSEE, so I know what I *want* at the end of this; I just have never taken on a programming task of this magnitude. I've s

Re: Using python for a CAD program

2006-05-16 Thread 63q2o4i02
Cool. thanks for the links. I've already looked around quite a bit, and am very hesitant to just write more shit on top of other shit. The idea behind this is it's completely mine. So yes, I have a tendency to want to reinvent a few wheels, but I think it'll give me greater satisfaction. The pr

Re: Using python for a CAD program

2006-05-16 Thread 63q2o4i02
Yes, I figured I should be pretty expert at what's out there first before redoing something and making in inferior to the existing solution. I took a quick peek at cadence courses, and they're out of my personal price range. I have a new job coming up which should lead into IC design after some t

Re: Using python for a CAD program

2006-05-17 Thread 63q2o4i02
Hi, Actually, I've wondered about using a custom-rolled binary or text-based database, vs. something that uses the OpenEDA standard, vs a 'real' database like sql. I guess my impression is that something like SQL is not designed for something as multi-... uh, dimensional? as an EE design. Perhap

Re: Using python for a CAD program

2006-05-17 Thread 63q2o4i02
Thanks for this. I'm enjoying this discussion and I'm learning a lot about people's views and how they differ from mine. However, I'm still wondering about my original post. Can the experts please comment on python's usage for the following: 1. Databases. Assuming I roll my own, does python h

Re: Tabs versus Spaces in Source Code

2006-05-17 Thread 63q2o4i02
I use Edit Plus for all my text-editing needs. With a simple shift-alt-i it faintly displays all spaces as little dots and all tabs as '>>' (but using the single ascii character instead). I use tabs to indent blocks, then if stuff within a block needs to be aligned (such as if statements or dicti