pprinting objects

2007-12-08 Thread Donn Ingle
Hi, Is there a way to get a dump of the insides of an object? I thought pprint would do it. If I had a class like this: class t: def __init__(self): self.x=1 self.y=2 self.obj = SomeOtherObj() Then it could display it as: class t, x,1, y,2, obj,class SomeOtherObj Or something like

Re: how to convert 3 byte to float

2007-12-08 Thread John Machin
On Dec 8, 9:34 pm, Mario M. Mueller [EMAIL PROTECTED] wrote: Hi, I have a binary file containing 3 byte float values (big endian). How can I read them into python? The struct module does not work, since it expects 4 byte floats. Any hints? Mario What does a three-byte float look like? To

XSLT 2 Processor

2007-12-08 Thread anand nalya
Hi, I wanted to know if there is a XSLT 2 processor for python?? Thanks, Anand Nalya -- http://mail.python.org/mailman/listinfo/python-list

Re: Distinguishing attributes and methods

2007-12-08 Thread James Stroud
[EMAIL PROTECTED] wrote: Hi, With properties, attributes and methods seem very similar. I was wondering what techniques people use to give clues to end users as to which 'things' are methods and which are attributes. With ipython, I use tab completion all the time, but I can rarely tell

Re: pprinting objects

2007-12-08 Thread Martin Blume
Donn Ingle schrieb Is there a way to get a dump of the insides of an object? I thought pprint would do it. print would actually like to do it if you told it how to do it. print actually does it, but takes a default implementation if you do not override __repr__ or __str__. If I had a class

Re: how to convert 3 byte to float

2007-12-08 Thread Mario M. Mueller
John Machin wrote: On Dec 8, 9:34 pm, Mario M. Mueller [EMAIL PROTECTED] wrote: Hi, I have a binary file containing 3 byte float values (big endian). How can I read them into python? The struct module does not work, since it expects 4 byte floats. Any hints? Mario What does a

Re: how to convert 3 byte to float

2007-12-08 Thread Mario M. Mueller
Bjoern Schliessmann wrote: [...] BTW, who in his mind designs three byte floats? Memory isn't that expensive anymore. Even C bool is four bytes long. It's output of a digitizer (but not that old). I was also wondering about the reason for this limitation (maybe the design is ~20 years old).

Re: pprinting objects

2007-12-08 Thread John Machin
On Dec 8, 9:16 pm, Donn Ingle [EMAIL PROTECTED] wrote: Hi, Is there a way to get a dump of the insides of an object? I thought pprint would do it. If I had a class like this: class t: def __init__(self): self.x=1 self.y=2 self.obj = SomeOtherObj() Then it could display it as:

how to convert 3 byte to float

2007-12-08 Thread Mario M. Mueller
Hi, I have a binary file containing 3 byte float values (big endian). How can I read them into python? The struct module does not work, since it expects 4 byte floats. Any hints? Mario -- http://mail.python.org/mailman/listinfo/python-list

XSLT 2 Processor

2007-12-08 Thread anand nalya
Hi, I wanted to know if there is a XSLT 2 processor for python?? Thanks, Anand Nalya -- http://mail.python.org/mailman/listinfo/python-list

Re: setattr getattr confusion

2007-12-08 Thread James Stroud
Donn Ingle wrote: Hi, Here's some code, it's broken: class Key( object ): def __init__(self): self.props = KeyProps() def __getattr__(self, v): return getattr( self.props,v ) def __setattr__(self,var,val): object.__setattr__(self.props,var,val)

setdefaultencoding error

2007-12-08 Thread smalltalk
import sys sys.setdefaultencoding(utf8) Traceback (most recent call last): File interactive input, line 1, in module AttributeError: 'module' object has no attribute 'setdefaultencoding' but i find the attributesetdefaultencoding in python manuals where is the error? --

Re: Some python syntax that I'm not getting

2007-12-08 Thread Matt
Think of it as using a name instead of a position for your %s. In addition to what others already said, I thought I'd add an example of where this is useful. One place where you don't just want to have a position is when doing internatiolization. When translating for example: I'm going by

Re: how to convert 3 byte to float

2007-12-08 Thread Bjoern Schliessmann
Mario M. Mueller wrote: I have a binary file containing 3 byte float values (big endian). How can I read them into python? The struct module does not work, since it expects 4 byte floats. Since the module crystalball is still in development, you'll have to analyze your three byte float format

