Re: Questions about remembering and caching function arguments

2007-11-11 Thread thebjorn
On Nov 12, 1:05 am, "Anand Patil" <[EMAIL PROTECTED]> wrote: > Hi all, > > I have two questions about a class, which we'll call MyWrapperClass, > in a package to which I'm contributing. > > 1) MyWrapperClass wraps functions. Each instance has an attribute > called 'value' and a method called 'eval'

Re: how to know if folder contents have changed

2007-11-11 Thread Marc 'BlackJack' Rintsch
On Sun, 11 Nov 2007 21:03:33 -0800, [EMAIL PROTECTED] wrote: > one scheme suggested was to create a string from the names of sorted > image files and give it as the cache name.. > ie ,if i have one.jpg,three.jpg,new.jpg , > i will name the cache as 'newonethree.cache' and everytime i want to >

how to know if folder contents have changed

2007-11-11 Thread [EMAIL PROTECTED]
hi i am trying to create a cache of digitized values of around 100 image files in a folder..In my program i would like to know from time to time if a new image has been added or removed from the folder.. one scheme suggested was to create a string from the names of sorted image files and give it

Re: Populating a dictionary, fast

2007-11-11 Thread Istvan Albert
On Nov 11, 11:51 am, Michael Bacarella <[EMAIL PROTECTED]> wrote: > and see it take about 45 minutes with this: > > $ cat cache-keys.py > #!/usr/bin/python > v = {} > for line in open('keys.txt'): > v[long(line.strip())] = True On my system (windows vista) your code (using your data) runs

The Python Papers Monograph Series (TPPM): Call for Proposals

2007-11-11 Thread Maurice LING
The editorial committee of The Python Papers (ISSN 1834-3147) calls for proposals for The Python Papers Monograph Series. Potential authors should contact the editors at [EMAIL PROTECTED] at an early stage of preparation. We await your indications of interests. Regards Maurice Ling Associate E

The Python Papers Monograph Series (TPPM): Call for Proposals

2007-11-11 Thread Maurice LING
The editorial committee of The Python Papers (ISSN 1834-3147) calls for proposals for The Python Papers Monograph Series. Potential authors should contact the editors at [EMAIL PROTECTED] at an early stage of preparation. We await your indications of interests. Regards Maurice Ling Associate E

Re: security code whit python

2007-11-11 Thread Wildemar Wildenburger
Ahh, crap! Wildemar Wildenburger wrote: > [EMAIL PROTECTED] wrote: >> have you got any example?pls :S >> > I suggest you learn to use internet search. And if you already know it, > please use it before asking that. 10 seconds of search (!) and I had: > Make that 2 seconds: > http://www.google.de

Re: Pyzzle development?

2007-11-11 Thread John Salerno
Dennis Lee Bieber wrote: > On Sun, 11 Nov 2007 00:30:28 -0500, John Salerno > <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: > >> Does anyone happen to know what's going on with the development of the >> Pyzzle engine (for creating Myst-like games with Python)? Seems stalled >>

Questions about remembering and caching function arguments

2007-11-11 Thread Anand Patil
Hi all, I have two questions about a class, which we'll call MyWrapperClass, in a package to which I'm contributing. 1) MyWrapperClass wraps functions. Each instance has an attribute called 'value' and a method called 'eval', which calls the wrapped function. An instance D that depends on instan

RE: python - an eggs...

2007-11-11 Thread bruce
Hi Diez... I've never used setuptools, (it's not on the box) and i don't have easy_install tools installed... But in looking at your output, I have some questions... -The 1st, I'm assuming that easy_install works with python2.4.3? -The 2nd, In the output, is see the durus egg... with the "durus"

Re: security code whit python

2007-11-11 Thread Wildemar Wildenburger
[EMAIL PROTECTED] wrote: > I have setuped pyx i wonder i have mistake? > You need a running TeX/LaTeX system for pyx. Sorry, forgot about that. Also, I suggest you follow Scotts advice in reading http://www.catb.org/~esr/faqs/smart-questions.html>. If you're really looking for a way to generate

