Re: YOU MUST KNOW THIS MAN

2007-12-06 Thread Deltantor
Piet van Oostrum wrote: Deltantor [EMAIL PROTECTED] (D) wrote: D Does c.l.python get religious spam that much? Of all of the places to be D spammed the least likely I expected would be here. Is that the reason you find it necessary to repeat it? Sorry, was busy and forgot to clean up the

Re: Timezones in python

2007-12-06 Thread lukasz . f24
On 5 Dec, 13:59, Gabriel Genellina [EMAIL PROTECTED] wrote: En Wed, 05 Dec 2007 06:43:49 -0300, [EMAIL PROTECTED] escribió: Thanks guys for your answers! I know those library's but I was wondering is there something build-in for this simple convert convert. I have to do it only from +4 to

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

2007-12-06 Thread Adrian Cherry
Piet van Oostrum [EMAIL PROTECTED] wrote in news:[EMAIL PROTECTED]: Adrian Cherry [EMAIL PROTECTED] (AC) wrote: AC For that matter C# is no better, I thought that # was pronounced AC hash, I still refer to C# as C-hash. Are you musically illiterate? Yup! The limits of my musically ability

RE: Timeout test hangs IDLE

2007-12-06 Thread Andreas Tawn
I once made a small app that used threads on IDLE. There was a strange error when using 'print' threads. When what I printed filled the entire screen, instead of moving all the text up, IDLE just hanged. Try running your code from the shell instead, to see if the problem is in IDLE.

Surfing Script

2007-12-06 Thread [EMAIL PROTECTED]
AJ Surfing is a fully functional surfing website with full administration controls. Users need no programming experience to change any site features. It is a complete web application developed using PHP with MYSQL as back-end. Full developer API allows for endless possibilities and use in your own

Re: reloading modules and isinstance()

2007-12-06 Thread Diez B. Roggisch
Tlis schrieb: On 5 Dec, 13:18, Steven D'Aprano [EMAIL PROTECTED] cybersource.com.au wrote: On Tue, 04 Dec 2007 15:41:48 +0100, Diez B. Roggisch wrote: You just discovered one reason why reload() is a bad idea and IMHO shouldn't be used at all - as tempting it might be. I disagree -- I find

Re: An Object's Type

2007-12-06 Thread paul
Bruno Desthuilliers schrieb: [EMAIL PROTECTED] a écrit : Hi, Is it possible to find out if an object is of a certain type or of a type derived from this type? You have the answer, thanks to Diez and Christian. Now unless you have a *very* compelling reason to check the type of an object,

Re: Python surpasses Perl in TIOBE index

2007-12-06 Thread Carl Banks
On Dec 5, 4:18 pm, George Sakkis [EMAIL PROTECTED] wrote: On Dec 5, 7:34 am, BlueBird [EMAIL PROTECTED] wrote: On Dec 4, 4:08 pm, [EMAIL PROTECTED] wrote: This is *not* an attempt to start yet another Python-versus- AnyOtherProgrammingLanguage flame war, but I thought people might be

Re: reloading modules and isinstance()

2007-12-06 Thread Jean-Paul Calderone
On Thu, 06 Dec 2007 12:21:01 +0100, Diez B. Roggisch [EMAIL PROTECTED] wrote: Tlis schrieb: On 5 Dec, 13:18, Steven D'Aprano [EMAIL PROTECTED] cybersource.com.au wrote: On Tue, 04 Dec 2007 15:41:48 +0100, Diez B. Roggisch wrote: You just discovered one reason why reload() is a bad idea and

Re: reloading modules and isinstance()

2007-12-06 Thread Diez B. Roggisch
Jean-Paul Calderone schrieb: On Thu, 06 Dec 2007 12:21:01 +0100, Diez B. Roggisch [EMAIL PROTECTED] wrote: Tlis schrieb: On 5 Dec, 13:18, Steven D'Aprano [EMAIL PROTECTED] cybersource.com.au wrote: On Tue, 04 Dec 2007 15:41:48 +0100, Diez B. Roggisch wrote: You just discovered one reason

Re: An Object's Type

2007-12-06 Thread Diez B. Roggisch
paul schrieb: Bruno Desthuilliers schrieb: [EMAIL PROTECTED] a écrit : Hi, Is it possible to find out if an object is of a certain type or of a type derived from this type? You have the answer, thanks to Diez and Christian. Now unless you have a *very* compelling reason to check the type

