ANN: xmlrpcserver 0.99.1

2005-08-16 Thread Julien Oster
I am pleased to announce the initial release of xmlrpcserver 0.99.1, an XML-RPC server module on top of xmlrpclib. xmlrpcserver is a simple to use but fairly complete XML-RPC server module for Python, implemented on top of the standard module xmlrpclib. This module may, for example, be used in

Albatross 1.32 released

2005-08-16 Thread Andrew McNamara
OVERVIEW Albatross is a small toolkit for developing highly stateful web applications. The toolkit has been designed to take a lot of the pain out of constructing intranet applications although you can also use Albatross for deploying publicly accessed web applications. In slightly more than

Re: COM access sooo slow !?

2005-08-16 Thread Do Re Mi chel La Si Do
Hi ! I use a COM server, made with Python Win32all (PyWin32). The speed of function's call is : 5 seconds, for 100 000 calls. Only the first call is slow (due to time to load Python...) Config : W-XP, P.2.4.1, 1.6 GHz, 512MB RAM @-salutations sorry for my bad english Michel Claveau --

Re: get a list of mounted filesystems under MacOSX

2005-08-16 Thread garabik-news-2005-05
rafi [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: Hi all, I am trying to port my (linux) program to MacOSX, and I need to get a list of mounted filesystems. Under linux, it was easy, I was parsing /etc/mtab (or /proc/mounts), this works also on some other unices. But I have no idea how

Albatross 1.32 released

2005-08-16 Thread Andrew McNamara
OVERVIEW Albatross is a small toolkit for developing highly stateful web applications. The toolkit has been designed to take a lot of the pain out of constructing intranet applications although you can also use Albatross for deploying publicly accessed web applications. In slightly more than

Re: How to build Python modules on windows?

2005-08-16 Thread .
Hi, how can I build python modules on windows? I tried to build numarray[0] using Microsoft Visual C++ 2003 Toolkit, but got the following error: --- error: Python was built with version 7.1 of Visual Studio, and extensions need to be built with the same version of the compiler, but it isn't

Re: Library vs Framework (was Dr. Dobb's Python-URL!)

2005-08-16 Thread Simon Brunning
On 8/15/05, Terry Hancock [EMAIL PROTECTED] wrote: On Monday 15 August 2005 09:54 am, Simon Brunning wrote: If you call its code, it's a library. If it calls yours, it's a framework. Such concision deserves applause. ;-) Thank you. ;-) As others have pointed out, this is a *drastic*

Re: zlib + Windows 32 service problem (ImportError)

2005-08-16 Thread Laszlo Zsolt Nagy
vincent wehren wrote: Laszlo Zsolt Nagy [EMAIL PROTECTED] schrieb im Newsbeitrag news:[EMAIL PROTECTED] | Sorry, I realized that the import zlib was not executed from my | (working) service. | So here is the question: why can't I use zlib from a win32 service? Is | there any way to make it

Re: Decline and fall of scripting languages ?

2005-08-16 Thread Paul Rubin
[EMAIL PROTECTED] (Bengt Richter) writes: built-in concurrency support. OCaml seems to crush Haskell and Erlang (and even Java) in performance. Occam isn't used for much practical any more, but takes a purist approach to concurrency that seems worth studying. IIRC, I've seen something about

Re: Decline and fall of scripting languages ?

2005-08-16 Thread Paul Rubin
Paul Rubin http://[EMAIL PROTECTED] writes: So I think a (maybe not achievable) performance goal is for the web app to use 50% of the available cycles making html, and the other 50% go to gzipping the html. That means that the app should make dynamic output as fast as gzip can compress it,

keeping a ref to a non-member function in a class

2005-08-16 Thread Gregory Bond
I'm building a class hierarchy that needs to keep as a class variable a reference to a (non-member) function, so that different subclasses can use different generator functions. But it seems Python is treating the function as a member function because the reference to it is in class scope

Re: Replacement for keyword 'global' good idea? (e.g. 'modulescope' or 'module' better?)

2005-08-16 Thread Antoon Pardon
Op 2005-08-06, Mike Meyer schreef [EMAIL PROTECTED]: John Roth [EMAIL PROTECTED] writes: [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] A much better idea would be to fix the underlying situation that makes the global statement necessary. You can't fix this. This code (in some

