Re: Is it possible to open a dbf

2005-01-03 Thread Helmut Jarausch
yields only some code for reading dBase ... and lots of enquires about such a thing... I've been using http://www.fiby.at/dbfpy/ without any problems including writing/modifying dbf files. -- Helmut Jarausch Lehrstuhl fuer Numerische Mathematik RWTH - Aachen University D 52056 Aachen, Germany

Re: regex question

2005-06-25 Thread Helmut Jarausch
: ,match.group(1) Obviously I do not understand how (?:\s+(\d))* works in conjunction with ^ and $. I am sure what you like to do. What about regex= re.compile('\s+\d') print regex.findall(line) -- Helmut Jarausch Lehrstuhl fuer Numerische Mathematik RWTH - Aachen University D 52056 Aachen

BaseHTTPServer and priviledge separation?

2005-06-25 Thread Helmut Jarausch
Hi, to use a port below 1000 on a Unix system one needs root priviledges. But it's dangerous to execute all of a script under those priviledges. Therefore I'd like to drop the root priviledges as soon as possible. (How) is this possible? Many thanks for a hint, Helmut Jarausch Lehrstuhl fuer

Re: a trick with lists ?

2008-02-08 Thread Helmut Jarausch
mylist # this prints [1, 2, 3] The shortened list outer_list[:ll-1] has been assigned (bound in Python terms) to the LOCAL reference (to a list) 'outer_list' -- Helmut Jarausch Lehrstuhl fuer Numerische Mathematik RWTH - Aachen University D 52056 Aachen, Germany -- http://mail.python.org

Tkinter equiv for setPalette

2008-02-10 Thread Helmut Jarausch
and its children) Many thanks for a hint, Helmut. -- Helmut Jarausch Lehrstuhl fuer Numerische Mathematik RWTH - Aachen University D 52056 Aachen, Germany -- http://mail.python.org/mailman/listinfo/python-list

Tkinter - tk_focusNext broken for years?

2008-02-10 Thread Helmut Jarausch
return self._nametowidget(name) File /usr/lib/python2.5/lib-tk/Tkinter.py, line 1064, in nametowidget if name[0] == '.': TypeError: '_tkinter.Tcl_Obj' object is unsubscriptable --- -- Helmut Jarausch Lehrstuhl fuer Numerische Mathematik RWTH

Re: Why the result same as before modifing py files

2008-02-20 Thread Helmut Jarausch
'import' is cached. If do want Python to re-import a module just call reload(module.) -- Helmut Jarausch Lehrstuhl fuer Numerische Mathematik RWTH - Aachen University D 52056 Aachen, Germany -- http://mail.python.org/mailman/listinfo/python-list

append to a sublist - please help

2008-04-06 Thread Helmut Jarausch
Hi, I must be blind but I don't see what's going wrong with G=[[]]*2 G[0].append('A') G[1].append('B') print G[0] gives ['A', 'B'] as well as print G[1] I was expecting ['A'] and ['B'] respectively. Many thanks for enlightening me, Helmut. -- Helmut Jarausch Lehrstuhl fuer Numerische

Re: Unix Device File Emulation

2008-04-23 Thread Helmut Jarausch
/Recipe/414771 http://mail.python.org/pipermail/python-list/2002-August/157510.html http://pyinotify.sourceforge.net/ -- Helmut Jarausch Lehrstuhl fuer Numerische Mathematik RWTH - Aachen University D 52056 Aachen, Germany -- http://mail.python.org/mailman/listinfo/python-list

Re: Script to convert Tcl scripts to Python?

2008-04-23 Thread Helmut Jarausch
operations I asked a similar question some time ago. The summary was - don't do it! Instead, a Tcl interpreter could be loaded and given the job to do. I think that's similar to what Tkinter does. -- Helmut Jarausch Lehrstuhl fuer Numerische Mathematik RWTH - Aachen University D 52056 Aachen, Germany

Re: Regular Expression - Matching Multiples of 3 Characters exactly.

2008-04-28 Thread Helmut Jarausch
hypothetically yield different genes, since the frame would be shifted. As an alternative - if you do need speed - have a look at http://www.egenix.com/products/python/mxBase/mxTextTools/ Helmut. -- Helmut Jarausch Lehrstuhl fuer Numerische Mathematik RWTH - Aachen University D 52056 Aachen

variable length tuple assignment

2009-02-25 Thread Helmut Jarausch
for this? Many thanks for a hint, Helmut Jarausch Lehrstuhl fuer Numerische Mathematik RWTH - Aachen University D 52056 Aachen, Germany -- http://mail.python.org/mailman/listinfo/python-list

PyCrypto AES MODE_CBC - How to?

