Re: Swig and Python

2005-10-04 Thread Steve Juranich
WIG list. There are lots of Python hackers on the list, too. So don't be afraid to ask fairly Python-centric questions either. -- Steve Juranich Tucson, AZ USA -- http://mail.python.org/mailman/listinfo/python-list

Making "import" *SLIGHTLY* more verbose?

2005-10-25 Thread Steve Juranich
imagine that this is a cookbook type thing, and if there are any references on how to do this, I'd greatly appreciate it (I couldn't come up with the right Google magic words). Thanks in advance for any help. -- Steve Juranich Tucson, AZ USA -- http://mail.python.org/mailman/listinfo/python-list

Re: derived / base class name conflicts

2005-11-10 Thread Steve Juranich
ter.Canvas before I can safely subclass it (and assign attributes > to an instance of the subclass) or clear attribute names as I outlined > above? > > Chris Marshall > > -- > http://mail.python.org/mailman/listinfo/python-list > -- Steve Juranich Tucson, AZ USA -- http://mail.python.org/mailman/listinfo/python-list

Re: Shutdown hook

2005-11-16 Thread Steve Juranich
nc, *targs, **kargs) register a function to be executed upon normal program termination func - function to be called at exit targs - optional arguments to pass to func kargs - optional keyword arguments to pass to func -- Steve Juranich Tucson, AZ USA -- http://mail.python.org/mailman/listinfo/python-list

Re: Tkinter's coordinates setting

2005-11-17 Thread Steve Juranich
; among them, do I need transfer the coordinates? Transfer the coordinates of what? When you go from the standard right-handed system to the system used in computer graphics, you use these simple formulas: max_x, max_y = image size screen_x = original_x screen_y = max_y - original_y - 1 HTH -

Re: Tkinter's coordinates setting

2005-11-21 Thread Steve Juranich
he screen. -- Steve Juranich Tucson, AZ USA -- http://mail.python.org/mailman/listinfo/python-list

Re: returning True, False or None

2005-02-04 Thread Steve Juranich
> This has a light code smell for me though -- can anyone see a simpler > way of writing this? How's about: def ntf(x, y): if x is None and y is None: return None if x == True or y == True: return True return False # Then... reduce(ntf, ) You might need to make sure that you init

Hardening enviroment by overloading __import__?

2005-06-23 Thread Steve Juranich
the builtin behavior back. Am I barking up the wrong tree with __import__?? Where should I look for this answer? Thanks. -- Steve Juranich Tucson, AZ USA -- http://mail.python.org/mailman/listinfo/python-list

Is there an easy way to get at the value of DBL_MAX from Python?

2005-07-07 Thread Steve Juranich
I'm in a situation where it would be nice to have access to this value. I've been looking for it all afternoon and can't find anything. Thanks. -- Steve Juranich Tucson, AZ USA -- http://mail.python.org/mailman/listinfo/python-list

Should I use "if" or "try" (as a matter of speed)?

2005-07-09 Thread Steve Juranich
isons for each item. But in cases where I'm only trying a single getattr (for example), using "if" might be a cheaper way to go. What do I mean by "cheaper"? I'm basically talking about the number of instructions that are necessary to set up and execute a try bl

Can I make the Python build use an already-installed version of Expat?

2005-07-19 Thread Steve Juranich
is a way to tell Python to link to arbitrary libraries, but I don't know how to turn off the building of the "custom" Expat that comes with Python. Thanks for any tips, pointers, and insight. -- Steve Juranich Tucson, AZ USA -- http://mail.python.org/mailman/listinfo/python-list

Re: Can I make the Python build use an already-installed version of Expat?

2005-07-19 Thread Steve Juranich
On 7/19/05, Bernhard Herzog <[EMAIL PROTECTED]> wrote: > This sounds like this bugreport on sourceforge: > http://python.org/sf/1075984 Thanks! I applied the workaround posted by `bos' and things seem to work now. -- Steve Juranich Tucson, AZ USA -- http://mail.python.org

Re: python tutorial/projects

2005-02-22 Thread Steve Juranich
I think the tutorial offered at www.python.org/tut/tut.html is as good a starting place as any. I wouldn't be able to suggest a "non-trivial" project without knowing more about your background. Can you do a flashcard program? recipe organizer? [EMAIL PROTECTED] client? (I think you see where this

Re: python tutorial/projects

2005-02-22 Thread Steve Juranich
Oops. The correct URL is http://docs.python.org/tut/tut.html On Tue, 22 Feb 2005 16:48:48 -0700, Steve Juranich <[EMAIL PROTECTED]> wrote: > I think the tutorial offered at www.python.org/tut/tut.html is as good > a starting place as any. > > I wouldn't be able to

How to make an extension class have a __getitem__ interface?

2005-03-08 Thread Steve Juranich
#x27;t do what I want it to do (with nested templated classes and the like). Many thanks in advance. -- Steve Juranich Tucson, AZ USA -- http://mail.python.org/mailman/listinfo/python-list

