Re: buliding log files

2008-02-26 Thread Thinker
diljeet kaur wrote: > hi > im working on pyqt environment > i want to know how to take log or how to build log files of the output > > > Looking for last minute shopping deals? Find them fast with Yahoo! > Search. >

Re: [Newbie] Is there any method to urlretrieve to a file the html source from a url with "Transfer-encoding": chunked

2008-02-25 Thread Thinker
Aldo Ceccarelli wrote: > Hello All, > I apologize for posting a question on this but I could not find a > complete answer after reading and searching so far:-) > > My problem is that I'd like to store the html source of a certain web > url but when I try via urllib / urllib2 reads or urlretrieve I

Re: Embedding a literal "\u" in a unicode raw string.

2008-02-25 Thread Thinker
Romano Giannetti wrote: > Hi, > > while writing some LaTeX preprocessing code, I stumbled into this > problem: (I have a -*- coding: utf-8 -*- line, obviously) > > s = ur"añado $\uparrow$" > > Which gave an error because the \u escape is interpreted in raw > unicode strings, too. So I found that th

Re: AW: Write to a binary file

2007-04-05 Thread Thinker
es. But, using the file object to read/write a device is > probably not a good idea because of undefined behavior like > that. File objects also do their own buffering, which I > suspect isn't what you want. > Why not try to create a file object with bufsize = 0 ? for ex: - fo = file('/dev/pytest', 'wb', 0) fo.write() fo.close() -- Thinker Li - [EMAIL PROTECTED] [EMAIL PROTECTED] http://heaven.branda.to/~thinker/GinGin_CGI.py -- http://mail.python.org/mailman/listinfo/python-list

Re: Make variable global