Re: Extended date and time

2007-11-11 Thread John Machin
On Nov 11, 2:37 am, Jeremy Sanders wrote: > Hi - I need to add support to a program for dates and times. The built-in > Python library seems to be okay for many purposes, but what I would like > would be Unix epoch style times (seconds relative to some date), covering a > large period from the pas

Re: security code whit python

2007-11-11 Thread Wildemar Wildenburger
[EMAIL PROTECTED] wrote: > have you got any example?pls :S > I suggest you learn to use internet search. And if you already know it, please use it before asking that. 10 seconds of search (!) and I had: http://www.google.de/search?hl=de&q=pil%20python%20examples&btnG=Google-Suche&meta=> and fro

Re: get java class loader within pathon

2007-11-11 Thread Diez B. Roggisch
Diez B. Roggisch schrieb: > blueblueblue2005 schrieb: >> Hi, I have a java application with a UI compoennt of >> FlyoutPaletteComposite (an GEF class), this UI compoennt displays a >> scrollbar when needed. I am writing a Jython/Python script, and within >> this script, I want to grab the scrollbar

Re: get java class loader within pathon

2007-11-11 Thread Diez B. Roggisch
blueblueblue2005 schrieb: > Hi, I have a java application with a UI compoennt of > FlyoutPaletteComposite (an GEF class), this UI compoennt displays a > scrollbar when needed. I am writing a Jython/Python script, and within > this script, I want to grab the scrollbar and move the bar up and down >

Re: python - an eggs...

2007-11-11 Thread Diez B. Roggisch
bruce schrieb: > Hi Diez > > Forgot to mention, that when I did an unzip of the egg file, and placed the > files in the ../python2.4/site-packages/durus dir, it still crashed... > > it's as if the egg file is needed... I doubt that. And I get the feeling that you did not read anything belon

Information manager/organizer with tags question.

2007-11-11 Thread andrei . avk
Hello, I would like to write an information manager/organizer type of app but first I'd like to ask if there is something like that already existing. I asked on yahoo questions but did not get a response. I also searched freshmeat but even though they have plenty of projects that are tangentially

get java class loader within pathon

2007-11-11 Thread blueblueblue2005
Hi, I have a java application with a UI compoennt of FlyoutPaletteComposite (an GEF class), this UI compoennt displays a scrollbar when needed. I am writing a Jython/Python script, and within this script, I want to grab the scrollbar and move the bar up and down to a specified location. I was told

Re: Extended date and time

2007-11-11 Thread D.Hering
On Nov 11, 4:46 pm, "D.Hering" <[EMAIL PROTECTED]> wrote: > On Nov 10, 10:37 am, Jeremy Sanders > I also have trouble with date/times with whats available. Off the top > of my head... converting a numpy array of epochs to some datetime > object and back. > > If I had the time I'd contribute additi

Re: Populating a dictionary, fast

2007-11-11 Thread Ben Finney
DouhetSukd <[EMAIL PROTECTED]> writes: > Ah, well, just noticed Ben's suggested this already. Mind you, his > code, while correct in intent, does look a bit fishy (missing those > square brackets) By "missing those square brackets", what would be a list comprehension (allocating an entire list i

Re: Extended date and time

2007-11-11 Thread D.Hering
On Nov 10, 10:37 am, Jeremy Sanders wrote: > Hi - I need to add support to a program for dates and times. The built-in > Python library seems to be okay for many purposes, but what I would like > would be Unix epoch style times (seconds relative to some date), covering a > large period from the pa

Re: Looking for a good Python environment

2007-11-11 Thread Paul Rubin
Russell Warren <[EMAIL PROTECTED]> writes: > Wing now has multi-threaded debugging. Cool, is it windows-only? I'm using Linux. > A quick look at the current state of SPE shows that it now has multi- > threaded debugging via WinPDB (what I used to use for debugging thread > issues). Interesting.