2009-02-25 Thread Helmut Jarausch
= 'ea523a664dabaa4476d31226a1e3bab0' c = crypt.encrypt(txt) txt_plain=crypt.decrypt(c) print txt_plain Unfortunately, txt_plain differs from txt - why? (Using MODE_ECB does work however) What am I missing? Many thanks for a hint, Helmut Jarausch Lehrstuhl fuer Numerische Mathematik RWTH - Aachen University D

Re: PyCrypto AES MODE_CBC - How to?

2009-02-25 Thread Helmut Jarausch
Helmut Jarausch wrote: Hi, I've just tried to write a simple example using PyCrypto's AES (CBC mode) #!/usr/bin/python from Crypto.Cipher import AES PWD='abcdefghijklmnop' Initial16bytes='0123456789ABCDEF' crypt = AES.new(PWD, AES.MODE_CBC,Initial16bytes) # crypt = AES.new(PWD, AES.MODE_ECB

python3 - the hardest hello world ever ?

2008-10-14 Thread Helmut Jarausch
on that subject, Helmut. -- Helmut Jarausch Lehrstuhl fuer Numerische Mathematik RWTH - Aachen University D 52056 Aachen, Germany -- http://mail.python.org/mailman/listinfo/python-list

Re: python3 - the hardest hello world ever ?

2008-10-15 Thread Helmut Jarausch
Ben Finney wrote: Helmut Jarausch [EMAIL PROTECTED] writes: I have to set an internal property (with leading underscore) for each output file I'm using - right? If you're referring to the source encoding declaration: No, underscores have no effect. The specification is at URL:http

Re: python3 - the hardest hello world ever ?

2008-10-15 Thread Helmut Jarausch
Paul Boddie wrote: On 15 Okt, 12:08, Helmut Jarausch [EMAIL PROTECTED] wrote: What defines me as latin1-user? What does sys.stdout.encoding say? In Python 2.x, at least, that It says ansi_x3.4-1968 Where can I change this? attribute should reflect the capabilities of your environment

Re: python3 - the hardest hello world ever ?

2008-10-15 Thread Helmut Jarausch
] UnicodeEncodeError: 'ascii' codec can't encode characters in position 1-2: ordinal not in range(128) So my system seems to be an ASCII system? Thanks, Helmut -- Helmut Jarausch Lehrstuhl fuer Numerische Mathematik RWTH - Aachen University D 52056 Aachen, Germany -- http://mail.python.org/mailman

Re: python3 - the hardest hello world ever ?

2008-10-15 Thread Helmut Jarausch
Brian Quinlan wrote: Hey Helmut, Did you try just: print(Hallo, Süßes Python) Yes, but that doesn't work here. Please see my reply to Martin's reply. Thanks, Helmut. -- Helmut Jarausch Lehrstuhl fuer Numerische Mathematik RWTH - Aachen University D 52056 Aachen, Germany -- http

Re: python3 - the hardest hello world ever ?

2008-10-16 Thread Helmut Jarausch
of a script. Why isn't that possible? Helmut. -- Helmut Jarausch Lehrstuhl fuer Numerische Mathematik RWTH - Aachen University D 52056 Aachen, Germany -- http://mail.python.org/mailman/listinfo/python-list

Re: python3 - the hardest hello world ever ?

