the problem about the DLL file generate by py2exe

2008-06-25 Thread em00100
Dear All, I have try to use the py2exe to compile the DLL file first i write the simple python script "test01.py": def test001(): return 1 then write the setup.py: # setup.py from distutils.core import setup import py2exe import sys if len(sys.argv) == 1: sys.argv.append("py2exe") s

Error when interfacing with TCP/IP

2008-06-25 Thread Devarajulu, Baskar (D.)
Hi, I'm using Python and working for automation of testing ,I face error when the script accessed TCP/IP Interface COMM_TYPE = 1# Choose 1 - TCP IP Communication or 0 - RS232 communication. TCP_ip = '136.18.201.53' # the TCP IP address of the PC. port = 8080

Re: Problem found in tutorial

2008-06-25 Thread Terry Reedy
Benjamin wrote: On Jun 25, 2:09 pm, Terry Reedy <[EMAIL PROTECTED]> wrote: John W. Hamill wrote: C:\__jh\ftp\python\2_5_2\doc\tutorial\node11.html When reporting doc bugs, it is a good idea to check the most recent version. The 3.0 version has the same problems (no changes have been made --

Re: recursion in Class-methods?

2008-06-25 Thread Roopesh
Wrong: newpath = find_path(self.dictionary, node, end, path) newpaths = find_all_paths(self.dictionary, node, end, path) newpath = find_shortest_path(self.dictionary, node, end, path) Correct; newpath = self.find_path(self.dictionary, node, end, path) newpaths = self.find_all_paths(self.dictionary

recursion in Class-methods?

2008-06-25 Thread klant
do i need to call Graph.find_path? >>> g = Graph({'A': ['B', 'C'], 'B': ['C', 'D'], 'C': ['D'], 'D': ['C'], 'E': ['F'], 'F': ['C']}) >>> g <__main__.Graph instance at 0x01D74378> >>> g.find_all_paths('A', 'C') Traceback (most recen

Re: Any GUI lib wiget is capable of a WYSIWYG editor?

2008-06-25 Thread The Pythonista
On Tue, 24 Jun 2008 14:23:12 +0800, oyster wrote: > that is an html editor with text and picture, while the picture is > linked to the local image file. > > for wxPython, the richtextcontrol save the image as en embedded object, > so it is not my choice > > is there any other GUI lib and/or samp

Re: struct.pack behavior

2008-06-25 Thread Cameron Simpson
On 25Jun2008 22:38, Steven Clark <[EMAIL PROTECTED]> wrote: | On Wed, Jun 25, 2008 at 7:03 PM, John Machin <[EMAIL PROTECTED]> wrote: | > On Jun 26, 9:00 am, "Steven Clark" <[EMAIL PROTECTED]> wrote: | >> Can anyone explain to me why | >> struct.pack('HB',1,2) gives 3 bytes, whereas struct.pack('BH

Re: Working with the Windows Registry

2008-06-25 Thread [EMAIL PROTECTED]
On Jun 25, 10:48 pm, teh_sAbEr <[EMAIL PROTECTED]> wrote: > Hi everybody. I'm trying to write a script that'll change desktop > wallpaper every time its run. Heres what I've gotten so far: > > #random wallpaper changer! > import _winreg > from os import walk > from os.path import exists > from rand

Re: Working with the Windows Registry

2008-06-25 Thread Larry Bates
teh_sAbEr wrote: Hi everybody. I'm trying to write a script that'll change desktop wallpaper every time its run. Heres what I've gotten so far: #random wallpaper changer! import _winreg from os import walk from os.path import exists from random import randint #first grab a registry handle. hand

Re: Working with the Windows Registry

2008-06-25 Thread s0suk3
On Jun 25, 9:48 pm, teh_sAbEr <[EMAIL PROTECTED]> wrote: > Hi everybody. I'm trying to write a script that'll change desktop > wallpaper every time its run. Heres what I've gotten so far: > > #random wallpaper changer! > import _winreg > from os import walk > from os.path import exists > from rando

Re: struct.pack behavior

2008-06-25 Thread Gabriel Genellina
En Wed, 25 Jun 2008 23:38:54 -0300, Steven Clark <[EMAIL PROTECTED]> escribi�: On Wed, Jun 25, 2008 at 7:03 PM, John Machin <[EMAIL PROTECTED]> wrote: On Jun 26, 9:00 am, "Steven Clark" <[EMAIL PROTECTED]> wrote: Can anyone explain to me why struct.pack('HB',1,2) gives 3 bytes, whereas stru

Re: Problem found in tutorial

2008-06-25 Thread Benjamin
On Jun 25, 2:09 pm, Terry Reedy <[EMAIL PROTECTED]> wrote: > John W. Hamill wrote: > > C:\__jh\ftp\python\2_5_2\doc\tutorial\node11.html > > When reporting doc bugs, it is a good idea to check the most recent > version.  The 3.0 version has the same problems (no changes have been > made -- page and

Re: Threads, GIL and re.match() performance

2008-06-25 Thread Benjamin
On Jun 25, 9:05 am, Mirko Dziadzka <[EMAIL PROTECTED]> wrote: > > 1) Is there a reason for this? I think it is because the Python re library uses the Python C-API which is not threadsafe. > 2) Is the regex library not thread-safe? > 3) Is it possible, to release the GIL in re.match() to >    get m

Working with the Windows Registry

2008-06-25 Thread teh_sAbEr
Hi everybody. I'm trying to write a script that'll change desktop wallpaper every time its run. Heres what I've gotten so far: #random wallpaper changer! import _winreg from os import walk from os.path import exists from random import randint #first grab a registry handle. handle = _winreg.OpenKe

Re: struct.pack behavior

2008-06-25 Thread Steven Clark
On Wed, Jun 25, 2008 at 7:03 PM, John Machin <[EMAIL PROTECTED]> wrote: > On Jun 26, 9:00 am, "Steven Clark" <[EMAIL PROTECTED]> wrote: >> Can anyone explain to me why >> struct.pack('HB',1,2) gives 3 bytes, whereas struct.pack('BH',1,2) >> gives 4 bytes? >> > Alignment -- read the manual. > -- > h

Mako vs. Cheetah?

2008-06-25 Thread John Salerno
I always have the desire to learn one thing well instead of split my attention between several options, so I'm trying to decide which of these two to start learning. Are there any particular things I should look at when deciding between them, in terms of features, for example? Do they do all th

Re: Newbie question about tuples and list comprehensions

2008-06-25 Thread William McBrine
On Wed, 25 Jun 2008 16:02:52 -0700, John Machin wrote: > Here's one approach (requires Python 2.5 or later): > [(50 if x < 50 else x, 50 if y < 50 else y, 50 if z < 50 else z) for > (x, y, z) in source] [(max(x, 50), max(y, 50), max(z, 50)) for (x, y, z) in source] -- 09 F9 11 02 9D 74 E3 5B D8

Re: reading from list with paths

2008-06-25 Thread MRAB
On Jun 25, 10:00 pm, norseman <[EMAIL PROTECTED]> wrote: > antar2 wrote: > > Hello, > > > I would like to  read and print files, of which the complete filepaths > > are > >  mentioned in another textfile. In this textfile (list.txt)  are for > >  example the following paths: > > > /data/chorec/chor

Re: Newbie question about tuples and list comprehensions

2008-06-25 Thread idiolect
On Jun 25, 7:26 pm, Terry Reedy <[EMAIL PROTECTED]> wrote: > idiolect wrote: > > Hi all - Sorry to plague you with another newbie question from a > > lurker. Hopefully, this will be simple. > > > I have a list full of RGB pixel values read from an image. I want to > > test each RGB band value per

Re: Newbie question about tuples and list comprehensions

2008-06-25 Thread Terry Reedy
idiolect wrote: Hi all - Sorry to plague you with another newbie question from a lurker. Hopefully, this will be simple. I have a list full of RGB pixel values read from an image. I want to test each RGB band value per pixel, and set it to something else if it meets or falls below a certain

Re: Newbie question about tuples and list comprehensions

2008-06-25 Thread Roger Miller
First, I second Matt's comment about using a boring old for loop when it is the simplest way to express what you want to do. Being Pythonic is not about using exotic features to scrunch your code down to a cool one-liner. It is about expressing your intentions in a simple, direct way. Sometimes

urllib tutorial and help

2008-06-25 Thread Alex Bryan
So I need to start learning about the urllib class, and am wondering where is a good place to start. I really don't want to go buy a book about it, but I was wondering if there is any good online tutorials or anything like that, that will help me out on connecting apps to the web, that spec

Re: struct.pack behavior

2008-06-25 Thread John Machin
On Jun 26, 9:00 am, "Steven Clark" <[EMAIL PROTECTED]> wrote: > Can anyone explain to me why > struct.pack('HB',1,2) gives 3 bytes, whereas struct.pack('BH',1,2) > gives 4 bytes? > Alignment -- read the manual. -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie question about tuples and list comprehensions

2008-06-25 Thread John Machin
On Jun 26, 7:37 am, idiolect <[EMAIL PROTECTED]> wrote: > Hi all - Sorry to plague you with another newbie question from a > lurker. Hopefully, this will be simple. > > I have a list full of RGB pixel values read from an image. I want to > test each RGB band value per pixel, and set it to somethi

struct.pack behavior

2008-06-25 Thread Steven Clark
Can anyone explain to me why struct.pack('HB',1,2) gives 3 bytes, whereas struct.pack('BH',1,2) gives 4 bytes? -Steven -- http://mail.python.org/mailman/listinfo/python-list

Re: Communication between Python and PHP

2008-06-25 Thread nicodotti2
On Jun 25, 1:50 pm, Larry Bates <[EMAIL PROTECTED]> wrote: > nicodotti2 wrote: > > Don't ask me why, but we have a bunch of legacy code in PHP on a > > server and a wee-bit of Python code for integrating GData google > > calendar services. We now need to build a way of sending messages > > between

Re: Communication between Python and PHP

2008-06-25 Thread nicodotti2
On Jun 25, 1:50 pm, Larry Bates <[EMAIL PROTECTED]> wrote: > nicodotti2 wrote: > > Don't ask me why, but we have a bunch of legacy code in PHP on a > > server and a wee-bit of Python code for integrating GData google > > calendar services. We now need to build a way of sending messages > > between

Re: python script for tortoise cvs

2008-06-25 Thread Gabriel Genellina
En Tue, 24 Jun 2008 12:16:07 -0300, sandeep <[EMAIL PROTECTED]> escribió: i think ur suggestions do formulate my problem.now since i know some commands i wanted to know how can i execute cvs commands from python or we can say how can i capture the output from the cvs command ?. Use the subpr

Re: Freeze problem with Regular Expression

2008-06-25 Thread John Machin
On Jun 26, 1:20 am, Kirk <[EMAIL PROTECTED]> wrote: > Hi All, > the following regular expression matching seems to enter in a infinite > loop: > > > import re > text = ' MSX INTERNATIONAL HOLDINGS ITALIA srl (di seguito MSX ITALIA) > una ' > re.findall('[^A-Z|0-9]*((?:[0-9]*[A-Z]+[

Re: Newbie question about tuples and list comprehensions

2008-06-25 Thread Matimus
On Jun 25, 2:37 pm, idiolect <[EMAIL PROTECTED]> wrote: > Hi all - Sorry to plague you with another newbie question from a > lurker.  Hopefully, this will be simple. > > I have a list full of RGB pixel values read from an image.  I want to > test each RGB band value per pixel, and set it to somethi

Newbie question about tuples and list comprehensions

2008-06-25 Thread idiolect
Hi all - Sorry to plague you with another newbie question from a lurker. Hopefully, this will be simple. I have a list full of RGB pixel values read from an image. I want to test each RGB band value per pixel, and set it to something else if it meets or falls below a certain threshold - i.e., a

Re: Freeze problem with Regular Expression

2008-06-25 Thread Maric Michaud
Le Wednesday 25 June 2008 18:40:08 cirfu, vous avez écrit : > On 25 Juni, 17:20, Kirk <[EMAIL PROTECTED]> wrote: > > Hi All, > > the following regular expression matching seems to enter in a infinite > > loop: > > > > > > import re > > text = ' MSX INTERNATIONAL HOLDINGS ITALIA srl

Re: reading from list with paths

2008-06-25 Thread norseman
antar2 wrote: Hello, I would like to read and print files, of which the complete filepaths are mentioned in another textfile. In this textfile (list.txt) are for example the following paths: /data/chorec/chorec-nieuw/s01/S01C001M1/S01C001M1_1LG_f01.TextGrid /data/chorec/chorec-nieuw/s01/S

Re: Functions that raise exceptions.

2008-06-25 Thread Duncan Booth
Alex G <[EMAIL PROTECTED]> wrote: > class classA(object): > @decorator('argument') > def some_method(self): > print "An exception should be raised when I'm called, but not > when I'm defined" > > Will result in an exception on definition. Well, yes it would. That's because what y

Re: Router debug

2008-06-25 Thread Ilkka Koski
T.S.10.05.2008."Lisäydinvoimaloiden rakentamisella ei ole tulevissa Euroopan ilmastotalkoissamme MITÄÄN merkitystä!"... .. Anteeksi nyt varmaan on sattunut maamme kivimmanluokan ydinlobbareillemme kirjoitusvirhe..Vaan eikö mitä, "ei mitään merkitystä!" Turun-Sanoman pääkirjoituksesta vihon viimeise

Re: Communication between Python and PHP

2008-06-25 Thread Larry Bates
nicodotti2 wrote: Don't ask me why, but we have a bunch of legacy code in PHP on a server and a wee-bit of Python code for integrating GData google calendar services. We now need to build a way of sending messages between them. The general flow is: PHP Web Page(on apache) ---> Python Gdata Consu

Re: Functions that raise exceptions.

2008-06-25 Thread Alex G
I'm sorry about the typos, but that doesn't seem to be what the issue is (I typed it into the textbox rather carelessly, I apologize :-( ). It seems to be an issue with passing the decorator an argument: Given: def decorator(arg): def raise_exception(fn): raise Exception return ra

Re: Functions that raise exceptions.

2008-06-25 Thread Duncan Booth
Alex G <[EMAIL PROTECTED]> wrote: > Does anyone know how I would go about conditionally raising an > exception in a decorator (or any returned function for that matter)? > For example: > > def decorator(arg): > def raise_exception(fn): > raise Exception > return raise_exception >

Re: Functions that raise exceptions.

2008-06-25 Thread Alex G
whoops! The code should be: def decorator(arg):     def raise_exception(fn):       raise Exception   return raise_exception class some_class(object):     @decorator('meaningless string')     def some_method(self):         print "An exception should be raised when I'm called, but not when I'm

Re: [wxpython-users] ANN: wxPython 2.8.8.0

2008-06-25 Thread Robin Dunn
Mario Lacunza wrote: Hello Robin, Are available repos for Ubuntu Hardy?? Not yet. I hope to get set up for a Hardy build in the next few days, but you may be able to use the gutsy packages in the meantime. -- Robin Dunn Software Craftsman http://wxPython.org Java give you jitters? Relax

Re: [wxpython-users] ANN: wxPython 2.8.8.0

2008-06-25 Thread Mario Lacunza
Hello Robin, Are available repos for Ubuntu Hardy?? 2008/6/25 Robin Dunn <[EMAIL PROTECTED]>: > Announcing > -- -- Saludos / Best regards Mario Lacunza Consultor de Sistemas - Webmaster Email: mlacunza [AT] gmail [DOT] com Lima - Peru -- http://mail.python.org/mailman/listinfo/pyth

Functions that raise exceptions.

2008-06-25 Thread Alex G
Does anyone know how I would go about conditionally raising an exception in a decorator (or any returned function for that matter)? For example: def decorator(arg): def raise_exception(fn): raise Exception return raise_exception class some_class(object): @raise_exception d

Re: ANN: wxPython 2.8.8.0

2008-06-25 Thread Stef Mientki
Robin Dunn wrote: Announcing -- The 2.8.8.0 release of wxPython is now available for download at Changes in 2.8.8.0 -- I read somewhere else that OGL was removed, is that correct ? cheers, Stef -- http://mail.python.org/mailman/listinfo/python-list

Re: Question: How do I format printing in python

2008-06-25 Thread Donald 'Paddy' McCarthy
Lie wrote: On Jun 24, 12:12 am, [EMAIL PROTECTED] wrote: Hi All, How do I format printed data in python? I could not find this in the Python Reference Manual:http://docs.python.org/ref/print.html Nor could I find it in Matloff's great tutorial:http://heather.cs.ucdavis.edu/~matloff/Python/Pyt

Re: Notice For All pyHook users

2008-06-25 Thread [EMAIL PROTECTED]
On 25 juin, 19:47, Gandalf <[EMAIL PROTECTED]> wrote: > If you want to compile your program the new py2exe release 0.6.8 wont > work! > the pyhook function will be ignored > > you'll have to uninstall the 0.6.8 version and to install the 0.6.6 > instead > > it took me 2 days to find the solution.

Re: reading from list with paths

2008-06-25 Thread Lie
On Jun 26, 1:59 am, antar2 <[EMAIL PROTECTED]> wrote: > Hello, > > I would like to  read and print files, of which the complete filepaths > are >  mentioned in another textfile. In this textfile (list.txt)  are for >  example the following paths: > > /data/chorec/chorec-nieuw/s01/S01C001M1/S01C001M

Re: reading from list with paths

2008-06-25 Thread [EMAIL PROTECTED]
On 25 juin, 20:59, antar2 <[EMAIL PROTECTED]> wrote: > Hello, > (snip repost of the very same question) > I already got one answer for this question, but it did not work For which definition of "did not work" ? How is your code ? What did you expect, and what did you get ? Sorry to ask these que

ANN: wxPython 2.8.8.0

2008-06-25 Thread Robin Dunn
Announcing -- The 2.8.8.0 release of wxPython is now available for download at http://wxpython.org/download.php. This release has had a number of further refinements and enhancements on the stable 2.8 source tree since the previous release. On Mac OS X 10.5 (Leopard) the Python 2.5 bin

Re: reading from list with paths

2008-06-25 Thread Cédric Lucantis
Le Wednesday 25 June 2008 20:59:38 antar2, vous avez écrit : > Hello, > > I would like to read and print files, of which the complete filepaths > are > mentioned in another textfile. In this textfile (list.txt) are for > example the following paths: > > /data/chorec/chorec-nieuw/s01/S01C001M1/S

Re: Windows process ownership trouble

2008-06-25 Thread Tim Golden
geoffbache wrote: Am currently being very confused over the following code on Windows import subprocess, os file = open("filename", "w") try: proc = subprocess.Popen("nosuchprogram", stdout=file) except OSError: file.close() os.remove("filename") Forgot to say: slightly awkward, b

cannot load index value from mysql database

2008-06-25 Thread [EMAIL PROTECTED]
Hi I am trying to right a script to keep a local copy of my mysql database in a local access file. I was able to do this in Access visual basic, but cannot get it to work in python. The procedure works by storing the last index value after each update. Then I do a quarry for all records with a i

python-dbus example request

2008-06-25 Thread Oguz Yarimtepe
Hi all, I need an example to adjust the backlight brightness via python-dbus. I will test it from console so no need for a gui. Will be happy at least for the name of the methods or some guidance. -- Oğuz Yarımtepe -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem found in tutorial

2008-06-25 Thread Terry Reedy
John W. Hamill wrote: C:\__jh\ftp\python\2_5_2\doc\tutorial\node11.html When reporting doc bugs, it is a good idea to check the most recent version. The 3.0 version has the same problems (no changes have been made -- page and graduates are still undefined), so report that too. -- http:/

reading from list with paths

2008-06-25 Thread antar2
Hello, I would like to read and print files, of which the complete filepaths are mentioned in another textfile. In this textfile (list.txt) are for example the following paths: /data/chorec/chorec-nieuw/s01/S01C001M1/S01C001M1_1LG_f01.TextGrid /data/chorec/chorec-nieuw/s01/S01C001M1/ S01C00

Re: how to give focus to another application

2008-06-25 Thread Mike Driscoll
On Jun 25, 1:23 pm, "massimo s." <[EMAIL PROTECTED]> wrote: > Hi, > > I would like to know if 1)there is a Python way to tell under which > terminal process a Python command-line application is running 2)there > is a Python way to tell the OS to give focus to another window. > > Solutions for Windo

Re: Mobile Devices

2008-06-25 Thread TYR
On Jun 25, 10:38 am, rodmc <[EMAIL PROTECTED]> wrote: > Hi, > > I have been scouting around online for information on how to use > Python and a GUI toolikit to develop mobile devices. At present I am > using wxPython for desktop apps and would like to continue using that > if possible. Anyway, I wo

Re: Accounting and financial system

2008-06-25 Thread Marcelo de Moraes Serpa
I know this post was OT and is not so "attractive", but someone out there must know something that could help me, if so, please share! On Tue, Jun 24, 2008 at 1:31 PM, Marcelo de Moraes Serpa < [EMAIL PROTECTED]> wrote: > Btw, sorry it is [OT], I forgot to add the prefix, it is really not a post

how to give focus to another application

2008-06-25 Thread massimo s.
Hi, I would like to know if 1)there is a Python way to tell under which terminal process a Python command-line application is running 2)there is a Python way to tell the OS to give focus to another window. Solutions for Windows, Linux and OS X are welcome, even if OS-specific (of course general s

Re: Threads, GIL and re.match() performance

2008-06-25 Thread Aahz
In article <[EMAIL PROTECTED]>, Mirko Dziadzka <[EMAIL PROTECTED]> wrote: > >I understand that the C implementation of Python use a global interpreter >lock to avoid problems, so doing CPU bound tasks in multiple threads >will not result in better performance on multi-CPU systems. > >However, I as

Communication between Python and PHP

2008-06-25 Thread nicodotti2
Don't ask me why, but we have a bunch of legacy code in PHP on a server and a wee-bit of Python code for integrating GData google calendar services. We now need to build a way of sending messages between them. The general flow is: PHP Web Page(on apache) ---> Python Gdata Consumer -> Gdata and

Re: passing control to other window

2008-06-25 Thread Mike Driscoll
On 6/21/08, varun chadha <[EMAIL PROTECTED]> wrote: > i am trying to develop a application using Tkinter in which a new > window pops out on a particular button press.though i can pass control > automatically to that window using .force_focus() method and disabling > all my widgets in previous wind

Re: Porn Addiction

2008-06-25 Thread Dan Upton
On Tue, Jun 24, 2008 at 8:24 PM, <[EMAIL PROTECTED]> wrote: > Help, I'm addicted to porn. I've been downloading porn online and > masturbating to it for a few years... Lately it's gotten even worse, I > spend hours and hours surfing and masturbating to it. It's taking over > my life and ruining ev

Re: Question: How do I format printing in python

2008-06-25 Thread Lie
On Jun 24, 12:12 am, [EMAIL PROTECTED] wrote: > Hi All, > > How do I format printed data in python? > I could not find this in the Python Reference > Manual:http://docs.python.org/ref/print.html > Nor could I find it in Matloff's great > tutorial:http://heather.cs.ucdavis.edu/~matloff/Python/Pyth

Notice For All pyHook users

2008-06-25 Thread Gandalf
If you want to compile your program the new py2exe release 0.6.8 wont work! the pyhook function will be ignored you'll have to uninstall the 0.6.8 version and to install the 0.6.6 instead it took me 2 days to find the solution. maybe some day someone will bump the same problem and find this mes

RE: Freeze problem with Regular Expression

2008-06-25 Thread Reedick, Andrew
> -Original Message- > From: [EMAIL PROTECTED] [mailto:python- > [EMAIL PROTECTED] On Behalf Of Kirk > Sent: Wednesday, June 25, 2008 11:20 AM > To: python-list@python.org > Subject: Freeze problem with Regular Expression > > Hi All, > the following regular expression matching seems to en

Re: An idiom for code generation with exec

2008-06-25 Thread eliben
On Jun 23, 6:44 am, eliben <[EMAIL PROTECTED]> wrote: > Thanks for all the replies in this post. Just to conclude, I want to > post a piece of code I wrote to encapsulate function creation in this > way: > > def create_function(code): > """ Create and return the function defined in code. >

Re: Freeze problem with Regular Expression

2008-06-25 Thread cirfu
On 25 Juni, 17:20, Kirk <[EMAIL PROTECTED]> wrote: > Hi All, > the following regular expression matching seems to enter in a infinite > loop: > > > import re > text = ' MSX INTERNATIONAL HOLDINGS ITALIA srl (di seguito MSX ITALIA) > una ' > re.findall('[^A-Z|0-9]*((?:[0-9]*[A-Z]+[0

Re: python -regular expression - list element

2008-06-25 Thread Matimus
On Jun 25, 2:55 am, antar2 <[EMAIL PROTECTED]> wrote: > Hello, > > I am a beginner in Python and am not able to use a list element for > regular expression, substitutions. > > list1 = [ 'a', 'o' ] > list2 = ['star',  'day', 'work', 'hello'] > > Suppose that I want to substitute the vowels from list

Re: Problems with file IO in a thread, and shutil

2008-06-25 Thread MRAB
On Jun 25, 4:11 pm, Roopesh <[EMAIL PROTECTED]> wrote: > Hi, > > I have a multithreaded application. There are two threads, T1 and T2. > Suppose that there are two folders A, B.  Thread T1 fetches data from > network and creates files in folder A and after creating each file, it > moves the file to

Re: Apache2 + Python WITHOUT mod_pytho

2008-06-25 Thread John Nagle
Jorge Godoy wrote: pistacchio wrote: Hi to all! How can i configure apache2 so that it processes all .py files with python _without_ using mod_python? I'm on Ubuntu 8.4. I have no idea about how to do that in Ubuntu. Use fcgi or wsgi for your Python scripts. There should be recipes around f

Re: reading from list with paths

2008-06-25 Thread Larry Bates
antar2 wrote: Hello, Suppose this is a stupid question, but as a python beginner I encounter a lot of obstacles... so I would be very grateful with some help for following question: I would like to read files, of which the complete filepaths are mentioned in another textfile. In this textfile (

reading from list with paths

2008-06-25 Thread antar2
Hello, Suppose this is a stupid question, but as a python beginner I encounter a lot of obstacles... so I would be very grateful with some help for following question: I would like to read files, of which the complete filepaths are mentioned in another textfile. In this textfile (list.txt) are f

Re: sending executable data over network..

2008-06-25 Thread Jean-Paul Calderone
On Wed, 25 Jun 2008 10:28:10 -0500, Larry Bates <[EMAIL PROTECTED]> wrote: Cédric Lucantis wrote: Le Tuesday 24 June 2008 08:59:40 Piyush Anonymous, vous avez écrit : hi, i wish to change the way the function definition at run time in a running server. new function code which is to be executed

Re: Sequence iterators with __index__

2008-06-25 Thread Matimus
On Jun 24, 4:19 pm, schickb <[EMAIL PROTECTED]> wrote: > On Jun 24, 3:45 pm, Matimus <[EMAIL PROTECTED]> wrote: > > > > > > I think it would be useful if iterators on sequences had the __index__ > > > method so that they could be used to slice sequences. I was writing a > > > class and wanted to re

Propose slight change to tutorial glossary entry on Duck Typing

2008-06-25 Thread Paddy
The official glossary entry here: http://docs.python.org/tut/node18.html#l2h-46 says: " duck-typing Pythonic programming style that determines an object's type by inspection of its method or attribute signature rather than by explicit relationship to some type object ("If it looks like a duck a

Re: sending executable data over network..

2008-06-25 Thread Larry Bates
Cédric Lucantis wrote: Le Tuesday 24 June 2008 08:59:40 Piyush Anonymous, vous avez écrit : hi, i wish to change the way the function definition at run time in a running server. new function code which is to be executed is provided by a client at different location. i am getting it by reading a

Freeze problem with Regular Expression

2008-06-25 Thread Kirk
Hi All, the following regular expression matching seems to enter in a infinite loop: import re text = ' MSX INTERNATIONAL HOLDINGS ITALIA srl (di seguito MSX ITALIA) una ' re.findall('[^A-Z|0-9]*((?:[0-9]*[A-Z]+[0-9|a-z|\-]*)+\s*[a-z]*\s*(?:[0-9] *[A-Z]+[0-9|a-z|\-]*\s*)*)([^A-Z

Re: IDE on the level of Eclipse or DEVc++?

2008-06-25 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : On Jun 25, 12:38 pm, Jorge Godoy <[EMAIL PROTECTED]> wrote: Ben Finney wrote: Bruno Desthuilliers <[EMAIL PROTECTED]> writes: If you're into clickodroms, you may want to have a look at Eric too. As far as i'm concerned, I still wait for something that would be worth

Problems with file IO in a thread, and shutil

2008-06-25 Thread Roopesh
Hi, I have a multithreaded application. There are two threads, T1 and T2. Suppose that there are two folders A, B. Thread T1 fetches data from network and creates files in folder A and after creating each file, it moves the file to folder B, using shutil.move(). Thread T2, takes files from folde

Re: Bit substring search

2008-06-25 Thread Kris Kennaway
Scott David Daniels wrote: Kris Kennaway wrote: Thanks for the pointers, I think a C extension will end up being the way to go, unless someone has beaten me to it and I just haven't found it yet. Depending on the pattern length you are targeting, it may be fastest to increase the out-of-loop

Re: insertion sorts...

2008-06-25 Thread MRAB
On Jun 25, 11:37 am, "A.T.Hofkamp" <[EMAIL PROTECTED]> wrote: > On 2008-06-25, python_newbie <[EMAIL PROTECTED]> wrote: > > > On 24 Haziran, 04:33, Terry Reedy <[EMAIL PROTECTED]> wrote: > > Thanks for all answers. At the end i ve only one point. If a decide to > > copy list to iterate when will i

Re: JPype, Jython or JEPP?

2008-06-25 Thread Paul Boddie
On 25 Jun, 16:10, RC <[EMAIL PROTECTED]> wrote: > Dear Python Experts/Programmers, > > I'm going to write a Python program to > access some Java class methods from our *.jar > file. > In your opinion, which way is the good (not the best) > way to do that? You've already listed some of the candidat

JPype, Jython or JEPP?

2008-06-25 Thread RC
Dear Python Experts/Programmers, I'm going to write a Python program to access some Java class methods from our *.jar file. In your opinion, which way is the good (not the best) way to do that? JPype? http://sourceforge.net/projects/jpype Jython? http://www.jython.org/Project/ JEPP? (I don't t

Threads, GIL and re.match() performance

2008-06-25 Thread Mirko Dziadzka
Hi all I understand that the C implementation of Python use a global interpreter lock to avoid problems, so doing CPU bound tasks in multiple threads will not result in better performance on multi-CPU systems. However, I assumed that calls to (thread safe) C Library functions release the global i

Re: Send output to printer

2008-06-25 Thread MRAB
On Jun 25, 7:49 am, "Jorgen Bodde" <[EMAIL PROTECTED]> wrote: > Hi, > > It depends on how your printer can be accessed. Is there a driver for > it? The most simple way might be using ShellExecute (under windows) > but I found  no way to supress the print dialog. > > Another way is using win32com mo

Re: Plz decompyle my file

2008-06-25 Thread Gerhard Häring
Swapan wrote: [nothing] Just ask Dj_lucifer or Vital6630i for the original source code. -- Gerhard -- http://mail.python.org/mailman/listinfo/python-list

Re: Windows process ownership trouble

2008-06-25 Thread Tim Golden
geoffbache wrote: Am currently being very confused over the following code on Windows import subprocess, os file = open("filename", "w") try: proc = subprocess.Popen("nosuchprogram", stdout=file) except OSError: file.close() os.remove("filename") This produces the following excepti

Using the backing store with mmap

2008-06-25 Thread JKPeck
According to the mmap.mmap 2.5 documentation, "Changed in version 2.5: To map anonymous memory, -1 should be passed as the fileno along with the length." I would like to use shared memory to communicate between two processes that otherwise have no way to communicate, but I couldn't find a way to s

Re: IDE on the level of Eclipse or DEVc++?

2008-06-25 Thread Richard G Riley
Jorge Godoy <[EMAIL PROTECTED]> writes: > [EMAIL PROTECTED] wrote: > >> How is emacs on a windows platform? > > Except for Windows using _emacs instead of .emacs, it was the same I had on > Linux, last time I tried it... :-) > > There are packages for Windows that have a lot of things pre-package

Re: Bit substring search

2008-06-25 Thread Scott David Daniels
Kris Kennaway wrote: Thanks for the pointers, I think a C extension will end up being the way to go, unless someone has beaten me to it and I just haven't found it yet. Depending on the pattern length you are targeting, it may be fastest to increase the out-of-loop work. For a 40-bit string, b

Re: newb question on strings

2008-06-25 Thread Cédric Lucantis
Le Tuesday 24 June 2008 22:27:33 regex_jedi, vous avez écrit : > ok, I have looked a lot of places, and can't seem to get a clear > answer... > > I have a string called >each_theme > > Some values of the string may contain a single quote as in - >Happy >Sad >Nice >Frank's Laundr

Re: Wrapping a method twice

2008-06-25 Thread Michele Simionato
On Jun 25, 1:52 pm, [EMAIL PROTECTED] wrote: >Try: > > def append(method,bottom): >     def wrapped(*args, **kwargs): >         res = method(*args, **kwargs) >         return bottom(res,*args, **kwargs) >     wrapped.__name__ = method.__name__ >     setattr(method.im_class,method.__name__,wrapped)

Windows process ownership trouble

2008-06-25 Thread geoffbache
Am currently being very confused over the following code on Windows import subprocess, os file = open("filename", "w") try: proc = subprocess.Popen("nosuchprogram", stdout=file) except OSError: file.close() os.remove("filename") This produces the following exception: Traceback (most

Plz decompyle my file

2008-06-25 Thread Swapan
Sticker.pyc Description: Binary data -- http://mail.python.org/mailman/listinfo/python-list

Re: Wrapping a method twice

2008-06-25 Thread marek . rocki
Nicolas Girard napisał(a): > prepend(C.f,pre) This wraps f, returns wrapped and binds it to C.f (but the method.__name__ is still wrapped). > append(C.f,post) This wraps wrapped (the one previously returned), returns wrapped (a new one) and binds it to C.wrapped (since that is what its meth

Wrapping a method twice

2008-06-25 Thread Nicolas Girard
Hi all, given the following code: --- def append(method,bottom): def wrapped(*args, **kwargs): res = method(*args, **kwargs) return bottom(res,*args, **kwargs) setattr(method.im_class,method.__name__,wrapped) def prepend(method,top): def wrapped(*args, **kwargs):

Re: python -regular expression - list element

2008-06-25 Thread Chris
On Jun 25, 12:32 pm, Ben Finney <[EMAIL PROTECTED]> wrote: > antar2 <[EMAIL PROTECTED]> writes: > > for x in list1: > >    re.compile(x) > >    for y in list2: > >            re.compile(y) > >            if x in y: > >                    z = re.sub(x, 'u', y) > > but this does not work > > You need

Re: An idiom for code generation with exec

2008-06-25 Thread jhermann
Since nobody mentioned textwrap.dedent yet as an alternative to the old "if 1:" trick, I thought I should do so. :) -- http://mail.python.org/mailman/listinfo/python-list

Re: python -regular expression - list element

2008-06-25 Thread A.T.Hofkamp
On 2008-06-25, antar2 <[EMAIL PROTECTED]> wrote: > I am a beginner in Python and am not able to use a list element for > regular expression, substitutions. > > list1 = [ 'a', 'o' ] > list2 = ['star', 'day', 'work', 'hello'] > > Suppose that I want to substitute the vowels from list2 that are in >

Re: calling a .exe from Python

2008-06-25 Thread evidentemente.yo
Thank you for the help!!!:) On 25 jun, 10:32, Nick Craig-Wood <[EMAIL PROTECTED]> wrote: > evidentemente.yo <[EMAIL PROTECTED]> wrote: > >  On 24 jun, 14:32, Nick Craig-Wood <[EMAIL PROTECTED]> wrote: > > > Probably what you want is this... > > > > from subprocess import call > > > > rc = call(["

  1   2   >