Re: Looking for a good Python environment

2007-11-11 Thread Russell Warren
> While we're at it, do any of these debuggers implement a good way to > debug multi-threaded Python programs? Wing now has multi-threaded debugging. I'm a big Wing (pro) fan. To be fair, when I undertook my huge IDE evaluation undertaking it was approx 2 years ago... at the time as far as what

Re: Trouble with subprocess.call(...) and zsh script (OSError: [Errno 8] Exec format error)

2007-11-11 Thread Rob Wolfe
Michael George Lerner <[EMAIL PROTECTED]> writes: > Hi, > > (Python 2.5, OS X 10.4.10) > I have a program called pdb2pqr on my system. It is installed so that > "pdb2pqr" is in my path and looks like: > > #\!/bin/zsh -f Are you sure that this shebang is correct? I've tested that on bash and hav

RE: python - an eggs...

2007-11-11 Thread bruce
Hi Diez Forgot to mention, that when I did an unzip of the egg file, and placed the files in the ../python2.4/site-packages/durus dir, it still crashed... it's as if the egg file is needed... thanks -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Die

Re: Populating a dictionary, fast

2007-11-11 Thread Ricardo Aráoz
Michael Bacarella wrote: >>> This would seem to implicate the line id2name[id] = name as being > excruciatingly slow. >> As others have pointed out there is no way that this takes 45 >> minutes.Must be something with your system or setup. >> >> A functionally equivalent code for me runs in about 4

Re: Extended date and time

2007-11-11 Thread Colin J. Williams
Adam Pletcher wrote: > The "time" module in the standard library does epoch, and conversions. > > Get current local time in seconds since epoch (1970): > >> >> import time >> >> now_secs = time.time() >> >> print now_secs > 1194790069.33 > > Convert to a struct_time object for conversions: >

Re: easy 3D graphics for rendering geometry?

2007-11-11 Thread Scott David Daniels
Scott David Daniels wrote: > gsal wrote: >> On Nov 10, 11:13 am, Scott David Daniels <[EMAIL PROTECTED]> >> wrote: >>> Well, what kind of computer, what version of everything (OS, Python, >>> VPython), what display card, >> >> Windows XP Professional >> Version 2002, Service Pack 2 >> 1.4GHz,

Re: Avoid newline at the end

2007-11-11 Thread Florian Lindner
Steven D'Aprano wrote: > On Sun, 11 Nov 2007 11:22:19 +0100, Florian Lindner wrote: > >> Hello, >> I have a piece of code like that: >> >> for row in resultSet: >> logs += "/home/%s/%s/log/access.log \n" % (row[1], row[0]) >> logs += "/home/%s/%s/log/error.log \n" % (row[1],

Re: Avoid newline at the end

2007-11-11 Thread Paul Rubin
Florian Lindner <[EMAIL PROTECTED]> writes: > for row in resultSet: > logs += "/home/%s/%s/log/access.log \n" % (row[1], row[0]) > logs += "/home/%s/%s/log/error.log \n" % (row[1], row[0]) # <-- def logfile_path(name, row): return "/home/%s/%s/log/%s " % (row[1], row[0], n

which tool to use?

2007-11-11 Thread Brian Blais
Hello, I'm looking for a system for managing submissions of proposals, with multiple parts, and possible updating of those parts by the user (so it needs some basic version control). There has to be some sort of permissions enforcement, to distinguish submitters from committee members re

Re: Populating a dictionary, fast

