Re: Using Python to run SSH commands on a remote server

2008-06-25 Thread Taygun Kekec
Alson you can take a look at pexpect module if you want to automate logging in and process commands , in this way you will no longer wait for loginname and password prompt. -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem found in tutorial

2008-06-25 Thread A.T.Hofkamp
On 2008-06-25, John W. Hamill <[EMAIL PROTECTED]> wrote: > 20JUN2008 > By John W. Hamill > > > Errata found in Python tutorial > http://www.python.org Bugs and other problems should be reported in bugs.python.org Otherwise they will probably get lost. > Error Found by John W. Hamill > - -

Re: Sequence iterators with __index__

2008-06-25 Thread schickb
On Jun 24, 5:46 pm, Terry Reedy <[EMAIL PROTECTED]> wrote: > > Wanting to slice while iterating is a *very* specialized usage. I disagree because iterators mark positions, which for sequences are just offsets. And slicing is all about offsets. Here is a quote from the already implemented PEP 357:

Re: calling a .exe from Python

2008-06-25 Thread evidentemente.yo
Hey, thank you very much!!!:D Would it matter if my .exe doesn't return any value? would it return like an "ok" or something??? On 24 jun, 14:32, Nick Craig-Wood <[EMAIL PROTECTED]> wrote: > evidentemente.yo <[EMAIL PROTECTED]> wrote: > >  Hi, i am trying to call a .exe from my .py file, i have f

Re: newb question on strings

2008-06-25 Thread Bruno Desthuilliers
Dan Bishop a écrit : On Jun 24, 4:04 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: Are you trying to escape for a regular expression? Just do re.escape(). print re.escape('Happy') Happy print re.escape("Frank's Diner") Frank\'s\ Diner If you're escaping for URLs, there's urllib2.quot

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

2008-06-25 Thread Aspersieman
David wrote: Rich Healey wrote: I don't want to start a flamewar. But I like vim. Hi Rich, could I take a look at your .vimrc , the python stuff. thanks -- http://mail.python.org/mailman/listinfo/python-list Try this : http://blog.sontek.net/2008/05/11/python-with-a-modular-ide-vim/ Nicol

automatically import modules upon interpreter invocation

2008-06-25 Thread Daniel Fetchinson
Hi folks, this seems like a very basic thing but I couldn't find a solution. I always do the following after starting the python interpreter (on linux): import rlcompleter import readline readline.parse_and_bind("tab: complete") Is there a way of making python execute the above whenever it starts

Re: Sequence iterators with __index__

2008-06-25 Thread schickb
On Jun 25, 12:11 am, schickb <[EMAIL PROTECTED]> wrote: > > But this isn't just about slicing. I'd like sequence iterators to be > usable as simple indexes as well; like a[it] (which __index__ would > also provide). It occurred to me that this wouldn't need to be limited to sequence iterators. Alt

Re: percent string replacement with index

2008-06-25 Thread Ulrich Eckhardt
Ulrich Eckhardt wrote: > What I'm surprised is that this isn't supported: > > "%(1)s %(2)s" % ("zero", "one", "two") Thanks Terry and Matimus, actually I'm using 2.4 and considering upgrading now. ;) Uli -- Sator Laser GmbH Geschäftsführer: Thorsten Föcking, Amtsgericht Hamburg HR B62 932 -

Re: Porn Addiction

2008-06-25 Thread Jason Scheirer
On Jun 24, 5: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 everything.. I eve

Re: automatically import modules upon interpreter invocation

2008-06-25 Thread Ken Seehart
Daniel Fetchinson wrote: Hi folks, this seems like a very basic thing but I couldn't find a solution. I always do the following after starting the python interpreter (on linux): import rlcompleter import readline readline.parse_and_bind("tab: complete") Is there a way of making python execute t

Re: shorten this: if char in "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz":

2008-06-25 Thread Nick Craig-Wood
Guilherme Polo <[EMAIL PROTECTED]> wrote: > Let me post another one, and longer: > > if ord(somechar) in range(ord('A'), ord('Z') + 1) + range(ord('a'), > ord('z') + 1): > ... That is very inefficient! Every time it is run it creates two lists then joins them then throws the whole lot aw

Re: calling a .exe from Python

2008-06-25 Thread Nick Craig-Wood
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(["mypath/myfile.exe",arg1,arg2]) > > > > rc will contain the exit status > > > > See the subprocess

Re: automatically import modules upon interpreter invocation

