converting PDF files is now an easy task!

2014-11-26 Thread juanitanauman
I saw Pdf to word advertised there recently. You can occasionally notice results really quickly. I was a little awed tomorrow to see this linked to Pdf to word. That had a profound impact and eventually, you need something which is more than simply Pdf to word. We'll get down to the brass tacks. Th

Re: Fwd: Python Signal/Slot + QThred code analysis

2014-11-26 Thread Michael Torrie
On 11/26/2014 08:57 PM, Michael Torrie wrote: > On 11/26/2014 02:55 PM, Juan Christian wrote: >> On Wed Nov 26 2014 at 1:16:11 AM Michael Torrie wrote: >> You're going to have to post a complete, but small, code example, I >> think. Working with fragments of code is very difficult if not >> imposs

Re: Issues installing Python 2.7

2014-11-26 Thread Michael Torrie
To further explain my terse post from before (from my phone), see below. On 11/26/2014 10:09 AM, billyfurl...@gmail.com wrote: > Now the installation worked fine but shouldn't I see that it's using the > correct version??? > > I also did try to run /opt/python2.7/bin/python2.7 and it give me thi

Re: Fwd: Python Signal/Slot + QThred code analysis

2014-11-26 Thread Michael Torrie
On 11/26/2014 02:55 PM, Juan Christian wrote: > On Wed Nov 26 2014 at 1:16:11 AM Michael Torrie wrote: > You're going to have to post a complete, but small, code example, I > think. Working with fragments of code is very difficult if not > impossible to assist with, resulting in obtuse, obvious re

Re: GUI toolkit(s) status

2014-11-26 Thread Michael Torrie
On 11/26/2014 02:40 AM, Dave Cook wrote: > On 2014-11-22, Michael Torrie wrote: > >> I can't speak for wxWidgets, but when I last looked at it years ago it >> fairly reeked of MFC-style GUI programming with event tables instead of >> a nice, flexible signal/callback interface. Has this changed?

Re: Issues installing Python 2.7

2014-11-26 Thread Steven D'Aprano
billyfurl...@gmail.com wrote: > Hi all, > > Not a python user but I'm trying to upgrade python so I can install pip > which is required for one of the apps that I'm installing. > > I've tried to install using the below instructions, but when I type python > I still get the old 2.4.3 version. Oh

Re: Issues installing Python 2.7

2014-11-26 Thread Chris Angelico
On Thu, Nov 27, 2014 at 4:09 AM, wrote: > Hi all, > > Not a python user but I'm trying to upgrade python so I can install pip which > is required for one of the apps that I'm installing. > > I've tried to install using the below instructions, but when I type python I > still get the old 2.4.3 v

Re: Fwd: Python Signal/Slot + QThred code analysis

2014-11-26 Thread Juan Christian
On Wed Nov 26 2014 at 1:16:11 AM Michael Torrie wrote: You're going to have to post a complete, but small, code example, I think. Working with fragments of code is very difficult if not impossible to assist with, resulting in obtuse, obvious replies from folks. As asked, here is all the code: ou

Re: bug or feature in enum34 py2.7 backport?

2014-11-26 Thread Terry Reedy
On 11/26/2014 10:32 AM, random...@fastmail.us wrote: It seems like if it is a bug to reject long where int is accepted, I do not believe that is universally true is 2.7. But even if it is... Short ints were, value-wise, a subset of longs. Thus, for example, binary operations could always co

Building a Debian/Ubuntu package from a virtualenv

2014-11-26 Thread Tim Chase
I've created a small application in a virtualenv and would like to package it up as a .deb file for distribution on various Debian/Ubuntu (and derivatives) systems. Are there any good resources documenting this process? The biggest issue involves using versions of modules installed via pip into m

Re: Quotation Ugliness

2014-11-26 Thread Ben Finney
Tim Daneliuk writes: > The problem I am trying to solve is to determine whether the user > needs to provide a sudo password or not. Again, the ‘sudo’ program itself will figure this out and ask for a password if it needs one. Examining the command line isn't enough. Even if you find a ‘sudo’ co

Re: Quotation Ugliness

