PyAr - Python Argentina 10th Meeting, Thursday, August 4th

2005-08-04 Thread Batista, Facundo
Title: PyAr - Python Argentina 10th Meeting, Thursday, August 4th The Argentine Python User Group, PyAr, will have its tenth meeting this Thursday, August 4th at 7:00pm. Agenda -- Despite our agenda tends to be rather open, this time we would like to cover these topics: - Discuss

Re: Ideas for Python project?

2005-08-04 Thread Stuart Turner
Jon Hewer wrote: Hi I'm pretty new to Python, and recently been working my way through Dive Into Python, and I'm currently writing a really simple rss reader purely to get familiarised with the language. I want to move onto something a little more challenging, but I'm stuck for ideas on

Re: Wheel-reinvention with Python

2005-08-04 Thread Paul McNett
Mike Meyer wrote: Mike Meyer [EMAIL PROTECTED] writes: I think you'll find that wxPython installs perfectly on Tiger using the package provided. Indeed, the only really painful platform to install wxPython on is Linux, where you pretty much need to build from source if you want the latest and

Re: Wheel-reinvention with Python

2005-08-04 Thread Robert Kern
Paul McNett wrote: Mike Meyer wrote: Mike Meyer [EMAIL PROTECTED] writes: I think you'll find that wxPython installs perfectly on Tiger using the package provided. Indeed, the only really painful platform to install wxPython on is Linux, where you pretty much need to build from source if you

Re: Advanced concurrancy

2005-08-04 Thread Stefan Rank
on 04.08.2005 00:36 Michael Sparks said the following: Peter Tillotson wrote: I'm quite interested in the mini version and also using the modules as mobile code rather than installing it formally. I'll document it slightly better and post up on the website in the next 48 hours or so. In the

PEP-343 - Context Managment variant

2005-08-04 Thread falcon
I know I came after the battle. And I have just another sight on context managment. Simple Context Managment may look in Python 2.4.1 like this: Synhronized example: def Synhronised(lock,func): lock.acquire() try: func() finally:

Does pyparsing support UNICODE strings?

2005-08-04 Thread could ildg
pyparsing is very convenient to use. But I want to find some a py tool to parse non-English strings. Does pyparsing support UNICODE strings? If not, can someone tell me what py tool can do it? Thanks in advance. -- http://mail.python.org/mailman/listinfo/python-list

Re: Dabo in 30 seconds?

2005-08-04 Thread EP
But it would be a nice enhancement to add the option for auto-emailing in case of trouble. I like still like e-mail notices (it has a nice format we are used to as we use to communicate other things, and you can parse the text easily)... but I wonder: given the spam / virus induced

API class creation

2005-08-04 Thread kman3048
Hello, as a relative newcomer to Python API programming I've got a problem: To extend Python: - there is an API C call to create a module - there is also a API C call to create a method - there is an API C call to create a Class instance Now, I need to create a Class and fill it with Methods

substring and regular expression

2005-08-04 Thread [EMAIL PROTECTED]
i have read finding sublist http://groups.google.it/group/comp.lang.python/browse_thread/thread/50b09a0aca285256/5156ada81fc9358a?hl=it#5156ada81fc9358a the problem was in a string to find if we have two substring non overlapping of lenght al least 4 it was done by

Re: Python's CSV reader

2005-08-04 Thread Peter Otten
Stephan wrote: Can the CSV module be coerced to read two line formats at once or am I better off using read and split? Yes, it can: import csv import sys reader = csv.reader(sys.stdin) while True: try: names = reader.next() values = reader.next() except

Re: Invoke a method to a specific thread

2005-08-04 Thread Varghjärta
On 25/07/05, Diez B.Roggisch [EMAIL PROTECTED] wrote: Varghjärta varghjarta at gmail.com writes: If I have GUIClass:... And start another thread and from that thread I want to call the method PaintSomething() in GUIClass _in_ the same thread that GUIClass lives in. There is no such

Re: Wheel-reinvention with Python

2005-08-04 Thread Torsten Bronger
Hallöchen! Dennis Lee Bieber [EMAIL PROTECTED] writes: On Thu, 04 Aug 2005 00:53:28 -0400, Mike Meyer [EMAIL PROTECTED] declaimed the following in comp.lang.python: No, it's not a discussion about estimates. The average household in a G8 country has more computers that don't run Windows -