Re: pprinting objects

2007-12-08 Thread Donn Ingle
AFAIK you have to roll your own. Here is a very rudimentary example: Very cool, thanks. \d -- http://mail.python.org/mailman/listinfo/python-list

Re: weird embedding problem

2007-12-08 Thread Graham Dumpleton
On Dec 7, 11:44 pm, DavidM [EMAIL PROTECTED] wrote: On Fri, 07 Dec 2007 00:53:15 -0800, Graham Dumpleton wrote: Are you actually linking your C program against the Python library? Yes. Refer OP: I'm embedding python in a C prog which is built as a linux shared lib. The prog is linked

setattr getattr confusion

2007-12-08 Thread Donn Ingle
Hi, Here's some code, it's broken: class Key( object ): def __init__(self): self.props = KeyProps() def __getattr__(self, v): return getattr( self.props,v ) def __setattr__(self,var,val): object.__setattr__(self.props,var,val) class KeyProps(object):

Re: download complete webpage with python

2007-12-08 Thread Gabriel Genellina
En Fri, 07 Dec 2007 17:58:43 -0300, yi zhang [EMAIL PROTECTED] escribió: The urllib.urlretrieve() can only download the text part of a webpage, not the image associated. How can I download the whole, complete webpage with python? Thanks! The images are separate from the html document.

Re: Calculate an age

2007-12-08 Thread Marc 'BlackJack' Rintsch
On Fri, 07 Dec 2007 23:37:23 -0800, Pierre Quentel wrote: On Dec 7, 7:09 pm, Dennis Lee Bieber [EMAIL PROTECTED] wrote: How many days in a year? 365.25 (J2000 epoch), 365.2422 [as I recall](B1900 epoch), 365.0 (non-leap year), 366 (leap year)? Gregorian or Julian calendar -- and

Re: Distinguishing attributes and methods

2007-12-08 Thread Marc 'BlackJack' Rintsch
On Fri, 07 Dec 2007 23:19:40 -0800, tjhnson wrote: With properties, attributes and methods seem very similar. I was wondering what techniques people use to give clues to end users as to which 'things' are methods and which are attributes. Methods are attributes. So the decision is easy --

Re: setdefaultencoding error

2007-12-08 Thread John Machin
On Dec 8, 8:36 pm, smalltalk [EMAIL PROTECTED] wrote: import sys sys.setdefaultencoding(utf8) Traceback (most recent call last): File interactive input, line 1, in module AttributeError: 'module' object has no attribute 'setdefaultencoding' but i find the attributesetdefaultencoding in

how to convert 3 byte to float

2007-12-08 Thread Mario M. Mueller
Hi, I have a binary file containing 3 byte float values. How can I read them into python? The struct module does not work, since it expects 4 byte floats. Any hints? Mario -- http://mail.python.org/mailman/listinfo/python-list

Re: How does python build its AST

