mapped drive missing when run as a service

2006-12-04 Thread Thomas Thomas
Hi All, I have a python application which i run as a service.. import win32api,string drives=win32api.GetLogicalDriveStrings() drives=string.splitfields(drives,'\000') print drives in the list of drives my mapped network drive is not showing when i run the application as a ser

Outlook Addin and py2exe: 2 problems

2006-09-25 Thread Thomas Thomas
I recenlty had the same issue, but clearing the build directory and rebuilding again fixed the issue for me -- http://mail.python.org/mailman/listinfo/python-list

encoding of a file

2006-08-03 Thread Thomas Thomas
.open(filename, "r", encoding='latin-1') or f=codecs.open(filename, "r", encoding='utf-8')   sys.defaultencoding gives ascii and I know that's not the one to use   cheers -Thomas Thomas[EMAIL PROTECTED]

python unicode how to

2006-08-02 Thread Thomas Thomas
o a sample file content will be string MetaDataPrompt = "Discovery No"; string MetaDataFieldName = "Discovery No"; string MetaDataType = "string"; string MetaDataValue = "£500"; } 3{ string MetaDataP

Get age of a file/dir

2006-08-01 Thread Thomas Thomas
what abt   os.path.getmtime or may be os.stat(filename)[ST_MTIME];    cheers -Thomas Thomas[EMAIL PROTECTED]Phone.  +64 7 855 8478Fax.  +64 7 855 8871 -- http://mail.python.org/mailman/listinfo/python-list

Zipping files/zipfile module

2006-08-01 Thread Thomas Thomas
  myZipFile.close()    return (1,zipFilename)       (success,filename)=createZipFile(planName,files,folders);     hope it helps..   cheers -Thomas Thomas[EMAIL PROTECTED]Phone.  +64 7 855 8478Fax.  +64 7 855 8871 -- http://mail.python.org/mailman/listinfo/python-list

special charater in file causing trouble

2006-08-01 Thread Thomas Thomas
  line=f.next() metaHash[hashKey]=metaSubHash   print "one section over"   print filename,metaHash    return metaHash     else:   return {}   print "I cannot see a file of this name"

os listdir access denied when run as a service

2006-05-24 Thread Thomas Thomas
if ((not (file.find(".tmp")>=0)) and (not (file.find("~")>=0))): filelist.append(file) for folder in folders: logger.error("got a folder :"+folder); logger.error("it was in the list :"+folders.__str__());

Reading Soap struct type

2006-05-09 Thread Thomas Thomas
Hi All, I am receiving a hash below from my Soap Interface : {'Field12value': ':C F3Value', 'Field8': 'Price Text:price_text', 'Field9': 'Text with File:file_text ', 'Field11value': ':CF2Value', 'Field7': 'Product Code:product_code', 'Field7va lue': ':product_values', 'Field2': 'Job Reference:job

Reading XST file

2006-05-02 Thread Thomas Thomas
started using file objects  ..and was thinking is a better way to approach this scenario   from os.path import *filename="c:\sxtfile.xst";if exists(filename):   if isfile(filename):   f = open(filename, "rb")   for line in f.readlines():   print line   else:   print "I cannot see a file of this name"           cheers   -Thomas Thomas   phone  +64 7 855 8478fax    +64 7 855 8871 -- http://mail.python.org/mailman/listinfo/python-list

webbrowser failing

2005-09-20 Thread Thomas Thomas
Hi All,   import webbrowserurl=''webbrowser.open(url)   giving the error   Python 2.3.5 (#62, Feb  8 2005, 16:23:02) [MSC v.1200 32 bit (Intel)] on win32Type "help", "copyright", "credits" or "license" for more information.>>> ## working on region in file c:/DOCUME~1/ADMINI~1/LOCALS~1/Temp/p

python socket error

2005-06-01 Thread Thomas Thomas
Is there any getaround for the following error .. This happens when uploading large files say>50MB..   Python version Python 2.3.5 (#62, Feb  8 2005, 16:23:02) [MSC v.1200 32 bit (Intel)] on win32Type "help", "copyright", "credits" or "license" for more information.   Traceback (most recent

store data for search using python

2005-05-22 Thread Thomas Thomas
Hi all, I have files & text associated with that files as data. what will be the best way to store them(like xml..), So that i can search in the text and get a list of files as result from a python application.. what kind of factors do i have to take into account if my prime concern is effecti

urllib open error

2005-05-08 Thread Thomas Thomas
Hi   It's seem to me that it works fine if I use hostname instead of ip address.   Note: Can anyone tell me how i reply to a question in thread, rather than starting a new one"   regards Thomas -- http://mail.python.org/mailman/listinfo/python-list

urllib open error

2005-05-08 Thread Thomas Thomas
Hi all, trying to download a file using urllib. Working fine on most machines.. failing in one..   Python 2.3.5 (#62, Feb  8 2005, 16:23:02) [MSC v.1200 32 bit (Intel)] on win32Type "help", "copyright", "credits" or "license" for more information.>>> import urllib;>>> url='';>>> f=urllib.u

UnicodeDecodeError

2005-05-04 Thread Thomas Thomas
Hi all, Forgot to mention I am using python 2.3 on windows. I got the same error in mac panther . if I remove the line filename=unicode(filename); it works fine sometimes and if I encode the filename to ascii it works fine Thanks Thomas -- http://mail.python.org/mailman/listinfo/python-list

UnicodeDecodeError

2005-05-04 Thread Thomas Thomas
Hi all     import httplib, mimetypesimport os;   def get_content_type(filename):    return mimetypes.guess_type(filename)[0] or 'application/octet-stream'       filepath= 'c:/Documents and Settings/Administrator/Desktop/tmp/test.pdf';f = open(filepath, "rb")data = "">f.close()   (filedir,