2008-10-16 Thread Helmut Jarausch
the 'locale' or to switch settings for each output file (by settting the _encoding property. I wished I could override the locale settings within a Python script. Thanks, Helmut. -- Helmut Jarausch Lehrstuhl fuer Numerische Mathematik RWTH - Aachen University D 52056 Aachen, Germany -- http

Re: python3 - the hardest hello world ever ?

2008-10-16 Thread Helmut Jarausch
Paul Boddie wrote: On 16 Okt, 11:28, Helmut Jarausch [EMAIL PROTECTED] wrote: I meant setting the default encoding which is used by print (e.g.) when outputting the internal unicode string to a file. As far as I understood, currently I am fixed to setting either the 'locale' or to switch

Re: python3 - the hardest hello world ever ?

2008-10-17 Thread Helmut Jarausch
Ross Ridge wrote: Helmut Jarausch [EMAIL PROTECTED] wrote: # but this ugly one (to be done for each output file) sys.stdout._encoding='latin1' Is this writable _encoding attribute, with a leading underscore (_), documented anywhere? Does it actually work? Would it happen to be supported

subprocess - please enhance the documentation

2008-05-20 Thread Helmut Jarausch
some error messages Perhaps a few lines telling about this would be helpful. Thanks, Helmut. -- Helmut Jarausch Lehrstuhl fuer Numerische Mathematik RWTH - Aachen University D 52056 Aachen, Germany -- http://mail.python.org/mailman/listinfo/python-list

Re: compressing short strings?

2008-05-20 Thread Helmut Jarausch
. I'd ask in comp.compression where the specialists are listening and who are very helpful. -- Helmut Jarausch Lehrstuhl fuer Numerische Mathematik RWTH - Aachen University D 52056 Aachen, Germany -- http://mail.python.org/mailman/listinfo/python-list

Re: svg-chart 1.1 SVG Charting Library

2008-05-20 Thread Helmut Jarausch
Jason R. Coombs wrote: I'm pleased to announce svg-chart 1.1, the first public release of a library for generating Scalable Vector Graphic (SVG) charts. http://sourceforge.net/projects/py-svg This repository seems to be still empty? Helmut. -- Helmut Jarausch Lehrstuhl fuer Numerische

Python and Harry Potter?

2008-06-05 Thread Helmut Jarausch
Hi, just to let you know ... Today I've got an email from Amazon recommending me Harry Potter and the Deathly Hallows and they told me why they recommended this book, because I've bought Core PYTHON Programming Didn't know, Harry Potter is a Python fan. -- Helmut Jarausch Lehrstuhl fuer

Re: ANN: eGenix pyOpenSSL Distribution 0.7.0-0.9.8h-1

2008-06-13 Thread Helmut Jarausch
downloading the source doesn't work. Under requirements (to compile the source) there is mxbase version = 3.0.1 which I couldn't find on your web server. Many thanks, Helmut Jarausch Lehrstuhl fuer Numerische Mathematik RWTH - Aachen University D 52056 Aachen, Germany -- http://mail.python.org/mailman

Re: Plotting Graphs using Gnuplot

2008-06-13 Thread Helmut Jarausch
of my file... Plotting2.plot( [(2,3), (3,4)], [(4,5), (5,6)], [(1,3), (4,8)] ) -- Helmut Jarausch Lehrstuhl fuer Numerische Mathematik RWTH - Aachen University D 52056 Aachen, Germany -- http://mail.python.org/mailman/listinfo/python-list

Python-3.0b1 build fails on Linux : _gestalt

2008-06-19 Thread Helmut Jarausch
Hi, trying to build Python-3.0b1 on my Gentoo Linux box fails with Failed to find the necessary bits to build these modules: _gestalt Looking at setup.py it seems that module '_gestalt' is only needed on Darwin but my build on Linux fails nevertheless. Thanks for any hints, Helmut Jarausch

2to3 bug and question

2008-06-23 Thread Helmut Jarausch
/bin/python -O Is this a bug or a feature? Thanks for hint, Helmut Jarausch Lehrstuhl fuer Numerische Mathematik RWTH - Aachen University D 52056 Aachen, Germany -- http://mail.python.org/mailman/listinfo/python-list

[2to3] Bug converting import

2008-06-23 Thread Helmut Jarausch
import in non-package thanks for looking into it, Helmut Jarausch Lehrstuhl fuer Numerische Mathematik RWTH - Aachen University D 52056 Aachen, Germany -- http://mail.python.org/mailman/listinfo/python-list

Re: Python internals question

2008-07-15 Thread Helmut Jarausch
be most interested in your thoughts. Please have a look at http://effbot.org/zone/call-by-object.htm and http://rg03.wordpress.com/2007/04/21/semantics-of-python-variable-names-from-a-c-perspective/ -- Helmut Jarausch Lehrstuhl fuer Numerische Mathematik RWTH - Aachen University D 52056

restructuredtext latin1 encoding (FAQ?)

2007-07-03 Thread Helmut Jarausch
Hi, I did try to find something on the net but I couldn't find anything useful. Is there a way to write documents with the reST tools using the Latin1 encoding? Many thanks for a hint, Helmut Jarausch Lehrstuhl fuer Numerische Mathematik RWTH - Aachen University D 52056 Aachen, Germany

Re: restructuredtext latin1 encoding (FAQ?)

2007-07-03 Thread Helmut Jarausch
Marc 'BlackJack' Rintsch wrote: On Tue, 03 Jul 2007 12:12:04 +0200, Helmut Jarausch wrote: Is there a way to write documents with the reST tools using the Latin1 encoding? Yes of course there is. Just write the documents in Latin-1 encoding. Take a look at the charset command line

wxPython Cannot convert from the charset 'latin-1'

2007-07-03 Thread Helmut Jarausch
this did come from. Running it under pdb isn't helpful either. Many thanks for a hint, Helmut Jarausch Lehrstuhl fuer Numerische Mathematik RWTH - Aachen University D 52056 Aachen, Germany -- http://mail.python.org/mailman/listinfo/python-list

ReSTedit ported to Linux?

2007-07-04 Thread Helmut Jarausch
Hi, does anybody know if ReSTedit (originally for Mac OS X) has been ported to Linux? Many thanks for a hint, Helmut Jarausch Lehrstuhl fuer Numerische Mathematik RWTH - Aachen University D 52056 Aachen, Germany -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple search and Display system, no need for db?

2007-07-11 Thread Helmut Jarausch
dictionary in Python. You can use the module pickle (or cpickle) to dump it to disk and load it next time. Furthermore you can easily write the whole web server in Python, e.g. I like http://karrigell.sourceforge.net/ -- Helmut Jarausch Lehrstuhl fuer Numerische Mathematik RWTH - Aachen University D 52056

Re: pattern match !

2007-07-11 Thread Helmut Jarausch
+(?:[-.]\d+)+)-RHEL3-Linux\.RPM') S=hpsmh-1.1.1.2-0-RHEL3-Linux.RPM PO= P.match(S) if PO : print PO.group(1) -- Helmut Jarausch Lehrstuhl fuer Numerische Mathematik RWTH - Aachen University D 52056 Aachen, Germany -- http://mail.python.org/mailman/listinfo/python-list

