Re: Reading Adobe PDF File

2012-01-30 Thread Matej Cepl
On 29.1.2012 06:52, Shrewd Investor wrote: Or do I need to find a way to convert a PDF file into a text file? If so how? http://en.wikipedia.org/wiki/Pdftotext ? -- http://mail.python.org/mailman/listinfo/python-list

Re: PyPI - how do you pronounce it?

2012-01-30 Thread Neil Cerutti
On 2012-01-28, Chris Angelico wrote: > On Sat, Jan 28, 2012 at 8:57 PM, Steven D'Aprano > wrote: >> Obviously that's pronounced Fin-tim-lin-bin-whin-bim-lim-bus-stop-F'tang- >> F'tang-Ol?-Biscuitbarrel. > > Ah, it's of British origin then. The British pronunciation of Beauchamp created a minor in

add two strings

2012-01-30 Thread contro opinion
>>> s1='\x45' >>> s2='\xe4' >>> s1+s2 'E\xe4' >>> print s1+s2 E why s1+s2 not = '\x45\xe4'?? -- http://mail.python.org/mailman/listinfo/python-list

Re: Reading Adobe PDF File

2012-01-30 Thread Adam Tauno Williams
On Sat, 2012-01-28 at 21:59 -0800, Chris Rebert wrote: > On Sat, Jan 28, 2012 at 9:52 PM, Shrewd Investor wrote: > > I have a very large Adobe PDF file. I was hoping to use a script to > > extract the information for it. Is there a way to loop through a PDF > > file using Python? > Haven't used

Re: add two strings

2012-01-30 Thread Dave Angel
On 01/30/2012 08:02 AM, contro opinion wrote: s1='\x45' s2='\xe4' s1+s2 'E\xe4' print s1+s2 E why s1+s2 not = '\x45\xe4'?? It is. "E" is "\x45". That's plain ASCII and documented everywhere. -- DaveA -- http://mail.python.org/mailman/listinfo/python-list

Re: PyPI - how do you pronounce it?

2012-01-30 Thread Chris Angelico
On Mon, Jan 30, 2012 at 11:12 PM, Neil Cerutti wrote: > > The British pronunciation of Beauchamp created a minor incident > at Yeoman of the Guard auditions this weekend. What about Sir Richard "Chumley", the "Left Tenant" of the Tower? Although this is now quite off-topic for this list... Chri

Re: PyPI - how do you pronounce it?

2012-01-30 Thread Neil Cerutti
On 2012-01-30, Chris Angelico wrote: > On Mon, Jan 30, 2012 at 11:12 PM, Neil Cerutti wrote: >> >> The British pronunciation of Beauchamp created a minor incident >> at Yeoman of the Guard auditions this weekend. > > What about Sir Richard "Chumley", the "Left Tenant" of the > Tower? > > Although

IDLE not setting current directory in its path

2012-01-30 Thread gujax
Hi, When I open python shell and change to any directory, the sys.path always shows ' '. This means it has temporarily added the current directory to its path i.e., sys.path shows [' ', other paths] I can then load any module from the current directory even though the current directory is not

PMW+BLT on windows, any chance?

2012-01-30 Thread Giacomo Boffi
on my linux box i have a small python program that draws some 2-d line graphs in a window aside a graphical interface to change the problem data as you may have guessed from the subject line, the gui widgets are done with help from PMW [1], and the graps are done by the PMW <-> BLT[2] interface n

except clause syntax question

2012-01-30 Thread Charles Yeomans
To catch more than one exception type in an except block, one writes except (A, B, C) as e: I'm wondering why it was decided to match tuples, but not lists: except [A, B, C] as e: The latter makes more sense semantically to me -- "catch all exception types in a list" as opposed to "catch this

Re: except clause syntax question

2012-01-30 Thread Aaron
On 01/30/2012 06:41 PM, Charles Yeomans wrote: To catch more than one exception type in an except block, one writes except (A, B, C) as e: I'm wondering why it was decided to match tuples, but not lists: except [A, B, C] as e: The latter makes more sense semantically to me -- "catch all excep

Re: except clause syntax question

2012-01-30 Thread Charles Yeomans
On Jan 30, 2012, at 12:56 PM, Aaron wrote: > On 01/30/2012 06:41 PM, Charles Yeomans wrote: >> To catch more than one exception type in an except block, one writes >> >> except (A, B, C) as e: >> >> I'm wondering why it was decided to match tuples, but not lists: >> >> except [A, B, C] as e: >

Re: except clause syntax question

2012-01-30 Thread Mel Wilson
Charles Yeomans wrote: > To catch more than one exception type in an except block, one writes > > except (A, B, C) as e: > > I'm wondering why it was decided to match tuples, but not lists: > > except [A, B, C] as e: > > The latter makes more sense semantically to me -- "catch all exception >

Condition.wait() behavior with timeout