Re: SimpleXMLRPCServer interruptable?

2007-12-06 Thread Bret
On Dec 5, 10:00 pm, Edward Kozlowski [EMAIL PROTECTED] wrote: On Dec 5, 10:19 pm, Edward Kozlowski [EMAIL PROTECTED] wrote: On Dec 5, 6:22 pm, Gabriel Genellina [EMAIL PROTECTED] wrote: En Wed, 05 Dec 2007 18:20:35 -0300, Bret [EMAIL PROTECTED] escribió: I just tried changing this

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

2007-12-06 Thread Boris Borcic
Piet van Oostrum wrote: Adrian Cherry [EMAIL PROTECTED] (AC) wrote: AC For that matter C# is no better, I thought that # was pronounced AC hash, I still refer to C# as C-hash. Are you musically illiterate? Note that the notation for the note (!) isn't universal. French speakers for

Re: An Object's Type

2007-12-06 Thread Bruno Desthuilliers
paul a écrit : Bruno Desthuilliers schrieb: [EMAIL PROTECTED] a écrit : Hi, Is it possible to find out if an object is of a certain type or of a type derived from this type? You have the answer, thanks to Diez and Christian. Now unless you have a *very* compelling reason to check the

Re: reloading modules and isinstance()

2007-12-06 Thread Jean-Paul Calderone
On Thu, 06 Dec 2007 13:59:00 +0100, Diez B. Roggisch [EMAIL PROTECTED] wrote: [snip] Who says it isn't feasible? http://twistedmatrix.com/trac/browser/trunk/twisted/python/rebuild.py Nice try - for sure. But it seems to be geared towards special cases, not a general-purpose now reloading

ANN: UliPad 3.8 released!

2007-12-06 Thread limodou
UliPad is a flexible editor, based on wxPython. It's has many features,just like:class browser, code auto-complete, html viewer, directory browser, wizard, etc. The main feature is the usage of mixin. This makes UliPad can be extended easily. So you can write your own mixin or plugin, or simple

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

2007-12-06 Thread Piet van Oostrum
Adrian Cherry [EMAIL PROTECTED] (AC) wrote: AC Piet van Oostrum [EMAIL PROTECTED] wrote in AC news:[EMAIL PROTECTED]: Adrian Cherry [EMAIL PROTECTED] (AC) wrote: AC For that matter C# is no better, I thought that # was pronounced AC hash, I still refer to C# as C-hash. Are you musically

splitting a words of a line

2007-12-06 Thread Sumit
Hi , I am trying to splitt a Line whihc is below of format , AzAccept PLYSSTM01 [23/Sep/2005:16:14:28 -0500] 162.44.245.32 CN= cojack (890),OU=1,OU=Customers,OU=ISM-Users,OU=kkk Secure,DC=customer,DC=rxcorp,DC=com plysmhc03zp GET /mci/performance/ SelectProducts.aspx?

which configparse?

