Re: Running Python web apps on shared ASO servers?

2012-08-11 Thread Dieter Maurer
Gilles writes: > ... > Support replied this in an old thread: "Just a CGI option. We don't > have enough users to justify adding mod_python support." > http://forums.asmallorange.com/topic/4672-python-support/page__hl__python > http://forums.asmallorange.com/topic/4918-python-fcgi-verses-mod-pyth

Re: in-place exponentiation incongruities

2012-08-11 Thread Steven D'Aprano
On Sat, 11 Aug 2012 09:54:56 -0700, Giacomo Alzetta wrote: > I've noticed some incongruities regarding in-place exponentiation. > > On the C side nb_inplace_power is a ternary function, like nb_power (see > here: > http://docs.python.org/c-api/typeobj.html? highlight=numbermethods#PyNumberMethods

Re: Idle no longer works

2012-08-11 Thread Terry Reedy
On 8/11/2012 7:09 PM, Opap-OJ wrote: I can no longer open the Idle IDE for Python on Windows 7. For 3-5 years I used Idle for all my python work. But in January this happens: When I right click on a python file and choose "open with Idle" nothing happens. If I double-click on the file itself,

Re: Arithmetic with Boolean values

2012-08-11 Thread Paul Rubin
John Ladasky writes: > I have gotten used to switching back and forth between Boolean algebra > and numerical values. Python generally makes this quite easy. Generally ugly though, at least to my tastes. "Explicit is better than implicit" as the saying goes. > If the length of the list L is o

suggesting a launcher wrapper script for portable python

2012-08-11 Thread Gelonida N
I just started looking at portable Python and was rather surprised, that I didn't find any recommended method in the documentation of how to launch scripts with portable python. Creating py2exe scripts on ones own USB drive seems to be kind of overkill. So here my own thoughts / suggestsions. I'

Re: Arithmetic with Boolean values

2012-08-11 Thread MRAB
On 11/08/2012 23:30, John Ladasky wrote: I have gotten used to switching back and forth between Boolean algebra and numerical values. Python generally makes this quite easy. I just found a case that surprises me. Here is what I want to accomplish: I want to process a list. If the length of

Re: Idle no longer works

2012-08-11 Thread Benjamin Kaplan
On Sat, Aug 11, 2012 at 4:09 PM, Opap-OJ wrote: > I can no longer open the Idle IDE for Python on Windows 7. > > For 3-5 years I used Idle for all my python work. But in January this > happens: > > When I right click on a python file and choose "open with Idle" nothing > happens. > > If I doubl

Re: Arithmetic with Boolean values

2012-08-11 Thread Chris Angelico
On Sun, Aug 12, 2012 at 10:25 AM, Terry Reedy wrote: > On 8/11/2012 7:13 PM, Chris Angelico wrote: >> This appears to be a limitation of the parser; it's trying to >> interpret "not" as a binary operator. > > I think not. It is lower precedence than all arithmetic operators. > (We humans see that

Re: Arithmetic with Boolean values

2012-08-11 Thread Terry Reedy
On 8/11/2012 7:13 PM, Chris Angelico wrote: On Sun, Aug 12, 2012 at 8:30 AM, John Ladasky wrote: In [7]: 1 + not(len(L) % 2) File "", line 1 1 + not(len(L) % 2) ^ SyntaxError: invalid syntax This appears to be

Running Python web apps on shared ASO servers?

2012-08-11 Thread Gilles
Hello I use A Small Orange (ASO) as my web provider. Asking the question in their forum so far didn't work, so I figured I might have a faster answer by asking here. Support replied this in an old thread: "Just a CGI option. We don't have enough users to justify adding mod_python support." http:/

Re: Arithmetic with Boolean values

2012-08-11 Thread Chris Rebert
On Sat, Aug 11, 2012 at 3:30 PM, John Ladasky wrote: > for x in range(1 + not(len(L) % 2)): > # Do stuff > > This provoked a SyntaxError. I investigated this further with my interpreter > (ipython). > In [5]: not(1) > Out[5]: False > > In [6]: not(len(L) % 2) > Out[6]: False > > In [7]: 1

Re: Arithmetic with Boolean values

2012-08-11 Thread Chris Angelico
On Sun, Aug 12, 2012 at 8:30 AM, John Ladasky wrote: > In [7]: 1 + not(len(L) % 2) > >File "", line 1 > 1 + not(len(L) % 2) >^ > SyntaxError: invalid syntax This appears to be a limitation of the parser; it's trying

Idle no longer works

2012-08-11 Thread Opap-OJ
I can no longer open the Idle IDE for Python on Windows 7. For 3-5 years I used Idle for all my python work. But in January this happens: When I right click on a python file and choose "open with Idle" nothing happens. If I double-click on the file itself, it briefly opens an MS-DOS looking wi

Does anyone have an activate script for portable python?

2012-08-11 Thread Gelonida N
Hi, In Pythons installed with virtualenv there is on windows an activate.bat script, that can be used to setup the cmd-shell such, that the search path for python and pythor elated tools (pip / easy_install) is setup properly. Further there is the deactivate script to set the environment ba