split a string of space separated substrings - elegant solution?

2007-07-31 Thread Helmut Jarausch
. Many thanks for a hint, Helmut Jarausch Lehrstuhl fuer Numerische Mathematik RWTH - Aachen University D 52056 Aachen, Germany -- http://mail.python.org/mailman/listinfo/python-list

Re: split a string of space separated substrings - elegant solution?

2007-08-01 Thread Helmut Jarausch
Many thanks to all of you! It's amazing how many elegant solutions there are in Python. -- Helmut Jarausch Lehrstuhl fuer Numerische Mathematik RWTH - Aachen University D 52056 Aachen, Germany -- http://mail.python.org/mailman/listinfo/python-list

decorators - more than just syntactic sugar

2007-08-11 Thread Helmut Jarausch
Hi, are decorators more than just syntactic sugar in python 2.x and what about python 3k ? How can I find out the predefined decorators? Many thanks for your help, Helmut Jarausch Lehrstuhl fuer Numerische Mathematik RWTH - Aachen University D 52056 Aachen, Germany -- http://mail.python.org

Re: Drawing a graph

2007-08-13 Thread Helmut Jarausch
://gnuplot-py.sourceforge.net/ -- Helmut Jarausch Lehrstuhl fuer Numerische Mathematik RWTH - Aachen University D 52056 Aachen, Germany -- http://mail.python.org/mailman/listinfo/python-list

asynchronous timer events - how to?

2008-01-09 Thread Helmut Jarausch
this function is running I need access to the variables of the server. Can this be done in a simple way? Many thanks for a hint, Helmut Jarausch Lehrstuhl fuer Numerische Mathematik RWTH - Aachen University D 52056 Aachen, Germany -- http://mail.python.org/mailman/listinfo/python-list

Re: asynchronous timer events - how to?

2008-01-09 Thread Helmut Jarausch
Fredrik Lundh wrote: Helmut Jarausch wrote: I'm using a web server (Karrigell) which is based on the asyncore module. I'd like to be able to checkpoint some data (e.g. pickled dictionaries) to disk from time to time. For that I would need to setup a timer which calls a Python object

module finalizer - is there such a beast?

2008-01-11 Thread Helmut Jarausch
for a hint, Helmut Jarausch Lehrstuhl fuer Numerische Mathematik RWTH - Aachen University D 52056 Aachen, Germany -- http://mail.python.org/mailman/listinfo/python-list

common problem - elegant solution sought

2008-01-15 Thread Helmut Jarausch
take an additional function argument for the comparisons. Many thanks for your hints, Helmut Jarausch Lehrstuhl fuer Numerische Mathematik RWTH - Aachen University D 52056 Aachen, Germany -- http://mail.python.org/mailman/listinfo/python-list

Re: common problem - elegant solution sought

2008-01-15 Thread Helmut Jarausch
Thanks to you all for your help. The solution to regenerate the list skipping the one to be deleted is fine for me since my lists are of moderate size and the operation is infrequent. Helmut. -- Helmut Jarausch Lehrstuhl fuer Numerische Mathematik RWTH - Aachen University D 52056 Aachen

Re: common problem - elegant solution sought

2008-01-15 Thread Helmut Jarausch
Neil Cerutti wrote: On Jan 15, 2008 5:33 AM, Helmut Jarausch [EMAIL PROTECTED] wrote: Hi, I'm looking for an elegant solution of the following tiny but common problem. I have a list of tuples (Unique_ID,Date) both of which are strings. I want to delete the tuple (element) with a given

Benchmark [was Re: common problem - elegant solution sought]

2008-01-15 Thread Helmut Jarausch
Again, many thanks to all who provide their solution. I have timed these (though on my old P3(0.9GHz)) - see below Helmut. Helmut Jarausch wrote: Hi, I'm looking for an elegant solution of the following tiny but common problem. I have a list of tuples (Unique_ID,Date) both of which

Re: Benchmark [was Re: common problem - elegant solution sought]

