monitor a folder for file creation, how?
How do I monitor a folder for new file(s) creation? How to use thread to do a wait until a new file is 'detected'? Thank you! -- http://mail.python.org/mailman/listinfo/python-list
Re: monitor a folder for file creation, how?
SUPER! This is exactly what I'm looking for. gene tani wrote: > win32: (I posted this link in response to same question, um, day bef. > yesterday) > > http://groups-beta.google.com/group/comp.lang.python/browse_frm/thread/9a1c7629db72d064/56008cb68eeffa23?hl=en#56008cb68eeffa23 > (Thanks to Tim Golden for collecting the info) > > OS X: I dunno... > -- http://mail.python.org/mailman/listinfo/python-list
os.rename() doesn't work w/unicode??
C:\MP3\001.txt -> 0.txt C:\MP3\01. ??? - (???).mp3 -> 1.mp3 Traceback (most recent call last): File "C:\Python24\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\MP3\!RenameNum.py", line 40, in ? renameFiles(os.path.dirname(sys.argv[0])) File "C:\MP3\!RenameNum.py", line 26, in renameFiles os.rename(os.path.join(path, filenames), new_filename) OSError: [Errno 22] Invalid argument - def renameFiles(folder): """ The function called for each directory visited. We'll rename all the files in consecutive number except files with filename begins with '!' """ file_num_counter = 0 for path, dirs, files in os.walk(folder): for filenames in files: if filenames.startswith('!'): print 'file: ' + filenames + ' is ignored!' else: file_extension = filenames.split('.')[-1] new_filename = str(file_num_counter) + '.' \ + file_extension file_num_counter += 1 print os.path.join(path, filenames), "->", new_filename os.rename(os.path.join(path, filenames), new_filename) -- http://mail.python.org/mailman/listinfo/python-list
Re: os.rename() doesn't work w/unicode??
Serge Orlov wrote: fanbanlo wrote: C:\MP3\001.txt -> 0.txt C:\MP3\01. ??? - (???).mp3 -> 1.mp3 Traceback (most recent call last): File "C:\Python24\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\MP3\!RenameNum.py", line 40, in ? renameFiles(os.path.dirname(sys.argv[0])) File "C:\MP3\!RenameNum.py", line 26, in renameFiles os.rename(os.path.join(path, filenames), new_filename) OSError: [Errno 22] Invalid argument os.rename works with unicode, you're getting this error because question marks are not allowed in file names on Windows. Serge. The filename is supposed to be in Chinese, on NTFS (WinXP). However, when i print it, they are all '???', and that caused os.rename() to break. How to force os.walk to return a list of unicode filename? -- http://mail.python.org/mailman/listinfo/python-list
best XSLT processor?
Which XSLT processor is the most reliable? requirement: + must support Python 2.4 + must run w/ Windows (and Linux) + not super slow My python project needs a XSLT processor + Docbook's XSLT to translate from docbook-xml -> HTML. PyXML? is it reliable? Slow? 4Suite? some said it is buggy (lots of work arounds)? Others ??? Thx! -- http://mail.python.org/mailman/listinfo/python-list
pickle: No module named on. HELP!
What seems to be the matter? >>> path = "C:\\eclipse\\workspace\\moin134\\docbook\\xslt\\html\\db_compiled.dat" >>> f = file(path) >>> cPickle.load(f) Traceback (most recent call last): File "", line 1, in ? ImportError: No module named on. >>> f = file(path) >>> pickle.load(f) Traceback (most recent call last): File "", line 1, in ? File "C:\Python24\lib\pickle.py", line 1390, in load return Unpickler(file).load() File "C:\Python24\lib\pickle.py", line 872, in load dispatch[key](self) File "C:\Python24\lib\pickle.py", line 1083, in load_inst klass = self.find_class(module, name) File "C:\Python24\lib\pickle.py", line 1138, in find_class __import__(module) ImportError: No module named on. Thanks, Henry -- http://mail.python.org/mailman/listinfo/python-list
Re: pickle: No module named on. HELP!
fanbanlo wrote: What seems to be the matter? >>> path = "C:\\eclipse\\workspace\\moin134\\docbook\\xslt\\html\\db_compiled.dat" >>> f = file(path) >>> cPickle.load(f) Traceback (most recent call last): File "", line 1, in ? ImportError: No module named on. >>> f = file(path) >>> pickle.load(f) Traceback (most recent call last): File "", line 1, in ? File "C:\Python24\lib\pickle.py", line 1390, in load return Unpickler(file).load() File "C:\Python24\lib\pickle.py", line 872, in load dispatch[key](self) File "C:\Python24\lib\pickle.py", line 1083, in load_inst klass = self.find_class(module, name) File "C:\Python24\lib\pickle.py", line 1138, in find_class __import__(module) ImportError: No module named on. Thanks, Henry Got it, forgot to open file in binary mode. Thx -- http://mail.python.org/mailman/listinfo/python-list
pygdchart 0.6.1 for Windows Python 2.4 available?
Does any one has pygdchart compiled for Windows Python 2.4?? (.pyc file?) http://www.nullcube.com/software/pygdchart.html only has binary for Windows Python 2.3 and older... :( I tried following the instructions for compiling w/ Mingw from the README, but... in step2, i have no idea how to do this: 2. Make a Python import library (adjust for your setup and version of Python): impdef c:/windows/system32/python24.dll >python.def dlltool --dllname python24.dll --input-def python.def --output-lib libpython24.a what/where's impdef!? Thank you very much fanbanlo -- http://mail.python.org/mailman/listinfo/python-list