How do I get the current value of "errno"

2005-03-28 Thread Steve Juranich
thon for about six years now, and I never have found out how to do this. Thanks a lot. -- Steve Juranich Tucson, AZ -- http://mail.python.org/mailman/listinfo/python-list

Re: Wrapping C++ Class Heirachy in Python

2005-04-18 Thread Steve Juranich
object.c in the Python source as a reference for how to do this. I've had a couple of questions about how to implement new types that I posted to the list, and never got much help, so I started using the Python source as a reference. I've gotten most of what I needed to know from there. HTH -- Steve Juranich Tucson, AZ USA -- http://mail.python.org/mailman/listinfo/python-list

Re: Extending base class methods

2005-04-19 Thread Steve Juranich
): print "Standard: " + self.standard print "decField: " + self.decField super(MSD, self).printer() HTH -- Steve Juranich Tucson, AZ USA -- http://mail.python.org/mailman/listinfo/python-list

Re: Extending base class methods

2005-04-19 Thread Steve Juranich
oo >>> b = Bar() >>> b.foo() bar foo So nothing jumps out to me that you did obviously wrong, sorry. But in general my advice would be to switch to using "new-style" classes. HTH -- Steve Juranich Tucson, AZ USA -- http://mail.python.org/mailman/listinfo/python-list

Re: Kill forked processes

2006-02-26 Thread Steve Juranich
tay up. > > How can I achieve the desired behavior? You'll probably need to take a look at the `signal' and `atexit' modules. These will allow you to write hooks that will get called when your A script is terminated either by a signal or by reaching one of the "natura

Re: TypeError when subclassing 'list'

2006-02-26 Thread Steve Juranich
init__() > self.tag = tag > self.attrib = attrib I haven't put a lot of study into what you've done, but right off the bat, your use of "super" is incorrect. It should look like: super(XmlNode, self).__init__() Not sure if that will fix your problem, though. -- Steve Juranich Tucson, AZ USA -- http://mail.python.org/mailman/listinfo/python-list

Re: Use of __slots__

2006-02-26 Thread Steve Juranich
npythonic. Many others have stated so on the list. That's why it's great that you're free to ignore that variable. I suggest that you do so (as I have chosen to do). I'm sure that there are situations where you *MUST* have this kind of capability, but I haven't bumped in

Re: Kill forked processes

2006-02-26 Thread Steve Juranich
d signal modules will be your friend. > I'll be willing to PayPal $10 to anyone who completely figures this out > for me :) 1) I wouldn't want to spoil the fun. 2) My time writing code costs much more than that. :-) -- Steve Juranich Tucson, AZ USA -- http://mail.python.org/mailman/listinfo/python-list

Re: type = "instance" instead of "dict"

2006-02-27 Thread Steve Juranich
) class. Change your class definition to look more like what I have above and things should start working. If you're willing to post the code, we could pinpoint the problems much faster. -- Steve Juranich Tucson, AZ USA -- http://mail.python.org/mailman/listinfo/python-list

Re: Accessing 'mangled' class attrbutes

2006-03-01 Thread Steve Juranich
since this is a reference to the base class, so if it's inherited from some other class, you'll need to know from which class the member is inherited. HTH -- Steve Juranich Tucson, AZ USA -- http://mail.python.org/mailman/listinfo/python-list

Re: Accessing 'mangled' class attrbutes

2006-03-01 Thread Steve Juranich
the mangled member. Then (I forgot this part), you can just call the mangled member from `self'. Example follows. class A(object): def __init__(self): self.__foo = lambda x, y : x + y class B(A): def __init__(self, x, y): # Make sure you're calling th

Re: newbie question

2006-03-01 Thread Steve Juranich
be given a executable mode, or permission, using the > chmod command: > > $ chmod +x myscript.py" This is a Unix-specific command (POSIX-specific, actually). It won't work on a Windows box. To run the script from a command line, `python C:\path\to\script\myscript.py' sho

Re: SWIG and Python incompatibilities?

2005-05-05 Thread Steve Juranich
re proven to be > compatible/incompatible etc? We've used Swig 1.3.21 with a couple version of Python now (2.3.3, 2.3.4, 2.4, and now 2.4.1) without any problems. You might want to take a look at the code that Swig generates to see if that's really where your problems are coming from. Goo

Re: debugging in emacs