Re: Ideas for Python project?

2005-08-04 Thread Jon Hewer
Thanks i'll check it out. I'm not very good yet tho! On 8/4/05, Stuart Turner [EMAIL PROTECTED] wrote: Jon Hewer wrote: Hi I'm pretty new to Python, and recently been working my way through Dive Into Python, and I'm currently writing a really simple rss reader purely to get

Re: Does pyparsing support UNICODE strings?

2005-08-04 Thread Robert Kern
could ildg wrote: pyparsing is very convenient to use. But I want to find some a py tool to parse non-English strings. Does pyparsing support UNICODE strings? If not, can someone tell me what py tool can do it? Thanks in advance. Try it! # vim:fileencoding=utf-8 from pyparsing import Word

Re: Py: a very dangerous language

2005-08-04 Thread Peter Otten
Tom Anderson wrote: On Mon, 1 Aug 2005, Peter Otten wrote: Harald Massa wrote: Always go to bed exactly when you want to write the first lambda. Eureka. The Twentieth Pythonic Thesis has finally surfaced. So what does it mean that i do much of my programming in bed? You may want to

Re: Does pyparsing support UNICODE strings?

2005-08-04 Thread could ildg
I want to parse some Chinese words. It seems that pyparsing doesn't work for me. Thank you. I have to use re directly, although it's harder, but it'll always work. On 8/4/05, Robert Kern [EMAIL PROTECTED] wrote: could ildg wrote: pyparsing is very convenient to use. But I want to find some a

Re: Emacs skeletons

2005-08-04 Thread Jorgen Grahn
On Tue, 26 Jul 2005 22:08:25 +0200, Caleb Hattingh [EMAIL PROTECTED] wrote: Since you are on this topic, do you (or anyone else) have any type of code-completion mode for python in emacs? Thanks -george For what its worth, Vim has a generic type of code-completion that uses the file

Idiots guide to fonts with tKinter