2012-01-30 Thread Ross Boylan
The Python 2.7 documents for the threading module says, in part, wait([timeout])¶ Wait until notified or until a timeout occurs. If the calling thread has not acquired the lock when this method is called, a RuntimeError is raised. This method releas

Re: IDLE not setting current directory in its path

2012-01-30 Thread Terry Reedy
On 1/30/2012 10:06 AM, gujax wrote: Hi, When I open python shell and change to any directory, the sys.path always shows ' '. It actually shows '' (without a space). When I do the same with IDLE, it shows the name of the current directory i.e., ['name1', other paths...] instead of showing ['

Disable use of pyc file with no matching py file

2012-01-30 Thread Roy Smith
Every so often (typically when refactoring), I'll remove a .py file and forget to remove the corresponding .pyc file. If I then import the module, python finds the orphaned .pyc and happily imports it. Usually leading to confusing and hard to debug failures. Is there some way to globally tell

Re: PyPI - how do you pronounce it?

2012-01-30 Thread André Malo
* Chris Angelico wrote: > Hopefully this will be a step up from Rick's threads in usefulness, > but I'm aware it's not of particularly great value! > > How do you pronounce PyPI? Is it: > * Pie-Pie? > * Pie-Pip, but without the last p? (same as above but short i) > * Pie-Pea-Eye? > * Something el

Re: Disable use of pyc file with no matching py file

2012-01-30 Thread Miki Tebeka
Not that I'm aware of. I have a script that run the test suite, one of the first commands (before calling nosetests) is: find . -name '*.py[co]' -exec rm {} \; This makes sure the tests run in a "clean" environment. -- http://mail.python.org/mailman/listinfo/python-list

Re: Disable use of pyc file with no matching py file

2012-01-30 Thread Terry Reedy
On 1/30/2012 4:30 PM, Roy Smith wrote: Every so often (typically when refactoring), I'll remove a .py file and forget to remove the corresponding .pyc file. If I then import the module, python finds the orphaned .pyc and happily imports it. Usually leading to confusing and hard to debug failures

Re: speaking at PyCon

2012-01-30 Thread Roy Smith
Wow. As somebody who has given plenty of talks, I can tell you this is an awesome checklist (and most of it not specific to PyCon). Let me add one suggestion -- never, ever, ever, type a URL into a browser connected to the internet in front of a live audience. You never know when you're going

Re: speaking at PyCon

2012-01-30 Thread Devin Jeanpierre
On Mon, Jan 30, 2012 at 6:48 PM, Roy Smith wrote: > Wow.  As somebody who has given plenty of talks, I can tell you this is an > awesome checklist (and most of it not specific to PyCon). > > Let me add one suggestion -- never, ever, ever, type a URL into a browser > connected to the internet in

Re: except clause syntax question

2012-01-30 Thread Steven D'Aprano
On Mon, 30 Jan 2012 12:41:00 -0500, Charles Yeomans wrote: > To catch more than one exception type in an except block, one writes > > except (A, B, C) as e: > > I'm wondering why it was decided to match tuples, but not lists: > > except [A, B, C] as e: Simplicity. If you also allow lists, the

Re: except clause syntax question

2012-01-30 Thread Devin Jeanpierre
On Mon, Jan 30, 2012 at 7:00 PM, Steven D'Aprano wrote: > On Mon, 30 Jan 2012 12:41:00 -0500, Charles Yeomans wrote: > >> To catch more than one exception type in an except block, one writes >> >> except (A, B, C) as e: >> >> I'm wondering why it was decided to match tuples, but not lists: >> >> e

Re: speaking at PyCon

2012-01-30 Thread python
Roy, > Let me add one suggestion -- never, ever, ever, type a URL into a browser > connected to the internet in front of a live audience. You never know when > you're going to make a typo and something *totally* not what you expected > will fill the screen. Great advice! Years ago I did a p

Re: IDLE not setting current directory in its path

2012-01-30 Thread Terry Reedy
On 1/30/2012 3:15 PM, Terry Reedy wrote: This issue is under consideration at http://bugs.python.org/issue13506 It should be fixed before the next Python releases. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: add two strings

2012-01-30 Thread David Lambert
On 01/30/2012 07:02 AM, contro opinion wrote: >>> s1='\x45' >>> s2='\xe4' >>> s1+s2 'E\xe4' >>> print s1+s2 E why s1+s2 not = '\x45\xe4'?? It is, but '\x45' is ASCII 'E', and '\xe4' is not a printable character: >>> print '\x45' E >>> print '\xe4' >>> Try printing s1 and s2 separately i

Killing threads, and os.system()

2012-01-30 Thread Laurent Claessens
Hello all I've a program that launches a lot of threads and each of them launches a os.system("my_command"). My program also keeps a list of the launched threads, so I can make "for" loops on the threads. My aim is to kill everything with ctrl-C (KeyboardInterrupt). Of course I tr