2006-04-24 Thread Steve Juranich
lder python-mode.el or the newer python.el? > > I am using eamcs 21.4.1 under dabian testing. I use python-mode.el v. 4.63 with Emacs 21.3 (I haven't made the switch to 21.4 yet). When I'm running an interactive *Python* buffer inside of Emacs and get a stack trace, I then use pdb.p

Re: Python C API question

2006-04-24 Thread Steve Juranich
to know how can I import and then manage xml.dom.minidom.* objects > using Python C API. > > thanks, > Gabriele > Have you looked at the PyImport_* functions? -- Steve Juranich Tucson, AZ USA -- http://mail.python.org/mailman/listinfo/python-list

Re: Zope 3

2006-04-25 Thread Steve Juranich
/ZopeBook/2_6Edition/view). Don't worry about the version (2.6) of the book. It's the latest they have (I think they're working on a new one for z3). You can skip the bits about DTML, but keep them handy. You should also take a look at the Zope user list: http://mail.zope.org/m

Re: Zope 3

2006-04-25 Thread Steve Juranich
uld look at to get an idea of what z3 has that 2.9 (which I'm currently still cutting my teeth on) doesn't? I've looked at the documentation on the main Zope page (zope.org) and all of the documents I've seen are apparently geared towards Zope 2.X. Where are the Zope3 docs? T

Re: Python Graphics Library

2006-05-08 Thread Steve Juranich
types of > graphical operations. Have you seen matplotlib? http://matplotlib.sourceforge.net -- Steve Juranich Tucson, AZ USA -- http://mail.python.org/mailman/listinfo/python-list

Re: Python cleanup on exit

2006-03-10 Thread Steve Juranich
Jacob Kroon wrote: > Is there another way to make python delete objects which were > created in the global scope upon exit ? Check out the `atexit' module. -- Steve Juranich Tucson, AZ USA -- http://mail.python.org/mailman/listinfo/python-list

Re: FIR filtering

2006-03-15 Thread Steve Juranich
LabWINC wrote: > If i type help scipy.filter it give me an error > > help scipy.filter > File "", line 1 > help scipy.filter > ^ > SyntaxError: invalid syntax You need parentheses: help(scipy.filter) -- Steve Juranich Tucson, AZ USA --

Re: Tried Ruby (or, "what Python *really* needs" or "perldoc!")

2006-03-16 Thread Steve Juranich
.. so alpha that it actually loops back around to *OMEGA*." Cheers. -- Steve Juranich Tucson, AZ USA -- http://mail.python.org/mailman/listinfo/python-list

Re: Converting to ARGB and writing to a bitmap

2006-03-17 Thread Steve Juranich
supported natively and makes image processing work a lot easier in some respects. -- Steve Juranich Tucson, AZ USA -- http://mail.python.org/mailman/listinfo/python-list

Barking up the wrong tree with extension types and modules?

2006-03-23 Thread Steve Juranich
nclude OurToolsPython.h and link against libOurToolsPythyon.so Am I thinking about this the right way, or am I *completely* twisted around the axle here (which is kind of how I feel)? Thanks in advance for any comments, corrections, and directions. -- Steve Juranich Tucson, AZ USA -- http://mail.python.org/mailman/listinfo/python-list

Re: Looking for a language/framework

2006-03-28 Thread Steve Juranich
osted. Thanks much. -- Steve Juranich Tucson, AZ USA -- http://mail.python.org/mailman/listinfo/python-list

Re: Parsing csh scripts with python

2006-03-29 Thread Steve Juranich
ur problem description, that's probably not what you want. I'd just process the each line, either making modifications or not, then put the processed line on an "out" buffer (list of strings), then write that list to a file. If you do it right, all the comments and things wil

Re: Difference in Python and Ruby interactive shells

2006-04-04 Thread Steve Juranich
is much more efficient than the Ruby VM. So if you want fast code, I'd stick with Python. However, if you regularly build large applications in memory from an interactive interpreter, then perhaps Ruby is the way for you to go. :-) Cheers. -- Steve Juranich Tucson, AZ USA -- http://mail.python.org/mailman/listinfo/python-list

Re: Strange problem when running python code

2006-04-04 Thread Steve Juranich
t crystal balls are for seeing the future, not for mind-reading. No, to do proper mind reading you need youself a pointy hat and (preferably) a deck of cards. Sorry, weird day at work. Had to vent. -- Steve Juranich Tucson, AZ USA -- http://mail.python.org/mailman/listinfo/python-list

Re: Strange problem when running python code

2006-04-05 Thread Steve Juranich
for myself -- the allow my subconscious to reveal > my inclinations based upon the cards' meanings) Who said anything about tarot? I'm talking about the old "Pick a card, any card..." bit. Cheers. -- Steve Juranich Tucson, AZ USA -- http://mail.python.org/mailman/listinfo/python-list

Re: newbie to SWIG/Python

2006-04-10 Thread Steve Juranich
files?? > > Thanks, Vasili > http://www.swig.org/Doc1.3/SWIGDocumentation.html#Python -- Steve Juranich Tucson, AZ USA -- http://mail.python.org/mailman/listinfo/python-list

Re: Regular Expressions

2006-04-12 Thread Steve Juranich
> convert the remaining number from hex to dec. > > I have been trying to figure this out for a while..I am fairly new so > please any help would be greatly appreciated. line = '"DcaVer"=dword:0640' value = int(line.split(':')[1], 16) Note that no re