2007-12-08 Thread Carl Banks
On Dec 7, 9:23 am, MonkeeSage [EMAIL PROTECTED] wrote: A quick question about how python parses a file into compiled bytecode. Does it parse the whole file into AST first and then compile the AST, or does it build and compile the AST on the fly as it reads expressions? (If the former case, why

Re: how to convert 3 byte to float

2007-12-08 Thread Tommy Nordgren
On 8 dec 2007, at 12.52, Mario M. Mueller wrote: Bjoern Schliessmann wrote: [...] BTW, who in his mind designs three byte floats? Memory isn't that expensive anymore. Even C bool is four bytes long. It's output of a digitizer (but not that old). I was also wondering about the reason

Re: How does python build its AST

2007-12-08 Thread MonkeeSage
On Dec 8, 3:32 am, Carl Banks [EMAIL PROTECTED] wrote: On Dec 7, 9:23 am, MonkeeSage [EMAIL PROTECTED] wrote: A quick question about how python parses a file into compiled bytecode. Does it parse the whole file into AST first and then compile the AST, or does it build and compile the AST

Re: Distinguishing attributes and methods

2007-12-08 Thread MonkeeSage
On Dec 8, 2:10 am, Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote: On Fri, 07 Dec 2007 23:19:40 -0800, tjhnson wrote: With properties, attributes and methods seem very similar. I was wondering what techniques people use to give clues to end users as to which 'things' are methods and

Re: Distinguishing attributes and methods

2007-12-08 Thread MonkeeSage
On Dec 8, 6:50 am, Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote: On Sat, 08 Dec 2007 00:34:06 -0800, MonkeeSage wrote: I think he means callable attributes (methods) and non-callable attributes (variables). But not every callable attribute is a method. Ciao, Marc 'BlackJack'

Re: setattr getattr confusion

2007-12-08 Thread Carl Banks
On Dec 8, 6:06 am, Donn Ingle [EMAIL PROTECTED] wrote: Hi, Here's some code, it's broken: class Key( object ): def __init__(self): self.props = KeyProps() def __getattr__(self, v): return getattr( self.props,v ) def __setattr__(self,var,val):

Re: Distinguishing attributes and methods

2007-12-08 Thread Marc 'BlackJack' Rintsch
On Sat, 08 Dec 2007 00:34:06 -0800, MonkeeSage wrote: I think he means callable attributes (methods) and non-callable attributes (variables). But not every callable attribute is a method. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: setattr getattr confusion

2007-12-08 Thread Donn Ingle
So you might want to describe your use-case. Um.. I wanted an object with Key to hold other data. I wanted a way to set that *other* data within Key without having to specify the object in-between everytime. k1.x = ni! should perform: k1.props.x = ni! and print k1.x should perform: print

Re: Calculate an age

2007-12-08 Thread Shane Geiger
What is so obvious about dealing with months that vary in length and the leap-year issue? Nothing. If you were born on a day that does not exist every year (Feb 29th), how old are you on Feb 28th? or Mar 1 of non-leap years? If you were born on Feb 29th, then you would be one month old on March

Re: how to convert 3 byte to float

2007-12-08 Thread Tommy Nordgren
On 8 dec 2007, at 13.57, Bjoern Schliessmann wrote: Mario M. Mueller wrote: It's output of a digitizer (but not that old). I was also wondering about the reason for this limitation (maybe the design is ~20 years old). Uh, that's weird. Since Python cannot guess its format, you'll have to

Re: how to convert 3 byte to float

2007-12-08 Thread Bjoern Schliessmann
Mario M. Mueller wrote: It's output of a digitizer (but not that old). I was also wondering about the reason for this limitation (maybe the design is ~20 years old). Uh, that's weird. Since Python cannot guess its format, you'll have to try it out. Why don't you try to let the device output

Re: pprinting objects

2007-12-08 Thread Donn Ingle
Define a __repr__ or __str__ method for the class Yes, then I could include the code John Machin suggested in there: for attr, value in sorted(self.__dict__.iteritems()): blah That will do nicely. Thanks all. \d -- http://mail.python.org/mailman/listinfo/python-list

Basic animation in Python - how to

2007-12-08 Thread http://members.lycos.co.uk/dariusjack/
I need to draw a shaded rectangle and have flashing (gif animated) points on it so not to refresh all objects a rectangle, but points, changing their colors, attributes. Please refer me to some basic Python code for animation like that . Darius --

Re: Equivalent of perl's Pod::Usage?

2007-12-08 Thread Neil Cerutti
On 2007-12-08, Dennis Lee Bieber [EMAIL PROTECTED] wrote: On Fri, 7 Dec 2007 20:12:21 +, Adam Funk [EMAIL PROTECTED] declaimed the following in comp.lang.python: I'm using to using Pod::Usage in my Perl programs (a snipped example is shown below, if you're interested) to generate a little

Re: how to convert 3 byte to float

2007-12-08 Thread Mario M. Mueller
Tommy Nordgren wrote: [...] One thing to consider: It is possible that one of the bytes contributes bits to BOTH the mantissa and the exponent ; From todays point of view I cannot exclude this. Do you know the relative accurazy of the digitizer? Not yet. It's seismic data, that implies:

Re: Running unmodified CGI scripts persistently under mod_wsgi.

2007-12-08 Thread Michael Ströder
Jeffrey Froman wrote: I'd still be interested in a mod_wsgi wrapper for 3rd-party CGI scripts. I doubt that this is possible, not because of the interface. But conventional CGI scripts are implemented with the assumption of being stateless. You would have to completely reinitialize them for

Re: distutils OS X universal binaries