2007-03-21 Thread Thinker
objects into the module from another one. When you call a function in another module, it changes global space of module where it is defined. The global space of the module, where caller is in, is kept from touched except accessing through module names. - -- Thinker Li - [EMAIL PROTECTED] [EMAIL PROTE

Re: Garbage collection

2007-03-21 Thread Thinker
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Tom Wright wrote: > Thinker wrote: >> How do you know amount of memory used by Python? ps ? top or >> something? > > $ ps up `pidof python2.5` USER PID %CPU %MEM VSZ RSS TTY > STAT START TIME COMMAND tew24 26275 0.0 11.9 257592

Re: encoding characters

2007-03-21 Thread Thinker
26: ordinal not in range(128) > > <http://baghera.crs4.it:8080/sources#tbend> help me! Thanks More information, please. For example, what DBMS are used. Snippet run into error! - -- Thinker Li - [EMAIL PROTECTED] [EMAIL PROTECTED] http://heaven.branda.to/~thinker/GinGin_CGI.py -BEGIN PGP SIG

Re: Garbage collection

2007-03-21 Thread Thinker
and 2.5: ... skip . > (at this point, Python is using 252MB) > > > Is there something I've forgotten to do? Why is Python still using such a > lot of memory? > > > Thanks! > How do you know amount of memory used by Python? ps 、

Re: Constructor of object

2007-03-14 Thread Thinker
Window(): .. return xml.get_widget("window") pass or class HelloWindow: def __init__(self): pass def __new__(clz, *args): return xml.get_widget("window") - -- Thinker Li - [EMAIL PROTECTED] [EMAIL PROTECTED] http://heaven.branda.to/~thinker/GinGin_CGI.py -BE

Re: Constructor of object

2007-03-14 Thread Thinker
lass: class MyClass(ParentClass): def __init__(self): super(MyClass).__init__(self) Or class MyClass(ParentClass): def __init__(self): super(MyClass, self).__init__() - -- Thinker Li - [EMAIL PROTECTED] [EMAIL PROTECTED] http://heaven.branda.to/~thinker/GinGin_CGI.py -BEGIN PGP SIGNATURE- Ve

Re: getting user id (from an arbitrary sys user)

2007-03-14 Thread Thinker
> Gerardo Please refer http://docs.python.org/lib/module-pwd.html for pwd module. - -- Thinker Li - [EMAIL PROTECTED] [EMAIL PROTECTED] http://heaven.branda.to/~thinker/GinGin_CGI.py -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.6 (FreeBSD) Comment: Using GnuPG with Mozilla - http:

Re: Starting an external, independent process from a script

2007-03-12 Thread Thinker
http://docs.python.org/lib/os-process.html - -- Thinker Li - [EMAIL PROTECTED] [EMAIL PROTECTED] http://heaven.branda.to/~thinker/GinGin_CGI.py -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.6 (FreeBSD) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFF9jFe1LDUVn

Re: Starting Python... some questions

2007-03-12 Thread Thinker
ecuted directly, but not imported as a module. Once a module had been imported, you should invoke reload() function to reload it from filesystem. - -- Thinker Li - [EMAIL PROTECTED] [EMAIL PROTECTED] http://heaven.branda.to/~thinker/GinGin_CGI.py -BEGIN PGP SIGNATURE- Version: GnuPG

Re: Importing binary modules

2007-03-01 Thread Thinker
nfig (plz, man ldconfig) to add the directory, where you shared object is in, to the search path of dynamic linker. - -- Thinker Li - [EMAIL PROTECTED] [EMAIL PROTECTED] http://heaven.branda.to/~thinker/GinGin_CGI.py -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.6 (FreeBSD) Comment: Using GnuPG with

Re: Importing binary modules

2007-03-01 Thread Thinker
cannot rescan LD_LIBRARY_PATH after the python interpreter has > started. Since you create a new module, you should try to link your module with - -rpath-link option. You can specify a path searched by linker when finding shared object required. - -- Thinker Li - [EMAIL PROTECTED] [EMAIL

Re: spawnl and waitpid

2007-02-27 Thread Thinker
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 [EMAIL PROTECTED] wrote: > On 27 f憝, 18:54, Thinker <[EMAIL PROTECTED]> wrote: > hello > ha ok... > i tried this one and the browser don't write the message at once... > I have alos tried with thread and have the sam

Re: spawnl and waitpid

2007-02-27 Thread Thinker
-- > pid = os.spawnl(os.P_NOWAIT,"c:\\python25\ > \python.exe","python","Main.py") print 'please wait...' > ret = os.waitpid(pid,0) You have missed my idea. Since os.waitpid will be blocked, you should print your message before calling os.wait

Re: spawnl and waitpid

2007-02-27 Thread Thinker
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 [EMAIL PROTECTED] wrote: > On 27 f憝, 11:28, Thinker <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: >>>> hello, I run a python cgi script under Apache... and while >>>> the script is running i want to displa

Re: spawnl and waitpid

2007-02-27 Thread Thinker
the "please wait" message appears at > the script end (which is useless at this time! ) > You should flush sys.stdout after you print messages, or the message will keep in buffer untill buffer is full or process terminated. - -- Thinker Li - [EMAIL PROTECTED] [EMAIL PROTECT

Re: SystemError: new style getargs format but argument is not a tuple

2007-02-26 Thread Thinker
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 zefciu wrote: > Thinker wrote: > >> Since PyArg_ParseTuple() is supposed to parse arguments, I >> recommand you to use PyTuple_GetItem() or PyTuple_GET_ITEM(). > > Ok. Now I do it this way: > > c_real = PyFloat_As

Re: SystemError: new style getargs format but argument is not a tuple

2007-02-26 Thread Thinker
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 zefciu wrote: > Thinker wrote: > >> You can add some printf() to throw out messages to make sure >> where the program stop at. If you can compile the module with >> debug information and use gdb to backtrace dump file, it wou

Re: SystemError: new style getargs format but argument is not a tuple

2007-02-26 Thread Thinker
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 zefciu wrote: > Thinker wrote: > >> It should be "PyObject *coord;" . Maybe, it is what is wrong with >> your program! >> >> > Should it? The gcc shows me a warning then: > > warning: 'coord'

Re: SystemError: new style getargs format but argument is not a tuple

2007-02-26 Thread Thinker
= 0, z_imag2 = 0, c_real, > c_imag, bailoutsquare; int iteration_number; register int i; > PyObject coord; It should be "PyObject *coord;" . Maybe, it is what is wrong with your program! - -- Thinker Li - [EMAIL PROTECTED] [EMAIL PROTECTED] http://heaven.branda.to/~thinker/GinGin_CG

Re: Interactive os.environ vs. os.environ in script

2007-02-26 Thread Thinker
ocess does not make link-editor to re-read environment variable and take effect. To resolve the problem, you can try to add the path to sys.path. - -- Thinker Li - [EMAIL PROTECTED] [EMAIL PROTECTED] http://heaven.branda.to/~thinker/GinGin_CGI.py -BEGIN PGP SIGNATURE

Re: SystemError: new style getargs format but argument is not a tuple

2007-02-26 Thread Thinker
= 0, z_imag2 = 0, c_real, > c_imag, bailoutsquare; int iteration_number; register int i; > PyObject coord; if (!PyArg_ParseTuple(args, "Oid", &coord, > &iteration_number, &bailoutsquare)) return NULL; if > (!PyArg_ParseTuple(&coord, "dd", &c_real, &

Re: compile python with sqlite3

2007-02-26 Thread Thinker
27;sqlite3' somewhere on my Linux > (/path/to/sqlite'). What do I have to do if I want to compile 'Python' > with 'sqlite3'? I would appreciate if somebody tells me to solve this > problem. > > With regards, > Nader You need PySQLite .. - -- Th

Re: subprocess stdin encoding

2007-02-05 Thread Thinker
cii" # Default value set by _PyUnicode_Init() if 0: # Enable to support locale aware default string encodings. import locale loc = locale.getdefaultlocale() if loc[1]: encoding = loc[1] in site.py . and change if 0: to if 1: to enable string encoding. Now, you can execute python interpret

Re: Conversion of string to integer

2007-01-30 Thread Thinker
is > > #hs=string.split(hs) > hs =["popopopopop","254.25","pojdjdkjdhhjdccc","25452.25"] > hs = [.] import re reo = re.compile(r'^[0-9]+(\.[0-9]+)?$') result = [e for e in hs if reo.match(e)] -- Thinker Li - [EM

Re: Watch log

2007-01-15 Thread Thinker
you want is something like 'tail -f' in linux. If you look into it's source code, you will find it check file periodically. When a read() reach the end of the file, read() will return a empty string. You can try to read data from the file periodically after a EOF. I think it is wha

another SQL implement

2007-01-08 Thread Thinker
nto Python language? Downloads: The implementation depend on pythk, so you need two modules, pysql & pythk http://master.branda.to/downloads/pysql/pysql-20070108.tar.gz http://master.branda.to/downloads/pythk/pythk-20070108.tar.gz - -- Thinker Li - [EMAIL PROTECTED] [EMAIL PROTECTED

Re: Heap Memory

2006-11-16 Thread Thinker
; -Greg > What is your OS? Maybe you should show out the memory usage of your python process. In FreeBSD, you should set evironment variable 'MALLOC_OPTIONS=P' to print out usage of malloc()。Maybe you can find a way, in your system, to print out usage of the heap. -- Thinker Li -