Re: Difference between type and class

2008-08-01 Thread Nikolaus Rath
Miles [EMAIL PROTECTED] writes: On Thu, Jul 31, 2008 at 1:59 PM, Nikolaus Rath wrote: If it is just a matter of different rendering, what's the reason for doing it like that? Wouldn't it be more consistent and straightforward to denote builtin types as classes as well? Yes, and in Python 3,

Re: Difference between type and class

2008-08-01 Thread Nikolaus Rath
Steven D'Aprano [EMAIL PROTECTED] writes: So, to the Original Poster: In Python, new-style classes and types are the same, but it is traditional to refer to customer objects as class and built-in objects as types. Old-style classes are different, but you are discouraged from using old-style

py2exe bug with email.MIMEText

2008-08-01 Thread Marcus.CM
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 and run : python setup.py py2exe

Re: py2exe bug with email.MIMEText

2008-08-01 Thread Marcus.CM
Hi, After some debugging, i found the solution is to :- import email import email.mime.text import email.iterators import email.generator import email.utils Marcus. Marcus.CM wrote: There is a bug with py2exe when (at least under windows) when importing email # example testmime.py import

Re: like py2exe, but on a mac

2008-08-01 Thread Python.Arno
oops didn't send it to the list... On 31 jul 2008, at 23:28, Python.Arno wrote: On 30 jul 2008, at 20:48, William McBrine wrote: On Wed, 30 Jul 2008 16:57:35 +, I wrote: [bundlebuidler] does put in a version-specific #! line, but if I change that to #!/usr/bin/env python, the app

http://makmoneyy.googlepages.com

2008-08-01 Thread nandhini . ram8
http://makmoneyy.googlepages.com \.\.~.~././... ...(@.@). ==oOOo=(_)=oOOo=. ...|Se você é como eu, que| ...|.fica super feliz ao perceber..|

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

2008-08-01 Thread Antoon Pardon
On 2008-08-01, Carl Banks [EMAIL PROTECTED] wrote: On Jul 31, 1:27 pm, Chris Mellon [EMAIL PROTECTED] wrote: I'm really not sure where you're going with this or what you're trying to prove. if x is a duck-type test for a boolean value. Obviously if you know the type and want a more *specific*

very large dictionary

2008-08-01 Thread Simon Strobl
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 -- http://mail.python.org/mailman/listinfo/python-list

Re: very large dictionary

2008-08-01 Thread Marc 'BlackJack' Rintsch
On Fri, 01 Aug 2008 00:46:09 -0700, Simon Strobl 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? What does load a dictionary mean? Was it saved with the `pickle` module? How about using a

Re: saving an e-mail attachement

2008-08-01 Thread Aspersieman
[EMAIL PROTECTED] wrote: I'm trying to figure out how to save an e-mail attachment from a POP3 mailbox. I've scoured the web, but -none- of the examples I have found have actually worked. For instance, in this example:

Re: very large dictionary

2008-08-01 Thread Simon Strobl
What does load a dictionary mean? 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 How about using a database instead of a

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

2008-08-01 Thread Erik Max Francis
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. I could then rewrite my loop as follows: while 1: extra = produce()

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

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. I could then

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: 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 be

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 module size here. You can

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: 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 string into

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: 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

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 and

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 are

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 for

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
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: 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 I

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 that instances of

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 5,

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

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: 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,

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

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

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 recent

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

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: 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% right.

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 struggled to

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 about

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 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

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

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: 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 module cursor.execute('''SELECT '%' ''',

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 Matt

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: 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

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

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 def

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 hello2(self,

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

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:

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 online

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 for

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

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

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 =

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 Matt

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: 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: 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: 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: 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 sure if that

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

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 think of Python code as

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: 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: 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 such as

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

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 have

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 server is

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 server is

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: 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

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 as

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 print textfile

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

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

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

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 % (base, r,

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 that the

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 preferred term was

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 about the

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 :-) Heh.

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

Could someone please review patch 799428: fix Tkinter tk_focusNext?

2008-08-01 Thread Russell E. Owen
Patch http://bugs.python.org/issue799428 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 it

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

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

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

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 shell script'

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 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

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

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 chart information out

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

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, DG Sunglasses, Discount, Fendi

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 implemented

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: 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

  1   2   >