Arithmetic with Boolean values

2012-08-11 Thread John Ladasky
I have gotten used to switching back and forth between Boolean algebra and numerical values. Python generally makes this quite easy. I just found a case that surprises me. Here is what I want to accomplish: I want to process a list. If the length of the list L is odd, I want to process it o

in-place exponentiation incongruities

2012-08-11 Thread Giacomo Alzetta
I've noticed some incongruities regarding in-place exponentiation. On the C side nb_inplace_power is a ternary function, like nb_power (see here: http://docs.python.org/c-api/typeobj.html?highlight=numbermethods#PyNumberMethods). Obviously you can't pass the third argument using the usual in-pla

Re: Xlib: watching key presses without trapping them

2012-08-11 Thread Steven D'Aprano
On Sat, 11 Aug 2012 10:53:37 +0100, Raffaele Ricciardi wrote: > Hello there, > > I'm writing a X Windows program to perform some actions when modifier > keys have > been released. After looking into the Pykeylogger project > (pykeylogger.sourceforge.net), I've gone as far as detecting all events

Re: save dictionary to a file without brackets.

2012-08-11 Thread Steven D'Aprano
On Fri, 10 Aug 2012 08:53:43 +1000, Chris Angelico wrote: > On Fri, Aug 10, 2012 at 8:26 AM, Dave Angel wrote: >> On 08/09/2012 06:03 PM, Andrew Cooper wrote: >>> O(n) for all other entries in the dict which suffer a hash collision >>> with the searched entry. >>> >>> True, a sensible choice of h

Re: [Newbie] How to wait for asyncronous input

2012-08-11 Thread Steven D'Aprano
On Sat, 11 Aug 2012 11:24:48 +0200, Hans Mulder wrote: > On 11/08/12 09:07:51, pozz wrote: >> When the main thread wants to close the serial port, the receiving >> thread can be killed > > > How would you do that? > > IFAIK, there is no way in Python to kill a thread. Correct. > The usual wo

Xlib: watching key presses without trapping them

2012-08-11 Thread Raffaele Ricciardi
Hello there, I'm writing a X Windows program to perform some actions when modifier keys have been released. After looking into the Pykeylogger project (pykeylogger.sourceforge.net), I've gone as far as detecting all events related to modifiers, but then such events get trapped by the program

~~** Unique Floral, Neckline, 4x4 Ornament Embroidery Designs F.R.E.E.!! **~~

2012-08-11 Thread Mohamed Gad
Unique Floral Design .. F.R.E.E http://www.embroworld.com/embroidery/4x4-floral-design-132/ Unique Neckline Embroidery Design .. F.R.E.E http://www.theembroidery.com/unique-neckline-embroidery-design-136/ 4x4 Ornament Embroidery Design .. F.R.E.E http://www.embrohome.com/details.php?image_id=7

Re: [Newbie] How to wait for asyncronous input

2012-08-11 Thread Hans Mulder
On 11/08/12 09:07:51, pozz wrote: > Il 11/08/2012 01:12, Dennis Lee Bieber ha scritto: >> What you apparently missed is that serial.read() BLOCKs until data >> is available (unless the port was opened with a read timeout set). >> [...] >> >> serial.read() may, there for, be using select() b

Re: [c-api]Transmutation of an extension object into a read-only buffer adding an integer in-place.

2012-08-11 Thread Stefan Behnel
Giacomo Alzetta, 11.08.2012 10:55: > Il giorno sabato 11 agosto 2012 08:40:18 UTC+2, Stefan Behnel ha scritto: >> Giacomo Alzetta, 11.08.2012 08:21: >> >>> I'd prefer to stick to Python and C, without having to put cython >>> sources or cython-generated c modules (which I know are almost >>> comple

Re: [c-api]Transmutation of an extension object into a read-only buffer adding an integer in-place.

2012-08-11 Thread Giacomo Alzetta
Il giorno sabato 11 agosto 2012 08:40:18 UTC+2, Stefan Behnel ha scritto: > Giacomo Alzetta, 11.08.2012 08:21: > > > I'd prefer to stick to Python and C, without having to put cython > > > sources or cython-generated c modules (which I know are almost > > > completely unreadable from a human poi

Re: [Newbie] How to wait for asyncronous input

2012-08-11 Thread pozz
Il 11/08/2012 01:12, Dennis Lee Bieber ha scritto: What you apparently missed is that serial.read() BLOCKs until data is available (unless the port was opened with a read timeout set). [...] serial.read() may, there for, be using select() behind the scenes. Hmm..., so I could o

Re: Unable to execute the script

2012-08-11 Thread Hans Mulder
On 11/08/12 00:48:38, Dennis Lee Bieber wrote: > On Fri, 10 Aug 2012 12:35:06 -0700, Smaran Harihar > declaimed the following in > gmane.comp.python.general: > >> Hi Tim, >> >> this is the output for the ls -lsF filename >> >> 8 -rwxr-xr-x 1 root root 5227 Jul 30 13:54 iplantgeo_cgi.py* >> >