2007-12-08 Thread Christian Heimes
Martin v. Löwis wrote: At first, I also thought that Robin suggested that there is a problem with Python. Upon re-reading, I now believe he rather sees the bug in the reportlabs code, and is asking for an approach to solve it there. I saw your posting after I sent mine. The gmane web interface

Re: a Python person's experience with Ruby

2007-12-08 Thread Arkanes
Colin J. Williams wrote: Steve Howell wrote: Thanks for the interesting comparison. [snip] 3) I actually like being able to omit parentheses in method definitions and method calls. In Ruby you can express add(3,5,7) as both add(3,5,7) and add 3, 5, 7. The latter syntax is obviously

callback confusion

2007-12-08 Thread Donn Ingle
Hi, I have two modules, the second is imported by the first. Let's call them one.py and two.py (two being my API) In the first I register a function into the second. [in one.py] def boo(): ... ... two.register( boo ) two.startLoop() In two.py it starts a loop (GTK timeout), so processing

Re: Running unmodified CGI scripts persistently under mod_wsgi.

2007-12-08 Thread Istvan Albert
On Dec 8, 8:26 am, Michael Ströder [EMAIL PROTECTED] wrote: But conventional CGI scripts are implemented with the assumption of being stateless. while it might be that some CGI scripts must be executed in a new python process on each request, common sense and good programming practices would

Re: setattr getattr confusion

2007-12-08 Thread Donn Ingle
class Key(object): def __init__self): self.__dict__['props'] = KeyProps() Okay - that's weird. Is there another way to spin this? def __setattr__(self,var,val): setattr(self.props,var,val) Perhaps by changing this one? \d -- http://mail.python.org/mailman/listinfo/python-list

Re: a Python person's experience with Ruby

2007-12-08 Thread Colin J. Williams
MonkeeSage wrote: On Dec 7, 11:08 pm, Steve Howell [EMAIL PROTECTED] wrote: Python is my favorite programming language. I've used it as my primary language for about six years now, including four years of using it full-time in my day job. Three months ago I decided to take a position with

Re: a Python person's experience with Ruby

2007-12-08 Thread Colin J. Williams
Steve Howell wrote: Thanks for the interesting comparison. [snip] 3) I actually like being able to omit parentheses in method definitions and method calls. In Ruby you can express add(3,5,7) as both add(3,5,7) and add 3, 5, 7. The latter syntax is obviously more error prone, but I don't

Re: Python is not a good name, should rename to Athon

2007-12-08 Thread Jan Claeys
Op Mon, 03 Dec 2007 14:20:52 +1300, schreef greg: If you want a really appropriate name for a programming language, I'd suggest Babbage. (not for Python, though!) Konrad Zuse wrote the first high-level programming language, so I think his name would be a better candidate... -- JanC --

Re: setattr getattr confusion

2007-12-08 Thread Steven D'Aprano
On Sat, 08 Dec 2007 14:26:00 +0200, Donn Ingle wrote: So you might want to describe your use-case. Um.. I wanted an object with Key to hold other data. I wanted a way to set that *other* data within Key without having to specify the object in-between everytime. That's called automatic

Re: distutils OS X universal binaries

2007-12-08 Thread Robin Becker
Martin v. Löwis wrote: . In the specific case, just use the WORDS_BIGENDIAN macro defined in pyconfig.h; it will be defined if the target is bigendian, and undefined otherwise. In the case of a universal build, it will be undefined in the x86 compiler invocation, and defined in the

Re: Basic animation in Python - how to

2007-12-08 Thread Donn Ingle
Please refer me to some basic Python code for animation like that . You are in for a wild ride! Depending on your platform you can use dozens of different tools. Try wxPython, pyCairo, pyGTK and PIL (Python Imaging Library) for the most capable. Basically you are looking at a fairly complex

Re: Basic animation in Python - how to

2007-12-08 Thread Peter Wang
On Dec 8, 6:37 am, http://members.lycos.co.uk/dariusjack/; [EMAIL PROTECTED] wrote: I need to draw a shaded rectangle and have flashing (gif animated) points on it so not to refresh all objects a rectangle, but points, changing their colors, attributes. Please refer me to some basic Python

distutils OS X universal binaries

2007-12-08 Thread Robin Becker
A user reports problems with one of our extensions when running the intel compiled extension on ppc and vice versa. He is building the extension as a universal binary. Although the intel compiled version runs fine it displays a known bug when run on a ppc. It appears we have an endianness

