MemoryError Numarray

2005-09-26 Thread Bernhard Reimar Hoefle
I have the following python script: ### from numarray import * while 1: a=arange(1,3) b=a*100/100 del a del b ### This script crashes after a few minutes with an error: MemoryError: Co

Re: cannot write to file after close()

2005-09-26 Thread Reinhold Birkenfeld
Rainer Hubovsky wrote: > Thank you Reinhold, that was the solution. But just because I am curious: > what is this statement without the parentheses? After all it is a valid > statement... > > Rainer > > > In article <[EMAIL PROTECTED]>, Reinhold Birkenfeld wrote: >> Is the above exactly your c

Re: MemoryError Numarray

2005-09-26 Thread Robert Kern
Bernhard Reimar Hoefle wrote: > I have the following python script: > ### > from numarray import * > > while 1: > a=arange(1,3) > b=a*100/100 > del a > del b > ### > > This script crashes after

Re: Chronological Processing of Files

2005-09-26 Thread yoda
I've tried using the path module and it works like a *charm*.. plus my code is cleaner and clearer.. :) The list comprehension using os.stat() works well though I had to call an additional reverse() on the resultant list so that I could get the list in order of "newest first". So, in conclusion

Re: How to show percentage

2005-09-26 Thread Steve Holden
Steve Holden wrote: > Sen-Lung Chen wrote: > >>Dear All: >> I have a question of show percentage. >>For example ,I want to show the percentage of 1/3 = 33.33% >> >> I use the 1*100/3 = 33 >>it is 33 not 33.33 , how to show the 33.33 % >> Thanks >> > > You should by now know enough answers. The ea

never mind about the plot stuff, my mistake

2005-09-26 Thread nephish
hey, a little update. i got the pychart working the examples did not include the necessary #!/usr/bin/python its like being a literary critic forgetting how to spell his name. thanks for your help getting the deb package going. i should be all good now. sk -- http://mail.python.org/mailman/list

are variables local to try/except blocks ?

2005-09-26 Thread b_c_searle
# Is this valid (or is excp local only to try/except)? try: try: doSomething1 excp = 0 except: excp = 1 #endTry if (_excp_): doSomething1 # is excp defined here? excp = 0 except: excp = 1 #endTry if (excp): doSomething2 # is excp defined here? # val

Re: Sniffing Text Files

2005-09-26 Thread David Pratt
Hi Steven. Thank you for your detailed response. The code will be executed on a web server with limited memory so the desire to keep file loading in check. I like the approach you have suggested to score to give the best guess. It leaves it fairly modular in respect to how detailed you want to

Re: Carrying variables over from function to function

2005-09-26 Thread Ivan Shevanski
Thanks for your quick responce Roy, thats exactly what I needed. =) -Ivan _ On the road to retirement? Check out MSN Life Events for advice on how to get there! http://lifeevents.msn.com/category.aspx?cid=Retirement -- http://mai

Re: Would this be Guido's pen?

2005-09-26 Thread Giles Brown
Yeah and of course http://www.masterlock.com/promos/python/8413python_lock.shtml is Guido's security cable too. Giles -- http://mail.python.org/mailman/listinfo/python-list

Re: Parametric Polymorphism

2005-09-26 Thread Kay Schluehr
Catalin Marinas wrote: > Hi, > > Sorry if this was previously discussed but it's something I miss in > Python. I get around this using isinstance() but it would be cleaner > to have separate functions with the same name but different argument > types. I think the idea gets quite close to the Lisp/

window resize in PyGTK

2005-09-26 Thread Somesh
1. I have PyGTK 0.6 (Old GTK+ 1.2 stuff) 2. Created a main window with a Paned widget inside it. 3. I want it to resize the pane size along with resizing the main window. i couldnt get which event/signal to be trapped and how to get the length and width of window after resizing ... pl need some h

Re: Parametric Polymorphism

2005-09-26 Thread Catalin Marinas
"Kay Schluehr" <[EMAIL PROTECTED]> wrote: > Catalin Marinas wrote: >> Hi, >> >> Sorry if this was previously discussed but it's something I miss in >> Python. I get around this using isinstance() but it would be cleaner >> to have separate functions with the same name but different argument >> type

Re: Parametric Polymorphism

