mail

2008-01-04 Thread sanjeet
hi all, I am facing problem to fetch mail from internet mail server. Plz help me, how can do this? thanks , sanjeet -- http://mail.python.org/mailman/listinfo/python-list

Re: Skill Resume Achievements, What Good Goes Here?

2008-01-04 Thread Paddy
On Jan 2, 3:59 pm, vbgunz <[EMAIL PROTECTED]> wrote: > I spent some time working on a skill resume, the kind of resume > college students put together and realized, I am not in college and > everything I learned was self-taught. Of course I would like some real > world achievements but don't consid

Re: Problem reading csv files

2008-01-04 Thread Ramashish Baranwal
> > XLS != CSV > XLS is M$'s format for spreadsheets whereas CSV is essentially a text > document with comma-delimited fields. If you open it up in OpenOffice > and go File -> Save As then in the 'Save as type:' drop-down list > select 'Text CSV (.csv)' and ofc change your code to point to the new

Re: fastest method to choose a random element

2008-01-04 Thread Paddy
On Jan 4, 7:55 pm, [EMAIL PROTECTED] wrote: > Hello, > This is a question for the best method (in terms of performance > only) to choose a random element from a list among those that satisfy > a certain property. > > This is the setting: I need to pick from a list a random element > that sati

Re: How a smart editor could make "Postfix type declarations PEP3117" in Python3000 more readable

2008-01-04 Thread Russ P.
On Jan 4, 10:07 pm, John Nagle <[EMAIL PROTECTED]> wrote: > aspineux wrote: > > Hi > > > I read the PEP 3117 about the new "Postfix type declarations" in > > Python3000. > > THIS PEP as been REJECTED ! > > Of course. That was a joke. > > > And I think this is a good idea to include typing in

Re: How a smart editor could make "Postfix type declarations PEP3117" in Python3000 more readable

2008-01-04 Thread John Nagle
aspineux wrote: > Hi > > I read the PEP 3117 about the new "Postfix type declarations" in > Python3000. > THIS PEP as been REJECTED ! Of course. That was a joke. > And I think this is a good idea to include typing in python. Python doesn't really need explicit type declarations. The

Re: Information on PyGMT?

2008-01-04 Thread Alaric Haag
In article <[EMAIL PROTECTED]>, Jeroen Ruigrok van der Werven <[EMAIL PROTECTED]> wrote: > -On [20080104 04:11], Alaric ([EMAIL PROTECTED]) wrote: > >Unfortunately, the only site (forge.nesc.ac.uk) that seems to offer the code > >(written by Magnus Hagdorn) is not

Re: MRO Error on Multiple Inheritance?