Re: get a list of mounted filesystems under MacOSX

2005-08-16 Thread perchef
maybe you can catch the result of /bin/df and parse it. -- http://mail.python.org/mailman/listinfo/python-list

Re: keeping a ref to a non-member function in a class

2005-08-16 Thread Peter Otten
Gregory Bond wrote: I'm building a class hierarchy that needs to keep as a class variable a reference to a (non-member) function, so that different subclasses can use different generator functions. But it seems Python is treating the function as a member function because the reference to it

fsm - revert to previous state (newbie)

2005-08-16 Thread bruce
Hi all, I`m working on a fsm that looks up its transitions in some dictionaries. I`ve defined a default transition to an error_state that is launched when there is no match of input_symbol, state etc in other dicts. The error state just prints out that user_input was not defined. After this I

Re: sniffer in python

2005-08-16 Thread billiejoex
Thanks for your help. Like you suggested I converted the integer value in a string one by using the repr() funtion applied on the print: print '%d \n %s' %(count, repr(iface)) The program now permit me to select the interface. The output is in a strange hex-similar form: C:\Python24test.py 0

Re: Replacement for keyword 'global' good idea? (e.g. 'modulescope' or 'module' better?)

2005-08-16 Thread Antoon Pardon
Op 2005-08-06, Peter Hansen schreef [EMAIL PROTECTED]: Paolino wrote: [EMAIL PROTECTED] wrote: def enclosing(): var=[] var[0]=2 def enclosed(): var[0]=4 which is like saying python is not working It's ok to mark non locals,but why var=4 is not searched outside and var[0]=4

Re: Wheel-reinvention with Python

2005-08-16 Thread Magnus Lycka
David E. Konerding DSD staff wrote: Actually, the real problem with the wxWidgets documentation is that it doesn't tell you *how* to do things. It does only a barely adequate job as an API reference, but what it lacks is an extensive howto. I waste too much of my time dinking around deep

Re: How to obtain GMT offset?

2005-08-16 Thread Magnus Lycka
new pip wrote: I'm using Windows os. If the current system date time is '28 Jun 2001 14:17:15 +0700', how can I obtain the value '+0700' using python? Thank you If you ignore the time and datetime modules, you can always split the string on whitespace and grab the last part: ts='28 Jun

Re: sniffer in python

2005-08-16 Thread billiejoex
Sorry... the text has been wrong formatted. Read this, plz Thanks for your help. Like you suggested I converted the integer value in a string one by using the repr() funtion applied on the print: print '%d \n %s' %(count, repr(iface)) The program now permit me to select the interface. The output

Gadfly use (Newby)

2005-08-16 Thread niko
Hello, while using gadfly, got an error that i don't understand. Code is as follow : cursor = connection.cursor() cursor.execute('select id_m from mots where nom_m = %s' % nom_m) id_m = cursor.fetchall() Error message : File C:\Python24\Lib\site-packages\gadfly\kjParser.py, line 567, in

Re: Gadfly use (Newby)

2005-08-16 Thread Fredrik Lundh
niko [EMAIL PROTECTED] wrote: while using gadfly, got an error that i don't understand. Code is as follow : cursor = connection.cursor() cursor.execute('select id_m from mots where nom_m = %s' % nom_m) id_m = cursor.fetchall() Error message : File

Re: __del__ pattern?

2005-08-16 Thread Tom Anderson
On Mon, 15 Aug 2005, Peter Hansen wrote: Tom Anderson wrote: Only one socket can be bound to a given port at any time, so the second instance of SpecialClass will get an exception from the bind call, and will be stillborn. This is a bit of a crufty hack, though - you end up with an open

Re: zlib + Windows 32 service problem (ImportError)

2005-08-16 Thread vincent wehren
Laszlo Zsolt Nagy [EMAIL PROTECTED] schrieb im Newsbeitrag news:[EMAIL PROTECTED] | vincent wehren wrote: | | Laszlo Zsolt Nagy [EMAIL PROTECTED] schrieb im Newsbeitrag | news:[EMAIL PROTECTED] | | Sorry, I realized that the import zlib was not executed from my | | (working) service. | | So here

Re: sniffer in python

2005-08-16 Thread billiejoex
Moreover the getInterface() function seems to be unexistent: from pcapy import * getInterface() Traceback (most recent call last): File stdin, line 1, in ? NameError: name 'getInterface' is not defined Maybe it can be used only on *nix platforms? --