2005-08-04 Thread import newbie
Hi all, I'm a programming dabbler trying learn Python, and I've got a few questions. Mainly: Where can I find a good open-source library or tutorial (preferably free) that explains how to easily manipulate text in a tKinter window? Basically, I want to be able to do anything that HTML can do (or

Re: API class creation

2005-08-04 Thread Peter Maas
kman3048 schrieb: Now, I need to create a Class and fill it with Methods and Variables. There are means to create (and attache) methods and variables. However, I have not found how to create a Class within a Module. Or do import aModule c = aClassGenerator() setattr(aModule,'c',c) ci =

Re: Advanced concurrancy

2005-08-04 Thread Matt Hammond
Hi Stefan, It seems as though all components basically have to do busy waiting now. You are right - components are, for the most part, busy-waiting. Which is not a good thing! So do you plan on including a kind of scheduler-aware blocking communication (like the `channels` of the `tasklets`

Re: Does pyparsing support UNICODE strings?

2005-08-04 Thread could ildg
OK, I make it. It's right, it can work fine with unicode. pyparsing is great. Thanks. On 8/4/05, could ildg [EMAIL PROTECTED] wrote: I want to parse some Chinese words. It seems that pyparsing doesn't work for me. Thank you. I have to use re directly, although it's harder, but it'll always

Re: Does pyparsing support UNICODE strings?

2005-08-04 Thread could ildg
So what's you code? and what's you system default encoding? On 8/4/05, saddle [EMAIL PROTECTED] wrote: hello, but i can't run the script. could u told me what's the trick pls? here is the error output. D:\python\testpyp sys:1: DeprecationWarning: Non-ASCII character '\xce' in file

Re: Administrative prohibition error when sending email

2005-08-04 Thread Lad
I solved the problem. The reason was uncomplete email message msg should be like this timezone = ' %+03d%02d' % (-time.timezone/3600, time.timezone%3600) MessageSubject=This is a subject BodyMessage=This is a body msg='From: '+fromaddr+' '+fromaddr+'\nTo: '+toaddrs+''+toaddrs+'\nDate: '+

Re: API class creation

2005-08-04 Thread Daniel Dittmar
kman3048 wrote: Hello, as a relative newcomer to Python API programming I've got a problem: To extend Python: - there is an API C call to create a module - there is also a API C call to create a method - there is an API C call to create a Class instance Now, I need to create a Class

Re: Does pyparsing support UNICODE strings?

2005-08-04 Thread could ildg
I tested his code in a file test2.py: # -*- coding: UTF-8 -*- from pyparsing import Word text = Καλημέρα, κόσμε!.decode('utf-8') alphas = u''.join(unichr(x) for x in xrange(0x386, 0x3ce)) greet = Word(alphas) + u',' + Word(alphas) + u'!' greeting = greet.parseString(text) print greeting After

Re: COM makepy problem

2005-08-04 Thread James Kew
Alexander Eisenhuth [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] ActivePython 2.4.1 Windows XP I write a COM Server in VC++ 6.0 using ATL. So far so good. While I develop I got sometimes strange behaviour with makepy utility. Today again. :-( SyntaxError: invalid syntax

Re: Python-Excel: How to paste selected cells (range) to different location on the same sheet in Excel

2005-08-04 Thread mimicico
I think you just need do: sh.Range(sh.Cells(4,1),sh.Cell­s(6,3)).Value = sh.Range(sh.Cells(1,1),sh.Cell­s(3,3)).Value -- http://mail.python.org/mailman/listinfo/python-list

Re: Secure email

2005-08-04 Thread Martin P. Hellwig
[EMAIL PROTECTED] wrote: I need to write a .cgi that will take the content of an https GET or POST and send it securely as email to an Outlook client. I think that OpenSSL is somewhere in this, but I'm not even sure how to create the right certificate, how to use it to encrypt mail and how

Re: Secure email

2005-08-04 Thread Michael Ströder
[EMAIL PROTECTED] wrote: I need to write a .cgi that will take the content of an https GET or POST and send it securely as email to an Outlook client. I think that OpenSSL is somewhere in this, but I'm not even sure how to create the right certificate, how to use it to encrypt mail and how

Re: Secure email

2005-08-04 Thread Michael Ströder
Martin P. Hellwig wrote: I think you want this more common approach for mail encryption: server: https CGI form -- mail wrapper -- PGP encryption/signing -- send client: recieve mail -- pgp decryption/verification -- read This would require an additional PGP-plugin for Outlook. Outlook

Re: pyunit and Eclipse

2005-08-04 Thread Fabio Zadrozny
Steve Jorgensen wrote: I was working with a friend on a project Monday night, and tried to run a pyunit test from Eclipse, and nothing seemed to happen. We finally figured out that the test is doing exactly what it's supposed to do, but the pyunit output isn't making it to the Eclipse console

Re: pain

2005-08-04 Thread Martin P. Hellwig
Mage wrote: cut Thank you, I will check this out. My company will switch to a jsp site. cut Well I don't know your company and how many developers there are but I know this; a manager telling me what tools to use to do my job is a bad manager by definition because he should realize that the

Re: Secure email

2005-08-04 Thread Martin P. Hellwig
Michael Ströder wrote: Martin P. Hellwig wrote: I think you want this more common approach for mail encryption: server: https CGI form -- mail wrapper -- PGP encryption/signing -- send client: recieve mail -- pgp decryption/verification -- read This would require an additional PGP-plugin

Reliable destruction

2005-08-04 Thread Pierre-Eric . Melchy
Hello, I have a class measurement representing a physical measurement. Different objects in this class represent laboratory equipment, which might raise an exception (e.g. overtemperature). In any case the equipment has to be switched off after the experiment, since if a power supply stays in

Re: Secure email

2005-08-04 Thread Michael Ströder
Martin P. Hellwig wrote: Michael Ströder wrote: Martin P. Hellwig wrote: I think you want this more common approach for mail encryption: server: https CGI form -- mail wrapper -- PGP encryption/signing -- send client: recieve mail -- pgp decryption/verification -- read This would

Pythoncard - gauge component.

2005-08-04 Thread fiddlehead
Hello. I'd to use gauge component in the code below. I want to show Queue.quantity in gauge (during running thread, every time when it changed). I don't know which event i must use. I find some info about Time event for gauge but don't understand how it works. Any suggestions?

Re: Reliable destruction

2005-08-04 Thread Benjamin Niemann
[EMAIL PROTECTED] wrote: Hello, I have a class measurement representing a physical measurement. Different objects in this class represent laboratory equipment, which might raise an exception (e.g. overtemperature). In any case the equipment has to be switched off after the experiment,

Re: COM makepy problem

2005-08-04 Thread Alexander Eisenhuth
James Kew schrieb: Alexander Eisenhuth [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] ActivePython 2.4.1 Windows XP I write a COM Server in VC++ 6.0 using ATL. So far so good. While I develop I got sometimes strange behaviour with makepy utility. Today again. :-( SyntaxError:

Embedded python

2005-08-04 Thread nico
Hi, Does anyone have embedded a python interpreter on a proprietary hardware ? I have a home made hardware running a home made OS. C is used as programming language. I'd like to add a python interpreter to my system. Any guidelines ? Nicolas --

Re: Reliable destruction

2005-08-04 Thread Pierre-Eric . Melchy
Hello Benjamin, What would happen if an exception was thrown in the middle of setup()? tearDown could not handle this case without having a list of the objects already constructed (Or I would have to rely on the automatic call to __del__, if it is reliable). There is still some problem: Imagine

Re: Art of Unit Testing

2005-08-04 Thread Christoph Zwerschke
Your own feature request for setUpOnce() and tearDownOnce() is trivially coded using a global or class variable to restrict running to a single occasion. If that seems unpleasant, then encapsulate the logic in a subclass of TestCase, in a decorator, or in a metaclass. Ok, you can have a

Re: Python's CSV reader

2005-08-04 Thread Andrew McLean
In article [EMAIL PROTECTED], Stephan [EMAIL PROTECTED] writes I'm fairly new to python and am working on parsing some delimited text files. I noticed that there's a nice CSV reading/writing module included in the libraries. My data files however, are odd in that they are composed of lines with

Metaclasses and class variables

2005-08-04 Thread Jan-Ole Esleben
Hi! I am new to this list, and maybe this is a stupid question, but I can't seem to find _any_ kind of answer anywhere. What I want to do is the following: I want to insert a class variable into a class upon definition and actually use it during definition. Manually, that is possible, e.g.:

Re: PyGTK or wxPython (not a flame war) on Windows

2005-08-04 Thread TPJ
I have encountered some problems with PyGTK only when I was trying to install a PyGTK version that was different from the installed GTK+ version. When those both versions were the same, I had no problems at all. (Another problem with PyGTK is that it's installation is somewhat more complicated

QFileDialog

2005-08-04 Thread manojkumar_net
I am using windows Qt3.3.4 and want to verify the selected file path on pressing the OK button of File Dialog. After checking I don't want to close the QFileDialog. Can anyone tell me how to stop closing the FileDialog after checking the file path on pressing ok button. --

Re: Metaclasses and class variables

2005-08-04 Thread Christopher Subich
Jan-Ole Esleben wrote: class Meta(type): def __new__(cls, name, bases, d): d['classvar'] = [] return type.__new__(cls, name, bases, d) The problem is that __new__ is called upon object construction, not class definition, but you're trying to set the class variables at

jython: PythonInterpreter runs script, wrong classpath

2005-08-04 Thread HK
Hi, I am using ant to run junit to run a java class that uses a PythonInterpreter to execute a script. The script complains about a ImportError: cannot import name ... despite the fact that junit, on behalf of ant -v pretends to be using exactly the right classpath. Obviously the classpath does

Re: substring and regular expression

2005-08-04 Thread Kent Johnson
[EMAIL PROTECTED] wrote: i have read finding sublist http://groups.google.it/group/comp.lang.python/browse_thread/thread/50b09a0aca285256/5156ada81fc9358a?hl=it#5156ada81fc9358a the problem was in a string to find if we have two substring non overlapping of lenght al least 4 it was

Re: Metaclasses and class variables

2005-08-04 Thread Jan-Ole Esleben
I thought __new__ was called upon construction of the _class_ object that Meta is the type of. Then it would be available at the time of the definition of my class. Or am I mistaken? Ole 2005/8/4, Christopher Subich [EMAIL PROTECTED]: Jan-Ole Esleben wrote: class Meta(type): def

Re: pain

2005-08-04 Thread Greg Lindstrom
Mage Wrote: I would be surprised if there were more than five python jobs in my country but have to look around. I Reply: It's not quite that bad in Arkansas (USA), but when I was hired to help start a new IT department I insisted on using Python and my employer agreed to try it. I now have over

listing users in Plone

2005-08-04 Thread Somesh
Hi, 1.I have installed and running a plone Intranet site, I have registerd users on it. I want to get list of all registerd users on a page. how I should move towards getting it / scripting it in my index_html page ? I am just a frontend user of plone. 2.How to start creating small database

Re: Metaclasses and class variables

2005-08-04 Thread Mike C. Fletcher
Jan-Ole Esleben wrote: Yes, that works, but it is unfortunately not an option (at least not a good one). Is there no way to create a class variable that exists during definition of the class? (I cannot imagine there isn't, since technically it's possible and manually it can be done...) Ole

Re: Embedded python

2005-08-04 Thread Chris Johns
nico wrote: Does anyone have embedded a python interpreter on a proprietary hardware ? Yes, http://www.cybertec.com.au/microcore.htm I have a home made hardware running a home made OS. C is used as programming language. I'd like to add a python interpreter to my system. Any guidelines ?

Re: Passing a log handle to a module? Help needed with logging module and

2005-08-04 Thread rh0dium
I found my problem it wasn't this piece of the problem it was another... Thanks. However if you want a working example go here.. http://www.onlamp.com/pub/a/python/2005/06/02/logging.html -- http://mail.python.org/mailman/listinfo/python-list

Re: substring and regular expression

2005-08-04 Thread [EMAIL PROTECTED]
but in general is there a way to include in a re, in this example something like...matches iff p , and q in which p==q[::-1] ? A way to putting a small part of code of python in re? Thanx for your many helps -- http://mail.python.org/mailman/listinfo/python-list

Re: pain

2005-08-04 Thread projecktzero
a manager telling me what tools to use to do my job is a bad manager by definition because he should realize that the people who best know what tools to use are the peope who use the tools*. I'm sorry, this doesn't make much sense to me. In an ideal world where all developers are all knowing and

installing python2.4.1

2005-08-04 Thread Belyh G.P.
While I try to install python arise an error: I type ./configure ... ... checking for g++ ... no checking for gcc ... gcc checking for C++ compiler default output file name ... configure: error: C++ compiler cannot create executables See 'config.log' for more details. config.log is This

Re: Fail codecs.lookup() on 'mbcs' and 'tactis'

2005-08-04 Thread Richard Brodie
[EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I don't know what 'tactis' is, but 'mbcs' is not a portable character set name. It's a special character set name on win32, which refers to some system-specific multibyte character set. I don't think these failures are a Python

Re: installing python2.4.1

2005-08-04 Thread Belyh G.P.
Belyh G.P. wrote: Belyh G.P. wrote: OS - Debian GNU/Linux 3.1 Sorry forgor Hi all! :) -- http://mail.python.org/mailman/listinfo/python-list

Re: Mass importing of a template based system.. Trouble with name substitutions

2005-08-04 Thread Peter Otten
rh0dium wrote: for mod in modules: a = mod.mod() a.run() Puzzle: If mod.mod did what you expect, what would a.run have to do to maintain consistency? There would be no way to determine the name of the module bound to the mod variable, but fortunately the Python developers foresaw

Re: Python's CSV reader

2005-08-04 Thread Stephan
Thank you all for these interesting examples and methods! Supposing I want to use DictReader to bring in the CSV lines and tie them to field names, (again, with alternating lines having different fields), should I use two two DictReaders as in Christopher's example or is there a better way? --

Re: Python's CSV reader

2005-08-04 Thread Peter Otten
Stephan wrote: Thank you all for these interesting examples and methods! You're welcome. Supposing I want to use DictReader to bring in the CSV lines and tie them to field names, (again, with alternating lines having different fields), should I use two two DictReaders as in Christopher's

Re: Metaclasses and class variables

2005-08-04 Thread Jan-Ole Esleben
Thanks! It's a bit icky, yes, but I've been so wrapped up in complicated thinking that I didn't see this. It's actually quite an OK solution (I need it because I have an internal representation for method interfaces that needs to be saved somewhere without the user having to worry about it, and

Re: Mass importing of a template based system.. Trouble with name substitutions

2005-08-04 Thread rh0dium
Peter Otten wrote: rh0dium wrote: for mod in modules: a = mod.mod() a.run() Puzzle: If mod.mod did what you expect, what would a.run have to do to maintain consistency? I thought that once a = example.example the class is then loaded. Since my framework defines a python file

Re: cut paste text between tkinter widgets

2005-08-04 Thread William Gill
handy. Thanks, Bill [EMAIL PROTECTED] wrote: Here's some code that gives a cut-copy-paste pop-up window on all Entry widgets in an application. This code is released into the public domain. Jeff Epler # import

Re: ANN: Kamaelia 0.2.0 released!

2005-08-04 Thread Michael Sparks
Terry Reedy wrote: Michael Sparks [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] def updater(interval, message): t = time.time(): while 1: if time.time() - t interval: print message yield None # add this Yes. (I can't believe I missed that

Re: Fail codecs.lookup() on 'mbcs' and 'tactis'

2005-08-04 Thread jepler
On Thu, Aug 04, 2005 at 03:59:01PM +0100, Richard Brodie wrote: I suppose, for consistency, it should ideally raise LookupError, though Maybe so. If that was the poster's point, then I completely missed it. Jeff pgpUjJySHoMrY.pgp Description: PGP signature --

Re: Secure email

2005-08-04 Thread Martin P. Hellwig
Michael Ströder wrote: cut This would require an additional PGP-plugin for Outlook. Outlook can decrypt S/MIME messages out-of-the-box. Yes indeed, although I personaly find pgp a bit more elegant your solution would be the best for the OP. cut Whether S/MIME or PGP is used depends very much on

Re: Reliable destruction

2005-08-04 Thread Benjamin Niemann
[EMAIL PROTECTED] wrote: Hello Benjamin, What would happen if an exception was thrown in the middle of setup()? tearDown could not handle this case without having a list of the objects already constructed (Or I would have to rely on the automatic call to __del__, if it is reliable). class

Re: Windows command line problem

2005-08-04 Thread [EMAIL PROTECTED]
Here's an example... BEGIN TEST.PY import sys print Original:, sys.argv for arg in sys.argv: arg = arg.strip('-\x93\x96') # add chars here you want to strip print Stripped:, arg END TEST.PY -- http://mail.python.org/mailman/listinfo/python-list

Re: listing users in Plone

2005-08-04 Thread [EMAIL PROTECTED]
Can't help you with #1 as I don't use Plone anymore. I prefer using plain Zope and building my site around that. There's not much that Plone adds for me, besides a skin. As for 2, I do have some experience doing that. First, create a ZSQL statement that does something like this: select * from

Re: Getting HTML from a loaded page in Firefox

2005-08-04 Thread [EMAIL PROTECTED]
Please explain in more detail exactly what your problem was using the method you described. We can help you, but most would be hard pressed to write your code for you. -- http://mail.python.org/mailman/listinfo/python-list

Re: python ETL

2005-08-04 Thread Jorgen Grahn
On Mon, 01 Aug 2005 10:49:36 -0500, Paul Watson [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: Hi, My company is involved in the development of many data marts and data-warehouses, and I currently looking into migrating our old set of tools (written in Korn) to a new, more dynamic and

Re: Reliable destruction

2005-08-04 Thread Raymond Hettinger
[EMAIL PROTECTED] My questions are: 1) under normal conditions (no exceptions) is there a guarantee, that __del__ of all instruments is called at the end of measurement()? 2) if an exception is thrown, will all instruments be deleted if the error occurs in run() ? (only the instruments

Re: [ANN] pylint 0.7

2005-08-04 Thread François Pinard
[Sylvain Thénault] I'm pleased to announce a new release of PyLint. Bonjour Sylvain. J'ai la compulsion de dire bonjour, et merci! (On peut me tutoyer sans problème.) Ce logiciel `pylint', que je viens d'installer et d'essayer pour la première fois ce matin (donc, j'écris encore sur l'effet

Re: PEP-343 - Context Managment variant

2005-08-04 Thread Terry Reedy
falcon [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] def Synhronised(lock,func): lock.acquire() try: func() finally: lock.release() lock=Lock() def Some(): local_var1=x local_var2=y local_var3=Z def

Re: substring and regular expression

2005-08-04 Thread Diez B.Roggisch
borges2003xx at yahoo.it borges2003xx at yahoo.it writes: but in general is there a way to include in a re, in this example something like...matches iff p , and q in which p==q[::-1] ? A way to putting a small part of code of python in re? Thanx for your many helps What you are after is a

sample code for parsing html file to get contents of td fields

2005-08-04 Thread yaffa
does anyone have sample code for parsting an html file to get contents of a td field to write to a mysql db? even if you have everything but the mysql db part ill take it. thanks yaffa -- http://mail.python.org/mailman/listinfo/python-list

Re: sample code for parsing html file to get contents of td fields

2005-08-04 Thread William Park
yaffa [EMAIL PROTECTED] wrote: does anyone have sample code for parsting an html file to get contents of a td field to write to a mysql db? even if you have everything but the mysql db part ill take it. I usually use Expat XML parser to extract the field.

Re: sample code for parsing html file to get contents of td fields

2005-08-04 Thread Bill Mill
On 4 Aug 2005 11:54:38 -0700, yaffa [EMAIL PROTECTED] wrote: does anyone have sample code for parsting an html file to get contents of a td field to write to a mysql db? even if you have everything but the mysql db part ill take it. Do you want something like this? In [1]: x = something

Tough Tkinter Scrollregion vs Window Size Problem

2005-08-04 Thread syed_saqib_ali
Below is a simple code snippet showing a Tkinter Window bearing a canvas and 2 connected scrollbars (Vertical Horizontal). Works fine. When you shrink/resize the window the scrollbars adjust accordingly. However, what I really want to happen is that the area of the canvas that the scrollbars

2.3 or 2.4 on linux

2005-08-04 Thread Sells, Fred
We are in the process of standardizing ~10 Linux servers on Lineox 4.x, which is a variant of RedHat Enterprise server I'm told. Part of that process is to standardize python. The baseline install includes python 2.3 which is adequate, but I would like to standardize on 2.4.1, because it is the

Re: sample code for parsing html file to get contents of td fields

2005-08-04 Thread Kent Johnson
yaffa wrote: does anyone have sample code for parsting an html file to get contents of a td field to write to a mysql db? even if you have everything but the mysql db part ill take it. http://www.crummy.com/software/BeautifulSoup/examples.html --

Re: installing python2.4.1

2005-08-04 Thread Grig Gheorghiu
I had a similar problem when trying to compile Python 2.4.1 on AIX. The configure script complained about not finding 'cc_r'. I simply did 'ln -s /usr/bin/gcc /usr/bin/cc_r' and that solved my problem. You may consider doing the same for cclplus. Grig --

Re: Wheel-reinvention with Python

2005-08-04 Thread Cliff Wells
On Thu, 2005-08-04 at 01:04 -0400, Mike Meyer wrote: Right. Let's go back to the original question: What's the app I use on Unix that acts like py2exe on Windows and py2app on Unix? Any archiving system can be coerced into collecting all the parts together. None of them do it automatically.

Re: SciPy and NetCDF

2005-08-04 Thread Scott Kilpatrick
Thanks for your help guys! That cleared some stuff up for me. Now I just have to wait for the sysadmin to get back from his vacation, bah. Scott -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a way to determine -- when parsing -- if a word contains a builtin name or other imported system module name?

2005-08-04 Thread David M. Cooke
Casey Hawthorne [EMAIL PROTECTED] writes: Is there a way to determine -- when parsing -- if a word contains a builtin name or other imported system module name? Like iskeyword determines if a word is a keyword! Look in the keyword module; there is actually an iskeyword function there :) For

wxPython ListCtrl_edit and TextEditMixin on mac OS X 10.4

2005-08-04 Thread Sven Tissot
Hello, I am trying to build an editable ListCtrl_edit via TextEditMixin. It displays o.k. and I can edit the first field with this is the code piece: class VokabelListCtrl(wxListCtrl, listmix.ListCtrlAutoWidthMixin, listmix.TextEditMixin): def

Re: 2.3 or 2.4 on linux

2005-08-04 Thread Paul Watson
Sells, Fred wrote: We are in the process of standardizing ~10 Linux servers on Lineox 4.x, which is a variant of RedHat Enterprise server I'm told. Part of that process is to standardize python. The baseline install includes python 2.3 which is adequate, but I would like to standardize on

Parallel arithmetic?

2005-08-04 Thread Terrance N. Phillip
Given a and b, two equal length lists of integers, I want c to be [a1-b1, a2-b2, ... , an-bn]. I can do something like: c = [0] * len(a) for ndx, item in enumerate(a): c[ndx] = item - b[ndx] But I'm wondering if there's a better way, perhaps that avoids a loop? Nick. (I seem to recall

Re: Parallel arithmetic?

2005-08-04 Thread Paul Rubin
Terrance N. Phillip [EMAIL PROTECTED] writes: Given a and b, two equal length lists of integers, I want c to be [a1-b1, a2-b2, ... , an-bn]. c = [a[i] - b[i] for i in xrange(len(a))] -- http://mail.python.org/mailman/listinfo/python-list

Re: 2.3 or 2.4 on linux

2005-08-04 Thread Lonnie Princehouse
I assume some system tools must use them, even if I don't. I don't know if I can just copy all this into the 2.4 site-packages (deleting .pyc and .pyo) and get what I need. Copying pure python site-packages from python23 to python24 should be safe, but the binaries (.so) will not work because

Re: Parallel arithmetic?

2005-08-04 Thread Michael Hoffman
Terrance N. Phillip wrote: Given a and b, two equal length lists of integers, I want c to be [a1-b1, a2-b2, ... , an-bn]. I can do something like: c = [0] * len(a) for ndx, item in enumerate(a): c[ndx] = item - b[ndx] But I'm wondering if there's a better way, perhaps that avoids a

Re: Parallel arithmetic?

2005-08-04 Thread Cyril Bazin
Hello, I propose 3 solutions. If someone have time to waste, he can make a benchmark to know which is the fastest and give us the results on the list. Solution 1: import itertools c = [a_i-b_i for a_i, b_i in itertools.izip(a, b)] Solution 2: c = map(operator.sub, a, b) #map will be removed

Re: Parallel arithmetic?

2005-08-04 Thread Lonnie Princehouse
There are many ways to do this. None of them avoids looping, technically, although you can easily avoid the for syntax. -- Simple but wastes some memory c = [i-j for i,j in zip(a,b)] -- Using itertools.izip (python 2.3) c = [i-j for i,j in itertools.izip(a,b) ] -- Generator expression

Re: Parallel arithmetic?

2005-08-04 Thread Robert Kern
Terrance N. Phillip wrote: Given a and b, two equal length lists of integers, I want c to be [a1-b1, a2-b2, ... , an-bn]. I can do something like: c = [0] * len(a) for ndx, item in enumerate(a): c[ndx] = item - b[ndx] But I'm wondering if there's a better way, perhaps that avoids a

Re: Parallel arithmetic?

2005-08-04 Thread jepler
If you use numarray, you *can* write c = a-b import numarray a = numarray.array([1,2,3]) b = numarray.array([5,0,2]) c = a-b c array([-4, 2, 1]) numarray is packaged separately from Python. http://www.stsci.edu/resources/software_hardware/numarray Jeff pgp25gtINPiqa.pgp

Re: Parallel arithmetic?

2005-08-04 Thread Terry Reedy
#map will be removed from the next versions of python. The next version will be 2.5. Map will not go away then. In 3.0, in the indefinite future, it might go away, it might just be moved. tjr -- http://mail.python.org/mailman/listinfo/python-list

Re: cut paste text between tkinter widgets

2005-08-04 Thread Repton
Christopher Subich wrote: In experimenting with this, I found a slight... fun issue involved in this. Selection_get is the correct method to call, but it doesn't quite work out of the box. g.selection_get() Traceback (most recent call last): File stdin, line 1, in ? File

  1   2   >