Re: distutils OS X universal binaries

2007-12-08 Thread Robin Becker
Martin v. Löwis wrote: A user reports problems with one of our extensions when running the intel compiled extension on ppc and vice versa. He is building the extension as a universal binary. Although the intel compiled version runs fine it displays a known bug when run on a ppc. Have you

Re: distutils OS X universal binaries

2007-12-08 Thread Martin v. Löwis
One proposed fix is to make the endian variable code dynamically change at run time. I would advise against that. Endianness depdency should be resolved at compile time, with appropriate conditional compilation. Endianness won't change at run-time (and no, not even for a fat binary - the x86

Re: Python is not a good name, should rename to Athon

2007-12-08 Thread Steve Howell
--- Jan Claeys [EMAIL PROTECTED] wrote: Op Mon, 03 Dec 2007 14:20:52 +1300, schreef greg: If you want a really appropriate name for a programming language, I'd suggest Babbage. (not for Python, though!) Konrad Zuse wrote the first high-level programming language, so I think his

Re: distutils OS X universal binaries

2007-12-08 Thread Christian Heimes
Robin Becker wrote: A user reports problems with one of our extensions when running the intel compiled extension on ppc and vice versa. He is building the extension as a universal binary. Although the intel compiled version runs fine it displays a known bug when run on a ppc. Have you

Re: distutils OS X universal binaries

2007-12-08 Thread Martin v. Löwis
A user reports problems with one of our extensions when running the intel compiled extension on ppc and vice versa. He is building the extension as a universal binary. Although the intel compiled version runs fine it displays a known bug when run on a ppc. Have you reported the problem

Re: distutils OS X universal binaries

2007-12-08 Thread Martin v. Löwis
#ifdef __BIG_ENDIAN__ #define WORDS_BIGENDIAN 1 #else #ifndef __LITTLE_ENDIAN__ #undef WORDS_BIGENDIAN #endif #endif I'm puzzled why WORDS_BIGENDIAN is undefined if both __BIG_ENDIAN__ and __LITTLE_ENDIAN__ are undefined. Surely in that case WORDS_BIGENDIAN should be left alone (if

Re: distutils OS X universal binaries

2007-12-08 Thread Martin v. Löwis
PIL may also have a similar problem as the 1.1.6 setup.py script also defines WORDS_BIGENDIAN like this if struct.unpack(h, \0\1)[0] == 1: defs.append((WORDS_BIGENDIAN, None)) probably I borrowed/stole this as we have something very similar in our setup.py. All such

Re: callback confusion