Re: __del__ pattern?

2005-08-16 Thread Peter Hansen
Tom Anderson wrote: On Mon, 15 Aug 2005, Peter Hansen wrote: Using '' instead of 'localhost' means bind to *all* interfaces, not just the loopback one. Doesn't '' mean 'bind to the *default* interface'? What does default mean, and is that definition in conflict with what I said? The docs

looping list problem

2005-08-16 Thread Jon Bowlas
HI all, I'm fairly new to python and programming in general so I was hoping someone here may be able to help me. Let me explain what the problem I'm having is: I am trying to parse the XML of an attributes object I created, this object has the structure outlined below. Everything is ok on the

base64.encode and decode not correct

2005-08-16 Thread Damir Hakimov
Hi *! I found a strange bug in base64.encode and decode, when I try to encode - decode a file 1728512 bytes lenth. Is somebody meet with this? I don't attach the file because it big, but can send to private. Which solution for transfer file (binary data) via string-only object? Damir. --

Re: looping list problem

2005-08-16 Thread Fredrik Lundh
Jon Bowlas wrote: attobject = context.get_attobject() navstring = context.get_uclattribute(attobject, 'ucl_navhide') hiddennavelements = navstring.split(' ') for hiddennavelement in hiddennavelements: return hiddennavelement So the script 'get_attobject' basically looks for an instance

Re: base64.encode and decode not correct

2005-08-16 Thread Fredrik Lundh
Damir Hakimov wrote: I found a strange bug in base64.encode and decode, when I try to encode - decode a file 1728512 bytes lenth. does this work on your machine? import base64 x = base64.encodestring(1728512 * *) len(base64.decodestring(x)) 1728512 does it work also if you change it to

Re: base64.encode and decode not correct

2005-08-16 Thread jepler
It seems unlikely that there is a bug in Python's base64 encode/decode functions, but it is possible. For me, a long string of the same length you mention survives an encode/decode pair (a round-trip): Python 2.3.3 (#1, May 7 2004, 10:31:40) [GCC 3.3.3 20040412 (Red Hat Linux 3.3.3-7)]

Re: Zope, Python 2.4 pythonScripts import problem

2005-08-16 Thread krzychu
I see that Python 2.4.x does not work with Zope-2-7-6 properly. When I start zope I get warning that I should recompile my pythonScripts by executing manage_addProduct/PythonScripts/recompile. I do it and get list of scripts whoose were compiled but when I repeat that action I get the same list of

Re: How can I exclude a word by using re?