2007-11-11 Thread Marc 'BlackJack' Rintsch
On Sun, 11 Nov 2007 08:51:37 -0800, Michael Bacarella wrote: >> As others have pointed out there is no way that this takes 45 >> minutes.Must be something with your system or setup. >> >> A functionally equivalent code for me runs in about 49 seconds! >> (it ends up using about twice as much ram a

Re: python - an eggs...

2007-11-11 Thread Diez B. Roggisch
bruce schrieb: > Hi Diez... > > In my case, I do a "python setup.py install" and i get a Durus...egg > installed in the /usr/lib/python2.4/site-packages/ dir... As I understand > it, this egg/file contains compressed pythonic files. > > When I run the app which uses the durus stuff... the app cra

Re: Populating a dictionary, fast

2007-11-11 Thread Alberto Berti
> "Michael" == Michael Bacarella <[EMAIL PROTECTED]> writes: >> > This would seem to implicate the line id2name[id] = name as >> being Michael> excruciatingly slow. >> >> As others have pointed out there is no way that this takes 45 >> minutes.Must be something with y

Re: Populating a dictionary, fast

2007-11-11 Thread Arkanes
Michael Bacarella wrote: > You can download the list of keys from here, it's 43M gzipped: > http://www.sendspace.com/file/9530i7 > > and see it take about 45 minutes with this: > > $ cat cache-keys.py > #!/usr/bin/python > v = {} > for line in open('keys.txt'): > v[long(line.strip())] =

"No backend servers available" using httplib

2007-11-11 Thread miked
i am trying to access printing templates from avery.com and i get a message from the nsapi plugin:no backend server available.can you help me? -- http://mail.python.org/mailman/listinfo/python-list

Re: Populating a dictionary, fast

2007-11-11 Thread Michael Bacarella
> > I tried your code (with one change, time on feedback lines) and got the > > same terrible > > performance against my data set. > > > > To prove that my machine is sane, I ran the same against your generated >> sample file and got _excellent_ performance. Start to finish in under a minute.

Re: Populating a dictionary, fast

2007-11-11 Thread Michael Bacarella
> > This would seem to implicate the line id2name[id] = name as being excruciatingly slow. > > As others have pointed out there is no way that this takes 45 > minutes.Must be something with your system or setup. > > A functionally equivalent code for me runs in about 49 seconds! > (it ends up usi

Re: security code whit python

2007-11-11 Thread Piet van Oostrum
> "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> (oc) wrote: >oc> thank you >oc> but it said """ >oc> Traceback (most recent call last): >oc> File "", line 1, in >oc> c.text(0, 0, "Hello, world!") >oc> File "C:\web\apache\python\lib\pyx\canvas.py", line 309, in text >oc> return self.inse

RE: python - an eggs...

2007-11-11 Thread bruce
Hi Diez... In my case, I do a "python setup.py install" and i get a Durus...egg installed in the /usr/lib/python2.4/site-packages/ dir... As I understand it, this egg/file contains compressed pythonic files. When I run the app which uses the durus stuff... the app crashes, and displays the durus

Re: Populating a dictionary, fast

2007-11-11 Thread Istvan Albert
On Nov 11, 11:25 am, Michael Bacarella <[EMAIL PROTECTED]> wrote: > I tried your code (with one change, time on feedback lines) and got the > same terrible > performance against my data set. > To prove that my machine is sane, I ran the same against your generated > sample file and got _excellen

Re: Python iPod challenge

2007-11-11 Thread josetokyo
Hi guys,.. thanks for your thoughtful comments... as Alan says, its just a linguistic experiment... it seems the problem you guys found appears... when combining Windows OS and MSIE... (apologies... m_._m ) Dont know how to fix it .(I am a begginer...) if some soul wanna help out

Re: Populating a dictionary, fast

2007-11-11 Thread Michael Bacarella
Firstly, thank you for all of your help so far, I really appreciate it. > > So, you think the Python's dict implementation degrades towards O(N) > > performance when it's fed millions of 64-bit pseudo-random longs? > > No. Yes. I tried your code (with one change, time on feedback lines) and go

Re: easy 3D graphics for rendering geometry?

2007-11-11 Thread Scott David Daniels
gsal wrote: > On Nov 10, 11:13 am, Scott David Daniels <[EMAIL PROTECTED]> > wrote: >> Well, what kind of computer, what version of everything (OS, Python, >> VPython), what display card, > > Windows XP Professional > Version 2002, Service Pack 2 > 1.4GHz, 512MB > > ATI MOBILITY RADEON 9000

Re: Populating a dictionary, fast

2007-11-11 Thread Istvan Albert
On Nov 10, 4:56 pm, Michael Bacarella <[EMAIL PROTECTED]> wrote: > This would seem to implicate the line id2name[id] = name as being > excruciatingly slow. As others have pointed out there is no way that this takes 45 minutes.Must be something with your system or setup. A functionally equivalen

Re: Populating a dictionary, fast

2007-11-11 Thread Michael Bacarella
> Steven D'Aprano wrote: > > (2) More memory will help avoid paging. If you can't get more memory, try > > more virtual memory. It will still be slow, but at least the operating > > system doesn't have to try moving blocks around as much. > > Based on his previous post, it would seem he has 7GB

Re: Populating a dictionary, fast

2007-11-11 Thread DouhetSukd
Ah, well, just noticed Ben's suggested this already. Mind you, his code, while correct in intent, does look a bit fishy (missing those square brackets), so don't dismiss it just because you had trouble running it (or mine). Definitely worth a try and I'd be curious to know if it makes a differenc

Trouble with subprocess.call(...) and zsh script (OSError: [Errno 8] Exec format error)

2007-11-11 Thread Michael George Lerner
Hi, (Python 2.5, OS X 10.4.10) I have a program called pdb2pqr on my system. It is installed so that "pdb2pqr" is in my path and looks like: #\!/bin/zsh -f /sw/share/pdb2pqr/pdb2pqr.py "$@" When I call it via this script: #!/usr/bin/env python import subprocess import tempfile args = ('/sw/bin/

Re: Populating a dictionary, fast

2007-11-11 Thread Alberto Berti
> "Steven" == Steven D'Aprano <[EMAIL PROTECTED]> writes: Steven> $ time ./slurp_dict.py Starting at Sun Nov 11 14:26:51 Steven> 2007 Line 0 Line 100 Line 200 Line 300 Line Steven> 400 Line 500 Line 600 Line 700 Line Steven> 800 Items in dict: 81

Re: Populating a dictionary, fast

2007-11-11 Thread DouhetSukd
On Nov 11, 7:35 am, Michael Bacarella <[EMAIL PROTECTED]> wrote: > Tried that already. No difference. :( Not sure if it would make a difference, and it would imply re- organizing your preceding lines, but what about doing the dictionary build in one go, rather than incrementally? Using the dict

Re: Populating a dictionary, fast

2007-11-11 Thread Michael Bacarella
> - Original Message > From: Paul Rubin > To: python-list@python.org > Sent: Sunday, November 11, 2007 12:45:44 AM > Subject: Re: Populating a dictionary, fast > > Michael Bacarella <[EMAIL PROTECTED]> writes: > > If only it were so easy. > > I think I know wh

Re: Global variables within classes.

2007-11-11 Thread uestc_mahui
On 11 10 , 10 01 , Donn Ingle <[EMAIL PROTECTED]> wrote: > > > def pop(self): > > item = self.list[-1] > > del self.list[-1] > > return item > > Is there some reason you do all that and not a self.list.pop(0)? > Hi. There are no special reasons I do it that way. Just

Re: security code whit python

2007-11-11 Thread Scott David Daniels
[EMAIL PROTECTED] wrote: > On 10 Kas m, 23:57, Wildemar Wildenburger > I have setuped pyx i wonder i have mistake? So far you seem to be treating this group as a free help desk for a program you have paid thousands of dollars for. See http://www.catb.org/~esr/faqs/smart-questions.html You'

RE: Extended date and time

2007-11-11 Thread Adam Pletcher
The "time" module in the standard library does epoch, and conversions. Get current local time in seconds since epoch (1970): >>> import time >>> now_secs = time.time() >>> print now_secs 1194790069.33 Convert to a struct_time object for conversions: >>> now_struct = time.localtime(now_secs)

Re: Python Extension Building Network

2007-11-11 Thread kyosohma
On Nov 10, 11:03 pm, Yu-Xi Lim <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > Hi, > > > I am trying to get a small group of volunteers together to create > > Windows binaries for any Python extension developer that needs them, > > much like the package/extension builders who volunteer th

Re: Portrait of a "real life" __metaclass__

2007-11-11 Thread Mark Shroyer
On 2007-11-11, Jonathan Gardner <[EMAIL PROTECTED]> wrote: >> There isn't much difference between >> >> match_calendar_month(2007, 11, message) >> >> and >> >> m = CalendarMonthMatcher(2007, 11) >> m.match(message) > > Yes, there isn't a world of difference between the two. But there > is a w

Re: python - an eggs...

2007-11-11 Thread Diez B. Roggisch
bruce schrieb: > Hi... > > I have a python script/app that i'm dealing with. It uses Durus, which > installs as an egg. > > I'm trying to figure out how to modify any of the underlying source files or > the egg, short of modifying the original source file, and then having to > reinstall the egg v

Re: Avoid newline at the end

2007-11-11 Thread Steven D'Aprano
On Sun, 11 Nov 2007 11:22:19 +0100, Florian Lindner wrote: > Hello, > I have a piece of code like that: > > for row in resultSet: > logs += "/home/%s/%s/log/access.log \n" % (row[1], row[0]) > logs += "/home/%s/%s/log/error.log \n" % (row[1], row[0]) # <-- > > Now I want to

Re: Python iPod challenge

2007-11-11 Thread Alan Franzoni
Il Thu, 08 Nov 2007 08:11:27 -0600, Tim Chase ha scritto: > I had similar problems. Additionally, that's pretty unpythonic > code, as the "correct" answer would be something like That's true, but you should remember it's a linguistic experiment, not a Python programming contest. The task is n

why ctypes+dll gives a strange result

2007-11-11 Thread oyster
you can download the files at http://www.newsmth.net/att.php?s.284.38015.655.zip the dll and exe are created by freebasic import ctypes mydll=ctypes.windll.LoadLibrary("mydll.dll") _TwoTimes=getattr(mydll,'[EMAIL PROTECTED]') _TwoTimes.argtypes=[ctypes.c_double] def TwoTimes(i): return _T

Re: Avoid newline at the end

2007-11-11 Thread Paul Hankin
On Nov 11, 10:22 am, Florian Lindner <[EMAIL PROTECTED]> wrote: > Hello, > I have a piece of code like that: > > for row in resultSet: > logs += "/home/%s/%s/log/access.log \n" % (row[1], row[0]) > logs += "/home/%s/%s/log/error.log \n" % (row[1], row[0]) # <-- > > Now I want to

Avoid newline at the end

2007-11-11 Thread Florian Lindner
Hello, I have a piece of code like that: for row in resultSet: logs += "/home/%s/%s/log/access.log \n" % (row[1], row[0]) logs += "/home/%s/%s/log/error.log \n" % (row[1], row[0]) # <-- Now I want to avoid the newline at the last iteration and only at the second line. How to d

HI I AM VIVEK

2007-11-11 Thread [EMAIL PROTECTED]
http://www.anrdoezrs.net/ click-2701385-10313598"> http://www.tqlkg.com/image-2701385-10313598"; width="600" height="300" alt="Search FastWeb see Green!" border="0"/> http://www.jdoqocy.com/ click-2701385-10484777"> http://www.tqlkg.com/image-2701385-10484777"; width="160" height="600" alt="Want