2008-01-04 Thread Michele Simionato
On Jan 4, 9:03 pm, Ming <[EMAIL PROTECTED]> wrote: > I'm working through Wesley Chun's CPP2e and got this error on 13.11.1, > pp 548 where his interpreter snippet shows no problems: > > ActivePython 2.5.1.1 (ActiveState Software Inc.) b > Python 2.5.1 (r251:54863, May 1 2007, 17:47:05) [ > win32 >

Re: How a smart editor could make "Postfix type declarations PEP3117" in Python3000 more readable

2008-01-04 Thread Steven D'Aprano
On Fri, 04 Jan 2008 19:39:13 -0800, aspineux wrote: > Hi > > I read the PEP 3117 about the new "Postfix type declarations" in > Python3000. > THIS PEP as been REJECTED ! But ... > > The notation in the PEP is very ugly ! This make python code more > difficult to read! Please look at the date

How a smart editor could make "Postfix type declarations PEP3117" in Python3000 more readable

2008-01-04 Thread aspineux
Hi I read the PEP 3117 about the new "Postfix type declarations" in Python3000. THIS PEP as been REJECTED ! But ... The notation in the PEP is very ugly ! This make python code more difficult to read! Anyway when I switched to python (from C, C++, ..), I suffered a lot of the untyped python va

Re: vim newb - indenting python comments

2008-01-04 Thread Robert Kern
Tim Chase wrote: >> One problem I have is that the >> indent in normal mode doesn't work >> when a line starts with the # character. Any idea what I'm doing >> wrong? > > In short, ">>" *does* indent in normal mode (I presume you > accurately mean "Normal" mode, rather than "Insert" mode). The >

Re: Questions about subclassing an int

2008-01-04 Thread Steven D'Aprano
On Fri, 04 Jan 2008 15:36:27 -0800, Arnaud Delobelle wrote: > > Now it's no longer a syntax error but I don't see why it's different? > > Same as above, though I don't understand why you get a SyntaxError for T > and a TypeError for R. AFAICT both shoult give a TypeError. Probably because it was

Re: vim newb - indenting python comments

2008-01-04 Thread infixum
On Jan 4, 7:07 pm, Tim Chase <[EMAIL PROTECTED]> wrote: > > One problem I have is that the >> indent in normal mode doesn't work > > when a line starts with the # character.  Any idea what I'm doing > > wrong? > > In short, ">>" *does* indent in normal mode (I presume you > accurately mean "Normal"

Re: Memory Leaks and Heapy

2008-01-04 Thread Yaakov Nemoy
On Jan 4, 2008 11:56 AM, M.-A. Lemburg <[EMAIL PROTECTED]> wrote: > > The most common answer I heard was possible fragmentation, meaning > > there are no or few completely empty blocks to be found. If there are > > no 'leaks' in the VM, then it's probably related to how memory is > > freed. > > Yo

Re: vim newb - indenting python comments

2008-01-04 Thread Tim Chase
> One problem I have is that the >> indent in normal mode doesn't work > when a line starts with the # character. Any idea what I'm doing > wrong? In short, ">>" *does* indent in normal mode (I presume you accurately mean "Normal" mode, rather than "Insert" mode). The question becomes why doesn'

vim newb - indenting python comments

2008-01-04 Thread infixum
I'm just starting to use vim. It has helped me do a lot of repetitive editing of Python files. One problem I have is that the >> indent in normal mode doesn't work when a line starts with the # character. Any idea what I'm doing wrong? Thanks in advance for your help. -- http://mail.python.org

Re: Question on os.tempnam() vulnerability

2008-01-04 Thread [EMAIL PROTECTED]
On Jan 4, 12:09 pm, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > Does any one know what kind of security risk these message are > > suggesting? > > f = os.tempnam() > > __main__:1: RuntimeWarning: tempnam is a potential security risk to > > your program > f > >

Re: Request for help with Image color space conversion

2008-01-04 Thread Robert Kern
ttest wrote: > Hello, > > I'm working on an image processing project using the Python Imaging > Library along with numpy. Right now, I'm trying to build a speedy > script for converting whole images between the RGB and the HSV (a.k.a. > HSB) color spaces. Unfortunately, the code I've made so far

Re: Questions about subclassing an int

2008-01-04 Thread Arnaud Delobelle
On Jan 4, 10:55 pm, "Steven W. Orr" <[EMAIL PROTECTED]> wrote: > class S(int): >      def __init__(self, value): >         self.value = value >      def addStr(self, str): >         self.doc = str > > s = S(44) > s.addStr('Hello') > > print 's = ', s > print 's.doc = ', s.doc > > class T(int): >  

TextWrangler and new Python version (Mac)

2008-01-04 Thread cf29
I installed Python 2.5 on my Mac (OS X Tiger). When running scripts with the TextWrangler Run command it is using the system installed version of Python (2.3). If I run the scripts with the Apple Terminal it uses the new version (2.5). Is there any way to ask TextWrangler to use the new version of

Request for help with Image color space conversion

2008-01-04 Thread ttest
Hello, I'm working on an image processing project using the Python Imaging Library along with numpy. Right now, I'm trying to build a speedy script for converting whole images between the RGB and the HSV (a.k.a. HSB) color spaces. Unfortunately, the code I've made so far runs dreadfully slow wit

Re: MRO Error on Multiple Inheritance?

2008-01-04 Thread Ben Finney
Ming <[EMAIL PROTECTED]> writes: > I'm working through Wesley Chun's CPP2e and got this error on 13.11.1, > pp 548 where his interpreter snippet shows no problems: I don't know what a "CPP2e" is. Is it a book? Can you give the ISBN? > ActivePython 2.5.1.1 (ActiveState Software Inc.) b > Python 2

Re: Details about pythons set implementation

2008-01-04 Thread Arnaud Delobelle
On Jan 4, 10:15 pm, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > On Fri, 04 Jan 2008 09:29:50 -0800, bukzor wrote: > > Why cant you implement < for complex numbers? Maybe I'm being naive, but > > isn't this the normal definition? > >     a + bi < c + di iff sqrt(a**2 + b**2) < sq

Questions about subclassing an int

2008-01-04 Thread Steven W. Orr
class S(int): def __init__(self, value): self.value = value def addStr(self, str): self.doc = str s = S(44) s.addStr('Hello') print 's = ', s print 's.doc = ', s.doc class T(int): def __init__(self, value, str): self.value = value self.doc = str t

opensg or openscenegraph

2008-01-04 Thread yomgui
Hi, I need to use a scengraph for my python/opengl application but I have trouble finding out which one I should use. opensg or openscenegraph (OSG) ? I suppose the quality of the python bindings will make the decision. any advice ? thanks yomgui -- http://mail.python.org/mailman/listinfo/py

Re: Tabnanny errors when Migrating Python 2.4 code to 2.5

2008-01-04 Thread John Machin
On Jan 5, 8:05 am, [EMAIL PROTECTED] wrote: > On Jan 4, 2:06 pm, John Machin <[EMAIL PROTECTED]> wrote: > > > On Jan 5, 3:56 am, [EMAIL PROTECTED] wrote: > > > > Hi, > > > > When Python 2.5 first came out, I eagerly downloaded it and > > > immediately had issues with getting it to run my 2.4 code.

Re: Fortran to Python

2008-01-04 Thread Robert Kern
Jeroen Ruigrok van der Werven wrote: > I got someone who asked me to make changes in an old Fortran program she is > using for some calculations. > The calculations are pretty standard aside from 2 calls to DLINCG (an IMSL > numerical_libraries function to calculate an inverse matrix). > > What I

Re: Details about pythons set implementation

2008-01-04 Thread Steven D'Aprano
On Fri, 04 Jan 2008 09:29:50 -0800, bukzor wrote: > Why cant you implement < for complex numbers? Maybe I'm being naive, but > isn't this the normal definition? > a + bi < c + di iff sqrt(a**2 + b**2) < sqrt(c**2, d**2) No, it is not. Ordered comparisons are not defined for complex numbers.

Re: Skill Resume Achievements, What Good Goes Here?

2008-01-04 Thread kyosohma
On Jan 4, 3:06 pm, apatheticagnostic <[EMAIL PROTECTED]> wrote: > On Jan 2, 11:31 am, [EMAIL PROTECTED] wrote: > > > > > On Jan 2, 9:59 am, vbgunz <[EMAIL PROTECTED]> wrote: > > > > I spent some time working on a skill resume, the kind of resume > > > college students put together and realized, I a

Re: Skill Resume Achievements, What Good Goes Here?

2008-01-04 Thread kyosohma
On Jan 4, 3:06 pm, apatheticagnostic <[EMAIL PROTECTED]> wrote: > On Jan 2, 11:31 am, [EMAIL PROTECTED] wrote: > > > > > On Jan 2, 9:59 am, vbgunz <[EMAIL PROTECTED]> wrote: > > > > I spent some time working on a skill resume, the kind of resume > > > college students put together and realized, I a

Re: Question on os.tempnam() vulnerability

2008-01-04 Thread Grant Edwards
On 2008-01-04, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > you get a name instead of a file, so someone else can create that file > after you've called tempnam/tmpnam, but before you've actually gotten > around to create the file yourself. which means that anyone on the > machine might be able

Re: Skill Resume Achievements, What Good Goes Here?

2008-01-04 Thread apatheticagnostic
On Jan 2, 11:31 am, [EMAIL PROTECTED] wrote: > On Jan 2, 9:59 am, vbgunz <[EMAIL PROTECTED]> wrote: > > > I spent some time working on a skill resume, the kind of resume > > college students put together and realized, I am not in college and > > everything I learned was self-taught. Of course I wou

Re: Tabnanny errors when Migrating Python 2.4 code to 2.5

2008-01-04 Thread kyosohma
On Jan 4, 2:06 pm, John Machin <[EMAIL PROTECTED]> wrote: > On Jan 5, 3:56 am, [EMAIL PROTECTED] wrote: > > > Hi, > > > When Python 2.5 first came out, I eagerly downloaded it and > > immediately had issues with getting it to run my 2.4 code. So I just > > stuck to 2.4. However, I decided this week

Re: MRO Error on Multiple Inheritance?

2008-01-04 Thread Neil Cerutti
On Jan 4, 2008 3:03 PM, Ming <[EMAIL PROTECTED]> wrote: > I'm working through Wesley Chun's CPP2e and got this error on 13.11.1, > pp 548 where his interpreter snippet shows no problems: > > ActivePython 2.5.1.1 (ActiveState Software Inc.) b > Python 2.5.1 (r251:54863, May 1 2007, 17:47:05) [ > w

Re: fastest method to choose a random element

2008-01-04 Thread Neil Cerutti
On Jan 4, 2008 3:47 PM, Neil Cerutti <[EMAIL PROTECTED]> wrote: > On Jan 4, 2008 2:55 PM, <[EMAIL PROTECTED]> wrote: > > > Hello, > > This is a question for the best method (in terms of performance > > only) to choose a random element from a list among those that satisfy > > a certain property.

Re: fastest method to choose a random element

2008-01-04 Thread Neil Cerutti
On Jan 4, 2008 2:55 PM, <[EMAIL PROTECTED]> wrote: > Hello, > This is a question for the best method (in terms of performance > only) to choose a random element from a list among those that satisfy > a certain property. I would automatically use random.choice(filter(pred_func, a_list)). You ju

Re: MRO Error on Multiple Inheritance?

2008-01-04 Thread Fredrik Lundh
Ming wrote: > TypeError: Error when calling the metaclass bases > Cannot create a consistent method resolution > order (MRO) for bases A, B > > (I submitted the problem to the author but I'm not sure I'll ever hear > back.) I'm guessing that this kind of diamond inheritance is > prohibited

Re: Question on os.tempnam() vulnerability

2008-01-04 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > Does any one know what kind of security risk these message are > suggesting? > f = os.tempnam() > __main__:1: RuntimeWarning: tempnam is a potential security risk to > your program f > '/tmp/filed4cJNX' > g = os.tmpnam() > __main__:1: RuntimeWarning: tmp

Re: Details about pythons set implementation

2008-01-04 Thread Piet van Oostrum
> bukzor <[EMAIL PROTECTED]> (B) wrote: >B> Why cant you implement < for complex numbers? Maybe I'm being naive, >B> but isn't this the normal definition? >B> a + bi < c + di iff sqrt(a**2 + b**2) < sqrt(c**2, d**2) There doesn't exist a `normal' definition of < for the complex numbers. F

Re: Tabnanny errors when Migrating Python 2.4 code to 2.5

2008-01-04 Thread John Machin
On Jan 5, 3:56 am, [EMAIL PROTECTED] wrote: > Hi, > > When Python 2.5 first came out, I eagerly downloaded it and > immediately had issues with getting it to run my 2.4 code. So I just > stuck to 2.4. However, I decided this week that I really should try to > get 2.5 to work. Does anyone know why c

MRO Error on Multiple Inheritance?

2008-01-04 Thread Ming
I'm working through Wesley Chun's CPP2e and got this error on 13.11.1, pp 548 where his interpreter snippet shows no problems: ActivePython 2.5.1.1 (ActiveState Software Inc.) b Python 2.5.1 (r251:54863, May 1 2007, 17:47:05) [ win32 Type "help", "copyright", "credits" or "license" f >>> class A(

Question on os.tempnam() vulnerability

2008-01-04 Thread [EMAIL PROTECTED]
Hello, Does any one know what kind of security risk these message are suggesting? >>> f = os.tempnam() __main__:1: RuntimeWarning: tempnam is a potential security risk to your program >>> f '/tmp/filed4cJNX' >>> g = os.tmpnam() __main__:1: RuntimeWarning: tmpnam is a potential security risk to y

fastest method to choose a random element

2008-01-04 Thread caca
Hello, This is a question for the best method (in terms of performance only) to choose a random element from a list among those that satisfy a certain property. This is the setting: I need to pick from a list a random element that satisfies a given property. All or none of the elements may h

RE: Simple calculation error

2008-01-04 Thread Francois Liot
No the change of sign is due to a fake copy and past, My question was related to decimal calculation. Thanks, Francois Liot -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paul McGuire Sent: Friday, January 04, 2008 1:46 PM To: python-list@python.org Sub

Re: Simple calculation error

2008-01-04 Thread Paul McGuire
On Jan 4, 12:30 pm, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Francois Liot wrote: > > > I observed a strange calculation answer, on both python 2.3.4 and 2.4.4 > > >> >> print 753343.44 - 753361.89 > > > -18.450001 > > >> >> print ( (753361.89*100) - (753343.44*100) ) / 100 > > > 18.45 > > >

Re: Simple calculation error

2008-01-04 Thread Fredrik Lundh
Francois Liot wrote: > > I observed a strange calculation answer, on both python 2.3.4 and 2.4.4 > >> >> print 753343.44 - 753361.89 > > -18.450001 > >> >> print ( (753361.89*100) - (753343.44*100) ) / 100 > > 18.45 > > Can somebody help me to play correctly with decimal values? A 64-bit

Simple calculation error

2008-01-04 Thread Francois Liot
Dear all, I observed a strange calculation answer, on both python 2.3.4 and 2.4.4 >>> print 753343.44 - 753361.89 -18.450001 >>> print ( (753361.89*100) - (753343.44*100) ) / 100 18.45 Can somebody help me to play correctly with decimal values? Thanks in advance, Francois

Re: Pivot Table/Groupby/Sum question

2008-01-04 Thread petr . jakes . tpc
On Jan 4, 4:55 pm, [EMAIL PROTECTED] wrote: > Petr thanks so much for your input. I'll try to learnSQL, especially > if I'll do a lot of database work. > > I tried to do it John's way as en exercise and I'm happy to say I > understand a lot more. Basically I didn't realize I could nest > dictiona

Re: Details about pythons set implementation

2008-01-04 Thread Diez B. Roggisch
bukzor schrieb: > On Jan 4, 9:08 am, Sion Arrowsmith <[EMAIL PROTECTED]> > wrote: >> Hrvoje Niksic <[EMAIL PROTECTED]> wrote: >> >>> BTW if you're using C++, why not simply use std::set? >> Because ... how to be polite about this? No, I can't. std::set is >> crap. The implementation is a sorted se

Re: Details about pythons set implementation

2008-01-04 Thread Arnaud Delobelle
On Jan 4, 5:08 pm, Sion Arrowsmith <[EMAIL PROTECTED]> wrote: [...] > But the real killer is that requirement for a std::set is that > T::operator< exists. Which means, for instance, that you can't > have a set of complex numbers This is really OT but IIRC, std::set is actually std::set< T, st

matplotlib fill command on axes plot problem

2008-01-04 Thread Rominsky
I am trying to use the fill command to draw a box around an object in an image. I can get the box drawn, but there seems to be a side effect. The fill command is adding white lines to the top and sometimes right side of my axes plots. I am using small images, 124x200, and after the fill command

Re: Details about pythons set implementation

2008-01-04 Thread bukzor
On Jan 4, 9:08 am, Sion Arrowsmith <[EMAIL PROTECTED]> wrote: > Hrvoje Niksic <[EMAIL PROTECTED]> wrote: > > >BTW if you're using C++, why not simply use std::set? > > Because ... how to be polite about this? No, I can't. std::set is > crap. The implementation is a sorted sequence -- if you're luc

Re: how to use bool

2008-01-04 Thread bukzor
On Jan 4, 8:51 am, bukzor <[EMAIL PROTECTED]> wrote: > On Jan 3, 7:49 am, [EMAIL PROTECTED] wrote: > > > > > hi, i have some code where i set a bool type variable and if the value > > is false i would like to return from the method with an error msg.. > > being a beginner I wd like some help here >

Re: import zlib in 2.5 fails

2008-01-04 Thread Zentrader
On Jan 4, 2:19 am, stuntgoat <[EMAIL PROTECTED]> wrote: > import zlib works in Python 2.4 (debian etch AMD64 - default python > version for that distro) > > I built python 2.5 from source; zlib is not importable. 2.5 has been available for some time in the Debian repositories. Installing the .deb

Re: Details about pythons set implementation

2008-01-04 Thread Sion Arrowsmith
Hrvoje Niksic <[EMAIL PROTECTED]> wrote: >BTW if you're using C++, why not simply use std::set? Because ... how to be polite about this? No, I can't. std::set is crap. The implementation is a sorted sequence -- if you're lucky, this is a heap or a C array, and you've got O(log n) performance. But

Re: python interfaces

2008-01-04 Thread Sion Arrowsmith
hyperboreean <[EMAIL PROTECTED]> wrote: >Why doesn't python provide interfaces trough its standard library? Because they're pointless. Java interfaces are a hack around the complexities of multiple inheritence. Python does multiple inheritence Just Fine (give or take the subtleties of super()) so

Tabnanny errors when Migrating Python 2.4 code to 2.5

2008-01-04 Thread kyosohma
Hi, When Python 2.5 first came out, I eagerly downloaded it and immediately had issues with getting it to run my 2.4 code. So I just stuck to 2.4. However, I decided this week that I really should try to get 2.5 to work. Does anyone know why code that works perfectly for months in a 2.4 environmen

Re: Memory Leaks and Heapy

2008-01-04 Thread M.-A. Lemburg
On 2008-01-04 17:23, Yaakov Nemoy wrote: > On Jan 4, 2008 11:10 AM, M.-A. Lemburg <[EMAIL PROTECTED]> wrote: >> If you're using lots of small objects, you may be running into a >> problem with the Python memory allocation mechanism, pymalloc. It used >> to not return memory to the system. In Python

Re: how to use bool

2008-01-04 Thread bukzor
On Jan 3, 7:49 am, [EMAIL PROTECTED] wrote: > hi, i have some code where i set a bool type variable and if the value > is false i would like to return from the method with an error msg.. > being a beginner I wd like some help here > > class myclass: > . > def mymethod(self): >

Re: dictionary/hash and '1' versus 1

2008-01-04 Thread Stephen Hansen
> > > A single integer is distinctly different from a sequence of characters > in > > some encoding that may just happen to contain representations of a > > number so they'll hash differently :) > >Depends on the context. The machine encoding may be different, but > in human terms they

Re: how to use bool

2008-01-04 Thread Paul McGuire
On Jan 3, 10:09 am, [EMAIL PROTECTED] wrote: > > With my philosophical programming hat on the first thing I'd say (as a > fairly beginning python programmer) is "avoid multiple returns from a > function/method if at all possible".  They breed all sorts of problems > and errors, in particular if the

Re: How Does This Static Variable Work?

2008-01-04 Thread Victor Subervi
Thanks. I'll study that. Victor On Jan 4, 2008 12:34 PM, Neil Cerutti <[EMAIL PROTECTED]> wrote: > On Jan 4, 2008 10:17 AM, Victor Subervi <[EMAIL PROTECTED]> wrote: > > > Hi; > > I read this example somewhere, but I don't understand it <:-) Can > > someone please explain how static variables wor

Re: how to use bool

2008-01-04 Thread tinnews
Chris Mellon <[EMAIL PROTECTED]> wrote: > On 03 Jan 2008 16:09:53 GMT, <[EMAIL PROTECTED]> wrote: > > > > [EMAIL PROTECTED] wrote: > > > hi, i have some code where i set a bool type variable and if the value > > > is false i would like to return from the method with an error msg.. > > > being a be

Re: How Does This Static Variable Work?

2008-01-04 Thread Neil Cerutti
On Jan 4, 2008 10:17 AM, Victor Subervi <[EMAIL PROTECTED]> wrote: > Hi; > I read this example somewhere, but I don't understand it <:-) Can someone > please explain how static variables work? Or recommend a good how-to? > > > import random > > def randomwalk_static(last=[1]): # init the "static"

Re: Memory Leaks and Heapy

2008-01-04 Thread Christian Heimes
Jeroen Ruigrok van der Werven wrote: > Aside from that (rant), I seriously dislike Python's memory management and > even more the fairly arcane ways people have to go about > debugging/troubleshooting some 600 MB to 2-3 GB(!) of resident memory use by > Python. > > Personally I consider this the w

Re: Memory Leaks and Heapy

2008-01-04 Thread Yaakov Nemoy
On Jan 4, 2008 11:10 AM, M.-A. Lemburg <[EMAIL PROTECTED]> wrote: > If you're using lots of small objects, you may be running into a > problem with the Python memory allocation mechanism, pymalloc. It used > to not return memory to the system. In Python 2.5 (IIRC, could be > 2.6) this was changed t

Re: Memory Leaks and Heapy

2008-01-04 Thread Yaakov Nemoy
On Jan 4, 2008 10:34 AM, Jeroen Ruigrok van der Werven <[EMAIL PROTECTED]> wrote: > As various people pointed out to me: > http://wingolog.org/archives/2007/11/27/reducing-the-footprint-of-python-applications It did; it's what lead me to Heapy. > Aside from that (rant), I seriously dislike Python

Re: Memory Leaks and Heapy

2008-01-04 Thread M.-A. Lemburg
On 2008-01-04 16:07, Yaakov Nemoy wrote: > Hi list, > > Firstly, this is my first post here, so I hope I'm not breaking some > unwritten etiquette rule about asking questions involving several > different libraries. > > I'm trying to plug some memory leaks in a TurboGears program. We (the > Fedo

PyGTK, libglade, and signal_autoconnect

2008-01-04 Thread rocco . rossi
I was having a real hard time trying to accomplish something. I couldn't find a way to automatically connect the "close" button (clicked signal) of a GUI app I was working on, to the gtk.main_quit() function. I had entered this handler directly with the GLADE-3 designer (I DON'T WANT TO USE A DICTI

Re: Pivot Table/Groupby/Sum question

2008-01-04 Thread patrick . waldo
Petr thanks so much for your input. I'll try to learn SQL, especially if I'll do a lot of database work. I tried to do it John's way as en exercise and I'm happy to say I understand a lot more. Basically I didn't realize I could nest dictionaries like db = {country:{genre:{sub_genre:3}}} and cal

Re: What's the limit of variables size in pyhton?

2008-01-04 Thread Artur M. Piwko
In the darkest hour on Mon, 31 Dec 2007 20:53:28 -0200, Gabriel Genellina <[EMAIL PROTECTED]> screamed: >> Is that mean that i can deal with files with size more than 2GB only >> if the available memory allow > > To be more precise, that depends on the OS. On Windows there is a limit of > 2GB adr

RE: dictionary/hash and '1' versus 1

2008-01-04 Thread Reedick, Andrew
> From: Stephen Hansen [mailto:[EMAIL PROTECTED] > Sent: Thursday, January 03, 2008 7:39 PM > To: Reedick, Andrew > Cc: python-list@python.org > Subject: Re: dictionary/hash and '1' versus 1 > > > > Well one important thing to learn while learning Python is that while the > language is dynamical

Re: problem in importing .pyd

2008-01-04 Thread Jeroen Ruigrok van der Werven
-On [20080104 16:41], abhishek ([EMAIL PROTECTED]) wrote: >What should i do to resolve this problem. Perhaps the hints/tips from http://blogs.msdn.com/nikolad/articles/427101.aspx might help? -- Jeroen Ruigrok van der Werven / asmodai イェルーン ラウフロック ヴァン デル ウェルヴェン http://www.in-nomine.org/ | h

Re: choosing random dynamic port number

2008-01-04 Thread Grant Edwards
On 2008-01-04, Giampaolo Rodola' <[EMAIL PROTECTED]> wrote: >>     def GenerateDynamicPortNumber(): >>         return 0 >> >> (to get the actual number, use getsockname() on the socket after you've >> called "bind" on it) >> >> > > By using 0 as port number value you let kernel choose a free > un

problem in importing .pyd

2008-01-04 Thread abhishek
hello group , I have build a python c extension. Using python 2.5 , VS.Net 2005 on Win server 2003. But when i am trying to imort this .pyd file into python interperter or my project source code . Code compilation as well as interpreter fails. Resulting in c/c++ runtime error "R6034". The descri

Re: Memory Leaks and Heapy

2008-01-04 Thread Jeroen Ruigrok van der Werven
-On [20080104 16:11], Yaakov Nemoy ([EMAIL PROTECTED]) wrote: >I'm trying to plug some memory leaks in a TurboGears program. We (the >Fedora Project) have a few apps in Turbogears in infrastructure that >all seem to be running into the same issues in a variety of >configurations

Re: python interfaces

2008-01-04 Thread Michele Simionato
On Jan 4, 3:59 pm, hyperboreean <[EMAIL PROTECTED]> wrote: > Hi, > Probably it has been asked before, but I'll still ask. > Why doesn't python provide interfaces trough its standard library? Or it > was ever proposed to be included in the language? > Zope's implementation seems pretty flexible and

Re: Fortran to Python

2008-01-04 Thread Jeroen Ruigrok van der Werven
-On [20080104 15:56], Robin Becker ([EMAIL PROTECTED]) wrote: >you probably want to look at numpy an extension that handles lots of matrix >things with great ease. I think it now lives at http://scipy.org/ Yeah, I am aware of SciPy/NumPy, but aside from these two calls to do this inverse

Re: Details about pythons set implementation

2008-01-04 Thread Hrvoje Niksic
Achim Domma <[EMAIL PROTECTED]> writes: > I'm interested in details about how sets are implemented in python. > They seem to be quite fast and I found some remarks who state, that > the implementation is highly optimized. I need to implemented sets > in C/C++ and need a starting point on how to do

python interfaces

2008-01-04 Thread hyperboreean
Hi, Probably it has been asked before, but I'll still ask. Why doesn't python provide interfaces trough its standard library? Or it was ever proposed to be included in the language? Zope's implementation seems pretty flexible and straightforward. Thanks. -- http://mail.python.org/mailman/listin

How Does This Static Variable Work?

2008-01-04 Thread Victor Subervi
Hi; I read this example somewhere, but I don't understand it <:-) Can someone please explain how static variables work? Or recommend a good how-to? import random def randomwalk_static(last=[1]): # init the "static" var(s) rand = random.random() # init a candidate value if last[0] < 0.1: #

Re: Details about pythons set implementation

2008-01-04 Thread Neil Cerutti
On Jan 4, 2008 9:54 AM, Achim Domma <[EMAIL PROTECTED]> wrote: > Hi, > > I'm interested in details about how sets are implemented in python. > They seem to be quite fast and I found some remarks who state, that > the implementation is highly optimized. I need to implemented sets in > C/C++ and nee

Scales question

2008-01-04 Thread Eduardo Matus
Hi all... I want to represent a point in 800 X 600 board in a 640 X 480 board..., for example (13, 50) in 640X480 to 800X600 so.. will be like this... Xscale = (13 * 800)/640 Xscale = 16.25 Yscale = (50 * 600)/480 Yscale = 62.5 what happend with the decimals??? I round up or down??? or there is

Memory Leaks and Heapy

2008-01-04 Thread Yaakov Nemoy
Hi list, Firstly, this is my first post here, so I hope I'm not breaking some unwritten etiquette rule about asking questions involving several different libraries. I'm trying to plug some memory leaks in a TurboGears program. We (the Fedora Project) have a few apps in Turbogears in infrastructu

pexpect - not printing more than 80 columns

2008-01-04 Thread Maximilian N. Andrews
Dear All, I'm trying to write a script which will check the progress of my MD-simulations on a cluster. So far I've been able to ssh to each node and retrieve the data I was looking for by sending the command ""top -c -n 1|grep mdrun" with pexpect. Unfortunately the string I'm looking for is b

Re: how to build a dict including a large number of data

2008-01-04 Thread wanzathe
On 1月4日, 下午10时17分, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > wanzathe wrote: > > i have a binary file named test.dat including 960 records. > > the record format is int a + int b + int c + int d > > i want to build a dict like this: key=int a,int b values=int c,int d > > i choose using bsddb

Details about pythons set implementation

2008-01-04 Thread Achim Domma
Hi, I'm interested in details about how sets are implemented in python. They seem to be quite fast and I found some remarks who state, that the implementation is highly optimized. I need to implemented sets in C/C++ and need a starting point on how to do it right. Could somebody give me a starting

Re: Fortran to Python

2008-01-04 Thread Robin Becker
Jeroen Ruigrok van der Werven wrote: > -On [20080104 14:22], Jeroen Ruigrok van der Werven ([EMAIL PROTECTED]) wrote: >> What I wonder about, does anybody have a Fortran to Python conversion page >> somewhere to map some of the basic types to Python equivalents? > > Just

Re: Fortran to Python

2008-01-04 Thread Jeroen Ruigrok van der Werven
-On [20080104 14:22], Jeroen Ruigrok van der Werven ([EMAIL PROTECTED]) wrote: >What I wonder about, does anybody have a Fortran to Python conversion page >somewhere to map some of the basic types to Python equivalents? Just to share my own ideas: Seems COMPLEX*16/complex*16 ~= complex

Re: Who's to blame?

2008-01-04 Thread Nicola Musatti
On Jan 4, 3:12 pm, [EMAIL PROTECTED] wrote: [...] > I have sub-classed wx.Dialog to do my own custom modal dialogs as > well. You can use sizers and put whatever widgets you want onto it > that way. Just make sure that when you create the Yes/No buttons, you > give them the wx.ID_YES or wx.ID_NO id

relax

2008-01-04 Thread [EMAIL PROTECTED]
!guys make a brake see something really interesting and then heads again in: http://kavallaris.santorini.googlepages.com/ http://rooms.santorini.googlepages.com/ http://santorini.accommodation.googlepages.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Why python says "unexpected parameter 'mini.py'" for my code?

2008-01-04 Thread Nick Craig-Wood
oyster <[EMAIL PROTECTED]> wrote: > The following is my pure-python wxwidgets test. It is hardly pure python since it depends on wxWindows and ctypes... > It runs and give a frame, but soon python comes up to say > "unexpected parameter > 'mini.py'" and I have to close it. > I cannot find the

Re: Cursors in a Loop

2008-01-04 Thread Carsten Haese
On Fri, 2008-01-04 at 00:03 -0800, Chris wrote: > You should bind all variables to save the pool. > > cursor = connection.cursor() > cursor.executemany("""insert into as_siebel_hosts_temp > values (:whole, :lot, :of, :bind, :variables) >""" >

Re: how to build a dict including a large number of data

2008-01-04 Thread Fredrik Lundh
wanzathe wrote: > i have a binary file named test.dat including 960 records. > the record format is int a + int b + int c + int d > i want to build a dict like this: key=int a,int b values=int c,int d > i choose using bsddb and it takes about 140 seconds to build the dict. you're not buildin

Re: Strange varargs issue

2008-01-04 Thread Mike
You know, every once in a while, self really bites me. (I program in Java too much) Thanks for everyone who replied quickly. Mike wrote: >> [ a bunch of crap because I forgot self, nevermind sorry ] -- http://mail.python.org/mailman/listinfo/python-list

Re: Who's to blame?

2008-01-04 Thread kyosohma
On Jan 4, 3:35 am, Nicola Musatti <[EMAIL PROTECTED]> wrote: > Hallo, Mike. > First of all, thanks to both you and Rob for your answers. I now see > that the wxPython group would have been a better place to post to, all > the more so given the tight connection between the wxPython and > wxWidgets p

Re: pydepend (checking dependencies like jdepend) ?

2008-01-04 Thread Thomas Heller
Stefan Schukat schrieb: > No, py2exe does not display such information but has an algorithm to > collect such information. > Perhaps this is a starting point for you. If py2exe is run with the -x flag, it does display a cross-reference in a browser window. Thomas -- http://mail.python.org/mailm

Re: how to build a dict including a large number of data

2008-01-04 Thread Chris
On Jan 4, 3:57 pm, wanzathe <[EMAIL PROTECTED]> wrote: > hi everyone > i'm a newbie to python :) > i have a binary file named test.dat including 960 records. > the record format is int a + int b + int c + int d > i want to build a dict like this: key=int a,int b values=int c,int d > i choose u

Re: Strange varargs issue

2008-01-04 Thread Fredrik Lundh
Mike wrote: >__f.func(a) > TypeError: func() takes exactly 1 argument (2 given) > > How can this possibly be? The "caller" print statement obviously > shows "a" is singular. __f.func(a) is a method call, and methods always get the object itself as an extra initial argument. to fix this, a

Re: Strange varargs issue

2008-01-04 Thread Chris
On Jan 4, 3:45 pm, Mike <[EMAIL PROTECTED]> wrote: > I'm not sure if this is a bug or if I'm just not understanding > something correctly. I'm running the following (broken.py) on > ActivePython 2.5.1.1, based on Python 2.5.1 (r251:54863 5/1/2007) as > "python broken.py foo" (on Windows, of course

  1   2   >