2005-08-16 Thread Paul McGuire
Just as with re you were using ?Pxxx to assign the matching text to the variable xxx, pyparsing allows you to associate a name with an element of your grammar using setResultsName. Here is your original re: r=re.compile(ur'valign=top(?P­­number\d{1,2})/tdtd[^]*­­\s{0,2}' ur'a

RE: looping list problem

2005-08-16 Thread Jon Bowlas
Ok so I changed it to this: attobject = context.get_attobject() navstring = context.get_uclattribute(attobject, 'ucl_navhide') hiddennavelements = navstring.split(' ') for hiddennavelement in hiddennavelements: yield hiddennavelements But I get the following error- Line 5: Yield statements

Re: __del__ pattern?

2005-08-16 Thread Dan
What does default mean, and is that definition in conflict with what I said? The docs say it means INADDR_ANY. someSocket.bind(('', somePort)) means accept connections from any machine. (We use INADDR_ANY instead of '' in C.) someSocket.bind(('localhost', somePort)) means accept only

Re: Replacement for keyword 'global' good idea? (e.g. 'modulescope' or 'module' better?)

2005-08-16 Thread Peter Hansen
Antoon Pardon wrote: Why has one made a difference in search policy for finding a variable based on whether the variable is rebound or not in the first place. Do you really not understand the reason, or do you simply disagree with it? It's a choice with rational thought behind it. Whether

Re: looping list problem

2005-08-16 Thread Paul McGuire
Well, you are returning prematurely from a for loop, so that is why you are only getting the first value. Its just like: for i in range(100): return i It doesn't matter how big the range is you are iterating over, you'll return on the first element and that's it. If what you want is

Re: looping list problem

2005-08-16 Thread Fredrik Lundh
Jon Bowlas wrote: Ok so I changed it to this: attobject = context.get_attobject() navstring = context.get_uclattribute(attobject, 'ucl_navhide') hiddennavelements = navstring.split(' ') for hiddennavelement in hiddennavelements: yield hiddennavelements But I get the following error-

Re: How to obtain GMT offset?

2005-08-16 Thread Peter Hansen
Erik Max Francis wrote: time.timezone gives you the timezone offset in minutes. Dang, that means I'm twelve days in the past! import time time.timezone 18000 18000/60 300 (So that would be hours? ;-) ) 18000/60/24 12 Wait up guys! -Peter --

Re: looping list problem

2005-08-16 Thread Peter Hansen
Jon Bowlas wrote: Ok so I changed it to this: attobject = context.get_attobject() navstring = context.get_uclattribute(attobject, 'ucl_navhide') hiddennavelements = navstring.split(' ') for hiddennavelement in hiddennavelements: yield hiddennavelements But I get the following

RE: looping list problem

2005-08-16 Thread Peter Otten
Jon Bowlas wrote: Ok so I changed it to this: attobject = context.get_attobject() navstring = context.get_uclattribute(attobject, 'ucl_navhide') hiddennavelements = navstring.split(' ') for hiddennavelement in hiddennavelements: yield hiddennavelements But I get the following

A (unpythonic) pythonable mixin recipe.

2005-08-16 Thread Paolino
I had always been negative on the boldeness of python on insisting that unbound methods should have been applied only to its im_class instances. Anyway this time I mixed in rightly, so I post this for comments. ## looking for a discovery .Start # class _Mixin(object): def

Creating a graphical interface on top of SSH. How?

2005-08-16 Thread John F.
I want to write a client app in Python using wxWindows that connects to my FreeBSD server via SSH (using my machine account credentials) and runs a python or shell script when requested (by clicking a button for instance). Can someone give me some advice on how to create a graphical shell per se?

Re: Library vs Framework (was Dr. Dobb's Python-URL!)

2005-08-16 Thread Rocco Moretti
Simon Brunning wrote: On 8/15/05, Terry Hancock [EMAIL PROTECTED] wrote: On Monday 15 August 2005 09:54 am, Simon Brunning wrote: If you call its code, it's a library. If it calls yours, it's a framework. Such concision deserves applause. ;-) Thank you. ;-) As others have pointed out,

Re: [Python-Dev] implementation of copy standard lib

2005-08-16 Thread Simon Brunning
On 8/14/05, Martijn Brouwer [EMAIL PROTECTED] wrote: After profiling a small python script I found that approximately 50% of the runtime of my script was consumed by one line: import copy. Another 15% was the startup of the interpreter, but that is OK for an interpreted language. The copy

open links in a html page

2005-08-16 Thread Ajar
Hi, Using urllib2,ClinetForm and ClinetCookie modules I have logged into my ISPs web site and managed to fetch the first page. Now, on this page there is this link: a href=# onclick=check(4);return false; class=zi01Service Records/a I need to click this link from python code. How do I do it?

Re: Library vs Framework (was Dr. Dobb's Python-URL!)

2005-08-16 Thread Terry Hancock
On Tuesday 16 August 2005 08:46 am, Rocco Moretti wrote: But I'm not sure if library vs. framework a fair comparison - the two are doing different things. With a framework, you're not really writing your own program, you're customizing someone else's. Sort of a vastly more flexible version

extending: new type instance

2005-08-16 Thread BranoZ
I'm writing my own (list-like) type in C. It is implementing a Sequence Protocol. In 'sq_slice' method I would like to return a new instance of my class/type. How do I create (and initialize) an instance of a given PyTypeObject MyType ? I have tried to provide (PyObject *)MyType as 'class'

RE: looping list problem

2005-08-16 Thread Jon Bowlas
Ok, so I've adapted my script calling it a hiddens() function and included it inside my get_tree_html function which creates my navigation: pub = context.get_publication() obj = context.aq_inner fpath = context.getPhysicalPath() def hiddens(): attobject = context.get_attobject()

Re: Creating a graphical interface on top of SSH. How?

2005-08-16 Thread Jp Calderone
On 16 Aug 2005 07:10:25 -0700, John F. [EMAIL PROTECTED] wrote: I want to write a client app in Python using wxWindows that connects to my FreeBSD server via SSH (using my machine account credentials) and runs a python or shell script when requested (by clicking a button for instance). Can

libdnet and python (scapy)

2005-08-16 Thread codecraig
I am interested in using libdnet with Python, how can I go about installing it on windows? http://libdnet.sourceforge.net/ Ultimately, I would like to get Scapy (http://www.secdev.org/projects/scapy/) running on windows...currently it is a *nix app written in Python, so I think I should be able

Re: help with mysql cursor.execute()

2005-08-16 Thread William Gill
Dennis Lee Bieber wrote: On Sun, 14 Aug 2005 19:28:04 GMT, William Gill [EMAIL PROTECTED] declaimed the following in comp.lang.python: I have been trying to pass parameters as indicated in the api. when I use: sql= 'select * from %s where cusid = %s ' % name,recID)