2005-09-26 Thread Pierre Barbier de Reuille
Kay Schluehr a écrit : > Catalin Marinas wrote: > >>Hi, >> >>Sorry if this was previously discussed but it's something I miss in >>Python. I get around this using isinstance() but it would be cleaner >>to have separate functions with the same name but different argument >>types. I think the idea g

how to use copy_reg/pickle (was Re: how to pickle unpicklable objects)

2005-09-26 Thread Guy Lateur
Thanks for the swift reply, Hans, and sorry for my delayed reaction. I've been looking at the copy_reg module, but I can't seem to get it to work. wx.Font has a method called GetNativeFontInfo(), which returns a string description of the font. Here's what I had hoped would have worked. [code]

Re: [RFC] Parametric Polymorphism

2005-09-26 Thread Catalin Marinas
Tom Anderson <[EMAIL PROTECTED]> wrote: > Is there any reason you have to stringify the type signature? Types > are hashable, so a tuple of types is hashable, so you can just use > that as a key. Replace "methods[f.func_name][str(types)] = f" with > "methods[f.func_name][types] = f" and "type_str =

Re: Simple Dialogs

2005-09-26 Thread neil . fraser
James Stroud wrote: > from tkMessageBox import showerror > showerror('Problem','Program Crashed before Starting') Here's a faster method, though not cross-platform: import ctypes ctypes.windll.user32.MessageBoxA(0, "Hello World", "Title", 0x00) -- http://mail.python.org/mailman/listinfo/python-

Re: Struggling with this concept please help

2005-09-26 Thread Diez B. Roggisch
George wrote: > Not allowed to use Beautiful Soup because of the very important built > ins that is provides that makes it very simple to complete this > problem. Not my choice . This is a review question for our final in two > months and I just want to get things going so I can try to understand >

Re: cElementTree clear semantics

2005-09-26 Thread Paul Boddie
Fredrik Lundh wrote: > well, for the record, I strongly recommend people to post questions in > public forums. I wasn't saying that such advice was wrong, though. I suppose the quality or responsiveness of advice is going to vary somewhat depending on a number of factors... > it's often a good id

Re: List of integers & L.I.S.

2005-09-26 Thread antonmuhin
Hellom n00m! I beg your pardon for not having replied for such long time---I was really busy. Yes, the posted code doesn't solve the supernumbers problem, but solves the problem you posted first as I understood it :) --- for each number find a position of this number in the longest sequence it be

good exercises for Beginner

2005-09-26 Thread Kanthi Kiran Narisetti
Hi ALL, I am new to programming and python. In my quest to get good at programming, even when I am able to get through the python tutorials I feel for lack of exercises & examples that emphasises the programming logic skills. The examples are just introduction to particular definition of the conce

Re: good exercises for Beginner

2005-09-26 Thread [EMAIL PROTECTED]
try this... http://www.awaretek.com/tutorials.html Cheers, pujo -- http://mail.python.org/mailman/listinfo/python-list

Re: good exercises for Beginner

2005-09-26 Thread Miki Tebeka
Hello Kanthi, > I would appreciate if any one provide me the resources to find such > exercise(irrespective of Programming language) , working on which would > help to build to skills in programming for problem solving which is > more critical. http://www.pythonchallenge.com/ HTH. --

Re: What is "self"?