2008-01-15 Thread Helmut Jarausch
Paul Rubin wrote: Helmut Jarausch [EMAIL PROTECTED] writes: def del_by_key(L,key) : for pos, (k,d) in enumerate(L): if k == key : del L[pos] break This looks very dangerous, mutating L while iterating over it. No, as Bruno Desthuilliers has pointed out, because one

Re: super, decorators and gettattribute

2008-01-15 Thread Helmut Jarausch
Michele Simionato wrote: I really need to publish this one day or another, since these questions about super keeps coming out: http://www.phyast.pitt.edu/~micheles/python/super.html Unfortunately the links [2], [3] and [4] are not given, Helmut. -- Helmut Jarausch Lehrstuhl fuer

ctypes CDLL - which paths are searched?

2008-01-21 Thread Helmut Jarausch
Hi, how can I specify the paths to be searched for a dynamic library to be loaded by ctypes' CDLL class on a Linux system. Do I have to set os.environment['LD_LIBRARY_PATH'] ? Many thanks for a hint, Helmut. -- Helmut Jarausch Lehrstuhl fuer Numerische Mathematik RWTH - Aachen University D

Re: ctypes CDLL - which paths are searched?

2008-01-22 Thread Helmut Jarausch
Thomas Heller wrote: Helmut Jarausch schrieb: Hi, how can I specify the paths to be searched for a dynamic library to be loaded by ctypes' CDLL class on a Linux system. Do I have to set os.environment['LD_LIBRARY_PATH'] ? ctypes passes the argument given to CDLL(path) straight

Re: Removing objects

2008-01-23 Thread Helmut Jarausch
N.key,N.data MyQ.dequeue(MyQ.Tail) print after second dequeue print Head: ,MyQ.Head, Tail: ,MyQ.Tail for N in MyQ: print loop3-,N print N.key,N.data ENJOY, Helmut. -- Helmut Jarausch Lehrstuhl fuer Numerische Mathematik RWTH - Aachen University D 52056 Aachen, Germany -- http

Re: global/local variables

2008-01-25 Thread Helmut Jarausch
of a singleton class called gameVars that would get passed everywhere. It's unlikely that they'll get mixed in with anyhting else, as they fulfill a unique function. Also, I think it's more convenient, and I am, after all, my own employer when it comes to programming. -- Helmut Jarausch

Tkinter - incremental input ?

2008-01-30 Thread Helmut Jarausch
can only see the brute force method: keeping track of all cursor positioning means like Backspace, Del, the '-' and '-' keys and mouse clicks. Is there an easier method? Many thanks for a hint or even a pointer to an example, Helmut. -- Helmut Jarausch Lehrstuhl fuer Numerische Mathematik RWTH

Re: Trouble loading dll via ctypes

2008-01-30 Thread Helmut Jarausch
. -- Helmut Jarausch Lehrstuhl fuer Numerische Mathematik RWTH - Aachen University D 52056 Aachen, Germany -- http://mail.python.org/mailman/listinfo/python-list

Re: Sine Wave Curve Fit Question

2008-01-30 Thread Helmut Jarausch
and similarly. Now, for Python, to handle vectors and scalar products efficiently, have a look at numpy. -- Helmut Jarausch Lehrstuhl fuer Numerische Mathematik RWTH - Aachen University D 52056 Aachen, Germany -- http://mail.python.org/mailman/listinfo/python-list

Re: Sine Wave Curve Fit Question

2008-01-31 Thread Helmut Jarausch
Mikael Olofsson wrote: Helmut Jarausch wrote: Your model is A*sin(omega*t+alpha) where A and alpha are sought. Let T=(t_1,...,t_N)' and Y=(y_1,..,y_N)' your measurements (t_i,y_i) ( ' denotes transposition ) First, A*sin(omega*t+alpha) = A*cos(alpha)*sin(omega*t) + A*sin(alpha)*cos

helper function in a class' namespace

2008-01-31 Thread Helmut Jarausch
++ history. Many thanks for your help, Helmut. -- Helmut Jarausch Lehrstuhl fuer Numerische Mathematik RWTH - Aachen University D 52056 Aachen, Germany -- http://mail.python.org/mailman/listinfo/python-list

hashing an array - howto

2008-09-05 Thread Helmut Jarausch
know such a thing? Many thanks for a hint, Helmut Jarausch Lehrstuhl fuer Numerische Mathematik RWTH - Aachen University D 52056 Aachen, Germany -- http://mail.python.org/mailman/listinfo/python-list

sendmail a long message

2007-11-21 Thread Helmut Jarausch
this. Is there an alternative solution, e.g. where smtplib.SMTP.sendmail calls a generator. Many thanks for a hint, Helmut Jarausch Lehrstuhl fuer Numerische Mathematik RWTH - Aachen University D 52056 Aachen, Germany -- http://mail.python.org/mailman/listinfo/python-list

Re: sendmail a long message

2007-11-21 Thread Helmut Jarausch
Laszlo Nagy wrote: Helmut Jarausch wrote: Hi, to send a possibly long email I have seen a solution which does os.popen to an external sendmail program and then writes the message into that pipe. I wonder if it possible to use smtplib.SMTP.sendmail but this requires building the complete

check object being a compiled regular expression

2006-03-25 Thread Helmut Jarausch
,_sre.SRE_Pattern) and if isinstance(RX,re._sre.SRE_Pattern) both fail. Many thanks for a hint, Helmut Jarausch Lehrstuhl fuer Numerische Mathematik RWTH - Aachen University D 52056 Aachen, Germany -- http://mail.python.org/mailman/listinfo/python-list