Re: [Python-Dev] implementation of copy standard lib

2005-08-16 Thread Michael Hoffman
Simon Brunning wrote: I think that copy is very rarely used. I don't think I've ever imported it. Or is it just me? It's just you. wink I use copy.deepcopy() fairly often. -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: Library vs Framework (was Dr. Dobb's Python-URL!)

2005-08-16 Thread Peter Decker
On 8/16/05, Terry Hancock [EMAIL PROTECTED] wrote: Where a framework shines is when you don't really want to program it much at all -- you just need a tweak here and there beyond what it already does. Gimp plugins are a great example of that. I'd put it slightly differently. Where a

Re: base64.encode and decode not correct

2005-08-16 Thread bryanjugglercryptographer
Damir Hakimov wrote: I found a strange bug in base64.encode and decode, when I try to encode - decode a file 1728512 bytes lenth. Is somebody meet with this? I don't attach the file because it big, but can send to private. I agree the file is too big, but can you show a small Python program

RE: looping list problem

2005-08-16 Thread Peter Otten
Jon Bowlas wrote: Incidentally I'm doing this in zope. Many posters (including me) in this newsgroup don't do zope, so your best option is to ask on a zope-related mailing list. I was hoping that this would loop through the elements in the list returned by the hiddens function comparing them

Re: Wheel-reinvention with Python

2005-08-16 Thread Ed Leafe
On Tuesday 16 August 2005 05:48, Magnus Lycka wrote: The fact that his excellent, more or less daily postings are so badly needed does indicate a problem, either with the design of the toolkit, or with the docs. I'm not sure which. I htink that there is such an overwhelming amount of stuff

class-call a function in a function -problem

2005-08-16 Thread wierus
Hello, i have a problem. I write my first class in python so i'm not a experience user. I want to call a function in another function, i tried to do it in many ways, but i always failed:( I supposed it's sth very simple but i can't figure what it is: == class

class-call a function in a function -problem

2005-08-16 Thread wierus
Hello, i have a problem. I write my first class in python so i'm not a experience user. I want to call a function in another function, i tried to do it in many ways, but i always failed:( I supposed it's sth very simple but i can't figure what it is: == class

String functions deprication

2005-08-16 Thread steve morin
http://www.python.org/doc/2.4.1/lib/node110.html These methods are being deprecated. What are they being replaced with? Does anyone know? Steve -- http://mail.python.org/mailman/listinfo/python-list

Re: MainThread blocks all others

2005-08-16 Thread Nodir Gulyamov
Thank you very much to all. I found out solution. I created separate thread from GUI and everything is working correct. Best Regards, /Gelios -- http://mail.python.org/mailman/listinfo/python-list

Re: String functions deprication

2005-08-16 Thread Tim Peters
[steve morin] http://www.python.org/doc/2.4.1/lib/node110.html These methods are being deprecated. What are they being replaced with? Does anyone know? As it says at the top of that page, The following list of functions are also defined as methods of string and Unicode objects;

RE: looping list problem

2005-08-16 Thread Jon Bowlas
Many thanks for your help, worked a treat Jon -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Peter Otten Sent: 16 August 2005 17:25 To: python-list@python.org Subject: RE: looping list problem Jon Bowlas wrote: Incidentally I'm doing this in zope.

Re: class-call a function in a function -problem