2005-09-26 Thread Diez B. Roggisch
> This still seems not quite right to me... Or more likely seems to be > missing something still. > > (But it could be this migraine I've had the last couple of days > preventing me from being able to concentrate on things with more than a > few levels of complexity.) > > Playing around with

Re: Most direct way to strip unoprintable characters out of a string?

2005-09-26 Thread Diez B. Roggisch
Steve Bergman wrote: > Fredrik Lundh wrote: > >> ("sanitizing" HTML data by running filters over encoded 8-bit data is >> hardly >> ever the right thing to do...) >> >> >> >> > I'm very much open to suggestions as to the right way to do this. I'm > working on this primarily as a learning proj

Re: good exercises for Beginner

2005-09-26 Thread Roberto De Almeida
Twenty one nice problems: http://blogs.pragprog.com/cgi-bin/pragdave.cgi/Practices/Kata -- http://mail.python.org/mailman/listinfo/python-list

Re: sorting tuples...

2005-09-26 Thread Magnus Lycka
[EMAIL PROTECTED] wrote: > I edited my code earlier and came up with stringing the groups > (200501202010, sender, message_string) into one string delimited by > '%%%'. Why? It seems you are trying to use a string as some kind of container, and Python has those in the box. Just use a list of tuple

Re: Module import via sys.path and py2exe

2005-09-26 Thread flupke
flupke wrote: > I forgot to add that if i check the shared.lib py2exe creates, the > program1 dir and subdirs/files are there so they are included in the > package. > > Benedict Hi, i solved it by adding the same import statement to the py2exe setup.py script as in my code: import sys sys.

number of python users

2005-09-26 Thread Bryan
is there a rough estimate somewhere that shows currently how many python 1.5 vs 2.2 vs 2.3 vs 2.4 users there are? have a majority moved to 2.4? or are they still using 2.3? etc... thanks, bryan -- http://mail.python.org/mailman/listinfo/python-list

ncurses programming

2005-09-26 Thread Sinan Nalkaya
hi, i want to use ncurses library in python i`ve found proper library for that, PyNcurses. then i searched for some documentation about ncurses programming, i only found that web site ; http://www.tldp.org/HOWTO/NCURSES-Programming-HOWTO/ this howto is nice but seems to me, this is for experience

extending and embedding python without distutils

2005-09-26 Thread Benjamin Rutt
I have a rather large C++ project which has his own build system (scons) and I would prefer to stay inside scons in order to build some python extensions/embeddings (that is, I prefer to avoid using distutils directly to build my extensions). Can someone confirm that I'm doing the right thing to p

Accesing Global variables in python

2005-09-26 Thread Pankaj
Hi All,      I have a service written in python (on Apache 2.0) which Initializes the global variables (or objects) when request comes for it. I want to use the same objects (or varaibles) in the subsequent requests. How could this one be done in Apache 2.0? can it be done by doing some co

Accesing Global variables in multiple Requests (Apache 2.0)

2005-09-26 Thread Pankaj Gupta
Hi All,      I have a service written in python (on Apache 2.0) which Initializes the global variables (or objects) when request comes for it. I want to use the same objects (or varaibles) in the subsequent requests. How could this one be done in Apache 2.0? can it be done by doing some configura

Re: Simple Dialogs

2005-09-26 Thread Grant Edwards
On 2005-09-26, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > James Stroud wrote: >> from tkMessageBox import showerror >> showerror('Problem','Program Crashed before Starting') > > Here's a faster method, though not cross-platform: > > import ctypes > ctypes.windll.user32.MessageBoxA(0, "Hello Wor

Re: number of python users

2005-09-26 Thread Fredrik Lundh
Bryan wrote: > is there a rough estimate somewhere that shows currently how many python 1.5 > vs > 2.2 vs 2.3 vs 2.4 users there are? have a majority moved to 2.4? or are they > still using 2.3? etc... Here are current PIL download statistics (last 10 days): 75.6% /downloads/PIL-1.1.5.win32

Re: number of python users

2005-09-26 Thread Scott David Daniels
Bryan wrote: > is there a rough estimate somewhere that shows currently how many python > 1.5 vs 2.2 vs 2.3 vs 2.4 users there are? have a majority moved to 2.4? > or are they still using 2.3? etc... > > thanks, > bryan I'd bet the majority is still using 2.3: * 2.3 has been around a very l

Re: number of python users

2005-09-26 Thread Grant Edwards
On 2005-09-26, Bryan <[EMAIL PROTECTED]> wrote: > is there a rough estimate somewhere that shows currently how many python 1.5 > vs > 2.2 vs 2.3 vs 2.4 users there are? have a majority moved to 2.4? or are they > still using 2.3? etc... My guess is most are still using 2.3. The last time I lo

how to implement propertyPage using wxPyhton?

2005-09-26 Thread James Hu
Hi, gurus,   I would like to implement something like propertyPage (VC++ term) Ie. There are a few tabs in the  top, clicking any tab will display a different panel. I searched on the Internet, couldn’t get any clue.   Thanks in advance.   James -- http://mail.python.org/mail

Determine type of a socket

2005-09-26 Thread Tor Erik S�nvisen
Hi How can I determine the type of a socket (TCP or UDP) object? regards tores -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple Dialogs

2005-09-26 Thread Thorsten Kampe
* [EMAIL PROTECTED] (2005-09-23 23:39 +0100) > James Stroud wrote: >> from tkMessageBox import showerror >> showerror('Problem','Program Crashed before Starting') > > Thanks. That works great when interpreted (though a blank window seems > to open as well). Unfortunately it still takes 40 second

Re: How to decompile an exe file compiled by py2exe?

2005-09-26 Thread Chris Lambacher
On Sat, Sep 24, 2005 at 09:29:30PM +0800, Leo Jay wrote: > Thanks for all of your replies. > > but my problem is not how to decompile .pyo or .pyc files. Eventually that is what the problem will become. hjparser.exe is a python interpreter that runs a python module that it extracts from itself.

Re: [RFC] Parametric Polymorphism

2005-09-26 Thread Donn Cave
In article <[EMAIL PROTECTED]>, Catalin Marinas <[EMAIL PROTECTED]> wrote: ... > Of course, duck-typing is simple to use but the parametric > polymorphism is useful when the types are unrelated. Let's say you > want to implement a colour-print function which should support basic > types like ints

Re: how to implement propertyPage using wxPyhton?

2005-09-26 Thread Steve Holden
James Hu wrote: > Hi, gurus, > > > > I would like to implement something like propertyPage (VC++ term) > > Ie. There are a few tabs in the top, clicking any tab will display a > different panel. > > I searched on the Internet, couldn’t get any clue. > I think you're looking for the wx.Note

Re: Question about smtplib, and mail servers in general.

2005-09-26 Thread Christos Georgiou
On Tue, 20 Sep 2005 16:48:41 +0200, rumours say that Piet van Oostrum <[EMAIL PROTECTED]> might have written: >And most smtp servers that I know also pass mail from any from-address to >any to-address if the IP number of he client machine belongs to a trusted >range (usually the range that belongs

Re: Determine type of a socket

2005-09-26 Thread Peter Hansen
Tor Erik Sønvisen wrote: > How can I determine the type of a socket (TCP or UDP) object? In what context? Do you have some code that gets passed a socket object but it could have been created with either SOCK_STREAM or SOCK_DGRAM? And you want a way of determining by looking just at the object

Re: Question about smtplib, and mail servers in general.

2005-09-26 Thread Christos Georgiou
On Wed, 21 Sep 2005 07:50:26 +0100, rumours say that Steve Holden <[EMAIL PROTECTED]> might have written: >I agree that there's an element of the moral imperative in my assertion >that the mails "should" go through which is largely ignored by the real >world nowadays. Some ISPs force you to use

Re: Simple Dialogs

2005-09-26 Thread Steve Holden
Grant Edwards wrote: > On 2005-09-26, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > >>James Stroud wrote: >> >>>from tkMessageBox import showerror >>>showerror('Problem','Program Crashed before Starting') >> >>Here's a faster method, though not cross-platform: >> >>import ctypes >>ctypes.windll.u

Re: Simple Dialogs

2005-09-26 Thread Grant Edwards
On 2005-09-26, Steve Holden <[EMAIL PROTECTED]> wrote: from tkMessageBox import showerror showerror('Problem','Program Crashed before Starting') >>> >>>Here's a faster method, though not cross-platform: >>> >>>import ctypes >>>ctypes.windll.user32.MessageBoxA(0, "Hello World", "Title", 0x0

Re: Shed Skin Python-to-C++ Compiler 0.0.3 Release: some fixes, 3 MB Windows package

2005-09-26 Thread cmkl
I'va got a trojan message by my virus scanner trying to download the 0.03 exe-file. Something to worry about? Carl Mark Dufour schrieb: > Hi all, > > Thanks to the people trying out Shed Skin 0.0.2 and letting me know > about several problems they encountered. I have released an updated > versio

Re: [RFC] Parametric Polymorphism

2005-09-26 Thread Bengt Richter
On Sun, 25 Sep 2005 09:30:30 +0100, Catalin Marinas <[EMAIL PROTECTED]> wrote: >Hi, > >Sorry if this was previously discussed but it's something I miss in >Python. I get around this using isinstance() but it would be cleaner >to have separate functions with the same name but different argument >ty

Re: Determine type of a socket

2005-09-26 Thread Reinhold Birkenfeld
Peter Hansen wrote: > Tor Erik Sønvisen wrote: >> How can I determine the type of a socket (TCP or UDP) object? > > In what context? Do you have some code that gets passed a socket object > but it could have been created with either SOCK_STREAM or SOCK_DGRAM? > And you want a way of determining

Re: Getting tired with py2exe

2005-09-26 Thread Thomas Heller
Bugs <[EMAIL PROTECTED]> writes: > Any luck on finding anyone to take over py2exe development Thomas? > It's a GREAT project and would be a shame to see it fall into > obsolescence. No, nobody stepped up (yet). Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: ncurses programming

2005-09-26 Thread ncf
I don't know too much about (n)curses, but I feel that it's worth pointing out that Python has a (built-in?) module named `curses` that supports ncurses as of Python version 1.6. I don't think it'd be necessary to learn how to use ncurses in C first, though. The Python docs for the curses module i

Re: ncurses programming

2005-09-26 Thread ncf
I don't know too much about (n)curses, but I feel that it's worth pointing out that Python has a (built-in?) module named `curses` that supports ncurses as of Python version 1.6. I don't think it'd be necessary to learn how to use ncurses in C first, though. The Python docs for the curses module i

PyDev 0.9.8.2 released

2005-09-26 Thread Fabio Zadrozny
Hi All, PyDev - Python IDE (Python Development Enviroment for Eclipse) version 0.9.8.2 has been released. Check the homepage (http://pydev.sourceforge.net/) for more details. Details for Release: 0.9.8.2 Major highlights: * Content assistants reviewed (and better

Need to pass Object by value into a list

2005-09-26 Thread Aaron
I have a data sructure setup and I populate it in a loop like so: y=0 while X: DS.name = "ASDF" DS.ID = 1234 list[y] = DS; y = y + 1 print list This does not work because DS is passed in by reference causing all entries into the list to change to the most current value. I cannot fi

Re: Need to pass Object by value into a list

2005-09-26 Thread Fredrik Lundh
Aaron wrote: > I have a data sructure setup and I populate it in a loop like so: > > y=0 > while X: >DS.name = "ASDF" >DS.ID = 1234 > >list[y] = DS; >y = y + 1 > > print list > > This does not work because DS is passed in by reference causing all > entries into the list to change t

Re: CRC16

2005-09-26 Thread Tuvas
I should probably have mentioned that my code is just 6 bytes long, we send an 8 byte data packet with 2 bytes CRC. There's a CRC poly of 0x1021. Still having a bit of problems, but it's coming, thanks for the help! -- http://mail.python.org/mailman/listinfo/python-list

Re: ncurses programming

2005-09-26 Thread Torsten Bronger
Hallöchen! "ncf" <[EMAIL PROTECTED]> writes: > [...] > > Py Docs: http://docs.python.org/lib/module-curses.html This document suggests that Python+ncurses won't work on windows. What's the reason for this? Tschö, Torsten. -- Torsten Bronger, aquisgrana, europa vetusICQ 264-296-6

Re: ncurses programming

2005-09-26 Thread Grant Edwards
On 2005-09-26, Sinan Nalkaya <[EMAIL PROTECTED]> wrote: > hi, i want to use ncurses library in python i`ve found proper > library for that, PyNcurses. then i searched for some > documentation about ncurses programming, i only found that web > site ; http://www.tldp.org/HOWTO/NCURSES-Programming-HO

build problems on AIX

2005-09-26 Thread ersher
I'm having trouble building Python 2.4.1 on AIX 5. I've built/installed tcl/tk under ~/local, added ~/local/lib to my $LD_LIBRARY_PATH, and set $LDFLAGS and $CPPFLAGS appropriately. I'm still getting the following errors: ./Modules/ld_so_aix cc_r -bI:Modules/python.exp \ -L/home/me/local/l

Re: Determine type of a socket

2005-09-26 Thread Peter Hansen
Reinhold Birkenfeld wrote: > Peter Hansen wrote: >>Tor Erik Sønvisen wrote: >>>How can I determine the type of a socket (TCP or UDP) object? >>Let's see... what looks good here? >> >> >>> u._sock >> >> >>> t._sock >> >> >>Maybe that type field? > > Heh. The type field isn't publicly accessible (y

The ^ operator

2005-09-26 Thread Tuvas
What exactly does the ^ operator do? I've seen, for example, that 3^4=7, 3^5=8. but 3^3=0. Is it just adding them together if they are not equal, and if they are equal, outputs 0, or what? Thanks! -- http://mail.python.org/mailman/listinfo/python-list

Re: Getting tired with py2exe

2005-09-26 Thread Bugs
What do you think of the idea of putting both py2exe AND py2app under the same umbrella? I don't know what the status of py2app is or who maintains it but I was thinking that it would be ideal if the 2 utilities could share code, ideas, protocols, etc. Seems like this synergy and consistency

Telephony project

2005-09-26 Thread Roger
I'm new to Python and need to do a (low level, I think) telephony project ( POTS, all local calling) in WinXp. 1. Fetch phone number from my ASCII data. 2. Dial (always a local number) phone (through USRobotics 56K? ). 3. Ask @3 questions to called phone number. Y/N Y/N Y/N 4. Save ans

Re: The ^ operator

2005-09-26 Thread Peter Hansen
Tuvas wrote: > What exactly does the ^ operator do? I've seen, for example, that > 3^4=7, 3^5=8. but 3^3=0. Is it just adding them together if they are > not equal, and if they are equal, outputs 0, or what? Thanks! It performs an "exclusive-OR" (XOR) operation on the binary data corresponding to

Re: The ^ operator

2005-09-26 Thread Tuvas
Thanks alot! That sure makes lots of sense! -- http://mail.python.org/mailman/listinfo/python-list

Re: The ^ operator

2005-09-26 Thread Steve Holden
Tuvas wrote: > What exactly does the ^ operator do? I've seen, for example, that > 3^4=7, 3^5=8. but 3^3=0. Is it just adding them together if they are > not equal, and if they are equal, outputs 0, or what? Thanks! > ^ is the "bit XOR" operation. It treats its left and right operands as binary

Re: ncurses programming

2005-09-26 Thread Mike Meyer
Torsten Bronger <[EMAIL PROTECTED]> writes: > Hallöchen! > > "ncf" <[EMAIL PROTECTED]> writes: > >> [...] >> >> Py Docs: http://docs.python.org/lib/module-curses.html > > This document suggests that Python+ncurses won't work on windows. > What's the reason for this? Could it be that ncurses doe

Python Programming

2005-09-26 Thread David Edwards
I've got a short, simple Python script that is supposed to read a midi file and produce a text file of note and volume information, then render that info in another program. Unfortunately, I can't get it to work, so I was wondering if anyone is skilled enough to rewrite the script to read and rend

Re: Telephony project

2005-09-26 Thread Paul Rubin
"Roger" <[EMAIL PROTECTED]> writes: > 1. Fetch phone number from my ASCII data. > 2. Dial (always a local number) phone (through USRobotics 56K? ). > 3. Ask @3 questions to called phone number. Y/N Y/N Y/N > 4. Save answers to ASCII file. > 5. Say 'Thanks', hang up. > Repeat till eo

Plotting points to screen

2005-09-26 Thread Jason
If I'm wanting to plot points to the screen (nothing fancy at all for the moment), would you recommend PyGame, PyOpenGL or PIL? Like I said, it's nothing complicated, no flashing wotsits or 3d quad-linear vertexes with bi-linear real-time shading, just simple 'points' a few lines or circles and

Re: ncurses programming

2005-09-26 Thread Grant Edwards
On 2005-09-26, Mike Meyer <[EMAIL PROTECTED]> wrote: [...] >>> Py Docs: http://docs.python.org/lib/module-curses.html >> >> This document suggests that Python+ncurses won't work on windows. >> What's the reason for this? > > Could it be that ncurses doesn't work on Windows? At least, it > didn't

Re: Best practices for dynamically loading plugins at startup

2005-09-26 Thread Jack Diederich
On Sun, Sep 25, 2005 at 11:24:04PM +0200, Christoph Haas wrote: > Dear coders... > > I'm working on an application that is supposed to support "plugins". > The idea is to use the plugins as packages like this: > > Plugins/ > __init__.py > Plugin1.py > Plugin2.py > Plugin3.py > > When the

Re: Proposal: add sys to __builtins__

2005-09-26 Thread Tom Anderson
On Sun, 25 Sep 2005, James Stroud wrote: > I'm into *real* purity. I would rather begin every script: > > from python import list, str, dict, sys, os > > Oh wait. I only use dict in less than 50% of my scripts: > > from python import list, str, sys, os > > That's better. What? How exactly is th

Re: ncurses programming

2005-09-26 Thread Grant Edwards
On 2005-09-26, Grant Edwards <[EMAIL PROTECTED]> wrote: > On 2005-09-26, Mike Meyer <[EMAIL PROTECTED]> wrote: > [...] Py Docs: http://docs.python.org/lib/module-curses.html >>> >>> This document suggests that Python+ncurses won't work on windows. >>> What's the reason for this? >> >> Could

Re: Plotting points to screen

2005-09-26 Thread Fredrik Lundh
Jason wrote: > Like I said, it's nothing complicated, no flashing wotsits or 3d > quad-linear vertexes with bi-linear real-time shading, just simple > 'points' a few lines or circles and nothing more. all UI toolkits can do that. just pick one, and read up on the graphics API. for Tkinter, you

Re: Accesing Global variables in python

2005-09-26 Thread Terry Reedy
> I have a service written in python (on Apache 2.0) which This is an exact duplicate of the same posting under the subject 'Accesing Global variables in multiple Requests (Apache 2.0)' Let's put any substantive responses under that one. -- http://mail.python.org/mailman/listinfo/python-list

Re: Accessing class variable at class creation time

2005-09-26 Thread Dave Hansen
On 23 Sep 2005 14:01:21 -0700, "Carlos" <[EMAIL PROTECTED]> wrote: >Hi! > >class A: > X = 2 > def F(): >print A.X > F() > >The above fails because the name A is not >yet at global scope when the reference A.X Maybe I'm missing something. Python 2.4.1#65 under Win32 Idle 1.1.1 gives me the

Re: Metaclasses, decorators, and synchronization

2005-09-26 Thread Tom Anderson
On Mon, 26 Sep 2005, Jp Calderone wrote: > On Sun, 25 Sep 2005 23:30:21 -0400, Victor Ng <[EMAIL PROTECTED]> wrote: >> You could do it with a metaclass, but I think that's probably overkill. >> >> It's not really efficient as it's doing test/set of an RLock all the >> time, but hey - you didn't a

Re: Getting tired with py2exe

2005-09-26 Thread Thomas Heller
> Thomas Heller wrote: >> Bugs <[EMAIL PROTECTED]> writes: >> >>>Any luck on finding anyone to take over py2exe development Thomas? >>>It's a GREAT project and would be a shame to see it fall into >>>obsolescence. >> No, nobody stepped up (yet). >> Thomas Bugs <[EMAIL PROTECTED]> writes: > What d

Re: ncurses programming

2005-09-26 Thread Torsten Bronger
Hallöchen! Grant Edwards <[EMAIL PROTECTED]> writes: > On 2005-09-26, Mike Meyer <[EMAIL PROTECTED]> wrote: > [...] Py Docs: http://docs.python.org/lib/module-curses.html >>> >>> This document suggests that Python+ncurses won't work on windows. >>> What's the reason for this? >> >> Could i

Debugging callbacks?

2005-09-26 Thread brucedickey
Title: Debugging callbacks? Hi All, I have a Python app that receives CORBA callbacks in Linux. I post a msg to the GUI and am having refresh issues with some GTK controls in wxPython. The Python-specific question is -- I have tried to set a breakpoint inside the event handler in the GUI,

Re: Plotting points to screen

2005-09-26 Thread jay graves
I've used both pygame and PIL for this in the past. (i'm plotting a non-standard 3d data format from a in-house app) Pygame was nice because I put a key handler in to reload the file and do a little zooming/panning and when I wanted to save a particular plot I would just use a screen capture progr

Re: Would this be Guido's pen? [OT]

2005-09-26 Thread Terry Reedy
"Dennis Lee Bieber" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > http://www.empirepens.com/signum_python.html "Each cap in this series is hand covered with genuine python." Am I to understand that they actually mean real python skin, as opposed to a 'genuine' python skin des

Re: PyDev 0.9.8.2 released

2005-09-26 Thread Alacrite
Anyone know how to get IPython to display properly when using it as an external tool? It will display nothing and give no feedback until output of some kind then it will do it all at once. Love the plug-in though! thanks Fabio -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Programming

2005-09-26 Thread Michael Ekstrand
On Sep 26, 2005, at 1:46 PM, David Edwards wrote: > I've got a short, simple Python script that is > supposed to read a midi file and produce a text file > of note and volume information, then render that info > in another program. > > Unfortunately, I can't get it to work, so I was > wondering if

Re: Plotting points to screen

2005-09-26 Thread Jason
jay graves wrote: > I've used both pygame and PIL for this in the past. (i'm plotting a > non-standard 3d data format from a in-house app) > Pygame was nice because I put a key handler in to reload the file and > do a little zooming/panning and when I wanted to save a particular plot > I would jus