2007-12-06 Thread Neal Becker
I have all my options setup with optparse. Now, I'd like to be able to parse an ini file to set defaults (that could be overridden by command line switches). I'd like to make minimal change to my working optparse setup (there are lots of options - I don't want to duplicate all the cmdline

multidimensional arrays

2007-12-06 Thread Horacius ReX
in python, when I want to use arrays, I follow this way; DATA = [0] * nint and when I want to use I do; DATA[i] = do you know how to do similar but in two dimensions ? thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: multidimensional arrays

2007-12-06 Thread bearophileHUGS
Horacius ReX: do you know how to do similar but in two dimensions ? nr = 3 nc = 4 [[None] * nc for _ in xrange(nr)] [[None, None, None, None], [None, None, None, None], [None, None, None, None]] Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list

Re: SimpleXMLRPCServer interruptable?

2007-12-06 Thread Bret
On Dec 6, 7:04 am, Bret [EMAIL PROTECTED] wrote: On Dec 5, 10:00 pm, Edward Kozlowski [EMAIL PROTECTED] wrote: On Dec 5, 10:19 pm, Edward Kozlowski [EMAIL PROTECTED] wrote: On Dec 5, 6:22 pm, Gabriel Genellina [EMAIL PROTECTED] wrote: En Wed, 05 Dec 2007 18:20:35 -0300, Bret [EMAIL

Re: which configparse?

2007-12-06 Thread Shane Geiger
Best, is naturally, a somewhat subjective evaluation. That being said, configparser is well regarded. I have also seen these two options that you might want to check out: http://wiki.woodpecker.org.cn/moin/Dict4Ini http://www.voidspace.org.uk/python/configobj.html I have all my options setup

Re: An Object's Type

2007-12-06 Thread Hrvoje Niksic
Bruno Desthuilliers [EMAIL PROTECTED] writes: So ask yourself: in which way will the final result be different from would very probably happens without the typecheking code ? In *both* cases, you end up with a runtime exception. The idea behind such type checks is to make sure type errors are

Re: multidimensional arrays

2007-12-06 Thread Jeremy Sanders
Horacius ReX wrote: do you know how to do similar but in two dimensions ? Investigate the numpy module if you are dealing with numbers. Jeremy -- Jeremy Sanders http://www.jeremysanders.net/ -- http://mail.python.org/mailman/listinfo/python-list

Re: multidimensional arrays

2007-12-06 Thread Remco Gerlich
Hi, DATA = [ [ 0 for i in range(ncolumns) ] for i in range(nrows) ] Is one way. DON'T do it like this: row = [0] * ncolumns data = [ row ] * nrows # WRONG! Since after that, every row is the exact same object; if you set data[0][0] = 1, the first element of _every_ row is 1. But I guess you

Re: SimpleXMLRPCServer interruptable?

2007-12-06 Thread Bret
On Dec 6, 7:04 am, Bret [EMAIL PROTECTED] wrote: On Dec 5, 10:00 pm, Edward Kozlowski [EMAIL PROTECTED] wrote: On Dec 5, 10:19 pm, Edward Kozlowski [EMAIL PROTECTED] wrote: On Dec 5, 6:22 pm, Gabriel Genellina [EMAIL PROTECTED] wrote: En Wed, 05 Dec 2007 18:20:35 -0300, Bret [EMAIL

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

2007-12-06 Thread Hertha Steck
Boris Borcic wrote: Piet van Oostrum wrote: Adrian Cherry [EMAIL PROTECTED] (AC) wrote: AC For that matter C# is no better, I thought that # was pronounced AC hash, I still refer to C# as C-hash. Are you musically illiterate? Note that the notation for the note (!) isn't universal.

JSON

2007-12-06 Thread belred
i tried a couple python json libraries. i used simplejson on the server and was using cjson on the client, but i ran into this issue. i'm now using simplejson on both sides, but i'm still interested in this issue. did i do something wrong? is there a bug in one of the libraries? or something i

New subclass vs option in __init__

2007-12-06 Thread Kurt Smith
Hi List: Class inheritance noob here. For context, I have the following base class and subclass: class Base(object): def __init__(self, val): self.val = val class Derived1(Base): def __init__(self, val): super(Derived1, self).__init__(val) I'm curious as to other's

pipeline encoding

2007-12-06 Thread Tomasz Toczyski
My locale is set to UTF-8. The command: python -c print u'\u03A9' gives me the desired result and doesn't produce any error. But when I want to redirect the output to a file I invoke: python -c print u'\u03A9' file.txt I get an error: File string, line 1, in module UnicodeEncodeError: 'ascii'

Best way to merge/sort two sorted lists?...

2007-12-06 Thread Aaron Watters
...is to forget they are sorted??? While trying to optimize some NUCULAR libraries I discovered that the best way to merge 2 sorted lists together into a new sorted list is to just append them and re-sort. The following test case demonstrates this. It can be criticized in many ways: it only

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

2007-12-06 Thread Bruno Desthuilliers
Boris Borcic a écrit : Piet van Oostrum wrote: Adrian Cherry [EMAIL PROTECTED] (AC) wrote: AC For that matter C# is no better, I thought that # was pronounced AC hash, I still refer to C# as C-hash. Are you musically illiterate? Note that the notation for the note (!) isn't

Re: New subclass vs option in __init__

2007-12-06 Thread Bruno Desthuilliers
Kurt Smith a écrit : Hi List: Class inheritance noob here. For context, I have the following base class and subclass: class Base(object): def __init__(self, val): self.val = val class Derived1(Base): def __init__(self, val): super(Derived1,

ANNOUNCE: Resolver One public Beta now live

2007-12-06 Thread giles . thomas
We're proud to announce that today Resolver One, our flagship application, entered its public Beta phase. It can be downloaded from http://www.resolversystems.com/download/ (free registration required), and we would very much welcome feedback from the Python community. Resolver One is a Rapid

Re: pipeline encoding

2007-12-06 Thread Tomek Toczyski
Diez B. Roggisch: Python tries and guesses the stdout-encoding based on the terminal settings. So the first print works. However, piping to a file means that it can't do so, because it doesn't (and shouldn't) make any assumptions on the output encoding desired - after all, it might be

Re: An Object's Type

2007-12-06 Thread Bruno Desthuilliers
Hrvoje Niksic a écrit : Bruno Desthuilliers [EMAIL PROTECTED] writes: So ask yourself: in which way will the final result be different from would very probably happens without the typecheking code ? In *both* cases, you end up with a runtime exception. The idea behind such type checks is

logging.py: mutiple system users writing to same file getting permission errors.

2007-12-06 Thread evenrik
An a redhat box I have root, apache and other normal users run code that uses the logging module to write to the same log file. Since umasks are set to 2 or 022 this gets permission errors. I have fixed my issue by patching the logging code everywhere there is an open for write with: try:

Capture DOS error???

2007-12-06 Thread Tangen, Erik
Did you ever get a solution to this? I am also in need of this solution. Thanks, Erik -- http://mail.python.org/mailman/listinfo/python-list

Re: pipeline encoding

2007-12-06 Thread Rob Wolfe
Tomasz Toczyski [EMAIL PROTECTED] writes: My locale is set to UTF-8. The command: python -c print u'\u03A9' gives me the desired result and doesn't produce any error. But when I want to redirect the output to a file I invoke: python -c print u'\u03A9' file.txt I get an error: File

Re: Best way to merge/sort two sorted lists?...

2007-12-06 Thread Robin Becker
Aaron Watters wrote: ...is to forget they are sorted??? code snipped Aaron I just flung your python merge code into pyrex and the results show that the iteration overhead can be brought down without much effort. The real deal would presumably be to start using pointers into the result list

Re: pipeline encoding

2007-12-06 Thread Diez B. Roggisch
Tomasz Toczyski schrieb: My locale is set to UTF-8. The command: python -c print u'\u03A9' gives me the desired result and doesn't produce any error. But when I want to redirect the output to a file I invoke: python -c print u'\u03A9' file.txt I get an error: File string, line 1, in

Re: An Object's Type

2007-12-06 Thread Chris Mellon
On Dec 6, 2007 5:52 AM, paul [EMAIL PROTECTED] wrote: Bruno Desthuilliers schrieb: [EMAIL PROTECTED] a écrit : Hi, Is it possible to find out if an object is of a certain type or of a type derived from this type? You have the answer, thanks to Diez and Christian. Now unless you have

Re: Best way to merge/sort two sorted lists?...

2007-12-06 Thread Neil Cerutti
On 2007-12-06, Aaron Watters [EMAIL PROTECTED] wrote: ...is to forget they are sorted??? While trying to optimize some NUCULAR libraries I discovered that the best way to merge 2 sorted lists together into a new sorted list is to just append them and re-sort. The following test case

Re: Best way to merge/sort two sorted lists?...

2007-12-06 Thread Raymond Hettinger
On Dec 6, 9:30 am, Aaron Watters [EMAIL PROTECTED] wrote: While trying to optimize some NUCULAR libraries I discovered that the best way to merge 2 sorted lists together into a new sorted list is to just append them and re-sort. . . . I'm beginning to think a sorted list merger might make

__iadd__ useless in sub-classed int

2007-12-06 Thread samwyse
For whatever reason, I need an inproved integer. Sounds easy, let's just subclass int: class test(int): pass Now let's test it: zed=test(0) zed.__class__ class '__main__.test' zed 0 So far, so good. Now let's try incrementing: zed+=1 zed 1 zed.__class__ type 'int' WTF??! Is

Re: pipeline encoding

2007-12-06 Thread Diez B. Roggisch
Tomek Toczyski schrieb: Diez B. Roggisch: Python tries and guesses the stdout-encoding based on the terminal settings. So the first print works. However, piping to a file means that it can't do so, because it doesn't (and shouldn't) make any assumptions on the output encoding desired

Re: __iadd__ useless in sub-classed int

2007-12-06 Thread Diez B. Roggisch
samwyse schrieb: For whatever reason, I need an inproved integer. Sounds easy, let's just subclass int: class test(int): pass Now let's test it: zed=test(0) zed.__class__ class '__main__.test' zed 0 So far, so good. Now let's try incrementing: zed+=1 zed 1

Re: Best way to merge/sort two sorted lists?...

2007-12-06 Thread Neil Cerutti
On 2007-12-06, Raymond Hettinger [EMAIL PROTECTED] wrote: On Dec 6, 9:30 am, Aaron Watters [EMAIL PROTECTED] wrote: While trying to optimize some NUCULAR libraries I discovered that the best way to merge 2 sorted lists together into a new sorted list is to just append them and re-sort. . .

Re: pipeline encoding

2007-12-06 Thread Martin v. Löwis
Are there any command line option for telling python what encoding to use for stdout? Not a command line option. However, you can wrap sys.stdout with a stream that automatically performs an encoding. If all your print statements output Unicode strings, you can do sys.stdout =

Re: pipeline encoding

2007-12-06 Thread Rob Wolfe
Tomek Toczyski [EMAIL PROTECTED] writes: Are there any command line option for telling python what encoding to use for stdout? To be honest I have a more complicated program than the example that I have presented - there are many print commands inside and it is not very feasible for me to

Re: Best way to merge/sort two sorted lists?...

2007-12-06 Thread Neil Cerutti
On 2007-12-06, Neil Cerutti [EMAIL PROTECTED] wrote: It should beat ResortEverything consistently once the lists become larger than a certain size. Do you get better results at all with the above function? With psyco, my merge_sorted becamse faster than relying on timsort at roughly 80

Re: pipeline encoding

2007-12-06 Thread Peter Otten
Tomek Toczyski wrote: Diez B. Roggisch: Python tries and guesses the stdout-encoding based on the terminal settings. So the first print works. However, piping to a file means that it can't do so, because it doesn't (and shouldn't) make any assumptions on the output encoding desired -

Determining Dependencies

2007-12-06 Thread Greg Lindstrom
Hello All- I have a Python routine consisting of 75 or more files (most files house 1 object) and would like to know if there is an automated way to search though the files and determine all of the (non-standard lib) modules required to run the routine. For example, looking in my base class I

Re: Best way to merge/sort two sorted lists?...

2007-12-06 Thread Neil Cerutti
On 2007-12-06, Aaron Watters [EMAIL PROTECTED] wrote: On Dec 6, 2:14 pm, Neil Cerutti [EMAIL PROTECTED] wrote: On 2007-12-06, Raymond Hettinger [EMAIL PROTECTED] wrote: See recipes: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/491285

Re: which configparse?

2007-12-06 Thread Joshua Kugler
Shane Geiger wrote: Best, is naturally, a somewhat subjective evaluation. That being said, configparser is well regarded. I have also seen these two options that you might want to check out: http://wiki.woodpecker.org.cn/moin/Dict4Ini http://www.voidspace.org.uk/python/configobj.html +1

Re: JSON

2007-12-06 Thread Joshua Kugler
[EMAIL PROTECTED] wrote: i tried a couple python json libraries. i used simplejson on the server and was using cjson on the client, but i ran into this issue. i'm now using simplejson on both sides, but i'm still interested in this issue. did i do something wrong? is there a bug in one of

Re: Capture DOS error???

2007-12-06 Thread Joshua Kugler
Tangen, Erik wrote: Did you ever get a solution to this? I am also in need of this solution. Thanks, Erik Can you clarify? What is a DOS error? You mean an error in reading or writing a file? That would be an IOError exception. If a file is not found, or you can't read it, that's an

Re: which configparse?

2007-12-06 Thread Neal Becker
Martin Marcher wrote: Hi, On 12/6/07, Neal Becker [EMAIL PROTECTED] wrote: configparse looks like what I want, but it seems last commit was 2years ago. What is the best choice? that seems like configparse is the best choice. Thanks. I see something right off that should be improved

Re: Best way to merge/sort two sorted lists?...

2007-12-06 Thread Aaron Watters
On Dec 6, 2:14 pm, Neil Cerutti [EMAIL PROTECTED] wrote: On 2007-12-06, Raymond Hettinger [EMAIL PROTECTED] wrote: See recipes: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/491285 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/305269 That's fairly awesome. The second

Re: which configparse?

2007-12-06 Thread Martin Marcher
Hi, On 12/6/07, Neal Becker [EMAIL PROTECTED] wrote: configparse looks like what I want, but it seems last commit was 2years ago. What is the best choice? that seems like configparse is the best choice. I use it quite often and no commit in 2years to me means Boy that's stable software. A

sqlite or xml

2007-12-06 Thread Kelie
Hello group, If I need store and use a couple thousand of people's contact info: first name, last name, phone, fax, email, address, etc. I'm thinking of using either sqlite or xml. Which one is better? My understanding is if there is large amount of data, sqlite would be better as far as speed is

Charging range

2007-12-06 Thread Miguel Galves
I was recently approached with a offer to work on a web related project where I'd use Python as my main tool. I am using Python for the past year, and this would be first project. Also, this is a remote position. The company is located in the US, South Atlantic Region. Considering it is contract

Re: How can I create customized classes that have similar properties as 'str'?

2007-12-06 Thread samwyse
On Nov 24, 6:38 pm, Hrvoje Niksic [EMAIL PROTECTED] wrote: samwyse [EMAIL PROTECTED] writes: create a hash that maps your keys to themselves, then use the values of that hash as your keys. The atom function you describe already exists under the name intern. D'oh! That's what I get for

Re: Distutils help for sub-packages

2007-12-06 Thread Rick Muller
On Dec 5, 7:20 am, [EMAIL PROTECTED] wrote: I recommend asking the distutils guys at their list: http://mail.python.org/mailman/listinfo/distutils-sig Mike I did, and no one replied there either. Probably because everyone, there and here, were too polite to say that I was nutso. Which, it

Re: sqlite or xml

2007-12-06 Thread Chris
On Dec 6, 10:21 pm, Kelie [EMAIL PROTECTED] wrote: Hello group, If I need store and use a couple thousand of people's contact info: first name, last name, phone, fax, email, address, etc. I'm thinking of using either sqlite or xml. Which one is better? My understanding is if there is large

Re: Distutils help for sub-packages

2007-12-06 Thread kyosohma
On Dec 6, 2:37 pm, Rick Muller [EMAIL PROTECTED] wrote: On Dec 5, 7:20 am, [EMAIL PROTECTED] wrote: I recommend asking the distutils guys at their list: http://mail.python.org/mailman/listinfo/distutils-sig Mike I did, and no one replied there either. Probably because everyone, there

Re: sqlite or xml

2007-12-06 Thread Tim Chase
how much data is considered to be large amount? one record Unless you really need XML to communicate with some other app via a predetermined schema, use a database to store and retrieve data. If you only need to send data to another app via a predetermined schema, use a database and then

Re: splitting a words of a line

2007-12-06 Thread John Machin
On Dec 7, 2:21 am, Sumit [EMAIL PROTECTED] wrote: Hi , I am trying to splitt a Line whihc is below of format , AzAccept PLYSSTM01 [23/Sep/2005:16:14:28 -0500] 162.44.245.32 CN= cojack (890),OU=1,OU=Customers,OU=ISM-Users,OU=kkk Secure,DC=customer,DC=rxcorp,DC=com plysmhc03zp

Re: __iadd__ useless in sub-classed int

2007-12-06 Thread samwyse
On Dec 6, 1:12 pm, Diez B. Roggisch [EMAIL PROTECTED] wrote: samwyse schrieb: For whatever reason, I need an inproved integer. Sounds easy, let's just subclass int: class test(int): pass Now let's test it: zed=test(0) zed.__class__ class '__main__.test' zed 0 So

Re: __iadd__ useless in sub-classed int

2007-12-06 Thread Chris Mellon
On Dec 6, 2007 3:02 PM, samwyse [EMAIL PROTECTED] wrote: On Dec 6, 1:12 pm, Diez B. Roggisch [EMAIL PROTECTED] wrote: samwyse schrieb: For whatever reason, I need an inproved integer. Sounds easy, let's just subclass int: class test(int): pass Now let's test it:

Re: __iadd__ useless in sub-classed int

2007-12-06 Thread Neil Cerutti
On 2007-12-06, samwyse [EMAIL PROTECTED] wrote: And that's my complaint. The value in zed is being replaced by something almost, but not quite, identical to the original value. Python's internal implementation of __iadd__ for int isn't returning self, it's returning a new value belonging to

Calculate an age

2007-12-06 Thread Pierre Quentel
Hi all, I have searched in the standard distribution if there was a function to return the difference between 2 dates expressed like an age : number of years, of months and days. The difference between datetime instances returns a timedelta object that gives a number of days, but not an age So

Capturing global input?

2007-12-06 Thread nomihn0
I'd like to accept mouse gestures and keyboard shortcuts as input to a program. The nature of this program requires that these commands be issued regardless of the currently active window. Here's the rub: I need a platform-independent solution. Java supports with its MouseInfo class, but I'd like

Class destructor -- strange behaviour

2007-12-06 Thread Spes
Hi, I have this simple code: | #!/usr/bin/python | import codecs | import re | from copy import deepcopy | | class MyClass(object): | def __del__(self): | deepcopy(1) | | x=MyClass() but I get an error: | Exception exceptions.TypeError: 'NoneType' object is not callable in bound method

Re: sqlite or xml

2007-12-06 Thread Yu-Xi Lim
Tim Chase wrote: how much data is considered to be large amount? one record Unless you really need XML to communicate with some other app via a predetermined schema, use a database to store and retrieve data. If you only need to send data to another app via a predetermined schema, use

I'm missing something here with range vs. xrange

2007-12-06 Thread Joe Goldthwaite
I've been playing with Python a bit. Doing little performance benchmarks and working with Psyco. It's been fun and I've been learning a lot. For example, in a previous post, I was looking for a way to dynamically add new runtime function to a class. Martin told me to use a class instance

Re: Calculate an age

2007-12-06 Thread John Machin
On Dec 7, 8:34 am, Pierre Quentel [EMAIL PROTECTED] wrote: Hi all, I have searched in the standard distribution if there was a function to return the difference between 2 dates expressed like an age : number of years, of months and days. The difference between datetime instances returns a

Re: I'm missing something here with range vs. xrange

2007-12-06 Thread Bjoern Schliessmann
Joe Goldthwaite wrote: I read that the range function builds a list and that xrange returns an iterator and is therefore more efficient. This is generally not true. In my testing, they both come out to almost exactly the same performance wise. Did something get changed in Python 2.4 to

Re: sqlite or xml

2007-12-06 Thread Yu-Xi Lim
Tim Chase wrote: how much data is considered to be large amount? one record Unless you really need XML to communicate with some other app via a predetermined schema, use a database to store and retrieve data. If you only need to send data to another app via a predetermined schema, use

Re: sqlite or xml

2007-12-06 Thread Kelie
Thanks Chris, Tim and Yu-Xi. I'll follow your advice and use database. -- http://mail.python.org/mailman/listinfo/python-list

Re: Speed of Nested Functions Lambda Expressions

2007-12-06 Thread Terry Jones
[Referring to the thread at http://mail.python.org/pipermail/python-list/2007-October/463348.html with apologies for top posting (I don't have the original mail)] Duncan Booth wrote: You can use Python's bytecode disassembler to see what actually gets executed here: def fn_outer(v):

Re: Calculate an age

2007-12-06 Thread Paul McGuire
On Dec 6, 4:19 pm, John Machin [EMAIL PROTECTED] wrote: On Dec 7, 8:34 am, Pierre Quentel [EMAIL PROTECTED] wrote: Hi all, I have searched in the standard distribution if there was a function to return the difference between 2 dates expressed like an age : number of years, of months and

Re: using pdb and catching exception

2007-12-06 Thread R. Bernstein
Just checked to see how Ruby deals with this. Both languages allow one to register a trace functon to catch events like call, line, return, exception, etc. Ruby however register an event before the raise takes place. It might be cool for some good person to go through the process of making a

Re: Calculate an age

2007-12-06 Thread thebjorn
On Dec 6, 11:19 pm, John Machin [EMAIL PROTECTED] wrote: On Dec 7, 8:34 am, Pierre Quentel [EMAIL PROTECTED] wrote: Hi all, I have searched in the standard distribution if there was a function to return the difference between 2 dates expressed like an age : number of years, of months

Re: Best ways of managing text encodings in source/regexes?

2007-12-06 Thread tinkerbarbet
OK, for those interested in this sort of thing, this is what I now think is necessary to work with Unicode in python. Thanks to those who gave feedback, and to Cliff in particular (but any remaining misconceptions are my own!) Here are the results of my attempts to come to grips with this.

Re: sqlite or xml

2007-12-06 Thread tinkerbarbet
On Dec 7, 12:34 am, Kelie [EMAIL PROTECTED] wrote: Thanks Chris, Tim and Yu-Xi. I'll follow your advice and use database. Hi Kelie If you're happy going with sqlite then stick with it. If on the other hand you were considering XML because you're more comfortable with that (e.g. you find XML

Re: which configparse?

2007-12-06 Thread limodou
On Dec 6, 2007 11:49 PM, Shane Geiger [EMAIL PROTECTED] wrote: Best, is naturally, a somewhat subjective evaluation. That being said, configparser is well regarded. I have also seen these two options that you might want to check out: http://wiki.woodpecker.org.cn/moin/Dict4Ini

Python Profiler GUI like Matlab?

2007-12-06 Thread Davy
Hi all, Is there any Python Profiler GUI like Matlab? I found the Matlab Profiler is very intuitive and easy to use. Best regards, Davy -- http://mail.python.org/mailman/listinfo/python-list

Can I embed Windows Python in C# or VC++?

2007-12-06 Thread grbgooglefan
I want to use Python's Windows (python25.dll) version to embed in my C# (or atleast VC++) program for performing syntax checks on the Python expressions which are later supposed to be evaluated at runtime by another C++ program For this, I would like to use CPython API functions such as

PyImport_ImportModule(foo.bar)

2007-12-06 Thread sndive
I'm trying to import foo.bar in order not to add every single directory with python files to the search path. i immediately follow the import with the PyModule_AddObject call to put the imported module to __main__ module but later on PyEval_EvalCode on Py_CompileString compiled code foo.bar.baz()

Re: JSON

2007-12-06 Thread Marc Christiansen
Joshua Kugler [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: i tried a couple python json libraries. i used simplejson on the server and was using cjson on the client, but i ran into this issue. i'm now using simplejson on both sides, but i'm still interested in this issue. did i do

Re: Best way to merge/sort two sorted lists?...

2007-12-06 Thread Terry Reedy
Aaron Watters [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] | While trying to optimize some NUCULAR libraries I discovered | that the best way to merge 2 sorted lists together | into a new sorted list is to just append | them and re-sort. The current version of list.sort (timsort)

Thought you would enjoy some funny math cartoons!!!

2007-12-06 Thread craig . snodgrass
I just wanted to share some math cartoons (mathtoons) I put together at http://notsohumblepi.com. I thought you guys might enjoy. I tried to figure out how to make a mathtoon involving Pi in place of Python (like Pi in the middle of a snake) but couldn't get it to work. Anyways, I hope you

Re: SimpleXMLRPCServer interruptable?

2007-12-06 Thread Gabriel Genellina
En Thu, 06 Dec 2007 13:11:09 -0300, Bret [EMAIL PROTECTED] escribió: For completeness, what I ended up doing is this: server = SimpleXMLRPCServer((host, port)) server.socket.settimeout(0.1) ServerWrapper became: def ServerWrapper(): while True: try:

Re: Python Profiler GUI like Matlab?

2007-12-06 Thread sturlamolden
On 7 Des, 02:58, Davy [EMAIL PROTECTED] wrote: Is there any Python Profiler GUI like Matlab? I found the Matlab Profiler is very intuitive and easy to use. There is a Python profiler. But is does not have a GUI. -- http://mail.python.org/mailman/listinfo/python-list

Re: Capturing global input?

2007-12-06 Thread sturlamolden
On 6 Des, 22:51, nomihn0 [EMAIL PROTECTED] wrote: I'd like to accept mouse gestures and keyboard shortcuts as input to a program. It depends on which GUI toolkit you use. Look in the wxPython, PyGTK, tkinter or pygame documentation. The nature of this program requires that these commands be

Re: Timeout test hangs IDLE

2007-12-06 Thread Gabriel Genellina
En Thu, 06 Dec 2007 08:03:49 -0300, Andreas Tawn [EMAIL PROTECTED] escribió: There was a strange error when using 'print' threads. When what I printed filled the entire screen, instead of moving all the text up, IDLE just hanged. Try running your code from the shell instead, to see if the

Re: Class destructor -- strange behaviour

2007-12-06 Thread MonkeeSage
On Dec 6, 3:51 pm, Spes [EMAIL PROTECTED] wrote: Hi, I have this simple code: | #!/usr/bin/python | import codecs | import re | from copy import deepcopy | | class MyClass(object): | def __del__(self): | deepcopy(1) | | x=MyClass() but I get an error: | Exception

Re: Capturing global input?

2007-12-06 Thread MonkeeSage
On Dec 6, 9:16 pm, MonkeeSage [EMAIL PROTECTED] wrote: On Dec 6, 3:51 pm, nomihn0 [EMAIL PROTECTED] wrote: I'd like to accept mouse gestures and keyboard shortcuts as input to a program. The nature of this program requires that these commands be issued regardless of the currently active

  1   2   >