2005-08-16 Thread Larry Bates
Try something like: class ludzik: # # Define an __init__ method that gets called when # you instantiate the class. Notice also that I've # allowed you to set x, and y parameters if you like. # If you don't pass them they default to 1 and 2 as # in your example. #

String functions deprication

2005-08-16 Thread Dan
http://www.python.org/doc/2.4.1/lib/node110.html These methods are being deprecated. What are they being replaced with? They're being made methods of the string class itself. For example: s = 'any old string' string.split(s, ' ') # Old way ['any', 'old', 'string'] s.split()

Re: Library vs Framework (was Dr. Dobb's Python-URL!)

2005-08-16 Thread Paolino
Rocco Moretti wrote: Cameron Laird wrote: Andy Smith rails against frameworks: http://an9.org/devdev/why_frameworks_suck?sxip-homesite=checked=1 Slapdash Summary: Libraries good, frameworks bad - they are a straightjackets and limit sharing. Which lead me to the

Re: [Python-Dev] implementation of copy standard lib

2005-08-16 Thread Benji York
Simon Brunning wrote: I think that copy is very rarely used. I don't think I've ever imported it. Or is it just me? I rarely use copy, and almost always regret it when I do. wink -- Benji York -- http://mail.python.org/mailman/listinfo/python-list

Re: __del__ pattern?

2005-08-16 Thread bryanjugglercryptographer
Tom Anderson wrote: On Mon, 15 Aug 2005, Chris Curvey wrote: Is there a better pattern to follow than using a __del__ method? I just need to be absolutely, positively sure of two things: An old hack i've seen before is to create a server socket - ie, make a socket and bind it to a port:

Re: Replacement for keyword 'global' good idea? (e.g. 'modulescope' or 'module' better?)

2005-08-16 Thread Bengt Richter
On 5 Aug 2005 21:22:41 -0700, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I'm not saying 'modulescope' and 'module' are the only alternatives or even the best anyone can come up with. 'global' has the connotation of being visible *EVERYWHERE* where in Python it is just visible in one module's

Re: class-call a function in a function -problem

2005-08-16 Thread Steven Bethard
wierus wrote: class ludzik: x=1 y=2 l=0 def l(self): ludzik.l=ludzik.x+ludzik.y print ludzik.l def ala(self): print ludzik.x print ludzik.y ludzik.l() Methods defined in a class expect an instance of that class as the first argument. When you write: ludzik.l()

Re: GUI tookit for science and education

2005-08-16 Thread Mateusz Łoskot
Thank you all for valuable responses. I think I will stick to Tk and Tkinter. Cheers -- Mateusz Łoskot, mateusz (at) loskot (dot) net Registered Linux User #220771 -- http://mail.python.org/mailman/listinfo/python-list

Re: class-call a function in a function -problem

2005-08-16 Thread Steven Bethard
Larry Bates wrote: def __init__(self, x=1, y=2) [snip] self.x=x self.y=y self.a=0 return def l(self): [snip] self.a=self.x+self.y print In ludzik.l a=',self.a return def ala(self): [snip] self.l()

get the return code when piping something to a python script?

2005-08-16 Thread mhenry1384
On WinXP, I am doing this nant.exe | python MyFilter.py This command always returns 0 (success) because MyFilter.py always succeeds. MyFilter.py looks like this while 1: line = sys.stdin.readline() if not line: break ... sys.stdout.write(line) sys.stdout.flush()

Windows message pump problems

2005-08-16 Thread Cantankerous Old Git
I am trying to write a program that I hope to get working as a command-line app to start with, and then eventually use a windows service wrapper to call it as a service. Its purpose is to attach to an already running (not ours) service using an API DLL, where it will do houskeeping and

Re: Library vs Framework (was Dr. Dobb's Python-URL!)

2005-08-16 Thread Magnus Lycka
Terry Hancock wrote: Zope recently started going through some massive changes to make it more like a toolkit (which is the term I use instead of library here). Even if there must be a framework, a thin framework with good tools tends to be better than a complex framework, even if they can, in

Re: Replacement for keyword 'global' good idea? (e.g. 'modulescope' or 'module' better?)

2005-08-16 Thread Bengt Richter
On Sat, 06 Aug 2005 20:56:13 GMT, Dennis Lee Bieber [EMAIL PROTECTED] wrote: On Sat, 06 Aug 2005 21:16:13 +0200, Paolino [EMAIL PROTECTED] declaimed the following in comp.lang.python: The point is not to understand obvious technical things, but having a coherent programming framework.If I

Re: How to obtain GMT offset?

2005-08-16 Thread Mark Thalman
According to http://www.python.org/doc/2.4.1/lib/module-time.html it is in seconds. -- Mark On Aug 16, 2005, at 9:35 AM, Peter Hansen wrote: Erik Max Francis wrote: time.timezone gives you the timezone offset in minutes. Dang, that means I'm twelve days in the past! import time

random seed

2005-08-16 Thread vivek7006
By default, randomm module uses the timestamp to generate the seed value. Is it possible to know what that seed value is? import random random.random() # How do I print the current value of the seed? Thanks Vivek -- http://mail.python.org/mailman/listinfo/python-list

Re: How can I exclude a word by using re?

2005-08-16 Thread Paul McGuire
I just reviewed what the re \s signifies: whitespace. This is easy, pyparsing ignores all intervening whitespace by default. So mp3Entry simplfies to: mp3entry = valign + number.setResultsName(number­­­) + tdEnd + \ tdStart + aStart + \

Re: get the return code when piping something to a python script?

2005-08-16 Thread BranoZ
mhenry1384 wrote: On WinXP, I am doing this nant.exe | python MyFilter.py How do I set the return code from MyFilter.py based on the return of nant.exe? Is this possible? I don't know how it is on WinXP, but in UNIX you IMHO cannot easily get the retcode of the peer _if_ the pipe was

Re: get the return code when piping something to a python script?

2005-08-16 Thread mhenry1384
Didn't help you much.. Thanks, actually even hints that it's not possible helps. So I won't keep driving myself crazy figuring out how to do it. :-) -- http://mail.python.org/mailman/listinfo/python-list

Re: [Python-Dev] implementation of copy standard lib

2005-08-16 Thread Ron Adam
Simon Brunning wrote: On 8/14/05, Martijn Brouwer [EMAIL PROTECTED] wrote: After profiling a small python script I found that approximately 50% of the runtime of my script was consumed by one line: import copy. Another 15% was the startup of the interpreter, but that is OK for an interpreted

Re: Reading portions of a wave file

2005-08-16 Thread Bengt Richter
On Tue, 16 Aug 2005 02:33:36 GMT, Nadie [EMAIL PROTECTED] wrote: Greeting list readers, I noticed that the wave read object has an *implementation dependent* setpos(pos) method. When reading audio files, it is useful to be able to set the position to a specific sample. While setpos(pos) may

Re: get the return code when piping something to a python script?

2005-08-16 Thread Paul Watson
mhenry1384 wrote: On WinXP, I am doing this nant.exe | python MyFilter.py This command always returns 0 (success) because MyFilter.py always succeeds. MyFilter.py looks like this while 1: line = sys.stdin.readline() if not line: break ...

Re: Replacement for keyword 'global' good idea? (e.g. 'modulescope' or 'module' better?)

2005-08-16 Thread Ron Adam
Antoon Pardon wrote: I disagree here. The problem with global, at least how it is implemented in python, is that you only have access to module scope and not to intermediate scopes. I also think there is another possibility. Use a symbol to mark the previous scope. e.g. x would be the

Re: GUI tookit for science and education

2005-08-16 Thread Markus Rosenstihl
It doesn't have much math built in. For functions you have to plot points. If you want to plot stuff, the gnuplot-py module is very easy to use. http://sourceforge.net/projects/gnuplot-py/ The one feature that I'd really like to add is the ability to plot a python function object.

Re: How to obtain GMT offset?

2005-08-16 Thread Bengt Richter
On Mon, 15 Aug 2005 20:57:16 -0700, Erik Max Francis [EMAIL PROTECTED] wrote: new pip wrote: I'm using Windows os. If the current system date time is '28 Jun 2001 14:17:15 +0700', how can I obtain the value '+0700' using python? time.timezone gives you the timezone offset in minutes. ITYM

Re: class-call a function in a function -problem

2005-08-16 Thread Elmo Mäntynen
On Tue, 16 Aug 2005 18:45:51 +0200, wierus wrote: Hello, i have a problem. I write my first class in python so i'm not a experience user. I want to call a function in another function, i tried to do it in many ways, but i always failed:( I supposed it's sth very simple but i can't figure

Re: How to obtain GMT offset?

2005-08-16 Thread Bengt Richter
On Mon, 15 Aug 2005 20:57:16 -0700, Erik Max Francis [EMAIL PROTECTED] wrote: new pip wrote: I'm using Windows os. If the current system date time is '28 Jun 2001 14:17:15 +0700', how can I obtain the value '+0700' using python? time.timezone gives you the timezone offset in minutes. Hm, ...

Re: random seed

2005-08-16 Thread tiissa
[EMAIL PROTECTED] wrote: By default, randomm module uses the timestamp to generate the seed value. Is it possible to know what that seed value is? From a (very) quick glance at the doc [1], I'm not sure you can get it. But if you want to reuse it later (for a deterministic behaviour), you

'import copy' too slow?, was Re: [Python-Dev] implementation of copy standard lib

2005-08-16 Thread Peter Otten
[Martijn Brouwer] Importing copy takes 5-10 times more time that import os, string and re together! Are you sure you aren't seeing the effects of caching? My little ad hoc test (which fails on the os module) doesn't confirm your numbers: $ python2.4 -m timeit -n1 -r1 -simport sys; assert 're'

Re: String functions deprication

2005-08-16 Thread Paul Watson
steve morin wrote: http://www.python.org/doc/2.4.1/lib/node110.html These methods are being deprecated. What are they being replaced with? Does anyone know? Steve It might be helpful to compare the following lists. Python 2.1 (#1, May 23 2003, 11:43:56) [C] on aix4 Type copyright,

Re: 'import copy' too slow?, was Re: [Python-Dev] implementation of copy standard lib

2005-08-16 Thread Peter Otten
[Martijn Brouwer] Importing copy takes 5-10 times more time that import os, string and re together! If your measurement isn't flawed, try again after replacing the following import in copy.py try: from org.python.core import PyStringMap except ImportError: PyStringMap = None with just

FW: python oldie, SWIG newbie needs help

2005-08-16 Thread Sells, Fred
-Original Message- From: Sells, Fred Sent: Tuesday, August 16, 2005 5:09 PM To: python-list@python.org Subject: python oldie, SWIG newbie needs help I've been trying all day to get a simple SWIG generated interface to a simple (but ugly) piece of c++ code provided to us by the gov't.

Re: class-call a function in a function -problem

2005-08-16 Thread Bengt Richter
On Tue, 16 Aug 2005 18:46:30 +0200, wierus [EMAIL PROTECTED] wrote: Hello, i have a problem. I write my first class in python so i'm not a experience user. I want to call a function in another function, i tried to do it in many ways, but i always failed:( I supposed it's sth very simple but i

Re: String functions deprication

2005-08-16 Thread Paul Watson
Sorry, the previous post was based on Python 2.1. That is probably not of much interest. How about 2.4.1? Python 2.4.1 (#1, Jul 19 2005, 14:16:43) [GCC 4.0.0 20050519 (Red Hat 4.0.0-8)] on linux2 Type help, copyright, credits or license for more information. import string dir(string)

Re: __del__ pattern?

2005-08-16 Thread Peter Hansen
Dan wrote: someSocket.bind(('localhost', somePort)) means accept only connections from the local machine. Almost: accept only attempts to connect *to* localhost, from the local machine. Attempting to connect -- even locally -- using one of the IP addresses bound to an external interface will

Read from stdouton Popen on WinXP?

2005-08-16 Thread mhenry1384
I am trying to run a program and filter the output on Windows XP. Since I want to filter the output, I'd like to read it a line at a time and only print the lines I care about. p = subprocess.Popen([doxygen.exe, rDoxyfile.cfg], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) while 1: line =

Re: random seed

2005-08-16 Thread vivek7006
Thanks. I guess I will use the system time and pass it as seed explicitly. My goal is to replicate the random numbers that I generate to ensure repeatabilty in the regression test suite that I am trying to write. -- http://mail.python.org/mailman/listinfo/python-list

Help!

2005-08-16 Thread Ert Ert
When ever i try to open python it opens as a MS-DOS Prompt I do not know what else to do i need your help so if you could please help. Oh and this is the second time i emailed you so please do not send me back an automated message thank you. --

  1   2   >