Re: integer >= 1 == True and integer.0 == False is bad, bad, bad!!!

2010-07-10 Thread rantingrick
On Jul 11, 1:22 am, Stephen Hansen wrote: > If you are so desperately concerned with space, then simply do: > >     if (choiceIdx1, choiceIdx2) != (None, None): > > Its only eleven characters longer. > > Or, you can do: > >     if None not in (choiceIdx1, choiceIdx2): Only the first example was

Re: integer >= 1 == True and integer.0 == False is bad, bad, bad!!!

2010-07-10 Thread Stephen Hansen
On 7/10/10 11:03 PM, rantingrick wrote: > On Jul 11, 12:51 am, Stephen Hansen wrote: > >> You don't need to build a tuple. Just change the tests, to "if >> choiceIdx1 is not None". Its a little more work, sure. But its not >> enough that its even vaguely worth breaking the otherwise very useful >

Re: integer >= 1 == True and integer.0 == False is bad, bad, bad!!!

2010-07-10 Thread rantingrick
On Jul 11, 12:51 am, Stephen Hansen wrote: > You don't need to build a tuple. Just change the tests, to "if > choiceIdx1 is not None". Its a little more work, sure. But its not > enough that its even vaguely worth breaking the otherwise very useful > behavior of bool(0) == False. Hmm, i beg to

Re: integer >= 1 == True and integer.0 == False is bad, bad, bad!!!