2014-11-26 Thread Tim Chase
On 2014-11-26 08:58, Tim Daneliuk wrote: > On 11/26/2014 06:56 AM, Tim Chase wrote: > > On 2014-11-26 00:04, Tim Daneliuk wrote: > >> someprog.py uname && sudo cat /etc/sudoers > >> > >> vs. > >> > >> someprog.py uname && echo "sudo cat /etc/suoders" > >> > >> > >> In the first instance, I need the

[RELEASE] Python 2.7.9 release candidate 1

2014-11-26 Thread Benjamin Peterson
I'm pleased to announce the first release candidate of Python 2.7.9, which will be the next bugfix release in the Python 2.7 series. Despite technically being a maintenance release, Python 2.7.9 will include several majors changes from 2.7.8: - The "ensurepip" module has been backported to Python 2

Issues installing Python 2.7

2014-11-26 Thread billyfurlong
Hi all, Not a python user but I'm trying to upgrade python so I can install pip which is required for one of the apps that I'm installing. I've tried to install using the below instructions, but when I type python I still get the old 2.4.3 version. Oh Red Hat 5.8 is where I'm installing on.

Re: Quotation Ugliness

2014-11-26 Thread Tim Daneliuk
On 11/26/2014 10:45 AM, alister wrote: On Wed, 26 Nov 2014 10:02:57 -0600, Tim Daneliuk wrote: On 11/26/2014 10:00 AM, random...@fastmail.us wrote: On Wed, Nov 26, 2014, at 10:55, Tim Daneliuk wrote: Nope. Password only exist in memory locally. How does it send it to the remote sudo? Ov

Re: bug or feature in enum34 py2.7 backport?

2014-11-26 Thread Ethan Furman
On 11/26/2014 07:32 AM, random...@fastmail.us wrote: > > It seems like if it is a bug to reject long where int is accepted, it > should be likewise considered a bug to reject ASCII-only unicode where > str is accepted. While I agree, I don't know if there are currently any parts of core 2.7 that

Re: Quotation Ugliness

2014-11-26 Thread Tim Daneliuk
On 11/26/2014 10:16 AM, random...@fastmail.us wrote: On Wed, Nov 26, 2014, at 11:02, Tim Daneliuk wrote: On 11/26/2014 10:00 AM, random...@fastmail.us wrote: On Wed, Nov 26, 2014, at 10:55, Tim Daneliuk wrote: Nope. Password only exist in memory locally. How does it send it to the remote su

Re: Quotation Ugliness

