Re: very large dictionary

2008-08-01 Thread Steven D'Aprano
On Fri, 01 Aug 2008 00:46:09 -0700, Simon Strobl wrote: > Hello, > > I tried to load a 6.8G large dictionary on a server that has 128G of > memory. I got a memory error. I used Python 2.5.2. How can I load my > data? How do you know the dictionary takes 6.8G? I'm going to guess an answer to my

Interconvert a ctypes.Structure to/from a binary string?

2008-08-01 Thread Andrew Lentvorski
Basically, I'd like to use the ctypes module as a much more descriptive "struct" module. Is there a way to take a ctypes.Structure-based class and convert it to/from a binary string? Thanks, -a -- http://mail.python.org/mailman/listinfo/python-list

Re: interpreter vs. compiled

2008-08-01 Thread castironpi
On Aug 1, 5:24 am, Paul Boddie <[EMAIL PROTECTED]> wrote: > On 1 Aug, 07:11, castironpi <[EMAIL PROTECTED]> wrote: > > > > > Given the restrictions (or rather, freedoms) of Python, does there > > exist code that necessarily cannot translate to machine code?  In > > other words, can you translate al

Re: simple error i hope

2008-08-01 Thread Maric Michaud
Le Saturday 02 August 2008 00:51:50 Clay Hobbs, vous avez écrit : > It is also a good idea to open files with the open() function and not the > file() function.  They do the exact same thing, and take the exact same > parameters, just open() makes your code a bit more readable (or at least > that's

IMRANHASHMI Enjoyed Diyamirza's Boobs PRESS

2008-08-01 Thread Easy INCOME
HiFriends, watch and enjoy SECRET WEB-CAMS at LADIES HOSTELS and INTERNET CAFE SEX SCANDALS VIDEOS... ** HOT Sexy Girls Nude Video's ** ** Porn Video's ** ** Nude Sexy For Mega Size Big Boobs ** Lesbian ** ** Gay ** Lesbian ** Data Sex ** Pay Sex's *** www.googlemobilesphones.blogspot.com

Re: How to figure out if the platform is 32bit or 64bit?

2008-08-01 Thread Paul McNett
Gary Josack wrote: Trent Mick wrote: Manuel Vazquez Acosta wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Just test for maxint value: from sys import maxint if maxint >> 33: print "more than 32 bits" # probably 64 else: print "32 bits" I believe that was already suggested in t

Re: Class definition attribute order

2008-08-01 Thread Benjamin
On Aug 1, 6:23 pm, Andrew Lentvorski <[EMAIL PROTECTED]> wrote: > How do I determine the order of definition of class attributes? > > For example, if I have a class > > class Test(object): >      y = 11 >      x = 22 > > How do I tell that y was defined before x? You wait until Python 3.0 where yo

Re: Strong/weak typing

2008-08-01 Thread Mel
[EMAIL PROTECTED] wrote: > I'm writing Python as if it were strongly typed, never recycling a > name to hold a type other than the original type. > > Is this good software engineering practice, or am I missing something > Pythonic? Nothing wrong with what you're doing. I've never come up with a

HELP DESK SOFTWARE APPLICATION DESIGNED

2008-08-01 Thread jasmine956
HELP DESK SOFTWARE APPLICATION DESIGNED ___ http://helpdesksoftwaremanagement.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Class definition attribute order

2008-08-01 Thread Ben Finney
Andrew Lentvorski <[EMAIL PROTECTED]> writes: > How do I determine the order of definition of class attributes? > > For example, if I have a class > > class Test(object): > y = 11 > x = 22 > > How do I tell that y was defined before x? Like any namespace, attributes of an object are im

Discount Armani / Prada / Chanel / LV / Versace / Burberry Sunglasses for sale

2008-08-01 Thread www.cheapforwholesale.com
Discount Coach Sandals, Dior Sandals, Prada Sandals, Chanel Sandals, Versace Sandals, Crocs Sandals, LV Sandals, ( G U C C I ) Sandals, UGG Sandals, Burberry Sandals, Women's Sandals Men's Slippers From China Discount, Prada Sunglasses, Discount, D&G Sunglasses, Discount, Fendi Sunglasses,Discoun

Re: very large dictionary

2008-08-01 Thread Sean
Simon Strobl wrote: Hello, I tried to load a 6.8G large dictionary on a server that has 128G of memory. I got a memory error. I used Python 2.5.2. How can I load my data? SImon Take a look at the python bsddb module. Uing btree tables is fast, and it has the benefit that once the table is o

Re: win32com ChartObject pythonwin vs idle

2008-08-01 Thread sterling
On Jul 31, 11:22 pm, "Roger Upole" <[EMAIL PROTECTED]> wrote: > "sterling" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > > > > > > > I'm curious as to why the difference between IDLE and pythonWin when > > using win32com. > > opening an excel file, i've attempted to grab the cha

Re: Agnostic fetching

2008-08-01 Thread Terry Reedy
jorpheus wrote: OK, that sounds stupid. Anyway, I've been learning Python for some time now, and am currently having fun with the urllib and urllib2 modules, but have run into a problem(?) - is there any way to fetch (urllib.retrieve) files from a server without knowing the filenames? For insta

RE:applescript/python question

2008-08-01 Thread jyoung79
Hi Sean, Thanks for your fast reply. This still doesn't seem to work. I also tried changing it to #!/usr/local/bin/python since it looks like the Python 2.5 items are actually in there. I'm starting to wonder if AppleScript's 'do shell script' command is actually looking in /usr/bin for Pyth

Re: Agnostic fetching

2008-08-01 Thread Bruce Frederiksen
On Fri, 01 Aug 2008 17:05:00 -0700, jorpheus wrote: > OK, that sounds stupid. Anyway, I've been learning Python for some > time now, and am currently having fun with the urllib and urllib2 > modules, but have run into a problem(?) - is there any way to fetch > (urllib.retrieve) files from a server

Re: applescript/python question

2008-08-01 Thread Sean DiZazzo
On Aug 1, 5:41 pm, <[EMAIL PROTECTED]> wrote: > I can't seem to figure this out.  I just installed Python 2.5.2 a few days > ago on my OS X 10.4.11 > system.  It runs fine and if I type "Python -V" in the Terminal it outputs > "Python 2.5.2" which is > correct.  However, if I try to run a 'do she

Re: Python parsing iTunes XML/COM

2008-08-01 Thread John Machin
On Aug 2, 10:02 am, william tanksley <[EMAIL PROTECTED]> wrote: > Given that the input file was > Unicode, You mean something like "encoded in UTF-8". Here's another reference for you to read: http://www.amk.ca/python/howto/unicode -- http://mail.python.org/mailman/listinfo/python-list

applescript/python question

2008-08-01 Thread jyoung79
I can't seem to figure this out. I just installed Python 2.5.2 a few days ago on my OS X 10.4.11 system. It runs fine and if I type "Python -V" in the Terminal it outputs "Python 2.5.2" which is correct. However, if I try to run a 'do shell script' in AppleScript which I'm wanting to run a Py

Re: when does the GIL really block?

2008-08-01 Thread John Krukoff
On Thu, 2008-07-31 at 18:27 -0700, Craig Allen wrote: > I have followed the GIL debate in python for some time. I don't want > to get into the regular debate about if it should be gotten rid of > (though I am curious about the status of that for Python 3)... > personally I think I can do multi-th

Could someone please review patch 799428: fix Tkinter tk_focusNext?

2008-08-01 Thread Russell E. Owen
Patch is a trivial (one word) fix to a long-standing issue with Tkinter: calls to the widget method tk_focusNext() fail with "unsubscriptable object" error. Admittedly we've lived a long time with this bug. But the fix is so simple and so obviously safe that

Agnostic fetching

2008-08-01 Thread jorpheus
OK, that sounds stupid. Anyway, I've been learning Python for some time now, and am currently having fun with the urllib and urllib2 modules, but have run into a problem(?) - is there any way to fetch (urllib.retrieve) files from a server without knowing the filenames? For instance, there is smth

Re: Python parsing iTunes XML/COM

2008-08-01 Thread william tanksley
John Machin <[EMAIL PROTECTED]> wrote: > william tanksley <[EMAIL PROTECTED]> wrote: > > Cool. Sorry for the misunderstanding. Thank you for helping again! > > Postscript: your request to print the actual data did the trick. > I'd back inspecting actual data against armchair philosophy any > time

Re: when does the GIL really block?

2008-08-01 Thread Craig Allen
On Aug 1, 12:06 pm, Rhamphoryncus <[EMAIL PROTECTED]> wrote: > On Jul 31, 7:27 pm, Craig Allen <[EMAIL PROTECTED]> wrote: > > > > > I have followed the GIL debate in python for some time. I don't want > > to get into the regular debate about if it should be gotten rid of > > (though I am curious a

Re: Error:can't assign to operator

2008-08-01 Thread MRAB
On Aug 1, 9:50 pm, Emile van Sebille <[EMAIL PROTECTED]> wrote: > Prasad, Mrunalini wrote: > >         dest + j - 1 = source + i > > Well, what are you trying to do here? > >  >>> a,b,c = range(3) >  >>>a+b-1=c+1 > SyntaxError:can't assign to operator > > Emile Just a comment, but I thought the pr

Re: Class definition attribute order

2008-08-01 Thread Miles
On Fri, Aug 1, 2008 at 7:23 PM, Andrew Lentvorski <[EMAIL PROTECTED]> wrote: > How do I determine the order of definition of class attributes? > > For example, if I have a class > > class Test(object): >y = 11 >x = 22 > > How do I tell that y was defined before x? You can't. The order tha

Inexplicable timings

2008-08-01 Thread MRAB
I'm looking at the implementation of regular expressions in Python and wrote a script to test my changes. This is the script: import re import time base = "abc" final = "d" for n in [100, 1000, 1]: for f in [final, ""]: for r in ["+", "+?"]: pattern = "(?:%s)%s%s" %

Class definition attribute order

2008-08-01 Thread Andrew Lentvorski
How do I determine the order of definition of class attributes? For example, if I have a class class Test(object): y = 11 x = 22 How do I tell that y was defined before x? Thanks, -a -- http://mail.python.org/mailman/listinfo/python-list

base-96

2008-08-01 Thread Kless
I think that would be very interesting thay Python would have a module for working on base 96 too. [1] It could be converted to base 96 the digests from hashlib module, and random bytes used on crypto (to create the salt, the IV, or a key). As you can see here [2], the printable ASCII characters

Re: Shared script

2008-08-01 Thread Clay Hobbs
On Fri, 2008-08-01 at 14:41 -0700, Zach Hobesh wrote: > I wrote a script that several different people on different machines > need to run on a regular basis. When I first wrote it, it was in > crisis mode, I got something out that was quick and dirty, very bare > bones. Recently I had some more

Re: simple error i hope

2008-08-01 Thread Clay Hobbs
On Fri, 2008-08-01 at 13:25 -0700, Emile van Sebille wrote: > suhail shaik wrote: > > > print fileName > > file = fileName.split(".") > .. this is a list > > you're shadowing a builtin -- generally a bad practice > > > print file > > textfile = file[0]+".txt" > > pr

Re: Newbie having issues with threads

2008-08-01 Thread Raja Baz
On Thu, 31 Jul 2008 14:09:12 -0700, James Calivar wrote: > I'm a newbie trying to write a script that uses threads. I'm right now > a little bit stuck in understanding why the code snippet I wrote doesn't > seem to be entering the function defined in the start_new_thread() call. > > If I run it

Re: when does the GIL really block?

2008-08-01 Thread Rhamphoryncus
On Jul 31, 7:27 pm, Craig Allen <[EMAIL PROTECTED]> wrote: > I have followed the GIL debate in python for some time.  I don't want > to get into the regular debate about if it should be gotten rid of > (though I am curious about the status of that for Python 3)... > personally I think I can do mult

Re: PIL (etc etc etc) on OS X

2008-08-01 Thread Irmen de Jong
David C. Ullrich wrote: Decided to try to install PIL on my Mac (OS X.5). I know nothing about installing programs on Linux, nothing about building C programs, nothing about installing libraries, nothing about "fink", nothing about anything. Please insert question marks after every sentence:

Re: very large dictionary

2008-08-01 Thread Raja Baz
On Fri, 01 Aug 2008 14:47:17 +0100, Sion Arrowsmith wrote: > Simon Strobl <[EMAIL PROTECTED]> wrote: >>I tried to load a 6.8G large dictionary on a server that has 128G of >>memory. I got a memory error. I used Python 2.5.2. How can I load my >>data? > Let's just eliminate one thing here: this s

Re: very large dictionary

2008-08-01 Thread Raja Baz
On Fri, 01 Aug 2008 14:47:17 +0100, Sion Arrowsmith wrote: > Simon Strobl <[EMAIL PROTECTED]> wrote: >>I tried to load a 6.8G large dictionary on a server that has 128G of >>memory. I got a memory error. I used Python 2.5.2. How can I load my >>data? > > Let's just eliminate one thing here: this

Re: Hobbyist - Python vs. other languages

2008-08-01 Thread Luis M . González
On 31 jul, 15:32, fprintf <[EMAIL PROTECTED]> wrote: > I have been playing with computers since I first learned to program > moving shapes on an Atari 800XL in BASIC. After many years of dabbling > in programming languages as a hobbyist (I am not a computer scientist > or other IT professional), I

Shared script

2008-08-01 Thread Zach Hobesh
I wrote a script that several different people on different machines need to run on a regular basis. When I first wrote it, it was in crisis mode, I got something out that was quick and dirty, very bare bones. Recently I had some more time, so I pushed most of the functions that the script uses i

Re: Boolean tests [was Re: Attack a sacred Python Cow]

2008-08-01 Thread Carl Banks
On Aug 1, 4:45 pm, Carl Banks <[EMAIL PROTECTED]> wrote: > On Aug 1, 3:36 pm, Terry Reedy <[EMAIL PROTECTED]> wrote: > > In general, asking code to apply across numeric, container, and other > > classes is asking too much. Python code can be generic only within > > protocol/interface categories su

Re: Strong/weak typing

2008-08-01 Thread Terry Reedy
[EMAIL PROTECTED] wrote: I'm writing Python as if it were strongly typed, never recycling a name to hold a type other than the original type. Names are bound to objects with types. Is this good software engineering practice, If you expand 'type' to 'category', then yes. or am I missing

Re: PIL (etc etc etc) on OS X

2008-08-01 Thread Kevin Walzer
David C. Ullrich wrote: Decided to try to install PIL on my Mac (OS X.5). OK, sounds good. I know nothing about installing programs on Linux, nothing about building C programs, nothing about installing libraries, nothing about "fink", nothing about anything. Please insert question marks after

Re: Boolean tests [was Re: Attack a sacred Python Cow]

2008-08-01 Thread Carl Banks
On Aug 1, 4:45 pm, Carl Banks <[EMAIL PROTECTED]> wrote: > On Aug 1, 3:36 pm, Terry Reedy <[EMAIL PROTECTED]> wrote: > > > > > > Nevertheless, I think this is probably the best example of the > > > enhanced polymorphism of "if x" yet. I'm kind of surprised no one > > > came up with it.) > > > I th

Re: Sharing common memory space (In form of List) across the python processes.

2008-08-01 Thread Terry Reedy
Piyush Chechani wrote: Hi, I am working on a module where I need to share contents of a big List across the processes. I am using socket programming concept for this. My current processing for this is as follows: - 1. There is a server program S which loads the list in the memory,

Re: Boolean tests [was Re: Attack a sacred Python Cow]

2008-08-01 Thread Carl Banks
On Aug 1, 3:36 pm, Terry Reedy <[EMAIL PROTECTED]> wrote: > > Nevertheless, I think this is probably the best example of the > > enhanced polymorphism of "if x" yet. I'm kind of surprised no one > > came up with it.) > > I think of Python code as 'generic' rather than 'polymorphic'. I am not > su

Re: Error:can't assign to operator

2008-08-01 Thread Emile van Sebille
Prasad, Mrunalini wrote: dest + j - 1 = source + i Well, what are you trying to do here? >>> a,b,c = range(3) >>>a+b-1=c+1 SyntaxError:can't assign to operator Emile -- http://mail.python.org/mailman/listinfo/python-list

Re: Difference between type and class

2008-08-01 Thread Terry Reedy
Thomas Troeger wrote: Steven D'Aprano wrote: class A: def bar(self): print "A" Alas, you've chosen the worst-possible example to "clarify" matters, because old-style classic classes are *not* unified with types, and will disappear in the future: Of course I wanted to write `

Re: interpreter vs. compiled

2008-08-01 Thread Terry Reedy
castironpi wrote: Similarly, I take it that the decision to make CPython a stack machine + VM was a design decision, not a necessity, favoring internal simplicity over the extra 5%. Years ago, someone once started a project to write a register-based virtual machine for (C)Python. I suspect it

Re: simple error i hope

2008-08-01 Thread Emile van Sebille
suhail shaik wrote: print fileName file = fileName.split(".") .. this is a list you're shadowing a builtin -- generally a bad practice print file textfile = file[0]+".txt" print textfile os.chdir(PNAME) file(textfile,'wt') .. and this is why

Re: Boolean tests [was Re: Attack a sacred Python Cow]

2008-08-01 Thread Matthew Fitzgibbons
Carl Banks wrote: On Aug 1, 8:49 am, Matthew Fitzgibbons <[EMAIL PROTECTED]> wrote: Carl Banks wrote: On Jul 31, 11:44 pm, Carl Banks <[EMAIL PROTECTED]> wrote: [snip excellent explanation of why it's hard to for "if x" to be extensively polymorphic] By the way, one thing I forgot to mention is

simple error i hope

2008-08-01 Thread suhail shaik
hi , i am new to python..may be this may turn into a simple error but i am in urgency please kindly help me #!/usr/bin/python #Globals here ROOTDIR = "/vol/mmis/media/video/tvid2008/mediaVideos/test" # Root dir where video files are located PNAME = "/data/test_1/" #DAILY_UPLOAD_PATH = "/mmis-ss9

Re: Boolean tests [was Re: Attack a sacred Python Cow]

2008-08-01 Thread Terry Reedy
Nevertheless, I think this is probably the best example of the enhanced polymorphism of "if x" yet. I'm kind of surprised no one came up with it.) I think of Python code as 'generic' rather than 'polymorphic'. I am not sure if that is a real difference or not, since I am a bit fuzzy on the m

Re: Hobbyist - Python vs. other languages

2008-08-01 Thread Mensanator
On Jul 31, 1:32 pm, fprintf <[EMAIL PROTECTED]> wrote: > I have been playing with computers since I first learned to program > moving shapes on an Atari 800XL in BASIC. After many years of dabbling > in programming languages as a hobbyist (I am not a computer scientist > or other IT professional),

Re: Boolean tests

2008-08-01 Thread Ethan Furman
Anders J. Munch wrote: Ethan Furman wrote: > Even if we find out that C.__nonzero__ is called, what was it that > __nonzero__ did again? reinforce the impression that he is unaware of the double-underscore functions and what they do and how they work. Only if your newsreader malfunctio

Re: Pointers/References in Python?

2008-08-01 Thread Robert Latest
Gary Herron wrote: > No need. A Python list contains *references* to objects, not copies of > objects. (The same is true of variables, dictionaries, sets, and so > on...). Good to know. I just wanted to make sure before writing more code which in the end might not scale well. Thanks to all f

Re: overriding file.readline: "an integer is required"

2008-08-01 Thread kj
In <[EMAIL PROTECTED]> Miles <[EMAIL PROTECTED]> writes: >On Wed, Jul 30, 2008 at 5:52 PM, kj <[EMAIL PROTECTED]> wrote: >> I know that I could rewrite the method like this: >> >>def readline(self, size=None): >>if size == None: >>line = self.file.readline() >>else:

popen hangs sporadically

2008-08-01 Thread kj
I have a script that calls the function write_tmpfile, which looks something like this: def write_tmpfile(f, tmpfile): # set-up code omitted in_f = popen("""grep -v '^\\[eof\\]$' %s |\ grep '[^[:space:]]' |\ sort -u""" % f) out_f = open(tmpf

Re: Hobbyist - Python vs. other languages

2008-08-01 Thread Tobiah
>> Since I don't have a specific problem to solve, besides >> Pythonchallenge (which I found very cryptic), and Project Euler (which >> I found beyond my mathematics skills), is there a place to go for >> increasingly difficult problems to solve? I have followed a number of >> the recommended onli

Re: DB-API corner case (psycopg2)

2008-08-01 Thread M.-A. Lemburg
On 2008-08-01 20:38, Thomas Guettler wrote: I forgot to mention where I stumbled about this. Django has a wrapper: http://code.djangoproject.com/browser/django/trunk/django/db/backends/util.py def execute(self, sql, params=()): start = time() try:

Apology

2008-08-01 Thread Russ P.
Many of you probably consider me a real jerk. Well, I guess I have been one here. Believe it or not, I'm actually a pretty nice guy in real life. Something about the detachment and (partial) anonymity of being online makes me write things I would never say in person. For that I apologize. I had tw

Re: mapping a string to an instancemethod

2008-08-01 Thread [EMAIL PROTECTED]
On Aug 1, 11:22 am, [EMAIL PROTECTED] wrote: > The following bit of code will allow an instance member to > be called by reference. How can I map a string (e.g. > "hello1" or "Foo.hello1" to a the instance member? > > class Foo: > def hello1(self, p): > print 'hello1', p > def hell

Re: mapping a string to an instancemethod

2008-08-01 Thread David C. Ullrich
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: > The following bit of code will allow an instance member to > be called by reference. How can I map a string (e.g. > "hello1" or "Foo.hello1" to a the instance member? > > class Foo: > def hello1(self, p): > print 'hello1', p

PIL (etc etc etc) on OS X

2008-08-01 Thread David C. Ullrich
Decided to try to install PIL on my Mac (OS X.5). I know nothing about installing programs on Linux, nothing about building C programs, nothing about installing libraries, nothing about "fink", nothing about anything. Please insert question marks after every sentence: I saw a "BUILDME" with instr

Re: DB-API corner case (psycopg2)

2008-08-01 Thread Thomas Guettler
I forgot to mention where I stumbled about this. Django has a wrapper: http://code.djangoproject.com/browser/django/trunk/django/db/backends/util.py def execute(self, sql, params=()): start = time() try: return self.cursor.execute(sq

Re: Strong/weak typing

2008-08-01 Thread Russ P.
On Aug 1, 8:31 am, [EMAIL PROTECTED] wrote: > I'm writing Python as if it were strongly typed, never recycling a > name to hold a type other than the original type. > > Is this good software engineering practice, or am I missing something > Pythonic? Reusing names for no reason can make debugging

Re: Strong/weak typing

2008-08-01 Thread Carl Banks
On Aug 1, 11:31 am, [EMAIL PROTECTED] wrote: > I'm writing Python as if it were strongly typed, never recycling a > name to hold a type other than the original type. > > Is this good software engineering practice, or am I missing something > Pythonic? I don't think you should go about gratuitously

mapping a string to an instancemethod

2008-08-01 Thread mh
The following bit of code will allow an instance member to be called by reference. How can I map a string (e.g. "hello1" or "Foo.hello1" to a the instance member? class Foo: def hello1(self, p): print 'hello1', p def hello2(self, p): print 'hello2', p def dispatch(self

Re: Boolean tests [was Re: Attack a sacred Python Cow]

2008-08-01 Thread Carl Banks
On Aug 1, 8:49 am, Matthew Fitzgibbons <[EMAIL PROTECTED]> wrote: > Carl Banks wrote: > > On Jul 31, 11:44 pm, Carl Banks <[EMAIL PROTECTED]> wrote: > > [snip excellent explanation of why it's hard to for "if x" to be > > extensively polymorphic] > > > By the way, one thing I forgot to mention is M

Re: DB-API corner case (psycopg2)

2008-08-01 Thread Paul Boddie
On 1 Aug, 16:39, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > Diez B. Roggisch schrieb: > > Thomas Guettler schrieb: > >> cursor.execute('''SELECT '%' ''', ()) # Does fail > > >> Traceback (most recent call last): > >> File "/localhome/modw/tmp/t.py", line 5, in > >> cursor.execute('''SEL

Pydev 1.3.19 Released

2008-08-01 Thread Fabio Zadrozny
Hi All, Pydev and Pydev Extensions 1.3.19 have been released Details on Pydev Extensions: http://www.fabioz.com/pydev Details on Pydev: http://pydev.sf.net Details on its development: http://pydev.blogspot.com Release Highlights in Pydev Extensions: --

Re: Difference between type and class

2008-08-01 Thread Matthew Woodcraft
Thomas Troeger <[EMAIL PROTECTED]> wrote: > Will this disappear in Python 3.0., i.e. can you again simply write > > class A: > > and inherit from object automagically? Short answer: yes. -M- -- http://mail.python.org/mailman/listinfo/python-list

Re: Strong/weak typing

2008-08-01 Thread paul
[EMAIL PROTECTED] schrieb: I'm writing Python as if it were strongly typed, never recycling a name to hold a type other than the original type. If it buys you anything? Maybe for shedskin or some future "to-native-code" compiler? Is this good software engineering practice, or am I missing som

Re: Strong/weak typing

2008-08-01 Thread Maric Michaud
Le Friday 01 August 2008 17:31:25 [EMAIL PROTECTED], vous avez écrit : > I'm writing Python as if it were strongly typed, never recycling a > name to hold a type other than the original type. > > Is this good software engineering practice, or am I missing something > Pythonic? As already stated by

Re: Strong/weak typing

2008-08-01 Thread Alan Franzoni
[EMAIL PROTECTED] was kind enough to say: > I'm writing Python as if it were strongly typed, never recycling a > name to hold a type other than the original type. > > Is this good software engineering practice, or am I missing something > Pythonic? Python *is* strongly typed. You're talking abo

Re: Python Written in C?

2008-08-01 Thread Fabio Oikawa
2008/8/1 Tim Rowe <[EMAIL PROTECTED]> > 2008/7/21 Krishnakant Mane <[EMAIL PROTECTED]>: > > > First off all c# is absolute rubbish waist of time. > > What a pity others are joining in this pointless language flame-war. > > Look, I recently had to write a script for manipulating some data; I > stru

Re: Strong/weak typing

2008-08-01 Thread eliben
On Aug 1, 5:31 pm, [EMAIL PROTECTED] wrote: > I'm writing Python as if it were strongly typed, never recycling a > name to hold a type other than the original type. > > Is this good software engineering practice, or am I missing something > Pythonic? I'm not sure you've got the terminology 100% ri

Strong/weak typing

2008-08-01 Thread MartinRinehart
I'm writing Python as if it were strongly typed, never recycling a name to hold a type other than the original type. Is this good software engineering practice, or am I missing something Pythonic? -- http://mail.python.org/mailman/listinfo/python-list

Re: DB-API corner case (psycopg2)

2008-08-01 Thread M.-A. Lemburg
On 2008-08-01 15:44, Thomas Guettler wrote: Hi, I discovered this: import psycopg2 connection=psycopg2.connect("dbname='...' user='...'") cursor=connection.cursor() cursor.execute('''SELECT '%' ''') # Does not fail cursor.execute('''SELECT '%' ''', ()) # Does fail Traceback (most recent call l

Re: DB-API corner case (psycopg2)

2008-08-01 Thread Diez B. Roggisch
Diez B. Roggisch schrieb: Thomas Guettler schrieb: Hi, I discovered this: import psycopg2 connection=psycopg2.connect("dbname='...' user='...'") cursor=connection.cursor() cursor.execute('''SELECT '%' ''') # Does not fail cursor.execute('''SELECT '%' ''', ()) # Does fail Traceback (most recen

Re: DB-API corner case (psycopg2)

2008-08-01 Thread Diez B. Roggisch
Thomas Guettler schrieb: Hi, I discovered this: import psycopg2 connection=psycopg2.connect("dbname='...' user='...'") cursor=connection.cursor() cursor.execute('''SELECT '%' ''') # Does not fail cursor.execute('''SELECT '%' ''', ()) # Does fail Traceback (most recent call last): File "/loca

Re: like py2exe, but on a mac

2008-08-01 Thread Kevin Walzer
William McBrine wrote: On Tue, 29 Jul 2008 12:24:49 -0700, Russell E. Owen wrote: That is exactly what py2app does by default if you run py2app with the system python. Thanks. I see that it* avoids the issue with Tk starting in the background that I get with Platypus, too. In fact, it look

Re: very large dictionary

2008-08-01 Thread Sion Arrowsmith
Simon Strobl <[EMAIL PROTECTED]> wrote: >I tried to load a 6.8G large dictionary on a server that has 128G of >memory. I got a memory error. I used Python 2.5.2. How can I load my >data? Let's just eliminate one thing here: this server is running a 64-bit OS, isn't it? Because if it's a 32-bit OS

Simple Gui

2008-08-01 Thread Keith Nation
Hi folks, If anyone is interested, I could really use a simple gui such as easygui to do the following tasks: 1) Pick a file from a directory. 2) Allow the user to prioritize the file. 3) Add more files and prioritize. 3) Begin processing the most important file. 4) Interrupt button to stop

Re: Boolean tests

2008-08-01 Thread Anders J. Munch
Ethan Furman wrote: > Even if we find out that C.__nonzero__ is called, what was it that > __nonzero__ did again? reinforce the impression that he is unaware of the double-underscore functions and what they do and how they work. Only if your newsreader malfunctioned and refused to let you

DB-API corner case (psycopg2)

2008-08-01 Thread Thomas Guettler
Hi, I discovered this: import psycopg2 connection=psycopg2.connect("dbname='...' user='...'") cursor=connection.cursor() cursor.execute('''SELECT '%' ''') # Does not fail cursor.execute('''SELECT '%' ''', ()) # Does fail Traceback (most recent call last): File "/localhome/modw/tmp/t.py", line

Re: Boolean tests [was Re: Attack a sacred Python Cow]

2008-08-01 Thread Antoon Pardon
On 2008-08-01, Matthew Fitzgibbons <[EMAIL PROTECTED]> wrote: > Antoon Pardon wrote: >> On 2008-08-01, Erik Max Francis <[EMAIL PROTECTED]> wrote: >>> Antoon Pardon wrote: >>> I now have the following question for people who argue that "if x" is more polymorphic. I could subclass list, so

Re: Python Written in C?

2008-08-01 Thread Tim Rowe
2008/7/21 Krishnakant Mane <[EMAIL PROTECTED]>: > First off all c# is absolute rubbish waist of time. What a pity others are joining in this pointless language flame-war. Look, I recently had to write a script for manipulating some data; I struggled to organise it in Python and in C++, but when

Re: Boolean tests [was Re: Attack a sacred Python Cow]

2008-08-01 Thread Matthew Fitzgibbons
Matthew Fitzgibbons wrote: 'if x' strikes me as better for this case because you might want to accept a non-empty list (or some other objects) but reject non-empty lists. 'if x is None' would not work. It still may be susceptible to the empty iterator problem, depending on what prep_func does.

Re: Newbie having issues with threads

2008-08-01 Thread James Calivar
Well, that seemed to do the trick. Thanks for the tip! I guess as a novice and having no investment in the older "thread" module, I'll just use the Threading module from now on. James = PS Here is my new code snippet: = #!/usr/bin/python import threading class Test(object): def _

Re: Boolean tests [was Re: Attack a sacred Python Cow]

2008-08-01 Thread Matthew Fitzgibbons
Carl Banks wrote: On Jul 31, 11:44 pm, Carl Banks <[EMAIL PROTECTED]> wrote: [snip excellent explanation of why it's hard to for "if x" to be extensively polymorphic] By the way, one thing I forgot to mention is Matt Fitzgibbons' filter example. As I said, it's hard to write code that works fo

Re: Boolean tests [was Re: Attack a sacred Python Cow]

2008-08-01 Thread Matthew Fitzgibbons
Antoon Pardon wrote: On 2008-08-01, Erik Max Francis <[EMAIL PROTECTED]> wrote: Antoon Pardon wrote: I now have the following question for people who argue that "if x" is more polymorphic. I could subclass list, so that instances of this new sequence would always behave as true, even if they a

Re: py2exe bug with email.MIMEText

2008-08-01 Thread Werner F. Bruhin
Hi Marcus, Marcus.CM wrote: There is a bug with py2exe when (at least under windows) when importing email # example testmime.py import email msg = email.MIMEText.MIMEText("dsafdafdasfA") print "ok" 1. Save the text above and setup as testmime.py 2. Run it and u can see "ok" 3. Create setup.py

Re: Difference between type and class

2008-08-01 Thread Thomas Troeger
Steven D'Aprano wrote: class A: def bar(self): print "A" Alas, you've chosen the worst-possible example to "clarify" matters, because old-style classic classes are *not* unified with types, and will disappear in the future: Of course I wanted to write `class A(objec

Re: Genital Hair Removal

2008-08-01 Thread Tim Cook
On Thu, 2008-07-31 at 20:46 -0700, Paul McGuire wrote: > Be careful though, you should not modify a sequence while iterating > over it. > > -- Paul But if I can't remove each hair from the sequence as it's actually removed then how will I ever know when I'm finished? --Tim -- **

Re: find and replace with regular expressions

2008-08-01 Thread dusans
On Aug 1, 12:53 pm, dusans <[EMAIL PROTECTED]> wrote: > On Jul 31, 10:07 pm, [EMAIL PROTECTED] wrote: > > > > > > > I am using regular expressions to search a string (always full > > sentences, maybe more than one sentence) for common abbreviations and > > remove the periods.  I need to break the s

Re: find and replace with regular expressions

2008-08-01 Thread dusans
On Jul 31, 10:07 pm, [EMAIL PROTECTED] wrote: > I am using regular expressions to search a string (always full > sentences, maybe more than one sentence) for common abbreviations and > remove the periods.  I need to break the string into different > sentences but split('.') doesn't solve the whole

Re: very large dictionary

2008-08-01 Thread bearophileHUGS
Simon Strobl: > I had a file bigrams.py with a content like below: > bigrams = { > ", djy" : 75 , > ", djz" : 57 , > ", djzoom" : 165 , > ", dk" : 28893 , > ", dk.au" : 854 , > ", dk.b." : 3668 , > ... > } > In another file I said: > from bigrams import bigrams Probably there's a limit in the modu

Re: interpreter vs. compiled

2008-08-01 Thread Paul Boddie
On 1 Aug, 07:11, castironpi <[EMAIL PROTECTED]> wrote: > > Given the restrictions (or rather, freedoms) of Python, does there > exist code that necessarily cannot translate to machine code?  In > other words, can you translate all Python code to machine code? Given that all valid Python code can b

Error:can't assign to operator

2008-08-01 Thread Prasad, Mrunalini
Hello: I am getting the above error while tryign to run the tower of hanoi program. The error is at line 42 highligted in red below. PLease advise #!/usr/bin/env python class Hanoi: def __init__(self, N): self.N = N try: raise ValueError(N) except ValueError, e:

Re: Boolean tests [was Re: Attack a sacred Python Cow]

2008-08-01 Thread Antoon Pardon
On 2008-08-01, Erik Max Francis <[EMAIL PROTECTED]> wrote: > Antoon Pardon wrote: > >> I now have the following question for people who argue that "if x" >> is more polymorphic. I could subclass list, so that instances >> of this new sequence would always behave as true, even if they are >> empty.

Re: Decoding an attachment

2008-08-01 Thread Aspersieman
[EMAIL PROTECTED] wrote: > I figured out how to save an e-mail message as a text file, but I'm > not sure how to decode the encoded part as I am not sure how much I > need to include to decode it properly. Here is what a message looks > like: > > > Received: from INGESTOR2SQA ([10.220.83.198]) by

  1   2   >