Encode filenames to safe format

2006-07-20 Thread Dara Durum
Hi !I want to encode filenames to safe format, like in browser url (space -> %20, etc.).What the module and function name that helps me in this project ?Thanx for it:dd -- http://mail.python.org/mailman/listinfo/python-list

Re: Duplex communication with pipes - is possible ?

2006-06-26 Thread Dara Durum
is packet managing mode: def WriteData(WStm,Data): data=dumps(Data,1) bdata=encodestring(data) dlen=len(bdata) msg='%12d%s'%(dlen,bdata) if WStm==None: print msg else: WStm.write(msg) def ReadData(RStm): dlen=int(RStm.read(12)) bdata=RStm.read(dlen) d

Re: Duplex communication with pipes - is possible ?

2006-06-20 Thread Dara Durum
Hi ! Ahhh ! It's working ! This is the simple client code: if 'C' in sys.argv: #sys.stdout=open(r'c:\tpp2client.log','w') print "clt start" while 1: head=sys.stdin.read(4) print "clt head",[head] if head.lower()=='quit': break dsize=int(head)

Duplex communication with pipes - is possible ?

2006-06-16 Thread Dara Durum
Hi ! I want to create a Process Pool Object. I can hold started processes, and can communicate with them. I tryed with many ipc methods, but every of them have bug or other problem. Sockets are unavailabe (because Windows Firewall hold them). I think I will use pipe. The object's pseudocode: wh

IPC with mmap - freezed in Windows XP terminal ?

2006-06-14 Thread Dara Durum
Hi ! I want to comm. between 2 procs with mmap - in Windows XP. Interesting thing I saw yesterday. When I start my mtest.py without redirection stdout, the program freezed. When I pushed Enter, is was released. (Just like when I use raw_input in the end of the code... :-)) For this effect I nee

About Threading - implementation

2006-06-14 Thread Dara Durum
Hi ! I don't understand something. Under Python the threads are simulated by Python Interpreter as when prev. setted pieces (interval) of the interpreted tokens are executed, it is change to another "virtual" thread ? Or it was really create real threads, and they are figth for the priority, and

Use subprocesses in simple way...

2006-05-10 Thread Dara Durum
Hi ! Py2.4, Win32. I need to optimize a program that have a speciality: hash (MD5/SHA1) the file contents (many files). Now I do this in a simple python program, because (what a pity) the FSUM utility died in a file with unicode filename... (It is unknown error: I used alternate file name, but i

Why I get wrong filetime values with win32 api (FindFilesW) ?

2006-05-07 Thread Dara Durum
Hi !I need to get filelists from many HDD-s with more props. of files.I used FindFilesW to get these informations.But I have a problems with it.When I used Find_Data tuple, and it's atime,ctime,mtime props, I get wrong result. I have hungarian Windows (XP), so little time diff. I have.These method