2008-06-25 Thread Daniel Fetchinson
>> Hi folks, this seems like a very basic thing but I couldn't find a >> solution. >> I always do the following after starting the python interpreter (on >> linux): >> >> import rlcompleter >> import readline >> readline.parse_and_bind("tab: complete") >> >> Is there a way of making python execute

Re: Terminating processes on Windows (handles and IDs)

2008-06-25 Thread geoffbache
Thanks for the help Tim! Good to see this is being sorted in Python at last, although it'll be some time before I can use only Python 2.6 I suspect... I'm making use of _handle now and it works - most of the time. The remaining issues are probably PyGTK problems rather than python ones though, a

Re: insertion sorts...

2008-06-25 Thread python_newbie
On 24 Haziran, 04:33, Terry Reedy <[EMAIL PROTECTED]> wrote: > Matimus wrote: > > May I suggest you look into using `enumerate`: > > for i, val in enumerate([4,5,6]): > > ...  print i, val > > ... > > 0 4 > > 1 5 > > 2 6 > > > It allows you to get the index and the value at the same time, whic

Apache2 + Python WITHOUT mod_pytho

2008-06-25 Thread pistacchio
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. currently my /etc/apache2/sites-available/default file reads: __ NameVirtualHost * ServerAdmin [EMAIL PROTECTED] DocumentR

Mobile Devices

2008-06-25 Thread rodmc
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 would like to know what people would recommend for developing mobil

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

2008-06-25 Thread Bruno Desthuilliers
cirfu a écrit : is there an IDE for python of the same quality as Eclipse or DEVC++? I am currently using the editor that coems iwth python and it is all fine but for bigger projects it would be nice to have some way to easier browse the projectfiles for example. If you're into clickodroms, yo

python -regular expression - list element

2008-06-25 Thread antar2
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 list2 that are in list1, into for example 'u'. In my substitution, I shou

Re: python -regular expression - list element

2008-06-25 Thread cokofreedom
On Jun 25, 11: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 lis

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

2008-06-25 Thread Ben Finney
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 dropping emacs + python-mode + ecb. I'm having the most success with this combination, yes. Though ecb

A question about wxButton Event handler

2008-06-25 Thread grays
I Create A Button Named ABtn and Blind OnABtnClick() with it . How can i Call the ABtn Click Event just like use Abtn.click in Delphi? -- http://mail.python.org/mailman/listinfo/python-list

Re: python -regular expression - list element

2008-06-25 Thread Ben Finney
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 to frotz the hymangirator with spangule. That, or show us the actu

Re: Apache2 + Python WITHOUT mod_pytho

2008-06-25 Thread pistacchio
Solved. Here my new /etc/apache2/sites-available/default __ NameVirtualHost * ServerAdmin [EMAIL PROTECTED] DocumentRoot /var/www/ Options FollowSymLinks AllowOverride None AddHandler cgi-script .p

Re: Apache2 + Python WITHOUT mod_pytho

2008-06-25 Thread Jorge Godoy
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 for your distri

Re: A question about wxButton Event handler

2008-06-25 Thread grays
On 6月25日, 下午6时30分, grays <[EMAIL PROTECTED]> wrote: > I Create A Button Named ABtn and Blind OnABtnClick() with it . > How can i Call the ABtn Click Event just like use Abtn.click in > Delphi? I get it . event = wx.CommandEvent(wx.wxEVT_COMMAND_BUTTON_CLICKED, ABtn.GetId()) ABtn.GetEventHand

Re: insertion sorts...

2008-06-25 Thread A.T.Hofkamp
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 have to do this ? Before the > iteration ? And then iterate through one

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

2008-06-25 Thread Jorge Godoy
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 dropping emacs + python-mode + ecb. > > I'm having the most success with thi

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

2008-06-25 Thread cokofreedom
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 dropping

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

2008-06-25 Thread Jorge Godoy
[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-packaged to make it feel more like a Windows application, i

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(["

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: 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 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

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: 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

Plz decompyle my file

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

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

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)

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: 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: 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

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: 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

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: 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

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

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

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

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: 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

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: 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

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: 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

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: 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

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

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: 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 (

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: 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: 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: 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: 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 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

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: 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

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: 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

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: 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

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: 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

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: 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

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: 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:/

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

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

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

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

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 [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

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: 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: 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: 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

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: [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

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: 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: 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
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: 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: 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: 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: 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: 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

  1   2   >