Problems to list *all* mountedwindows partitions

2012-05-03 Thread joblack
I do have a script which shows me the mounted partitions: c = wmi.WMI ('localhost') for disk in c.Win32_DiskPartition (DriveType=3): diskspace = int(disk.FreeSpace)/100 if diskspace < mfspace: trigger = True ldisks.append(disk.Name +'\\ '+str('{0:,}'.format(diskspace).r

convert assembly data (double words and bytes) in two tupple

2010-12-07 Thread joblack
I have two assembly data txt files, one has the structure: 0E1459D1Fh, 0AB58FAAEh, 4303E35Bh, 55FA3020h, 0E66D76ADh, 0EF434544h, ... and the other has the structure: 53h, 6, 6Bh, 0D4h, 40h, 35h, 0B5h, 33h, 0AFh, 30h, 0B3h, 66h, ... (I removed the dd and db with awk) Now I want both of them in

polymorphic function question

2010-09-21 Thread joblack
Let's say I've got a function with def doesSomething(A='bla'): ... and I try to call it with a non existent variable with doesSomething(DoesNotExist) What will happen? Will it throw an exception or will it take the defautl value? -- http://mail.python.org/mailman/listinfo/python-list

pycrypto rsa string decryption

2010-07-22 Thread joblack
I have an encrypted string and a key string (512 bits long). After studying the pycrypto documentation I still don't get how to read the private key and decrypt the string. - read the 512 bit string as private key - decrypt the encrypted string with rsa Any short code example how to do that? Gre

Re: Errno 9] Bad file descriptor

2010-07-15 Thread joblack
> Where does the error occur? If Cameron is right, it occurs somewhere > completely different, when serializer.dump() is already long done, when > some unsuspecting fool tries to do something with serializer.outf (such > as closing it) I have found it but still I don't get it. Dump looks like this

Re: Errno 9] Bad file descriptor

2010-07-14 Thread joblack
> | > | Starting point: > | ... > |         self.status['text'] = 'Processing ...' > |         try: > |             cli_main(argv) > |         except Exception, e: > |             self.status['text'] = 'Error: ' + str(e) > |             return > | ... > | cli_main: > | > |     keypath, inpath, outp

Re: Errno 9] Bad file descriptor

2010-07-13 Thread joblack
All right I found the web link. It's an improvement to the pdf miner project (adds pdf dump methods). http://pastebin.com/P8SWj5YK -- http://mail.python.org/mailman/listinfo/python-list

Re: Errno 9] Bad file descriptor

2010-07-13 Thread joblack
Thanks for the answers so far. It's not my code I'm just curious how that could happen: Starting point: ... self.status['text'] = 'Processing ...' try: cli_main(argv) except Exception, e: self.status['text'] = 'Error: ' + str(e) return ..

Errno 9] Bad file descriptor

2010-07-11 Thread joblack
I get sometimes a Errno 9 Bad file descriptor the code is too long to show it here but what are the circumstances this could happen? A web search showed nothing. I have especially the feeling Python 2.6 has some problems with Unicode ... and might not find the file. Is that possible? -- http://

Re: RE - Parsing ipconfig /all output - question

2010-06-06 Thread joblack
Great - seems to work =) ... -- http://mail.python.org/mailman/listinfo/python-list

RE - Parsing ipconfig /all output - question

2010-06-06 Thread joblack
I'm trying to get the first MAC address from the ipconfig /all output. Unfortunately you can't just search for Physical Address because the name is only valid in the English Windows version. Here a test which isn't working: import subprocess import re p = subprocess.Popen('ipconfig /all', shell =

great

2010-06-03 Thread joblack
Great - it works. Thanks a lot. -- http://mail.python.org/mailman/listinfo/python-list

questions about how to parse a string and put it in a dictionary

2010-06-03 Thread joblack
I've got a string which (without any CR or LF) consists of 'attribute1=attribute_value;attribute2=attribute_value2; ...' and I want them to read in a dictionary so that the attribute name is the key and the attribute value is the data. Any ideas for an implementation? Greetings and thanks jb --