Re: File processing - is Python suitable?

2007-06-19 Thread Helmut Jarausch
some pointers http://gnosis.cx/TPiP/ http://www.egenix.com/products/python/mxBase/mxTextTools/ -- Helmut Jarausch Lehrstuhl fuer Numerische Mathematik RWTH - Aachen University D 52056 Aachen, Germany -- http://mail.python.org/mailman/listinfo/python-list

Python in a nutshell - new edition ?

2006-06-28 Thread Helmut Jarausch
Hi, is there a new edition of Python in a Nutshell covering Python 2.5 coming soon? Many thanks, Helmut Jarausch Lehrstuhl fuer Numerische Mathematik RWTH - Aachen University D 52056 Aachen, Germany -- http://mail.python.org/mailman/listinfo/python-list

How to terminate a main script?

2006-07-11 Thread Helmut Jarausch
for an exception. And setting a 'flag' and testing at several place for 'fall through' is ugly and error-prone. So what is a good choice? Many thanks for a hint, Helmut Jarausch Lehrstuhl fuer Numerische Mathematik RWTH - Aachen University D 52056 Aachen, Germany -- http://mail.python.org/mailman/listinfo

Re: How to terminate a main script?

2006-07-11 Thread Helmut Jarausch
Fredrik Lundh wrote: Helmut Jarausch wrote: Using sys.exit(0) produces an error message which looks dangerous to an uninitiated user. sys.exit(0) doesn't print anything at all. Yes, sorry, I was trying in in 'idle' There you get Traceback (most recent call last): File pyshell#1, line

NNTPlib::xover problem

2006-08-07 Thread Helmut Jarausch
No such article I would have expected to get an empty 'Response' or the value None for 'Articles'. What am I missing? (This is Python 2.4.3) Many thanks for a hint, Helmut Jarausch Lehrstuhl fuer Numerische Mathematik RWTH - Aachen University D 52056 Aachen, Germany -- http://mail.python.org

Re: NNTPlib::xover problem

2006-08-07 Thread Helmut Jarausch
. Thanks, though the name of the exception 'nntplib.NNTPTemporaryError' sound 'temporary' Helmut. Op 7-aug-2006, om 12:50 heeft Helmut Jarausch het volgende geschreven: Hi I try to regularly extract recent news from some newsgroups. If News is an NNTP object I try (Response,Articles

Re: hide python code !

2006-08-11 Thread Helmut Jarausch
John Machin wrote: Bayazee wrote: hi can we hide a python code ? if i want to write a commercial software can i hide my source code from [1] users access ? we can conver it to pyc but this file can decompiled ... so ...!! do you have any

upgrade 2.4 - 2.5 HowTo

2006-09-04 Thread Helmut Jarausch
for a hint, Helmut Jarausch Lehrstuhl fuer Numerische Mathematik RWTH - Aachen University D 52056 Aachen, Germany -- http://mail.python.org/mailman/listinfo/python-list

Re: upgrade 2.4 - 2.5 HowTo

2006-09-04 Thread Helmut Jarausch
Sibylle Koczian wrote: Helmut Jarausch schrieb: Hi, what has to be done for upgrading from Python 2.4 to 2.5? - How can I find out which packages (in addition to the core packages) have been installed up to now - Can I just copy /usr/local/lib/python2.4/site-packages

Re: Test for number?

2006-09-04 Thread Helmut Jarausch
... numtest() # enter 1 1 is a number between 1 20 numtest() # enter f f is not a number its not a final solution though, think input = -2, 5.5 or 21 One step further try: eval(x+'0') -- Helmut Jarausch Lehrstuhl fuer Numerische Mathematik RWTH - Aachen University D 52056

Re: mutable numeric type

2007-01-02 Thread Helmut Jarausch
[EMAIL PROTECTED] wrote: Way to go. Try doing this. x = MutableNumeric(42) ^^ where is this defined? y = x x += 42 print y -- Helmut Jarausch Lehrstuhl fuer Numerische Mathematik RWTH - Aachen University D 52056 Aachen, Germany -- http://mail.python.org/mailman

python2.5 frameobject - how to upgrade?

2007-01-02 Thread Helmut Jarausch
Hi, I'd like to install a package ('rekall') which uses frame-f_nlocals which is no longer contained in frameobject.h What's the recommended way to upgrade such an application? Many thanks for a hint, Helmut Jarausch Lehrstuhl fuer Numerische Mathematik RWTH - Aachen University D 52056 Aachen

Re: python2.5 frameobject - how to upgrade?

2007-01-02 Thread Helmut Jarausch
the trick. Yes, thanks, that fixed it, Happy New Year to you. A personal question: Have you converted from Perl to Python, as well? -- Helmut Jarausch Lehrstuhl fuer Numerische Mathematik RWTH - Aachen University D 52056 Aachen, Germany -- http://mail.python.org/mailman/listinfo/python-list

double import protection - how to ?

2008-11-29 Thread Helmut Jarausch
be executed only once, initializes another OS-thread (java in my case)) Many thanks for a hint, Helmut Jarausch Lehrstuhl fuer Numerische Mathematik RWTH - Aachen University D 52056 Aachen, Germany -- http://mail.python.org/mailman/listinfo/python-list

