ZODB 3.5.1 final released

2005-09-27 Thread Tim Peters
I'm pleased to announce the release of ZODB 3.5.1 final. This corresponds to the ZODB that will ship in Zope 3.1.0 final. You can download a source tarball or Windows installer from: http://zope.org/Products/ZODB3.5 Note that there are two Windows installers, for Python 2.3 (2.3.5 is

Re: Dynamic character substitution.

2005-09-27 Thread Tim Roberts
John Bausano [EMAIL PROTECTED] wrote: Hello all, I've been using Ansys which is a commercial FEA package which can be controlled through its own scripting language they call APDL. Now I'm trying to write some stand alone code in Python to supplement my current efforts. In Ansys I can do

Re: Dynamic character substitution.

2005-09-27 Thread Steve Jorgensen
On Mon, 26 Sep 2005 21:09:51 -0400, John Bausano [EMAIL PROTECTED] wrote: Hello all, ... Funny enough, some people have wanted to substitute a more dynamic character for me on occasion g. -- http://mail.python.org/mailman/listinfo/python-list

Re: What tools are used to write and generate Python Library documentation.

2005-09-27 Thread beza1e1
Do you think of pydoc? Just make comments in your code this way: def add10(x): this function adds ten to the given variable Then save this into add.py and now (in the same directory): pydoc add Voila, your documentation. -- http://mail.python.org/mailman/listinfo/python-list

Re: What tools are used to write and generate Python Library documentation.

2005-09-27 Thread Robert Kern
Kenneth McDonald wrote: I have a module I'd like to document using the same style... http://docs.python.org/doc/doc.html -- Robert Kern [EMAIL PROTECTED] In the fields of hell where the grass grows high Are the graves of dreams allowed to die. -- Richard Harter --

Re: ncurses programming

2005-09-27 Thread Sinan Nalkaya
thank you very much for your suggestions and links, also slang got my attention. thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP 350: Codetags

2005-09-27 Thread Bengt Richter
On Mon, 26 Sep 2005 15:35:21 -0700, Micah Elliott [EMAIL PROTECTED] wrote: 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

Re: Indexed variables

2005-09-27 Thread Magnus Lycka
[EMAIL PROTECTED] wrote: Hello, being an almost complete Python AND programming neophyte I would like to ask the following - very elementary, as I might suspect - question: How do I do the following flawed things right: a1=a2=0 def f(x): if x == a1: a1 = a1 + 1

Re: PEP 350: Codetags

2005-09-27 Thread Paul Rubin
[EMAIL PROTECTED] (Bengt Richter) writes: 2) In general, I think it might be good to meet Paul Rubin half way re convention vs syntax, but I don't think code tagging should be part of the language syntax per se. (-*- cookies -*- really are defacto source syntax that snuck in by disguise IMO)

Changing the module not taking effect in calling module

2005-09-27 Thread Gopal
Hi, I've a module report.py having a set of funtions to open/close/write data to a log file. I invoke these functions from another module script.py. Whenever I'm changing something in report.py, I'm running the file (however, it has not effect). After that I'm running script.py again. However,

Re: Self reordering list in Python

2005-09-27 Thread ABO
LRU caches are nice and simple, but if you want something fancier, with support for squid-like expiry models (ie, using mtime and atime to estimate a stale time, and IMS fetches), you can have a look at my GCache; http://minkirri.apana.org.au/~abo/projects/GCache Even if you don't want something

Re: Carrying variables over from function to function

2005-09-27 Thread Peter Otten
Bruno Desthuilliers wrote: 2/ functional solution: --- def make_funcs(): x = 0 def _abc(): x = 1 return x + 1 def _abcd(): return x + 1 return _abc, _abcd abc, abcd = make_funcs() print abc() print abcd() The x in

Re: Changing the module not taking effect in calling module

2005-09-27 Thread Juho Schultz
Gopal wrote: Hi, I've a module report.py having a set of funtions to open/close/write data to a log file. I invoke these functions from another module script.py. Whenever I'm changing something in report.py, I'm running the file (however, it has not effect). After that I'm running