2014-11-26 Thread alister
On Wed, 26 Nov 2014 10:02:57 -0600, Tim Daneliuk wrote: > On 11/26/2014 10:00 AM, random...@fastmail.us wrote: >> On Wed, Nov 26, 2014, at 10:55, Tim Daneliuk wrote: >>> Nope. Password only exist in memory locally. >> >> How does it send it to the remote sudo? >> >> > Over paramiko transport (ssh

Re: Challenge: optimizing isqrt

2014-11-26 Thread Serhiy Storchaka
On 26.11.14 02:46, Dave Angel wrote: Unfortunately, for many values, the version of the function with >>1 is slower. It's only when the argument is bigger than 10**40 that it's as much as 1% faster. But it's true that for really large values, it's quicker. Note that this path is used only for

Re: Quotation Ugliness

2014-11-26 Thread random832
On Wed, Nov 26, 2014, at 11:02, Tim Daneliuk wrote: > On 11/26/2014 10:00 AM, random...@fastmail.us wrote: > > On Wed, Nov 26, 2014, at 10:55, Tim Daneliuk wrote: > >> Nope. Password only exist in memory locally. > > > > How does it send it to the remote sudo? > > > > Over paramiko transport (ssh

Re: Quotation Ugliness

2014-11-26 Thread Chris Angelico
On Thu, Nov 27, 2014 at 3:02 AM, Tim Daneliuk wrote: > On 11/26/2014 10:00 AM, random...@fastmail.us wrote: >> >> On Wed, Nov 26, 2014, at 10:55, Tim Daneliuk wrote: >>> >>> Nope. Password only exist in memory locally. >> >> >> How does it send it to the remote sudo? >> > > Over paramiko transpor

Re: Quotation Ugliness

2014-11-26 Thread Tim Daneliuk
On 11/26/2014 10:00 AM, random...@fastmail.us wrote: On Wed, Nov 26, 2014, at 10:55, Tim Daneliuk wrote: Nope. Password only exist in memory locally. How does it send it to the remote sudo? Over paramiko transport (ssh) and then only if it sees a custom string coming back from sudo asking

Re: Quotation Ugliness

2014-11-26 Thread random832
On Wed, Nov 26, 2014, at 10:55, Tim Daneliuk wrote: > Nope. Password only exist in memory locally. How does it send it to the remote sudo? -- https://mail.python.org/mailman/listinfo/python-list

Re: Quotation Ugliness

2014-11-26 Thread Tim Daneliuk
On 11/26/2014 09:48 AM, Chris Angelico wrote: On Thu, Nov 27, 2014 at 2:36 AM, Tim Daneliuk wrote: The more I think about this, the more I think I am just going to look for the string 'sudo' anywhere in the argument. This merely will force the user to enter their sudo password if detected. If

Re: Quotation Ugliness

2014-11-26 Thread random832
On Wed, Nov 26, 2014, at 10:36, Tim Daneliuk wrote: > The more I think about this, the more I think I am just going to look for > the > string 'sudo' anywhere in the argument. This merely will force the user > to > enter their sudo password if detected. If it turns out to be a false > positive, >

Re: Quotation Ugliness

2014-11-26 Thread Chris Angelico
On Thu, Nov 27, 2014 at 2:36 AM, Tim Daneliuk wrote: > The more I think about this, the more I think I am just going to look for > the > string 'sudo' anywhere in the argument. This merely will force the user to > enter their sudo password if detected. If it turns out to be a false > positive, >

Re: bug or feature in enum34 py2.7 backport?

2014-11-26 Thread Chris Angelico
On Thu, Nov 27, 2014 at 2:32 AM, wrote: > But why shouldn't the type constructor do the conversion (and any > validation of being ASCII-only) when parsing the arguments? The root > cause seems to be that it parses its arguments with "SO!O!:type" > (typeobject.c, line 2097). Does anyone know what

Re: Quotation Ugliness

2014-11-26 Thread Tim Daneliuk
On 11/26/2014 09:09 AM, Chris Angelico wrote: On Thu, Nov 27, 2014 at 2:07 AM, Chris Angelico wrote: I was searching the ol' memory banks, trying to figure out if there was some way to tell the internal 'echo' command to use slash instead of dash (maybe for DOS/Windows people??), in which case

Re: bug or feature in enum34 py2.7 backport?

2014-11-26 Thread random832
On Wed, Nov 26, 2014, at 09:40, Chris Angelico wrote: > I'd say that's a limitation, not a bug. A lot of stuff in Python 2 > depends on identifiers being ASCII-only byte strings, including - > apparently - parts of the core code. But why shouldn't the type constructor do the conversion (and any va

Re: bug or feature in enum34 py2.7 backport?

2014-11-26 Thread Chris Angelico
On Thu, Nov 27, 2014 at 2:14 AM, Mark Summerfield wrote: > I only mentioned it since I noticed it. I actually use Python 3 so it isn't a > problem for me, but sometimes I have to teach Python 2.7 and I wanted to > cover enum because it is so much nicer and easier to debug than FOO = 1 etc. > > H

Re: Quotation Ugliness

2014-11-26 Thread random832
On Wed, Nov 26, 2014, at 10:02, Tim Daneliuk wrote: >someprog.py "uname && sudo cat /etc/sudoers" > > vs. > >someprog.py 'uname && echo "sudo cat /etc/suoders"' I think it would be better to provide a general way for the user to provide an input script as an option, rather than to spec

Re: bug or feature in enum34 py2.7 backport?

2014-11-26 Thread Mark Summerfield
I only mentioned it since I noticed it. I actually use Python 3 so it isn't a problem for me, but sometimes I have to teach Python 2.7 and I wanted to cover enum because it is so much nicer and easier to debug than FOO = 1 etc. However, the problem is that enum's function API doesn't play nicely

Re: Quotation Ugliness

2014-11-26 Thread Chris Angelico
On Thu, Nov 27, 2014 at 2:07 AM, Chris Angelico wrote: > I was searching the ol' memory banks, trying to figure out if there > was some way to tell the internal 'echo' command to use slash instead > of dash (maybe for DOS/Windows people??), in which case that would be > parsed as "echo -- hello" a

Re: Quotation Ugliness

2014-11-26 Thread Chris Angelico
On Thu, Nov 27, 2014 at 1:26 AM, Tim Chase wrote: > On 2014-11-26 15:45, Jussi Piitulainen wrote: >> Tim Chase writes: >> > bash$ echo // hello >> > hello >> >> Where did the // go? > > The bad-copy-and-paste gremlins ate them :-o > > Good catch. :) > I was searching the ol' memory banks, try

Re: Quotation Ugliness

2014-11-26 Thread Chris Angelico
On Thu, Nov 27, 2014 at 1:58 AM, Tim Daneliuk wrote: > The specific program in question I am modifying is > one that takes a shell command and executes it remotely on many machines. > The problem I am trying to solve is to determine whether the user needs to > provide a sudo password or not. Righ

Re: Quotation Ugliness

2014-11-26 Thread Tim Chase
On 2014-11-26 15:45, Jussi Piitulainen wrote: > Tim Chase writes: > > bash$ echo // hello > > hello > > Where did the // go? The bad-copy-and-paste gremlins ate them :-o Good catch. :) -tkc -- https://mail.python.org/mailman/listinfo/python-list

Re: Quotation Ugliness

2014-11-26 Thread Tim Daneliuk
On 11/26/2014 08:12 AM, random...@fastmail.us wrote: On Wed, Nov 26, 2014, at 01:04, Tim Daneliuk wrote: In this case, I am not trying to write a fullblown language or recover from syntax errors. Here's a usecase - I want to know whether I need to use a sudo password when the user passes a com

Re: Quotation Ugliness

2014-11-26 Thread Tim Daneliuk
On 11/26/2014 01:10 AM, Chris Angelico wrote: Why not set up sudo to not require a password Because I do not control the machines to which this program is talking and the security policy in question requires passwords. ---

Re: Quotation Ugliness

2014-11-26 Thread Tim Daneliuk
On 11/26/2014 06:56 AM, Tim Chase wrote: On 2014-11-26 00:04, Tim Daneliuk wrote: someprog.py uname && sudo cat /etc/sudoers vs. someprog.py uname && echo "sudo cat /etc/suoders" In the first instance, I need the sudo passoword, in the second I don't. This doesn't jibe with the pairs of qu

Re: bug or feature in enum34 py2.7 backport?

2014-11-26 Thread Chris Angelico
On Thu, Nov 27, 2014 at 1:05 AM, wrote: > On Wed, Nov 26, 2014, at 06:29, Mark Summerfield wrote: >> TypeError: type() argument 1 must be string, not unicode > > If this is a bug, maybe it is one in type() itself - I get the same > error with type('X', (object,), dict(a=1)) I'd say that's a limi

Re: Quotation Ugliness

2014-11-26 Thread Chris Angelico
On Thu, Nov 27, 2014 at 12:45 AM, Jussi Piitulainen wrote: > Tim Chase writes: > >> This doesn't jibe with the pairs of quotes you sent and your request >> for nesting. In most popular shells, the majority of your "quote" >> characters don't actually quote anything: >> >> bash$ echo // hello >>

Re: Quotation Ugliness

2014-11-26 Thread random832
On Wed, Nov 26, 2014, at 01:04, Tim Daneliuk wrote: > In this case, I am not trying to write a fullblown language or recover > from syntax errors. Here's a usecase - I want to know whether I need > to use a sudo password when the user passes a command on the command line > of a program: > > some

Re: bug or feature in enum34 py2.7 backport?

2014-11-26 Thread random832
On Wed, Nov 26, 2014, at 06:29, Mark Summerfield wrote: > TypeError: type() argument 1 must be string, not unicode If this is a bug, maybe it is one in type() itself - I get the same error with type('X', (object,), dict(a=1)) -- https://mail.python.org/mailman/listinfo/python-list

Re: Quotation Ugliness

2014-11-26 Thread Jussi Piitulainen
Tim Chase writes: > This doesn't jibe with the pairs of quotes you sent and your request > for nesting. In most popular shells, the majority of your "quote" > characters don't actually quote anything: > > bash$ echo // hello > hello Where did the // go? [...] > and has problems with things

Re: Quotation Ugliness

2014-11-26 Thread Tim Chase
On 2014-11-26 00:04, Tim Daneliuk wrote: > someprog.py uname && sudo cat /etc/sudoers > > vs. > > someprog.py uname && echo "sudo cat /etc/suoders" > > > In the first instance, I need the sudo passoword, in the second I > don't. This doesn't jibe with the pairs of quotes you sent and your requ

Re: GUI toolkit(s) status

2014-11-26 Thread Mark Summerfield
I've done a fair bit of Python GUI programming, so here's my 2c. Tkinter is small, fast, and v. frustrating to use (but maybe the latter is just me). It looks good on Windows (from 8.5), ugly on Linux, and OK on Mac (but you have to do a fair bit of if MAC do this else do that. The next three w

Re: PyEval_GetLocals and unreferenced variables

2014-11-26 Thread Kasper Peeters
> To be honest, that's just made it even more weird :) You're creating > something in a local namespace that the Python compiler isn't aware > of. Yes, I agree that retrieving the locals with PyEval_GetLocals and then sticking something in there on the C side is weird. I wouldn't say that the Pyth

bug or feature in enum34 py2.7 backport?

2014-11-26 Thread Mark Summerfield
Hi, Here are two programs both executed with Python 2.7 with the enum34 backport and their output. Is this a bug or intended behavior? (It may well be intended to help ensure that the class name is ASCII for Python 2; but maybe it would be nicer to check a unicode to see if it is ASCII and if s

Re: PyEval_GetLocals and unreferenced variables

2014-11-26 Thread Chris Angelico
On Wed, Nov 26, 2014 at 9:46 PM, Kasper Peeters wrote: > I agree that in this example that would be the natural thing to do. > My case is more tricky though: I have something like > > def fun(): >cfun_that_creates_q_in_local_scope() >def fun2(): >cfun_that_wants_to_

Re: PyEval_GetLocals and unreferenced variables

2014-11-26 Thread Kasper Peeters
> > def fun(): > > q=3 > > def fun2(): > > cfun() > > fun2() > > > > fun() > > > > and access 'q' inside the C-function cfun(). If I simply let it call > > PyEval_GetLocals, then the result will again not contain "q". Is > > there any way in which I can convince python to

Re: PyEval_GetLocals and unreferenced variables

2014-11-26 Thread Chris Angelico
On Wed, Nov 26, 2014 at 9:22 PM, Kasper Peeters wrote: > That is, I want > to do: > > def fun(): > q=3 > def fun2(): > cfun() > fun2() > > fun() > > and access 'q' inside the C-function cfun(). If I simply let it call > PyEval_GetLocals, then the result will again not co

PyEval_GetLocals and unreferenced variables

2014-11-26 Thread Kasper Peeters
I have a question about PyEval_GetLocals(). The normal behaviour of PyEval_GetLocals(), and in fact of the locals() function in Python itself, is to return a list which includes only those variables which are actually referenced in the local scope. Example: def fun(): q=3 def fun2():

Re: Challenge: optimizing isqrt

2014-11-26 Thread Steven D'Aprano
Stephen Tucker wrote: > Another _possible_ performance improvement that is staring us in the face > is that 2*b could be replaced with b<<1. Given that b+b (an earlier > suggestion of mine) involves two table look-ups for b, whereas b<<1 only > involves one, it seems that the scope here for improv

Re: GUI toolkit(s) status

2014-11-26 Thread Dave Cook
On 2014-11-22, Michael Torrie wrote: > I can't speak for wxWidgets, but when I last looked at it years ago it > fairly reeked of MFC-style GUI programming with event tables instead of > a nice, flexible signal/callback interface. Has this changed? In Python? I've been using wxpython for 6 or 7

Re: Challenge: optimizing isqrt

2014-11-26 Thread Stephen Tucker
Another _possible_ performance improvement that is staring us in the face is that 2*b could be replaced with b<<1. Given that b+b (an earlier suggestion of mine) involves two table look-ups for b, whereas b<<1 only involves one, it seems that the scope here for improvement is significant. By the w

Re: PyPI auth issues (Server response (401): basic auth failed)

2014-11-26 Thread Ricardo Bánffy
The second transcript was done without a .pypirc. That's why it asked for credentials. Can you post your .pypirc file (without password, of course) for comparison? On Wed, Nov 26, 2014, 05:04 dieter wrote: > Ricardo Bánffy writes: > > I must be doing something wrong, but I (and the clever folk