Re: double import protection - how to ?

2008-11-29 Thread Helmut Jarausch
Peter Otten wrote: Helmut Jarausch wrote: I have a module which gets imported at several different places not all of which are under my control. How can I achieve that all/some statements within that module get executed only at the very first import? What you describe is Python's default

Re: double import protection - how to ?

2008-12-01 Thread Helmut Jarausch
Peter Otten wrote: Helmut Jarausch wrote: Peter Otten wrote: Helmut Jarausch wrote: Then it's a problem with a problem with a webserver written in Python (Karrigell-3.0) and probably related to multi-threading (the statements in my module get definitely executed more than once). Maybe

Is it safe to modify the dict returned by vars() or locals()

2008-12-01 Thread Helmut Jarausch
in parms : vars()[N]= parms[N] else : vars()[N]= None Does this work, is it typical Python? Many thanks for a hint, Helmut. -- Helmut Jarausch Lehrstuhl fuer Numerische Mathematik RWTH - Aachen University D 52056 Aachen, Germany -- http://mail.python.org/mailman/listinfo/python-list

Re: Is it safe to modify the dict returned by vars() or locals()

2008-12-02 Thread Helmut Jarausch
Chris Rebert wrote: On Mon, Dec 1, 2008 at 1:01 PM, Helmut Jarausch [EMAIL PROTECTED] wrote: Hi, I am looking for an elegant way to solve the following problem: Within a function def Foo(**parms) I have a list of names, say VList=['A','B','C1'] and I like to generate abbreviation _A

Re: Is it safe to modify the dict returned by vars() or locals()

2008-12-03 Thread Helmut Jarausch
Duncan Booth wrote: Helmut Jarausch [EMAIL PROTECTED] wrote: Chris Rebert wrote: On Mon, Dec 1, 2008 at 1:01 PM, Helmut Jarausch [EMAIL PROTECTED] wrote: Hi, I am looking for an elegant way to solve the following problem: Within a function def Foo(**parms) I have a list of names, say

python3.0 - any hope it will get faster?

2008-12-09 Thread Helmut Jarausch
computers get faster, we human beings don't (me, at least) -- Helmut Jarausch Lehrstuhl fuer Numerische Mathematik RWTH - Aachen University D 52056 Aachen, Germany -- http://mail.python.org/mailman/listinfo/python-list

subprocess.Popen - file like object from stdout=PIPE

2009-02-04 Thread Helmut Jarausch
the lines of it like for line in EQ_OUT : ... I could use StringIO.StringIO applied to EQ_output but this reads all of the command's output into a big string first. On Unix/Linux a pipe is a file-like object after all, so how to get hold of it. Many thanks for a hint, Helmut. -- Helmut

Re: subprocess.Popen - file like object from stdout=PIPE

2009-02-04 Thread Helmut Jarausch
Chris Rebert wrote: On Wed, Feb 4, 2009 at 1:22 AM, Helmut Jarausch jarau...@skynet.be wrote: Hi, using e.g. import subprocess Package='app-arch/lzma-utils' EQ=subprocess.Popen(['/usr/bin/equery','depends',Package],stdout=subprocess.PIPE) EQ_output= EQ.communicate()[0] EQ_output is a string

Re: subprocess.Popen - file like object from stdout=PIPE

2009-02-04 Thread Helmut Jarausch
Clovis Fabricio wrote: 2009/2/4 Helmut Jarausch jarau...@skynet.be: using e.g. import subprocess Package='app-arch/lzma-utils' EQ=subprocess.Popen(['/usr/bin/equery','depends',Package],stdout=subprocess.PIPE) EQ_output= EQ.communicate()[0] EQ_output is a string containing multiple lines. I'd