2007-12-08 Thread Bruno Desthuilliers
Donn Ingle a écrit : (snip) [in one.py] kills=0 def boo(): print kills It will abort with: print kills UnboundLocalError: local variable 'kills' referenced before assignment As far as I can tell, you have a bit more code in boo, and somewhere in that code (after the print

Re: setattr getattr confusion

2007-12-08 Thread Bruno Desthuilliers
Donn Ingle a écrit : class Key(object): def __init__self): self.__dict__['props'] = KeyProps() Okay - that's weird. No, that's coherent. The default behavior (I mean, when there's no descriptor involved etc) of __setattr__ is to store attributes in instance.__dict__. So as long a you

Re: a Python person's experience with Ruby

2007-12-08 Thread James Matthews
I have been waiting for something like this! Thanks! On Dec 8, 2007 6:08 AM, Steve Howell [EMAIL PROTECTED] wrote: Python is my favorite programming language. I've used it as my primary language for about six years now, including four years of using it full-time in my day job. Three months

Re: distutils OS X universal binaries

2007-12-08 Thread Robin Becker
Martin v. Löwis wrote: ... I'm puzzled why WORDS_BIGENDIAN is undefined if both __BIG_ENDIAN__ and __LITTLE_ENDIAN__ are undefined. Surely in that case WORDS_BIGENDIAN should be left alone (if it is already defined). If there's a compiler for a bigendian architecture which doesn't define

Re: Calculate an age

2007-12-08 Thread Pierre Quentel
On Dec 8, 10:04 am, Shane Geiger [EMAIL PROTECTED] wrote: What is so obvious about dealing with months that vary in length and the leap-year issue? Nothing. If you were born on a day that does not exist every year (Feb 29th), how old are you on Feb 28th? X years, 11 months, 28 days or Mar 1

Re: setattr getattr confusion

2007-12-08 Thread Donn Ingle
Thanks Bruno, I had to keep coding, so I used the long form [Object.subobject.property = blah] anyway. It's long-winded, but unambiguous. \d -- http://mail.python.org/mailman/listinfo/python-list

Re: distutils OS X universal binaries

2007-12-08 Thread Martin v. Löwis
OK I need to use something a bit more complex then; I figure this should work #if defined(__BIG_ENDIAN__) || defined(__LITTLE_ENDIAN__) #ifdef __BIG_ENDIAN__ #ifdef WORDS_BIGENDIAN #undef WORDS_BIGENDIAN #endif #define WORDS_BIGENDIAN 1 #else

Re: callback confusion

2007-12-08 Thread Donn Ingle
As far as I can tell, you have a bit more code in boo, and somewhere in that code (after the print statement), you rebind the name 'kills'. Okay, yes: def boo() kills += 1 print kills the absence of a global declaration, this makes this name a local variable. I think I see what you mean:

Newbie edit/compile/run cycle question

2007-12-08 Thread MartinRinehart
I'm a java guy used to the effective edit/run cycle you get with a good IDE. Today I'm writing my first Python, but can't seem to find the way to use Python's inherent edit/run cycle. I edit my source, import it into Python, run it. Fine. Then I edit again, but the next import doesn't notice

Re: distutils OS X universal binaries

2007-12-08 Thread Robin Becker
Martin v. Löwis wrote: OK I need to use something a bit more complex then; I figure this should work #if defined(__BIG_ENDIAN__) || defined(__LITTLE_ENDIAN__) #ifdef __BIG_ENDIAN__ #ifdef WORDS_BIGENDIAN #endif I don't understand. If you assume that either

highscores list

2007-12-08 Thread Shawn Minisall
I'm writing a game that uses two functions to check and see if a file called highScoresList.txt exists in the main dir of the game program. If it doesn, it creates one. That part is working fine. The problem is arising when it goes to read in the high scores from the file when I play again.

Re: eof

2007-12-08 Thread jjnoakes
On Nov 24, 12:03 am, MonkeeSage [EMAIL PROTECTED] wrote: class open(file): def __init__(self, name): self.size = os.stat(name).st_size file.__init__(self, name) def eof(self): return self.tell() == self.size f = open('tmp.py') print f.eof() # False f.read() print

Re: eof

2007-12-08 Thread jjnoakes
On Nov 22, 10:37 am, Hrvoje Niksic [EMAIL PROTECTED] wrote: def read(self, size=None): if size is None: val = file.read(self) self.eof = True else: val = file.read(self, size) if len(val) size: self.eof = True

Nice Python Cartoon!

2007-12-08 Thread James Matthews
http://xkcd.com/353/ -- http://search.goldwatches.com/?Search=Movado+Watches http://www.jewelerslounge.com http://www.goldwatches.com -- http://mail.python.org/mailman/listinfo/python-list

Re: a Python person's experience with Ruby

2007-12-08 Thread Bruno Desthuilliers
MonkeeSage a écrit : On Dec 7, 11:08 pm, Steve Howell [EMAIL PROTECTED] wrote: (snip) 4) Ruby forces you to explicitly make attributes for instance variables. At first I found this clumsy, but I've gotten used to it, and I actually kind of like it in certain circumstances. 4.) Yeah,

Re: a Python person's experience with Ruby

2007-12-08 Thread Bruno Desthuilliers
Colin J. Williams a écrit : Steve Howell wrote: Thanks for the interesting comparison. [snip] 3) I actually like being able to omit parentheses in method definitions and method calls. In Ruby you can express add(3,5,7) as both add(3,5,7) and add 3, 5, 7. The latter syntax is

Re: Gnu/Linux dialogue boxes in python

2007-12-08 Thread Paul Boddie
On 7 Des, 17:43, [EMAIL PROTECTED] wrote: If you built a GUI with wxPython, it would just use the OS's native dialogs unless it didn't have one and then it would use a generic dialog. I would think creating a installer with wxPython and threads would be fairly trivial. I'm not convinced that

Re: Distinguishing attributes and methods

2007-12-08 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : Hi, With properties, attributes and methods seem very similar. I was wondering what techniques people use to give clues to end users as to which 'things' are methods and which are attributes. Documentation. With ipython, I use tab completion all the time,

