Discarding STDERR generated during subprocess.popen

2010-08-23 Thread Leon Derczynski
Hi, I would like to run an external program, and discard anything written to stderr during its execution, capturing only stdout. My code currently looks like: def blaheta_tag(filename): blaheta_dir = '/home/leon/signal_annotation/parsers/blaheta/' process = subpro

How to read source code of python?

2010-06-09 Thread Leon
Hi, there, I'm trying to read the source code of python. I read around, and am kind of lost, so where to start? Any comments are welcomed, thanks in advance. -- http://mail.python.org/mailman/listinfo/python-list

Re: what's the best way to call a method of object without a guarantee of its existence

2009-05-05 Thread Leon
On May 5, 3:25 am, Marco Mariani wrote: > Leon wrote: > > One way,  define the object before it is used, > > like this: > > object = None > > This is a good practice anyway. Conditional existance of objects is > quite evil. Resorting to if defined('foo

what's the best way to call a method of object without a guarantee of its existence

2009-05-05 Thread Leon
One way, define the object before it is used, like this: object = None . . if object is not None: object.method() The other way, using try ... catch try: object.method() catch NameError: pass for big programs, which is better, or any other way? Miles -- http://mail.pyth

Re: Which one is best Python or Java for developing GUI applications?

2009-05-05 Thread Leon
I think there are two advantages over java for GUI application First, python is more productive and has very rich third modules support, you can check the demo of wxPython. Second, you can develop native-looking GUI BTW: I'm developing GUI application using python and wxPython. Second, On May

Re: do something in time interval

2008-10-06 Thread Leon Zhang
Petr, I am not an expert, but why not to use time.sleep(5)? If you are using wxPython, you may also try wx.Timer, in which you could set its interval. Good luck! Leon On Tue, Oct 7, 2008 at 2:07 AM, Petr Jakes <[EMAIL PROTECTED]> wrote: > I have infinitive loop running script and I w

Re: Socket Question

2008-10-01 Thread Leon Zhang
Maybe you need to close the socket somewhere else, rather than to close it when you receive the your response. On Tue, Sep 30, 2008 at 7:01 AM, Ali Hamad <[EMAIL PROTECTED]> wrote: > Hello All : > > A socket question from a networking newbie. I need to create > a server that: > > 1) receive a me

Re: Eclipse, Python, wxPython and code completion

2008-08-11 Thread leon . domingo
On 11 ago, 04:34, "SPE - Stani's Python Editor" <[EMAIL PROTECTED]> wrote: > On 10 aug, 20:42, [EMAIL PROTECTED] wrote: > > > > > Hello, > > > I've installed Eclipse, Python 2.5 and wxPython on Ubuntu 8.04. The > > problem is that I can't get code completion for wx module. I don't > > know if it oc

Eclipse, Python, wxPython and code completion

2008-08-10 Thread leon . domingo
Hello, I've installed Eclipse, Python 2.5 and wxPython on Ubuntu 8.04. The problem is that I can't get code completion for wx module. I don't know if it occurs the same with other libraries outside the python "core". If I compile/run my code containing the wx library, I get an application running

the pipe reading in Thread dose not work.

2008-06-01 Thread Leon zhang
#!/usr/bin/env python # -*- coding: utf-8 -*- import string, sys from threading import Thread import os import time class test_pipe(Thread): def __init__(self, fd): Thread.__init__(self) self.testfd = fd def run(self): print "started thread begin -" w

Re: TK 8.5

2008-01-01 Thread Leon
/ We can read : "the initial 2.6 target is for April 2008" Great ! But I found nothing about Tk 8.5 ? Leon -- http://mail.python.org/mailman/listinfo/python-list

TK 8.5

2007-12-31 Thread Leon
esent version of TK[inter] included in the last version of Python (2.5.1) ? Can you give me informations (or links, etc...) about this three questions ? Thanx in advance !!! Leon -- http://mail.python.org/mailman/listinfo/python-list

Find the ID, but how to select/copy the whole string by ID?

2007-09-19 Thread Leon
Hi everybody, I am a beginer for Python, hope can get help from you guys. What I want to do is : Input an ID -> find the ID in the file -> copy the whole string y stringID = str(raw_input('Enter the string ID : ')) file = open('strings.txt') sourcefile = file.read() file.close() sourcefile.

Formatting a string to be a columned block of text

2006-12-26 Thread Leon
ike a newspaper on the screen. Text processing is very new to me, any ideas on how I could achieve a multi-columned text formatter. Are there any libraries that already do this? Thanks and happy holidays! Leon -- http://mail.python.org/mailman/listinfo/python-list

Freetype 2 Bindings

2006-09-07 Thread Leon
ut this out, please help, I'll be forever grateful. Thanks, Leon -- http://mail.python.org/mailman/listinfo/python-list

Re: Higher-level OpenGL modules

2006-09-05 Thread Leon
Thanks guys!, Ill look into your suggestions. I'm actually currently working directly with pyOpenGL, but hopefully Ill find something that would make me more efficient. I might end up writing a library myself. -- http://mail.python.org/mailman/listinfo/python-list

Higher-level OpenGL modules

2006-09-05 Thread Leon
like the processing language - http://www.processing.org/reference/index.html). The closest thing I could find was devachan - http://www.cesaremarilungo.com/sw/devachan/, but its very limited. Any response would be greatly appreciated. Thanks Leon -- http://mail.python.org/mailman/listinfo/python

Re: Regular Expression: Matching substring

2006-04-12 Thread Leon
You are right. In fact the procedure is as follows: The substr ``101101" is no problem, if stop here, match will successful. But the tailing `1' occurs, so we may imagine the working automata move to a state, which according to the regexp's outer most `)', and ready to repeat the whole regexp again

Re: Regular Expression: Matching substring

2006-04-12 Thread Leon
Hi Kevin, You may notice that, for matching the regex (0|(1(01*0)*1))*, the left most three characters of a string must not be ``101" while not followed by an `0'. After reading the first `1', automata expects `1' or ``00" or ``010" or ``11", right?:) Kevin CH 寫道: > Hi, > > I'm currently run

what module can do html encoder??

2004-12-12 Thread Leon
example: s = ' ' --->   -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie MySQLdb / MySQL version problem, I think

2004-11-29 Thread Leon
new version MySQL use new Password encode . you can use ¡upassword()¡v(modify user table)¡Ato change new password encode to old password.. good luck ^^ ---by Leon-- "Dave Merrill" <[EMAIL PROTECTED]> ¼¶¼g©ó¶l¥ó·s»D:[EMAIL PROTECTED] > Sorry for the newbness... Win2K,

how to drop all thread ??

2004-11-28 Thread Leon
if class A( use threading,thread module ) to produce 100 thread,how to drop its (100 thread) when its running -- http://mail.python.org/mailman/listinfo/python-list