Re: odd unicode error

2007-04-12 Thread tubby
Martin v. Löwis wrote: >> path += '/' + b >> UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 1: >> ordinal not in range(128) >> >> Any ideas? > > path is a Unicode string, b is a byte string and contains the > byte \xd0. > > The problem is that you have a directory with f

odd unicode error

2007-04-12 Thread tubby
This: for root, dirs, files in os.walk(search_path): for f in files: print f ### Produces this: Traceback (most recent call last): File "/home/brad/Desktop/my_script.pyw", line 340, in -toplevel- hunt(target_files(search_path, skip_file_extensions(), skip_file

Re: threading a thread

2007-02-27 Thread tubby
Bjoern Schliessmann wrote: > RTFM? One last things... here's a *very* small sample netstat output from a threaded py script: > tcp0 1 192.168.1.100:41066 192.168.17.132:www SYN_SENT > tcp0 1 192.168.1.100:46412 192.168.5.132:www SYN_SENT > tcp

Re: threading a thread

2007-02-27 Thread tubby
Bjoern Schliessmann wrote: > tubby wrote: > >> Have you tried it? Nmap is sequential. > > RTFM? I urge you to actually try it and see for yourself. From my experience, it sucks... even when only doing 1 port it takes hours regarless of what the man page implies. I'l

Re: threading a thread

2007-02-27 Thread tubby
Bjoern Schliessmann wrote: > tubby wrote: >> Right now I'm just prototyping and the threaded hosts portion >> works very well for my needs. I'd just like to add a threaded >> ports check and wanted to know if anyone had done something >> similar in Python.

threading a thread

2007-02-27 Thread tubby
I have a program written in Python that checks a class B network (65536 hosts) for web servers. It does a simple TCP socket connect to port 80 and times out after a certain periods of time. The program is threaded and can do all of the hosts in about 15 minutes or so. I'd like to make it so tha

Re: pdf to text

2007-01-29 Thread tubby
Dieter Deyke wrote: >> sout = os.popen('pdftotext "%s" - ' %f) > Your program above should read: > >sout = os.popen('pdftotext "%s" - ' % (f,)) What is the significance of doing it this way? -- http://mail.python.org/mailman/listinfo/python-list

Re: pdf to text

2007-01-25 Thread tubby
David Boddie wrote: > The pdftotext tool may do what you want: > > http://www.foolabs.com/xpdf/download.html > > Let us know how you get on with it. > > David Perhaps I'm just using pdftotext wrong? Here's how I was using it: f = filename try: sout = os.popen('pdftotext "%s" - ' %f)

Re: pdf to text

2007-01-25 Thread tubby
David Boddie wrote: > The pdftotext tool may do what you want: > > http://www.foolabs.com/xpdf/download.html > > Let us know how you get on with it. I have used this tool. However, I need PDF read ability on Windows and Linux and in the future Macs. pdftotext works great on Linux, but poorly

pdf to text

2007-01-25 Thread tubby
I know this question comes up a lot, so here goes again. I want to read text from a PDF file, run re searches on the text, etc. I do not care about layout, fonts, borders, etc. I just want the text. I've been reading Adobe's PDF Reference Guide and I'm beginning to develop a better understandin

Re: Determining when a file is an Open Office Document

2007-01-18 Thread tubby
Ross Ridge wrote: > tubby wrote: >> Silly question, but here goes... what's a good way to determine when a >> file is an Open Office document? I could look at the file extension, but >> it seems there would be a better way. VI shows this info in the files:

Determining when a file is an Open Office Document

2007-01-18 Thread tubby
ine when I need to do that versus just reading the file. Thanks, Tubby -- http://mail.python.org/mailman/listinfo/python-list

clarification on open file modes

2007-01-04 Thread tubby
Does a py script written to open and read binary files on Windows affect files on a Linux or Mac machine in a negative way? My concern is portability and safety. I want scripts written within Windows to work equally well on Linux and Mac computers. Is this the safest, most portable way to open

new office formats, REs and Python

2007-01-03 Thread tubby
How are Python users dealing with some of the new OASIS Open Document formats (Open Office) or MS Open XML formats. These formats store data in a file which is actual a zip archive that contains numerous files and folders. For example, a file saved from Open Office 2.0 named 'test.odt' can be u

Re: Progress Box or Bar in Windows

2006-12-31 Thread tubby
cyberco wrote: > Go for wxPython, it'll fulfill all your GUI needs. Handsdown the best > GUI toolkit I ever ran into. Thanks a lot! I had no idea wxPython was so easy to use. I added a progress bar from wx to the app. Less than 20 lines of code and it only took about 5 minutes! -- http://mail.p

Progress Box or Bar in Windows

2006-12-30 Thread tubby
Hi guys, I have a Python script that I've prettied-up for Windows users by adding things like shell.SHBrowseForFolder and win32gui.MessageBox, etc. In short, it looks like this: 1. Pretty window where user can browse for folder. (instead of typing path into cmd prompt) 2. win32gui.MessageBox