Highscores list

2007-12-08 Thread Shawn Minisall
I'm writing a game that uses two functions to check and see if a file called highScoresList.txt exists in the main dir of the game program. If it doesn, it creates one. That part is working fine. The problem is arising when it goes to read in the high scores from the file when I play again.

Re: a Python person's experience with Ruby

2007-12-08 Thread MonkeeSage
On Dec 8, 12:42 pm, Bruno Desthuilliers [EMAIL PROTECTED] wrote: MonkeeSage a écrit : On Dec 7, 11:08 pm, Steve Howell [EMAIL PROTECTED] wrote: (snip) 4) Ruby forces you to explicitly make attributes for instance variables. At first I found this clumsy, but I've gotten used to it,

Re: Distinguishing attributes and methods

2007-12-08 Thread Bruno Desthuilliers
MonkeeSage a écrit : On Dec 8, 2:10 am, Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote: On Fri, 07 Dec 2007 23:19:40 -0800, tjhnson wrote: With properties, attributes and methods seem very similar. I was wondering what techniques people use to give clues to end users as to which 'things'

Re: Distinguishing attributes and methods

2007-12-08 Thread MonkeeSage
On Dec 8, 12:56 pm, Bruno Desthuilliers [EMAIL PROTECTED] wrote: MonkeeSage a écrit : On Dec 8, 2:10 am, Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote: On Fri, 07 Dec 2007 23:19:40 -0800, tjhnson wrote: With properties, attributes and methods seem very similar. I was wondering what

Re: Newbie edit/compile/run cycle question

2007-12-08 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : I'm a java guy used to the effective edit/run cycle you get with a good IDE. Today I'm writing my first Python, but can't seem to find the way to use Python's inherent edit/run cycle. I edit my source, import it into Python, run it. Fine. Then I edit again,

Re: a Python person's experience with Ruby

2007-12-08 Thread Steve Howell
--- Bruno Desthuilliers [EMAIL PROTECTED] wrote: Colin J. Williams a écrit : I'm not sure that I like add 3, 5, 7 but it would be nice to be able to drop the parentheses when no argument is required. Thus: close; could replace close(); This just could not work given

Re: Newbie edit/compile/run cycle question

2007-12-08 Thread Steve Howell
--- [EMAIL PROTECTED] wrote: What don't I know that I should know to just edit/run, preferably at the tap of a function key? Most good editors let you do these things: 1) Save a file. 2) Run a script from the shell. 3) Turn steps 1 and 2 into a macro. 4) Allow you to map the

Re: highscores list

2007-12-08 Thread Chris
On Dec 8, 8:32 pm, Shawn Minisall [EMAIL PROTECTED] wrote: I'm writing a game that uses two functions to check and see if a file called highScoresList.txt exists in the main dir of the game program. If it doesn, it creates one. That part is working fine. The problem is arising when it goes

Re: how to convert 3 byte to float

2007-12-08 Thread jdsahr
On Dec 8, 6:05 am, Mario M. Mueller [EMAIL PROTECTED] wrote: Tommy Nordgren wrote: [...] One thing to consider: It is possible that one of the bytes contributes bits to BOTH the mantissa and the exponent ; From todays point of view I cannot exclude this. Do you know the relative

Re: Tkinter Newbie Question

2007-12-08 Thread robbie
Hi Mark, Thank you so much for the help. I figured it was something pretty simple like that. And I was also puzzled by the concept of the lambda function, so now I know what they do too. I just tried it out, and it works well. Much appreciated, Ciao back at you, Robbie --

Re: highscores list

2007-12-08 Thread Zepo Len
I'm writing a game that uses two functions to check and see if a file called highScoresList.txt exists in the main dir of the game program. If it doesn, it creates one. That part is working fine. The problem is arising when it goes to read in the high scores from the file when I

Re: highscores list

2007-12-08 Thread Chris
On Dec 8, 10:07 pm, Chris [EMAIL PROTECTED] wrote: On Dec 8, 8:32 pm, Shawn Minisall [EMAIL PROTECTED] wrote: I'm writing a game that uses two functions to check and see if a file called highScoresList.txt exists in the main dir of the game program. If it doesn, it creates one. That

Re: Securely distributing python source code as an application?