Re: Metaclasses, decorators, and synchronization

2005-09-26 Thread Michael Ekstrand
On Sep 26, 2005, at 2:16 PM, Tom Anderson wrote: > You could define a meta-lock, and use that to protect the > lock-installation action. Something like this (not yet tested): import threading global_lock = threading.Lock() def synchronized(meth): def inner(self, *args, **kwargs):

Re: Plotting points to screen

2005-09-26 Thread Fredrik Lundh
Jay wrote: > One question, that's twice in as many days that someone has said "YMMV". > > What's it mean!? http://www.google.com/search?q=acronym+ymmv -- http://mail.python.org/mailman/listinfo/python-list

RE: Plotting points to screen

2005-09-26 Thread Michael . Coll-Barth
Jason, YMMV = Your Mileage May Vary In other words, how well it works for you depends on a lot of things. You need to determine the suitability for a given task. :) Michael Don't like the legal notice at the end of my email? Too bad, you can stuff it where the sun don't shine. -O

Re: Need to pass Object by value into a list

2005-09-26 Thread Bruno Desthuilliers
Aaron a écrit : > I have a data sructure setup and I populate it in a loop like so: > > y=0 > while X: >DS.name = "ASDF" >DS.ID = 1234 >list[y] = DS; >y = y + 1 > > print list Traceback (most recent call last): File "", line 1, in ? File "/usr/tmp/python-9150sSF", line 2,