2010-07-10 Thread Stephen Hansen
On 7/10/10 10:38 PM, rantingrick wrote: > Seems kinda dumb to build a tuple just so a conditional wont blow > chunks! This integer bool-ing need to be fixed right away! Yes, let us penalize the thousands of use cases where 0 being false is useful and good, for the benefit of the one use-case (inde

Re: grailbrowser now running under python 2.5 (probably above too)

2010-07-10 Thread rantingrick
On Jul 10, 10:59 pm, Luke Kenneth Casson Leighton wrote: > source at:http://github.com/lkcl/grailbrowser > > $ python grail.py (note the lack of "python1.5" or "python2.4") > > conversion of the 80 or so regex's to re has been carried out. > entirely successfully or not is a matter yet to be deter

integer >= 1 == True and integer.0 == False is bad, bad, bad!!!

2010-07-10 Thread rantingrick
Let me tell you folks about a recent case of culo rojo i experianced whilst creating a customized bin packer with Python. First i want to say that i actually like the fact that i can do this.. py> a = [] py> if a: ... do something Instead of this py> if len(a) > 0: ... do something Ok b

grailbrowser now running under python 2.5 (probably above too)

2010-07-10 Thread Luke Kenneth Casson Leighton
source at: http://github.com/lkcl/grailbrowser $ python grail.py (note the lack of "python1.5" or "python2.4") conversion of the 80 or so regex's to re has been carried out. entirely successfully or not is a matter yet to be determined. always a hoot to try browsing http://www.bbc.co.uk or http:

Re: Sumatra m/l?

2010-07-10 Thread Dan Goodman
On 10/07/2010 22:08, Neal Becker wrote: Sumatra looks like an interesting project http://pypi.python.org/pypi/Sumatra/0.2 But I have some questions. Is there any mail list or forum? I can't find anything on the website. It's part of Neural Ensemble which has a google group (not specifically

Re: Issues compiling 2.6.5 on AIX 6.1

2010-07-10 Thread Dan Stromberg
On Fri, Jul 9, 2010 at 5:54 AM, Stopp, Bryan wrote: > I checked, none of the files are symlinks. The install process never got > to the point where it created sym-links for libraries (if it even does, > I haven't gotten to that point in the install process.) > > -B > > -Original Message- >

Re: Sumatra m/l?

2010-07-10 Thread Aahz
In article , Antoine Pitrou wrote: >On 10 Jul 2010 13:48:09 -0700 >a...@pythoncraft.com (Aahz) wrote: >> >> Also, it's pretty rude to set followups to gmane.comp.python.general > >Can you expand? If you look at the original post's headers, you'll see Followup-To: gmane.comp.python.general whi

Re: Download Microsoft C/C++ compiler for use with Python 2.6/2.7 ASAP

2010-07-10 Thread sturlamolden
On 9 Jul, 02:02, Neil Hodgson wrote: >    If you break the rules by using malloc rather than IMalloc for memory > that is deallocated by a different component to that which allocated it > or try to pass around FILE* objects then you will see failures. Yes, the CRT issue applies to COM as well. C

Re: any issues with long running python apps?

2010-07-10 Thread sturlamolden
On 10 Jul, 02:23, Tim Chase wrote: > While I'm not sure how much of Roy's comment was "hah, hah, just > serious", this has been my biggest issue with long-running Python > processes on Win32 -- either power outages the UPS can't handle, > or (more frequently) the updates Win32 is also the only O

Re: Plot problem.. ?? No sign at all

2010-07-10 Thread Ritchy lelis
On 7 jul, 08:38, Johan Grönqvist wrote: > 2010-07-06 19:18, Ritchy lelis skrev: > > > On 6 jul, 17:29, Alan G Isaac  wrote: > >> Unfortunately I cannot make sense of the code you posted. > >> Provide a detailed description in words (or psuedocode) > >> of what you are trying to accomplish.  Be ver

Re: MySqlDb any way to see the query string

2010-07-10 Thread News123
Hi everybody, im Roberts wrote: > News123 wrote: >> I'm using MYSQLdb >> >> and have following code >> >> db = MySQLdb.connect(**cfg) >> c = db.cursor() >> qrystr = "insert mytable set id = %s , other_field = %s" >> c.execute(qrystr, (id_val,other_field_val) ) >> >> What I wondered is whether t

Re: MySqlDb any way to see the query string

2010-07-10 Thread Tim Roberts
News123 wrote: > >I'm using MYSQLdb > >and have following code > >db = MySQLdb.connect(**cfg) >c = db.cursor() >qrystr = "insert mytable set id = %s , other_field = %s" >c.execute(qrystr, (id_val,other_field_val) ) > >What I wondered is whether there is any way to print the 'filled in' >query str

Re: 'reload M' doesn't update 'from M inport *'

2010-07-10 Thread Tim Roberts
Frederic Rentsch wrote: > >I develop in an IDLE window. > >Module M says 'from service import *'. >Next I correct a mistake in function 'service.f'. >Now 'service.f' works fine. > >I do 'reload (service); reload (M)'. >The function 'M.f' still misbehaves. > >'print inspect.getsource (service.f)' a

Re: Web page special characters encoding

2010-07-10 Thread mattia
Il Sat, 10 Jul 2010 16:24:23 +, mattia ha scritto: > Hi all, I'm using py3k and the urllib package to download web pages. Can > you suggest me a package that can translate reserved characters in html > like "è", "ò", "é" in the corresponding correct > encoding? > > Thanks, > Mattia Basically

Re: Any reason www.python.org is slow?

2010-07-10 Thread Pierre Rouleau
> > It is possible that the way Linux (or some Linux setups: many of the > recipes above are for Ubuntu, I use Mandriva myself) handles IPv6 > "connectivity" is suboptimal in some cases, and that connection > attempts don't fail immediately when they should. I don't have enough > knowledge to diag

Re: About new urllib.request in python 3.1.2

2010-07-10 Thread Cameron Simpson
On 10Jul2010 09:11, pavan kumar maddali wrote: | Thank You Steve, | I am not using the urllib. Your example did: from urllib.request import urlopen response = urlopen('http://python.org/') html = response.read() | I am using the xmlrpc and http modules from the | python library. [.

Re: Sumatra m/l?

2010-07-10 Thread Antoine Pitrou
On 10 Jul 2010 13:48:09 -0700 a...@pythoncraft.com (Aahz) wrote: > > Also, it's pretty rude to set followups to gmane.comp.python.general Can you expand? -- http://mail.python.org/mailman/listinfo/python-list

Re: Web page special characters encoding

2010-07-10 Thread John Nagle
On 7/10/2010 2:03 PM, mattia wrote: Il Sat, 10 Jul 2010 18:09:12 +0100, MRAB ha scritto: mattia wrote: Hi all, I'm using py3k and the urllib package to download web pages. Can you suggest me a package that can translate reserved characters in html like "è", "ò", "é" in the corresponding correc

Re: Web page special characters encoding

2010-07-10 Thread Christian Heimes
> Hi all, I'm using py3k and the urllib package to download web pages. Can > you suggest me a package that can translate reserved characters in html > like "è", "ò", "é" in the corresponding correct > encoding? I think the html parser of LXML can convert the entities, too. Christian -- http:

Re: Web page special characters encoding

2010-07-10 Thread mattia
Il Sat, 10 Jul 2010 18:09:12 +0100, MRAB ha scritto: > mattia wrote: >> Hi all, I'm using py3k and the urllib package to download web pages. >> Can you suggest me a package that can translate reserved characters in >> html like "è", "ò", "é" in the corresponding >> correct encoding? >> > import r

Re: Sumatra m/l?

2010-07-10 Thread Aahz
In article , Neal Becker wrote: > >Sumatra looks like an interesting project >http://pypi.python.org/pypi/Sumatra/0.2 And how are we supposed to know that it's interesting? You should provide a summary. Also, it's pretty rude to set followups to gmane.comp.python.general -- Aahz (a...@python

Sumatra m/l?

2010-07-10 Thread Neal Becker
Sumatra looks like an interesting project http://pypi.python.org/pypi/Sumatra/0.2 But I have some questions. Is there any mail list or forum? I can't find anything on the website. -- http://mail.python.org/mailman/listinfo/python-list

Re: MySqlDb any way to see the query string

2010-07-10 Thread MRAB
Dennis Lee Bieber wrote: On Sat, 10 Jul 2010 20:22:21 +0200, News123 declaimed the following in gmane.comp.python.general: Hi, I'm using MYSQLdb What I wondered is whether there is any way to print the 'filled in' query string for debuggin. Just edit the MySQLdb cursors m

Re: Download Microsoft C/C++ compiler for use with Python 2.6/2.7 ASAP

2010-07-10 Thread Tim Roberts
Dave Angel wrote: >Tim Roberts wrote: >> >> No. The multi-thread-aware CRT in Visual C++ (which is the only option >> since VS2008) puts errno in thread-local storage, so it's shared by all >> CRTs. >> >I didn't know specifically that errno is in TLS, but I will disagree >with the conclusion

Re: simples setup for an wsgi https server in python

2010-07-10 Thread Jean-Paul Calderone
On Jul 10, 2:42 pm, Gelonida wrote: > Hi, > > I'd like to debug a small wsgi module. > > I run it either on an apache web server > > or locally via wsgiref.simple_server.make_server > and following code snippet: > > from wsgiref.simple_server import make_server > httpd = make_server('localhost',80

Re: any issues with long running python apps?

2010-07-10 Thread Alf P. Steinbach /Usenet
* John Nagle, on 10.07.2010 20:54: On 7/9/2010 12:13 PM, Les Schaffer wrote: i have been asked to guarantee that a proposed Python application will run continuously under MS Windows for two months time. And i am looking to know what i don't know. The app would read instrument data from a serial

Re: any issues with long running python apps?

2010-07-10 Thread John Nagle
On 7/9/2010 12:13 PM, Les Schaffer wrote: i have been asked to guarantee that a proposed Python application will run continuously under MS Windows for two months time. And i am looking to know what i don't know. The app would read instrument data from a serial port, If the device you're lis

simples setup for an wsgi https server in python

2010-07-10 Thread Gelonida
Hi, I'd like to debug a small wsgi module. I run it either on an apache web server or locally via wsgiref.simple_server.make_server and following code snippet: from wsgiref.simple_server import make_server httpd = make_server('localhost',8012,application) while True: httpd.handle_request()

Re: Only one forum app in Python?

2010-07-10 Thread Bruno Desthuilliers
Gilles Ganault a écrit : > Hello > > I'd like to write a small web app in Python which must include a > forum. > > So I checked the relevant article in Wikipedia, which says that only > one forum app is available for Python: > > http://en.wikipedia.org/wiki/Comparison_of_internet_forum_software_

MySqlDb any way to see the query string

2010-07-10 Thread News123
Hi, I'm using MYSQLdb and have following code db = MySQLdb.connect(**cfg) c = db.cursor() qrystr = "insert mytable set id = %s , other_field = %s" c.execute(qrystr, (id_val,other_field_val) ) What I wondered is whether there is any way to print the 'filled in' query string for debuggin. Th

Re: any issues with long running python apps?

2010-07-10 Thread Bruno Desthuilliers
Les Schaffer a écrit : > i have been asked to guarantee that a proposed Python application will > run continuously under MS Windows for two months time. And i am looking > to know what i don't know. (snip) > but none of this has anything to do with Python itself. i am sure python > servers have b

Not-quite-the-module-name qualified names in extension modules? What?

2010-07-10 Thread Alf P. Steinbach /Usenet
Hi. I built the [xxmodule.c] from the source distribution, as suggested by the Python 3.1.1 docs. I named this [xx.pyd], as I believed the module name was just "xx". Indeed importing xx works fine, but when I do help(xx) I get ... >>> help( xx ) Help on module xx: NAME

Re: Web page special characters encoding

2010-07-10 Thread MRAB
mattia wrote: Hi all, I'm using py3k and the urllib package to download web pages. Can you suggest me a package that can translate reserved characters in html like "è", "ò", "é" in the corresponding correct encoding? import re from html.entities import entitydefs # The downloaded web page w

Re: Web page special characters encoding

2010-07-10 Thread Rami Chowdhury
On Jul 10, 2010, at 09:24 , mattia wrote: > Hi all, I'm using py3k and the urllib package to download web pages. Can > you suggest me a package that can translate reserved characters in html > like "è", "ò", "é" in the corresponding correct > encoding? It won't do the whole job for you but you

Indian photographer denies affair with Lindsay Lohan!

2010-07-10 Thread asim malik
Speaking on the issue for the first time, Chaudhuri, over the phone from New York, says, "They were completely distorted reports. We are really good friends for more details www.bollywood789.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Web page special characters encoding

2010-07-10 Thread mattia
Hi all, I'm using py3k and the urllib package to download web pages. Can you suggest me a package that can translate reserved characters in html like "è", "ò", "é" in the corresponding correct encoding? Thanks, Mattia -- http://mail.python.org/mailman/listinfo/python-list

Re: About new urllib.request in python 3.1.2

2010-07-10 Thread pavan kumar maddali
Thank You Steve, I am not using the urllib. I am using the xmlrpc and http modules from the python library. Please see the header code for the modules I am including.. from xmlrpc import client import pprint class ClientCertTransport(client.Transport):  def make_connection(self,host):   import

Re: About new urllib.request in python 3.1.2

2010-07-10 Thread Steven D'Aprano
On Sat, 10 Jul 2010 07:06:47 -0700, pcchen wrote: > And for the following three simple lines of code, borrowed from official > python-doc 3.1.2: > from urllib.request import urlopen response = urlopen('http://python.org/') html = response.read() > > They could cause this error: > > Fi

Re: Hello

2010-07-10 Thread Eli Bendersky
On Fri, Jul 9, 2010 at 19:31, Dani Valverde wrote: > Hello! > I am new to python and pretty new to programming (I have some expertise wit > R statistical programming language). I am just starting, so my questions may > be a little bit stupid. Can anyone suggest a good editor for python? > Cheers!

Re: Any reason www.python.org is slow?

2010-07-10 Thread Antoine Pitrou
On Sat, 10 Jul 2010 16:28:19 +0200 "Martin v. Loewis" wrote: > >> If your computer does have IPv6 connectivity, but it's broken > >> (i.e. you have a gateway, but eventually packets are discarded), > >> you see the IPv4 fallback after the IPv6 timeout. The IPv4 connection in > >> itself then would

Re: Any reason www.python.org is slow?

2010-07-10 Thread Martin v. Loewis
>> If your computer does have IPv6 connectivity, but it's broken >> (i.e. you have a gateway, but eventually packets are discarded), >> you see the IPv4 fallback after the IPv6 timeout. The IPv4 connection in >> itself then would be fast. > > I think it's what most users experience when they are t

Re: Any reason www.python.org is slow?

2010-07-10 Thread Antoine Pitrou
On Sat, 10 Jul 2010 16:03:24 +0200 "Martin v. Loewis" wrote: > > That is a common myth. If your computer doesn't have any IPv6 > connectivity, all is fine. The web browser will fallback to IPv4 > immediately (*), without sending out any IPv6 datagrams first. Ok, I suppose the explanation wasn't

About new urllib.request in python 3.1.2

2010-07-10 Thread pcchen
Sorry I have searched related topic but none could point out this problem. I am currently using python 3.1.2: >>>Python 3.1.2 (r312:79147, Jun 30 2010, 11:58:11) >>>[GCC 4.2.1 20070719 [FreeBSD]] on freebsd8 And for the following three simple lines of code, borrowed from official python-doc 3.1

Re: Any reason www.python.org is slow?

2010-07-10 Thread Martin v. Loewis
> I did disable IPv6 on my computer at home and it did speed it up. I'll > check the other computers where I experienced the same slowness. Of course, it would be interesting to find out what precisely went wrong. If you are curious to find out, let me know, and I'll help investigating. Regards,

Re: Any reason www.python.org is slow?

2010-07-10 Thread Martin v. Loewis
> For the last year?? > It's been mostly zippy here. > Is IPv6 enabled on your computer? If so, I'd try to disable it. > python.org domains resolve to both IPv4 and IPv6 addresses and, if your > computer has IPv6 enabled but you don't have any IPv6 connectivity, > this can result in slowdowns. Tha

Re: Any reason www.python.org is slow?

2010-07-10 Thread Pierre Rouleau
On Jul 10, 9:48 am, Antoine Pitrou wrote: > On Sat, 10 Jul 2010 06:30:11 -0700 (PDT) > > > I have been finding python.org site very slow for the last year and > > probably before. Is there any known reason why the site is slow? > > For the last year?? > It's been mostly zippy here. > Is IPv6 enab

Re: Any reason www.python.org is slow?

2010-07-10 Thread Antoine Pitrou
On Sat, 10 Jul 2010 06:30:11 -0700 (PDT) Pierre Rouleau wrote: > All, > > I have been finding python.org site very slow for the last year and > probably before. Is there any known reason why the site is slow? For the last year?? It's been mostly zippy here. Is IPv6 enabled on your computer? If s

Any reason www.python.org is slow?

2010-07-10 Thread Pierre Rouleau
All, I have been finding python.org site very slow for the last year and probably before. Is there any known reason why the site is slow? I tried accessing it from several locations and I always get to wait several seconds for a page to load (in any browser/OS). Thanks -- Pierre -- http://mail

Re: Hello

2010-07-10 Thread geremy condra
On Sat, Jul 10, 2010 at 7:05 AM, Dani Valverde wrote: > geremy condra wrote: >> >> On Sat, Jul 10, 2010 at 6:49 AM, Dani Valverde >> wrote: >> >>> >>> geremy condra wrote: >>> On Fri, Jul 9, 2010 at 1:08 PM, Dani Valverde wrote: > > Sorry, I forgot to mention tha

Re: Hello

2010-07-10 Thread flebber
On Jul 10, 8:49 pm, Dani Valverde wrote: > geremy condra wrote: > > On Fri, Jul 9, 2010 at 1:08 PM, Dani Valverde > > wrote: > > >> Sorry, I forgot to mention that I am using Linux. In fact, my first test > >> have been with gedit. Is there any way to directly run the Python code into > >> the c

Re: Hello [How to run your code]

2010-07-10 Thread donn
On 10/07/2010 13:05, Dani Valverde wrote: It could be a solution. But I am used to work with gEdit using the R statistical programming language plugin, and I am able to send the code to console instead of typing it in. To run your code, save it to a file 'mycode.py' (or whatever), then open a co

Re: Hello

2010-07-10 Thread Dani Valverde
geremy condra wrote: On Sat, Jul 10, 2010 at 6:49 AM, Dani Valverde wrote: geremy condra wrote: On Fri, Jul 9, 2010 at 1:08 PM, Dani Valverde wrote: Sorry, I forgot to mention that I am using Linux. In fact, my first test have been with gedit. Is there any way to directly run

Re: Hello

2010-07-10 Thread geremy condra
On Sat, Jul 10, 2010 at 6:49 AM, Dani Valverde wrote: > geremy condra wrote: >> >> On Fri, Jul 9, 2010 at 1:08 PM, Dani Valverde >> wrote: >> >>> >>> Sorry, I forgot to mention that I am using Linux. In fact, my first test >>> have been with gedit. Is there any way to directly run the Python code

Re: Hello

2010-07-10 Thread Dani Valverde
geremy condra wrote: On Fri, Jul 9, 2010 at 1:08 PM, Dani Valverde wrote: Sorry, I forgot to mention that I am using Linux. In fact, my first test have been with gedit. Is there any way to directly run the Python code into the console? Gedit has a plugin that brings up a python intepr

Re: load and plot from multiple file

2010-07-10 Thread rudra
On Jul 10, 1:13 pm, Tim Harig wrote: > It would really help to see a representative sample of the data that you > are working with and what you want the plot to look like. The data looks something like that: 0.70711 -2.57266 1.0 0.16694 1.22474 -0.15287 1.41421 0.28025 1.58114 -0.03806 1.7320

Re: Hello

2010-07-10 Thread christian schulze
On 9 Jul., 18:31, Dani Valverde wrote: > Hello! > I am new to python and pretty new to programming (I have some expertise > wit R statistical programming language). I am just starting, so my > questions may be a little bit stupid. Can anyone suggest a good editor > for python? > Cheers! > > Dani >

Re: Hello

2010-07-10 Thread Andreas Waldenburger
On Fri, 9 Jul 2010 16:49:20 + (UTC) Grant Edwards wrote: > On 2010-07-09, Dani Valverde wrote: > > > I am new to python and pretty new to programming (I have some > > expertise wit R statistical programming language). I am just > > starting, so my questions may be a little bit stupid. Can a

Re: zipimport (.pyd & .so) files.

2010-07-10 Thread King
I think I am trying to open a can of worms. It's better to leave the idea for now. Prashant -- http://mail.python.org/mailman/listinfo/python-list

Re: load and plot from multiple file

2010-07-10 Thread Tim Harig
On 2010-07-10, rudra wrote: > Dear friends, > I have several 2 column file which i need to plot in one figure. > I generally do it using gnuplot, but when there is several files, its > hard to do manually. > can you tell me how i can load a file in python and plot several file > in one figure(as

load and plot from multiple file

2010-07-10 Thread rudra
Dear friends, I have several 2 column file which i need to plot in one figure. I generally do it using gnuplot, but when there is several files, its hard to do manually. can you tell me how i can load a file in python and plot several file in one figure(as it is done via replot in gnuplot)? I am