Re: PEP 350: Codetags

2005-09-27 Thread Alexandre Fayolle
Le 27-09-2005, Paul http nous disait: Maybe the checking functions don't really belong in the compiler/interpreter. PyChecker might be a good home for them, if it's made part of the distro. There could be an interpreter flag to invoke PyChecker automatically. Just to make a quick note that

Re: Changing the module not taking effect in calling module

2005-09-27 Thread Mikael Olofsson
Gopal wrote: I've a module report.py having a set of funtions to open/close/write data to a log file. I invoke these functions from another module script.py. Whenever I'm changing something in report.py, I'm running the file (however, it has not effect). After that I'm running script.py

Re: Parametric Polymorphism

2005-09-27 Thread Catalin Marinas
Pierre Barbier de Reuille [EMAIL PROTECTED] wrote: Now suppose you have two classes A and B, B subclassing A. If you define : @method(A) def myfct(f): do_something_with_f Then, you want it to work with any object of type B ... but with either Guido's or this implementation, it won't !

Re: Telephony project

2005-09-27 Thread Roger
CheckOn is the working name for my project. Our church community has many elderly who are at home but close to assisted living placements. Many do not have family and rely on volunteer caretakers and lunch providers for their socialization. We are trying to make phone contact with

@staticmethod, backward compatibility?

2005-09-27 Thread Neal Becker
How can I write code to take advantage of new decorator syntax, while allowing backward compatibility? I almost want a preprocessor. #if PYTHON_VERSION = 2.4 @staticmethod ... Since python 2.4 will just choke on @staticmethod, how can I do this? --

Re: @staticmethod, backward compatibility?

2005-09-27 Thread Peter Hansen
Neal Becker wrote: How can I write code to take advantage of new decorator syntax, while allowing backward compatibility? I almost want a preprocessor. #if PYTHON_VERSION = 2.4 @staticmethod ... Since python 2.4 will just choke on @staticmethod, how can I do this? It seems to me

Re: @staticmethod, backward compatibility?

2005-09-27 Thread Laszlo Zsolt Nagy
Neal Becker wrote: How can I write code to take advantage of new decorator syntax, while allowing backward compatibility? I almost want a preprocessor. #if PYTHON_VERSION = 2.4 @staticmethod ... Since python 2.4 will just choke on @staticmethod, how can I do this? Decorators are there

Re: @staticmethod, backward compatibility?

2005-09-27 Thread Duncan Booth
Neal Becker wrote: How can I write code to take advantage of new decorator syntax, while allowing backward compatibility? I almost want a preprocessor. #if PYTHON_VERSION = 2.4 @staticmethod ... Since python 2.4 will just choke on @staticmethod, how can I do this? Here's one

Re: Carrying variables over from function to function

2005-09-27 Thread bruno modulix
Peter Otten wrote: Bruno Desthuilliers wrote: 2/ functional solution: --- def make_funcs(): x = 0 def _abc(): x = 1 return x + 1 def _abcd(): return x + 1 return _abc, _abcd abc, abcd = make_funcs() print abc() print abcd() The

Re: Metaclasses, decorators, and synchronization

2005-09-27 Thread Michael Ekstrand
On Tuesday 27 September 2005 00:22, Michele Simionato wrote: It is not that easy, but you can leverage on my decorator module which does exactly what you want: http://www.phyast.pitt.edu/~micheles/python/decorator.zip Excellent. Thank you :-). - Michael --

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

2005-09-27 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 Power

Spoiler to Python Challenge (help!!!)

2005-09-27 Thread Ian Vincent
Damn this is annoying me. I have a webpage with a BZ2 compressed text embedded in it looking like: 'BZh91AYSYA\xaf\x82\r\x00\x00\x01\x01\x80\x02\xc0\x02\x00 \x00!\x9ah3M \x07]\xc9\x14\xe1BA\x06\xbe\x084' Now, if I simply copy and paste this into Python and decompress it - it works a treat.