2007-12-08 Thread Larry Bates
xkenneth wrote: Hi All, I'll shortly be distributing a number of python applications that use proprietary. The software is part of a much larger system and it will need to be distributed securely. How can i achieve this? Regards, Ken We have partnered with developers to use our

Re: download complete webpage with python

2007-12-08 Thread Larry Bates
Gabriel Genellina wrote: En Fri, 07 Dec 2007 17:58:43 -0300, yi zhang [EMAIL PROTECTED] escribió: The urllib.urlretrieve() can only download the text part of a webpage, not the image associated. How can I download the whole, complete webpage with python? Thanks! The images are

Re: Distinguishing attributes and methods

2007-12-08 Thread Roberto Bonvallet
On Dec 8, 4:19 am, [EMAIL PROTECTED] wrote: With properties, attributes and methods seem very similar. I was wondering what techniques people use to give clues to end users as to which 'things' are methods and which are attributes. Methods are verbs, attributes are nouns :) -- Roberto

Re: Distinguishing attributes and methods

2007-12-08 Thread Glenn Hutchings
On Dec 8, 7:44 pm, MonkeeSage [EMAIL PROTECTED] wrote: I think it muddies the water to say that a.a() and a.a are the same thing--obviously they are not. A thing is not what it is; A thing is what it does. This is the Way of the Duck. -- Basho (in his 3 extra syllables phase) --

Re: Newbie edit/compile/run cycle question

2007-12-08 Thread Steve Howell
--- Bruno Desthuilliers [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] a écrit : I'm a java guy used to the effective edit/run cycle you get with a good IDE. Today I'm writing my first Python, but can't seem to find the way to use Python's inherent edit/run cycle. Use an IDE

Re: Distinguishing attributes and methods

2007-12-08 Thread Marc 'BlackJack' Rintsch
On Sat, 08 Dec 2007 11:44:36 -0800, MonkeeSage wrote: On Dec 8, 12:56 pm, Bruno Desthuilliers callable attributes are not necessarily methods, and are still 'variables' anyway. I think it muddies the water to say that a.a() and a.a are the same thing--obviously they are not. In the common

Re: highscores list

2007-12-08 Thread Samuel
On Sat, 08 Dec 2007 13:32:08 -0500, Shawn Minisall wrote: I'm writing a game that uses two functions to check and see if a file called highScoresList.txt exists in the main dir of the game program. If it doesn, it creates one. That part is working fine. The problem is arising when it goes

Ruby's Template Engine for Python

2007-12-08 Thread Samuel
Hi, Following the masses I was drawn to RoR's website today and I saw the following HTML template in one of the screencasts: -- body % form_remote_tag :url = { :action = :search }, :update = :results, :complete = visual_effect(:blind_down, 'image') :before =

Re: Ruby's Template Engine for Python

2007-12-08 Thread Steve Howell
--- Samuel [EMAIL PROTECTED] wrote: Hi, Following the masses I was drawn to RoR's website today and I saw the following HTML template in one of the screencasts: I know a lot of Rails goodies have been ported to Python, so you might want to google some variations on form_remote_tag

Re: Distinguishing attributes and methods

2007-12-08 Thread MonkeeSage
On Dec 8, 2:51 pm, Glenn Hutchings [EMAIL PROTECTED] wrote: On Dec 8, 7:44 pm, MonkeeSage [EMAIL PROTECTED] wrote: I think it muddies the water to say that a.a() and a.a are the same thing--obviously they are not. A thing is not what it is; A thing is what it does. This is the Way of the

Re: Running unmodified CGI scripts persistently under mod_wsgi.

2007-12-08 Thread Graham Dumpleton
On Dec 9, 12:26 am, Michael Ströder [EMAIL PROTECTED] wrote: Jeffrey Froman wrote: I'd still be interested in a mod_wsgi wrapper for 3rd-party CGI scripts. I doubt that this is possible, not because of the interface. But conventional CGI scripts are implemented with the assumption of being

Re: a Python person's experience with Ruby

2007-12-08 Thread I V
On Sat, 08 Dec 2007 11:23:57 -0800, MonkeeSage wrote: The equivalent python idiom is something like: class A: __a = foo def __init__(self): self.a = A.__a [...] Which roughly translates to this in ruby: class A attr_accessor :a def initialize @a = foo end

  1   2   >