Dr. Dobb's Python-URL! - weekly Python news and links (Sep 26)

2005-09-26 Thread Diez B. Roggisch
QOTW: "This is Open Source. If you want an initiative, start one." -- Rheinold Birkenfeld "I've found jython incredibly helpful in learning java." -- pythonUser_07 The fourth annual "Free Software and Open Source Symposium" hosted by Canada's largest college includes a talk on "Python P

Re: Carrying variables over from function to function

2005-09-26 Thread Bruno Desthuilliers
Ivan Shevanski a écrit : > Alright heres my problem. . .Say I want to carry over a variable from > one function to another or even another run of the same function. Is > that possible? Heres a quick example of what I'm talking about. > > def abc(): >x = 1 >y = x + 1 >print y > > def

Re: Best practices for dynamically loading plugins at startup

2005-09-26 Thread Christoph Haas
On Sun, Sep 25, 2005 at 11:33:03PM -0400, Jeff Schwab wrote: > I recently came up against this exact problem. My preference is to have > the plugin writer call a method to register the plugins, as this allows > him the most control. Something along these lines: > > class A_plugin(Plugin)

Re: Metaclasses, decorators, and synchronization

2005-09-26 Thread Scott David Daniels
Michael Ekstrand wrote: > Something like this (not yet tested): > > import threading > global_lock = threading.Lock() > def synchronized(meth): > def inner(self, *args, **kwargs): > try: > self._sync_lock.acquire() > except AttributeError: > global_lock.