Python batching on XP

2005-09-27 Thread [EMAIL PROTECTED]
Hi ! I want to write a program that backup some databases in the night. Pseudo like this: try: if cmd('net stop dbservice'): s=c://backup'+str(time.time())+'.zip' if cmd('zipit c:\\database '+s): if cmd('map drive backupdrive\\c$ y -user BACKUP -pwd SECRET'): if

memoru usage of process

2005-09-27 Thread Jacek Popławski
I need to know how much memory uses child process (after subprocess.Popen), so I want function: get_memory_usage(pid) I found two ways: - call ps and analyze its output - this is not portable (different output on Linux, Cygwin and QNX) - use resource.getrusage - but it works for

Re: Python batching on XP

2005-09-27 Thread Larry Bates
You should take a look at the subprocess module http://www.python.org/dev/doc/devel/lib/module-subprocess.html -Larry Bates [EMAIL PROTECTED] wrote: Hi ! I want to write a program that backup some databases in the night. Pseudo like this: try: if cmd('net stop dbservice'):

WindowsError: stack overflow

2005-09-27 Thread hardieca
Hi, I'm developing a program that analyzes all the webpages on my webserver. I've created one class, Filewalker(), with a function that returns the paths of all ASP pages of interest as a list, which I then turn into a tuple. I then iterate over the tuple, passing each path to my Analyzer()

Re: Parametric Polymorphism

2005-09-27 Thread Jay Parlar
I haven't been following this whole thread, but it sounds like you want something like PJE's RuleDispatch package. There's a Developer Works article about it, put up very recently: http://www-128.ibm.com/developerworks/linux/library/l-cppeak2/?ca=dgr- lnxw02aScalingPEAK PJE (IIRC) based it

Re: Memory stats

2005-09-27 Thread gene tani
linux: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/286222 Martin v. Löwis wrote: 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,

Re: Memory stats

2005-09-27 Thread Tarek Ziadé
Martin v. Löwis wrote: 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

Re: Memory stats

2005-09-27 Thread Tarek Ziadé
gene tani wrote: linux: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/286222 Yes thanks I have found this one, I need to try it out, but it does not provide a way to refcount, Another solution could be to use trace maybe I am going to try things out Regards --

Re: Config parser module