Re: subprocess.Popen - file like object from stdout=PIPE

2009-02-04 Thread Helmut Jarausch
Clovis Fabricio wrote: 2009/2/4 Helmut Jarausch jarau...@skynet.be: EQ.stdout is the filelike object you're looking for. communicate() grabs entire output at once so don't use it. Thanks a lot, I haven't found that in the official documentation. Helmut. That would be a documentation bug

pygtk - icons?

2009-11-18 Thread Helmut Jarausch
a copy from: http://icon-theme.freedesktop.org/releases On my Gentoo system lots of packages have placed icons under /usr/share/icons/hicolor So, what am I missing. Many thanks for a hint, Helmut. -- Helmut Jarausch Lehrstuhl fuer Numerische Mathematik RWTH - Aachen University D 52056

Re: python regex negative lookahead assertions problems

2009-11-22 Thread Helmut Jarausch
, there is no 'warning' anymore, so it matches. What are you trying to achieve? If you just want to single out lines with 'ok' or warning in it, why not just if re.search('(ok|warning)') : call_skip Helmut. -- Helmut Jarausch Lehrstuhl fuer Numerische Mathematik RWTH - Aachen University D 52056 Aachen

Re: python regex negative lookahead assertions problems

2009-11-23 Thread Helmut Jarausch
On 11/22/09 16:05, Helmut Jarausch wrote: On 11/22/09 14:58, Jelle Smet wrote: Hi List, I'm trying to match lines in python using the re module. The end goal is to have a regex which enables me to skip lines which have ok and warning in it. But for some reason I can't get negative lookaheads

Re: Best way to convert sequence of bytes to long integer

2010-01-21 Thread Helmut Jarausch
() returns a byte string which has no .encode method. Just my 5 cents, Helmut. -- Helmut Jarausch Lehrstuhl fuer Numerische Mathematik RWTH - Aachen University D 52056 Aachen, Germany -- http://mail.python.org/mailman/listinfo/python-list

Re: Repost: Read a running process output

2010-02-05 Thread Helmut Jarausch
subprocess p1= subprocess.Popen(['/bin/ls','/LOCAL/'],stdout=subprocess.PIPE) for line in p1.stdout : print ,line which works just fine. Are you sure, your /usr/sunvts/bin/64/vtsk writes a newline character (readline is waiting for that)? Helmut. -- Helmut Jarausch Lehrstuhl fuer Numerische

Re: How to solve an LCP (linear complementarity problem) in python ?

2010-02-14 Thread Helmut Jarausch
body simulation. Sorry, I can't help you except pointing you to the Complementarity Problem Net http://www.cs.wisc.edu/cpnet/ -- Helmut Jarausch Lehrstuhl fuer Numerische Mathematik RWTH - Aachen University D 52056 Aachen, Germany -- http://mail.python.org/mailman/listinfo/python-list

Syntax question

2009-10-10 Thread Helmut Jarausch
() argument after ** must be a mapping, not tuple I'm afraid I don't understand this error message. BTW I'm using python-2.6.3 on the machine where I try to install 3.2a Many thanks for a hint, Helmut. -- Helmut Jarausch Lehrstuhl fuer Numerische Mathematik RWTH - Aachen University D 52056 Aachen, Germany

Re: Syntax question

2009-10-10 Thread Helmut Jarausch
Benjamin Peterson wrote: Helmut Jarausch jarausch at skynet.be writes: Hi, I'm trying to build the recent Python-3.2a (SVN). It fails in Lib/tokenize.py (line 87) How are you invoking it? As I said, it's 'make' in Python's source directory (SVN revision 75309 Last Changed Date: 2009-10

Re: Syntax question

2009-10-10 Thread Helmut Jarausch
Benjamin Peterson wrote: Helmut Jarausch jarausch at skynet.be writes: As I said, it's 'make' in Python's source directory (SVN revision 75309 Last Changed Date: 2009-10-10) I can't reproduce your failure. What are the exact commands you are using? CFLAGS='-O3 -mtune=native -msse2 -pipe

Python-3.2 (SVN) bug [was syntax question]

2009-10-12 Thread Helmut Jarausch
() argument after ** must be a mapping, not tuple Meanwhile I could narrow this down to the --with-tsc configure option. Without it, it builds just fine. Helmut. -- Helmut Jarausch Lehrstuhl fuer Numerische Mathematik RWTH - Aachen University D 52056 Aachen, Germany -- http://mail.python.org/mailman

convert Dbase (.dbf) files to SQLite databases

2009-07-15 Thread Helmut Jarausch
for a hint, Helmut. -- Helmut Jarausch Lehrstuhl fuer Numerische Mathematik RWTH - Aachen University D 52056 Aachen, Germany -- http://mail.python.org/mailman/listinfo/python-list

  1   2   >