Re: Metaclasses, decorators, and synchronization

2005-09-26 Thread Michael Ekstrand
On Sep 26, 2005, at 4:21 PM, Scott David Daniels wrote: > Unnecessarily holding a lock while acquiring another can be a nasty > source of deadlock or at least delay. Another source of problems is > holding a lock because an exception skipped past the release code. I had thought of part of that af

Re: Memory stats

2005-09-26 Thread Martin v. Löwis
Tarek Ziadé wrote: > I am trying to find a general memory profiler that can measure the > memory usage in Python program > and gather some stats about object usages, and things like that. As Diez says, use gc: gc.getobjects() gives you all container objects. If you want a list of all objects (cont

PEP 350: Codetags

2005-09-26 Thread Micah Elliott
Please read/comment/vote. This circulated as a pre-PEP proposal submitted to c.l.py on August 10, but has changed quite a bit since then. I'm reposting this since it is now "Open (under consideration)" at . Thanks! -- Micah Elliott PEP: 350 Title: C

attribute error

2005-09-26 Thread M.N.A.Smadi
HI; I am having the following error. I am using someone else's code and all they are doing is pass an argv to a function then def execute_action(manager, argv): method_name = argv.pop(0).lower() and am getting this strange error. AttributeError: 'str' object has no attribute 'pop' am us

  1   2   >