2005-09-27 Thread qqcq6s59
wow, Thanks alex, this rocks really, [ i am new to OOP style in python] I am trying to implement it on similar lines, I`ll comeback if I encounter any trouble. thanks again -Jiro Paul McGuire wrote: [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi all I am a newbie and I just

Re: Telephony project

2005-09-27 Thread Mike
I was able to do something like this in Python a while back. You'll need one of: (a) A telephone line dialer/monitor DTMF I/O board that works through the serial port, and a phone audio tap that mixes the soundcard I/O to the phone (b) A TAPI-compliant modem that does everything you need (c) A

Python 2.4 under WinXP, free VC71 toolkit and VC6 libraries

2005-09-27 Thread Berthold Höllmann
I have wrapped some inhouse libraries for Python. The development team uses VC6 and DF6.1 for development of these libraries under WinXP. I would like to wrap the libraries for Python and use the official Win Python from python.org. Now I get a segmentation fault in (access violation in

Re: A 'find' utility that continues through zipped directory structure?

2005-09-27 Thread Fredrik Lundh
B Mahoney wrote: Is there a Python 'find' -like utility that will continue the file search through any zippped directory structure on the find path? something like this? # File: zipfind.py import fnmatch, os, sys, zipfile program, root, name = sys.argv for dirpath, dirnames, filenames in

Re: What is self?

2005-09-27 Thread Ron Adam
Diez B. Roggisch wrote: 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.)

Re: Dynamically adding and removing methods

2005-09-27 Thread Ron Adam
Steven D'Aprano wrote: On Sun, 25 Sep 2005 14:52:56 +, Ron Adam wrote: Steven D'Aprano wrote: Or you could put the method in the class and have all instances recognise it: py C.eggs = new.instancemethod(eggs, None, C) py C().eggs(3) eggs * 3 Why not just add it to the class directly?

Re: number of python users

2005-09-27 Thread Fredrik Lundh
Bryan wrote: just for fun, i looked at the top linux distros at distrowatch and looked at what version of python the latest released version is shipping with out of the box: 1. ubuntu hoary - python 2.4.1 2. mandriva 2005 - python 2.4 3. suse 9.3 - python 2.4 4. fedora core 4 - python

Re: A 'find' utility that continues through zipped directory structure?

2005-09-27 Thread B Mahoney
An effbot utility? I'll try that. Thank you -- http://mail.python.org/mailman/listinfo/python-list

Re: Telephony project

2005-09-27 Thread aaron
It will be much easier to use asterisk, there's a win32 version aterisk available but it does not support hardware phone, voip only. A clone FXO card only cost $15 on ebay. Roger [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I'm new to Python and need to do a (low level, I think)

Re: [Python-Dev] PEP 350: Codetags

2005-09-27 Thread Phillip J. Eby
At 03:35 PM 9/26/2005 -0700, Micah Elliott wrote: 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 http://www.python.org/peps/pep-0350.html.

Re: What is self?

2005-09-27 Thread Michael Spencer
Ron Adam wrote: What I've noticed is you can block the visibility of a class attribute, which include methods, by inserting an object in the instance with the same name. [snip example of this behavior] Yes, that's true for non-data descriptors (see last two bullets below) Raymond

installing cx_Oracle on Unix/Solaris

2005-09-27 Thread Steve
I'm posting this message here, so that someone googling here will be able to find it. I was having problems installing cx_Oracle on Solaris. The build would fail with a message: ld: fatal: file /apps/oracle/prod/9.2/lib/libclntsh.so: wrong ELF class: ELFCLASS64 I found the solution on Grig

Re: Memory stats

2005-09-27 Thread Stephen Kellett
In message [EMAIL PROTECTED], Tarek Ziadé [EMAIL PROTECTED] writes 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. Not a Python module, but Python Memory Validator may fit the bill.

Re: Memory stats

2005-09-27 Thread Fredrik Lundh
Tarek Ziadé wrote: If you want a list of all objects (container or not), you have to compile a debug build of Python. I am amazed not to find an existing implementation for this. the debug build is an existing implementation, of course. /F --

Problem SQL ADO

2005-09-27 Thread len
Using Python on WinXP going against MS SQL 2000 server. Connection is fine and I have executed several queries successfully. The following SQL statement however gives me an error and I have tried it several different ways: SELECT

Re: Python 2.4 under WinXP, free VC71 toolkit and VC6 libraries

2005-09-27 Thread F. Petitjean
Le Tue, 27 Sep 2005 17:48:47 +0200, Berthold Höllmann a écrit : I have wrapped some inhouse libraries for Python. How ? Directly coding C code ? The development team uses VC6 and DF6.1 for development of these libraries under WinXP. DF6.1 is Digital FORTRAN 6.1 ? I would like to wrap the

Re: PEP 350: Codetags

2005-09-27 Thread Tom Anderson
On Tue, 27 Sep 2005, Bengt Richter wrote: 5) Sometimes time of day can be handy, so maybe 2005-09-26 12:34:56 could be recognized? ISO 8601 suggests writing date-and-times like 2005-09-26T12:34:56 - using a T as the separator between date and time. I don't really like the look of it, but it

Re: [Python-Dev] PEP 350: Codetags

2005-09-27 Thread Bill Mill
On 9/27/05, Phillip J. Eby [EMAIL PROTECTED] wrote: At 03:35 PM 9/26/2005 -0700, Micah Elliott wrote: 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

Re: Self reordering list in Python

2005-09-27 Thread ABO
Actually, after posting this I did some more work on the PQueue modules I had, implementing both bisect and heapq versions. It turns out the bisect version is heaps faster if you ever delete or re-set values in the queue. The problem is heapq is O(N) for finding a particular entry in the Queue,

Re: Carrying variables over from function to function

2005-09-27 Thread Magnus Lycka
Ivan Shevanski wrote: Thanks for your quick responce Roy, thats exactly what I needed. =) No, it isn't! ;) It might seem like a good idea right now, but it's not a good choice in the long run. It's like peeing in bed: Initially it's both a relief and you get warm and cosy, but you'll end upp

Documenting properties

2005-09-27 Thread Lasse Vågsæther Karlsen
I notice that if I use this syntax: def classname: ... ## # closes the database connection and releases the resources. def close(self): ## # Returns a list of fields fields = property() then doing: help (classname) then the text is listed

Re: number of python users

2005-09-27 Thread Brett Hoerner
RHEL isn't really big on Distrowatch because Distrowatch is geared more towards users. RHEL 4.1 is using Python 2.3.4 now, btw. -- http://mail.python.org/mailman/listinfo/python-list

Re: Documenting properties

2005-09-27 Thread Paul McNett
Lasse Vågsæther Karlsen wrote: So, my question is, is there a way to get __doc__ support for properties, in effect, use the xxx syntax for documenting properties. Yes, the property() function accepts a doc argument, as in: property(fget, fset, fdel, doc) ex: MyProp = property(_get, _set,

Getting a number out of a string

2005-09-27 Thread ssmith579
I'm trying to extract single digit number from a string. t[1] = '06897' I want to get the 7, 9,8 6 seperated out to use but can't find a way to split out the single characters. Thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: Documenting properties

2005-09-27 Thread Gerrit Holl
Paul McNett wrote: Whatever is preferred, what's the upside/downsides of the two beyond what I just explained? Nothing really, but something handy to keep in mind is that the string literal (x) can be used to block out huge sections of code during testing, where you'd have to put a # in

Re: What tools are used to write and generate Python Library documentation.

2005-09-27 Thread Kenneth McDonald
Unfortunately, none of the documentation tools that use documentation strings are suitable for full, serious documentation. There are a number of reasons for this, and I'll touch on a few. The obvious one is that there is no standard format for docstrings, and this creates problems when

Re: Getting a number out of a string

2005-09-27 Thread jepler
You can index into a string: s = '06897' s[2] '8' You can also turn each character into an integer, in various ways: [int(c) for c in s] [0, 6, 8, 9, 7] map(int, s) [0, 6, 8, 9, 7] Jeff pgpDMq5e3RucB.pgp Description: PGP signature -- http://mail.python.org/mailman/listinfo/python-list

Re: Getting a number out of a string

2005-09-27 Thread Claudio Grondi
what about: lst = [digit for digit in '06897'] lst ['0', '6', '8', '9', '7'] Claudio [EMAIL PROTECTED] schrieb im Newsbeitrag news:[EMAIL PROTECTED] I'm trying to extract single digit number from a string. t[1] = '06897' I want to get the 7, 9,8 6 seperated out to use but can't find a

Re: Getting a number out of a string

2005-09-27 Thread Will McGugan
Claudio Grondi wrote: what about: lst = [digit for digit in '06897'] lst ['0', '6', '8', '9', '7'] Or.. list('06897') ['0', '6', '8', '9', '7'] Will McGugan -- http://www.willmcgugan.com .join({'*':'@','^':'.'}.get(c,0) or chr(97+(ord(c)-84)%26) for c in jvyy*jvyyzpthtna^pbz) --

Re: Spoiler to Python Challenge (help!!!)

2005-09-27 Thread Terry Reedy
Ian Vincent [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] line = line[20:] line = line[:-1] please, line = line[20:-1], etc, is easier to read and understand ;-) tjr -- http://mail.python.org/mailman/listinfo/python-list

Re: WindowsError: stack overflow

2005-09-27 Thread Terry Reedy
[EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I can get through about 1750 pages of 5000 before I get a WindowsError: stack overflow exception. Any ideas how I can keep the program chugging along? A typical source of stack overflow is recursion. Without seeing the code or

zlib decode fails with -5

2005-09-27 Thread Paul Watson
Traceback (most recent call last): File string, line 20, in ? File c:\Python24\lib\encodings\zlib_codec.py, line 43, in zlib_decode output = zlib.decompress(input) zlib.error: Error -5 while decompressing data The -5 error appears to be a Z_BUF_ERROR from looking at the manual at

Re: What tools are used to write and generate Python Librarydocumentation.

2005-09-27 Thread Fredrik Lundh
Kenneth McDonald wrote: More seriously, there is a major problem with docstrings in that they can only document something that has a docstring; classes, functions, methods, and modules. But what if I have constants that are important? The only place to document them is in the module

Re: Getting a number out of a string

2005-09-27 Thread ssmith579
Thanks all! This is just what I needed. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 2.4 under WinXP, free VC71 toolkit and VC6 libraries

2005-09-27 Thread Berthold Höllmann
F. Petitjean [EMAIL PROTECTED] writes: Le Tue, 27 Sep 2005 17:48:47 +0200, Berthold Höllmann a écrit : I have wrapped some inhouse libraries for Python. How ? Directly coding C code ? Depends :-) f2py, directly coding C, SWIG. The development team uses VC6 and DF6.1 for development of

How can I set the size of a window with tkinter?

2005-09-27 Thread Tor Erik Sønvisen
Hi I create a canvas that is to big for the default window-size, so it gets cut to fit... How can I increase the window-size to make sure the canvas fits? regards tores -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem SQL ADO

2005-09-27 Thread infidel
SELECT VA_MK_YEAR,VA_MK_DESCRIP,VO_VIN_NO,VO_MODEL,VO_BODY,VO_DESCRIPTION + \ FROM D014800 LEFT OUTER JOIN D014900 ON (VA_MK_NUMBER_VER = VO_MAKE_NO) AND (VA_MK_YEAR = VO_YEAR) + \ WHERE (((VA_MK_YEAR)=?) AND ((VA_MK_DESCRIP)=?) AND ((VO_MODEL)=?)) Doesn't look like you have a space

Re: How can I set the size of a window with tkinter?

2005-09-27 Thread Fredrik Lundh
Tor Erik Sønvisen wrote: I create a canvas that is to big for the default window-size, so it gets cut to fit... what default window size? what geometry management approach are you using? (if you're using pack or grid, your toplevel window should adapt itself to the canvas size, unless

sqlobject performance problems (really)

2005-09-27 Thread qvx
I'm writing a small project and I decided to try pysqlite. The database consists of one master table with five columns and two detail tables with one and two columns each (not counting foreign key columns). The program scans an input file and inserts data into those three tables. First I used

Re: How can I set the size of a window with tkinter?

2005-09-27 Thread James Stroud
You may want to read this scrollbar page: http://effbot.org/zone/tkinter-scrollbar-patterns.htm On Tuesday 27 September 2005 12:31, Tor Erik S�nvisen wrote: Hi I create a canvas that is to big for the default window-size, so it gets cut to fit... How can I increase the window-size to make

Re: Python 2.4 under WinXP, free VC71 toolkit and VC6 libraries

2005-09-27 Thread Benji York
Berthold Höllmann wrote: I'm sure ctypes doesnot work on Linux and Solaris, but my code has to. I've used ctypes to great effect on Linux. -- Benji York -- http://mail.python.org/mailman/listinfo/python-list

Re: memoru usage of process

2005-09-27 Thread MrJean1
On Linux, this may work for you http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/286222 /Jean Brouwers Jacek Poplawski wrote: I need to know how much memory uses child process (after subprocess.Popen), so I want function: get_memory_usage(pid) I found two ways: - call ps and

Re: What tools are used to write and generate Python Librarydocumentation.

2005-09-27 Thread Robert Kern
Fredrik Lundh wrote: Kenneth McDonald wrote: More seriously, there is a major problem with docstrings in that they can only document something that has a docstring; classes, functions, methods, and modules. But what if I have constants that are important? The only place to document them is in

Silly function call lookup stuff?

2005-09-27 Thread Lucas Lemmens
Dear pythonians, I've been reading/thinking about the famous function call speedup trick where you use a function in the local context to represent a remoter function to speed up the 'function lookup'. This is especially usefull in a loop where you call the function a zillion time they say.

Re: [Python-Dev] PEP 350: Codetags

2005-09-27 Thread Josiah Carlson
Phillip J. Eby [EMAIL PROTECTED] wrote: At 03:35 PM 9/26/2005 -0700, Micah Elliott wrote: 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)

Re: Silly function call lookup stuff?

2005-09-27 Thread Fredrik Lundh
Lucas Lemmens wrote: Why isn't the result of the first function-lookup cached so that following function calls don't need to do the function-lookup at all? And if the context changes (an import-statement say) reset the cached 'function-lookups'. import isn't the only way for the context to

Re: Silly function call lookup stuff?

2005-09-27 Thread Michael Spencer
Lucas Lemmens wrote: Dear pythonians, I've been reading/thinking about the famous function call speedup trick where you use a function in the local context to represent a remoter function to speed up the 'function lookup'. This is especially usefull in a loop where you call the function

__call__ in module?

2005-09-27 Thread ncf
I have a feeling that this is highly unlikely, but does anyone in here know if it's possible to directly call a module, or will I have to wrap it up in a class? i.e., import MyMod MyMod.whatever = Hi? MyMod(meow mix) Thanks in advance -Wes --

Re: What tools are used to write and generate Python Librarydocumentation.

2005-09-27 Thread Brett Hoerner
You get to spend all day in ipython? Can I have your job? -- http://mail.python.org/mailman/listinfo/python-list

Re: What tools are used to write and generate Python Library documentation.

2005-09-27 Thread Michael Ekstrand
On Sep 27, 2005, at 12:45 PM, Kenneth McDonald wrote: It's too bad that there is no equivalent of d'oxygen for Python. That is a _nice_ program. I've been using epydoc (http://epydoc.sourceforge.net) for a while now, and it's really nice. The output is very much in the style of Javadoc. Its

Re: __call__ in module?

2005-09-27 Thread Fredrik Lundh
ncf wrote. I have a feeling that this is highly unlikely, but does anyone in here know if it's possible to directly call a module no. /F -- http://mail.python.org/mailman/listinfo/python-list

Re: What tools are used to write and generate PythonLibrarydocumentation.

2005-09-27 Thread Fredrik Lundh
Robert Kern wrote: The one thing I dislike about PythonDoc is that it puts everything into comments and thus docstrings are usually neglected. teaser: from elementtree import ElementTree help(ElementTree) Help on module ElementTree: NAME ElementTree DESCRIPTION # ElementTree #

Re: What tools are used to write and generate Python Librarydocumentation.

2005-09-27 Thread Robert Kern
Brett Hoerner wrote: You get to spend all day in ipython? Can I have your job? Well, I use the terms work and day rather loosely. I'm a graduate student in geophysics. Somehow it rarely happens during daylight hours and quite possibly wouldn't be called working by an outside observer. --

Overhead of individual python apps

2005-09-27 Thread Qopit
I'm setting up a system that consists of several small python applications that all communicate amongst each other on the same pc. When running in Windows, launching each application generates a process, and each of those processes ends up taking up 4MB of system memory. This memory usage is as

Re: Silly function call lookup stuff?

2005-09-27 Thread Lucas Lemmens
On Tue, 27 Sep 2005 22:41:22 +0200, Fredrik Lundh wrote: Lucas Lemmens wrote: Why isn't the result of the first function-lookup cached so that following function calls don't need to do the function-lookup at all? And if the context changes (an import-statement say) reset the cached

Re: Silly function call lookup stuff?

2005-09-27 Thread Lucas Lemmens
On Tue, 27 Sep 2005 13:56:53 -0700, Michael Spencer wrote: Lucas Lemmens wrote: Dear pythonians, I've been reading/thinking about the famous function call speedup trick where you use a function in the local context to represent a remoter function to speed up the 'function lookup'. This

Re: [Python-Dev] PEP 350: Codetags

2005-09-27 Thread Michael
At 03:35 PM 9/26/2005 -0700, Micah Elliott wrote: 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 http://www.python.org/peps/pep-0350.html.

Re: __call__ in module?

2005-09-27 Thread Qopit
Nope - you can't even force it by binding a __call__ method to the module. For future reference, you can check to see what things *are* callable with the built-in function 'callable'. eg (with sys instead of MyApp): import sys callable(sys) False Also - a thing you can do to sort of do what

Re: Overhead of individual python apps

2005-09-27 Thread Mike Meyer
Qopit [EMAIL PROTECTED] writes: When running in Windows, launching each application generates a process, and each of those processes ends up taking up 4MB of system memory. This memory usage is as reported by the Windows Task manager for the python.exe image name. The first step is to

Re: PEP 350: Codetags

2005-09-27 Thread Terry Hancock
On Monday 26 September 2005 10:25 pm, Paul Rubin wrote: I really doubt you'll find much agreement for this (the compiler should enforce it) position. The 'fewer conventions are better' position might enjoy more support, but doesn't strike me as particularly Pythonic (e.g. compare

Re: What tools are used to write and generate Python Library documentation.

2005-09-27 Thread Terry Hancock
On Monday 26 September 2005 10:24 pm, Kenneth McDonald wrote: I have a module I'd like to document using the same style... Google for epydoc, pydoc, and happydoc. You've already received a comment about markup standards, although you will find more information at the web pages for the above

Re: PEP 350: Codetags

2005-09-27 Thread Terry Hancock
On Tuesday 27 September 2005 03:07 am, Paul Rubin wrote: [EMAIL PROTECTED] (Bengt Richter) writes: 2) In general, I think it might be good to meet Paul Rubin half way re convention vs syntax, but I don't think code tagging should be part of the language syntax per se. (-*- cookies -*-

Re: Spoiler to Python Challenge (help!!!)

2005-09-27 Thread Terry Hancock
On Tuesday 27 September 2005 08:32 am, Ian Vincent wrote: I have a webpage with a BZ2 compressed text embedded in it looking like: 'BZh91AYSYA\xaf\x82\r\x00\x00\x01\x01\x80\x02\xc0\x02\x00 \x00!\x9ah3M \x07]\xc9\x14\xe1BA\x06\xbe\x084' Now, if I simply copy and paste this into Python and

Human readable number formatting

2005-09-27 Thread Alex Willmer
When reporting file sizes to the user, it's nice to print '16.1 MB', rather than '16123270 B'. This is the behaviour the command 'df -h' implements. There's no python function that I could find to perform this formatting , so I've taken a stab at it: import math def human_readable(n, suffix='B',

Re: Getting a number out of a string

2005-09-27 Thread Steven D'Aprano
On Tue, 27 Sep 2005 20:28:53 +, Claudio Grondi wrote: what about: lst = [digit for digit in '06897'] lst ['0', '6', '8', '9', '7'] No need to use a list comprehension when this works just as well: py list('06897') ['0', '6', '8', '9', '7'] -- Steven. --

Re: __call__ in module?

2005-09-27 Thread Steven D'Aprano
On Tue, 27 Sep 2005 14:19:13 -0700, ncf wrote: I have a feeling that this is highly unlikely, but does anyone in here know if it's possible to directly call a module, or will I have to wrap it up in a class? Why not try it yourself? Write a quick module like this: Call a module def

Re: __call__ in module?

2005-09-27 Thread Leif K-Brooks
ncf wrote: I have a feeling that this is highly unlikely, but does anyone in here know if it's possible to directly call a module, or will I have to wrap it up in a class? You could use trickery with sys.modules to automatically wrap it in a class: import sys from types import ModuleType

  1   2   >