How to set proxy for a python script to run

2008-04-17 Thread Adam
Hi, I am using a script written in Python. For some reasons I should pass the fireware by proxy setting. But it seems not work when I set the 'http_proxy' 'ftp_proxy' environment variable. I also expored 'HTTP_PROXY' 'FTP_PROXY', but the problem remained. How can I set proxy for it to run the scrip

Re: How to have unittest tests to be executed in the order they appear?

2008-04-17 Thread Ben Finney
Roy Smith <[EMAIL PROTECTED]> writes: > Ben Finney <[EMAIL PROTECTED]> wrote: > > > Surely, since "suddenly" implies you changed one small area of the > > code, that area of the code is the best place to look for what caused > > the failure. > > Sometimes it's the environment that's changed. Yes

pprint module and newer standard types

2008-04-17 Thread Donald 'Paddy' McCarthy
Hi, When I try and use pprint on standard types I get varying 'quality of output'. Lists will wrap nicely to multiple lines as will dicts, but sets and defaultdicts give one long unreadable line. Is their a chance to get this changed so that more built-in types look pretty when printed with pprin

Re: get quote enclosed field in a line

2008-04-17 Thread Skye [EMAIL PROTECTED]
> [EMAIL PROTECTED] wrote: > > is there a simple way in perl, python, or awk/shell/pipe, that gets > > the user agent field in a apache log? > Something like: > # cut -d '"' -f 6 < httpd-access.log > ? > -- > mph Doesn't it feel like autosplit mode never gets any run time? perl -laF'"' -ne'print

How to set proxy for a python script to run

2008-04-17 Thread Adam
Hi, everyone, I am using /usr/share/system-config-language/ language_gui.py in Python. For some reason I have to bypass the firewall using a proxy. I read the urllib reference and set http_proxy="my proxy". But it didn't work. Is there anyway that we can set the proxy? -- http://mail.python.org/ma

Re: py3k s***s

2008-04-17 Thread Sverker Nilsson
On Apr 18, 1:27 am, John Machin <[EMAIL PROTECTED]> wrote: > Diez B. Roggisch wrote: > >> And I have been benefiting from Python in general, so far. Thanks, > >> community. > > >> But now... I'll probably stop posting here for now, & I may stop other > >> things too. > > >> Just my 2c. > > > You kn

Re: py3k s***s

2008-04-17 Thread Sverker Nilsson
On Apr 18, 12:59 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > > And I have been benefiting from Python in general, so far. Thanks, > > community. > > > But now... I'll probably stop posting here for now, & I may stop other > > things too. > > > Just my 2c. > > You know what I was just wonder

Re: Database vs Data Structure?

2008-04-17 Thread I V
On Thu, 17 Apr 2008 19:30:33 -0700, erikcw wrote: > use some sort of data-structure (maybe > nested dictionaries or a custom class) and store the pickled > data-structure in a single row in the database (then unpickle the data > and query in memory). Why would you want to do this? I don't see what

Re: Database vs Data Structure?

2008-04-17 Thread castironpi
On Apr 17, 9:30 pm, erikcw <[EMAIL PROTECTED]> wrote: > Hi, > > I'm working on a web application where each user will be creating > several "projects" in there account, each with 1,000-50,000 objects. > Each object will consist of a unique name, an id, and some meta data. > > The number of objects

Re: How to make this unpickling/sorting demo faster?

2008-04-17 Thread Steve Bergman
On Apr 17, 7:37 pm, Paul Rubin wrote: > Therefore the likelihood of a C or asm program > being 20x faster including disk i/o is dim.  But realistically, > counting just CPU time, you might get a 20x speedup with assembler if > you're really determined, using x86 SSE (128

Re: Unicode chr(150) en dash

2008-04-17 Thread hdante
On Apr 17, 12:10 pm, [EMAIL PROTECTED] wrote: > Thank you Martin and John, for you excellent explanations. > > I think I understand the unicode basic principles, what confuses me is the > usage different applications make out of it. > > For example, I got that EN DASH out of a web page which state

Database vs Data Structure?

2008-04-17 Thread erikcw
Hi, I'm working on a web application where each user will be creating several "projects" in there account, each with 1,000-50,000 objects. Each object will consist of a unique name, an id, and some meta data. The number of objects will grow and shrink as the user works with their project. I'm tr

Re: How to make this unpickling/sorting demo faster?

2008-04-17 Thread hdante
On Apr 17, 7:33 pm, Steve Bergman <[EMAIL PROTECTED]> wrote: > to demonstrate how Python can combine simplicity, readability, *and* > speed when the standard library is leveraged properly. So, in this But that's not true. You're just creating an artificial example to prove your point. Consider

Re: how do I know if I'm using a debug build of python

2008-04-17 Thread bgeddy
Tim Mitchell wrote: > Hi, > > A quick question: > Is there any way for a python script to know if it's being executed by a > debug build of python (python_d.exe) instead of python? > > Thanks > Tim > Not sure what this returns in Windows as I run Linux but this returns to namer of the python e

Re: Python for Series 40 Nokia?

2008-04-17 Thread [EMAIL PROTECTED]
On Apr 18, 8:46 am, "Dotan Cohen" <[EMAIL PROTECTED]> wrote: > I had once heard something about python running on a Series 40 Nokia, > but I am unable to google anything concrete. Might it have been > Jython? Is there a known implementation of Python for the series 40 > (which is not Symbian, by th

Re: get quote enclosed field in a line

2008-04-17 Thread Penny Y.
Hello, I don't know Python's RE very well. But using Perl's RE you can get it. > cat t1.pl $x=qq{189.139.109.235 - - [07/Apr/2008:00:00:16 -0400] "GET /Periodic_dosage_dir/lacru/manara.html HTTP/1.1" 200 1933 xahlee.org "http://xahlee.org/Periodic_dosage_dir/lacru/manara2.html"; "Mozilla/5.0 (Wi

Re: get quote enclosed field in a line

2008-04-17 Thread Paul McGuire
On Apr 17, 6:50 pm, John Machin <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > is there a simple way in perl, python, or awk/shell/pipe, that gets > > the user agent field in a apache log? > > > e.g. the typical line is like this: > > > 189.139.109.235 - - [07/Apr/2008:00:00:16 -0400] "G

Database vs Data Structure?

2008-04-17 Thread erikcw
Hi, I'm working on a web application where each user will be creating several "projects" in there account, each with 1,000-50,000 objects. Each object will consist of a unique name, an id, and some meta data. The number of objects will grow and shrink as the user works with their project. I'm tr

Re: Request a short code review

2008-04-17 Thread Scott David Daniels
[EMAIL PROTECTED] wrote: > Here is a method I came across that I would like to clean up: > > > def output_random_lesson_of_type(self, type=None): > """Output a lesson of a specific type - if no type is passed in > then output any type.""" > if type: > filtered_lessons = filter(lam

Python for Series 40 Nokia?

2008-04-17 Thread Dotan Cohen
I had once heard something about python running on a Series 40 Nokia, but I am unable to google anything concrete. Might it have been Jython? Is there a known implementation of Python for the series 40 (which is not Symbian, by the way)? Will Jython work in such an environment? Thanks in advance.

Re: How to make this unpickling/sorting demo faster?

2008-04-17 Thread Paul Rubin
Steve Bergman <[EMAIL PROTECTED]> writes: > I started at about 7 seconds to just read in and sort, and at 20 > seconds to read, sort, and write. I can now read in, sort, and write > back out in almost exactly 5 seconds, thanks to marshal and your > suggestions. That is not bad if you aren't using

Re: Building an RPM

2008-04-17 Thread Mark Lim
You could use the module compileall to create .pyc and .pyo (http://www.python.org/doc/1.5.1p1/tut/node43.html) and do this in your %build stage. Or if you don't need to ship them, strike them from the package as they will be generated as necessary. On 4/17/08 2:19 PM, "John Sutherland" <[EMAI

Re: get quote enclosed field in a line

2008-04-17 Thread Carsten Haese
John Machin wrote: > [EMAIL PROTECTED] wrote: >> is there a simple way in perl, python, or awk/shell/pipe, that gets >> the user agent field in a apache log? > If you don't like that, just hang about -- there's sure to be a > pyparsing bus coming by real soon now :-) While we're waiting for the

Re: get quote enclosed field in a line

2008-04-17 Thread John Machin
Martin P. Hellwig wrote: > > Something like: > # cut -d '"' -f 6 < httpd-access.log In Python: line.split('"')[5] -- http://mail.python.org/mailman/listinfo/python-list

Re: get quote enclosed field in a line

2008-04-17 Thread John Machin
[EMAIL PROTECTED] wrote: > is there a simple way in perl, python, or awk/shell/pipe, that gets > the user agent field in a apache log? > > e.g. the typical line is like this: > > 189.139.109.235 - - [07/Apr/2008:00:00:16 -0400] "GET / > Periodic_dosage_dir/lacru/manara.html HTTP/1.1" 200 1933 xah

Re: Finally had to plonk google gorups.

2008-04-17 Thread Michael Torrie
Mike Driscoll wrote: > I'm confused. First you say Gmail is create for filtering and then you > say it has a broken interface. I like Gmail for some things, but my > inability to create folders is one thing that really bugs me. I can > set up Thunderbird to accept mail from Gmail and do it that way

Re: [Python-Dev] Global Python Sprint Weekends: May 10th-11th and June 21st-22nd.

2008-04-17 Thread Thomas Lee
Anybody in Melbourne keen for this? Not sure if I'll be able to make it myself, but I'd be interested to know if there's anybody in the area keen to do the sprint. Cheers, T Tarek Ziadé wrote: > On Wed, Apr 16, 2008 at 8:40 PM, Michael Foord > <[EMAIL PROTECTED]> wrote: > >> Trent Nelson wro

Re: py3k s***s

2008-04-17 Thread John Machin
Diez B. Roggisch wrote: >> And I have been benefiting from Python in general, so far. Thanks, >> community. >> >> But now... I'll probably stop posting here for now, & I may stop other >> things too. >> >> Just my 2c. > > You know what I was just wondering about? All these C-written > cross-platf

Re: i want to add a timeout to my code

2008-04-17 Thread Miki
On Apr 17, 1:10 pm, maehhheeyy <[EMAIL PROTECTED]> wrote: > I want to add a timeout so that when I pull out my gps from my serial > port, it would wait for a bit then loop and then see if it's there. I > also want to add a print statement saying that there is no GPS device > found. However when I r

Re: get quote enclosed field in a line

2008-04-17 Thread Martin P. Hellwig
[EMAIL PROTECTED] wrote: > is there a simple way in perl, python, or awk/shell/pipe, that gets > the user agent field in a apache log? > > e.g. the typical line is like this: > > 189.139.109.235 - - [07/Apr/2008:00:00:16 -0400] "GET / > Periodic_dosage_dir/lacru/manara.html HTTP/1.1" 200 1933 xah

Re: Request a short code review

2008-04-17 Thread Ivan Illarionov
On Thu, 17 Apr 2008 15:11:40 -0700, james wrote: >> I am not necessarily looking to make the code shorter or more >> functional or anything in particular. However if you spot something to >> improve then I am happy to learn. > > To give an example of what I mean I have already altered the code:

get quote enclosed field in a line

2008-04-17 Thread [EMAIL PROTECTED]
is there a simple way in perl, python, or awk/shell/pipe, that gets the user agent field in a apache log? e.g. the typical line is like this: 189.139.109.235 - - [07/Apr/2008:00:00:16 -0400] "GET / Periodic_dosage_dir/lacru/manara.html HTTP/1.1" 200 1933 xahlee.org "http://xahlee.org/Periodic_dos

Re: Request a short code review

2008-04-17 Thread John Machin
[EMAIL PROTECTED] wrote: >> I am not necessarily looking to make the code shorter or more >> functional or anything in particular. However if you spot something >> to improve then I am happy to learn. > > To give an example of what I mean I have already altered the code: > > def output_random_le

Re: py3k s***s

2008-04-17 Thread Diez B. Roggisch
> And I have been benefiting from Python in general, so far. Thanks, > community. > > But now... I'll probably stop posting here for now, & I may stop other > things too. > > Just my 2c. You know what I was just wondering about? All these C-written cross-platform libraries (which Python users b

Re: Request a short code review

2008-04-17 Thread André
On Apr 17, 7:11 pm, [EMAIL PROTECTED] wrote: > > I am not necessarily looking to make the code shorter or more > > functional or anything in particular. However if you spot something > > to improve then I am happy to learn. > > To give an example of what I mean I have already altered the code: > >

Re: How to make this unpickling/sorting demo faster?

2008-04-17 Thread Steve Bergman
Thanks for the help. Yes, I see now that gdbm is really superfluous. Not having used pickel before, I started from the example in "Python in a Nutshell" which uses anydbm. Using a regular file saves some time. By far, the biggest improvement has come from using marshall rather than cPickel. Espe

Re: Request a short code review

2008-04-17 Thread james
> I am not necessarily looking to make the code shorter or more > functional or anything in particular. However if you spot something > to improve then I am happy to learn. To give an example of what I mean I have already altered the code: def output_random_lesson_of_type(self, type=None):

pyexpat.so not importing

2008-04-17 Thread Walker Lindley
Hopefully this is a relatively common problem. I'm working on a web service using ZSI running on Apache. The client generates a request just fine, but when the server tries to parse it, it fails while importing pyexpat.so. Specifically what's happening (after I traced the call stack down) is that x

User-defined Exceptions: is self.args OK?

2008-04-17 Thread Petr Jakeš
Hi, I have posted this via google.groups, but I have discovered many of you are filtering such a postings. So this is my second try from the mail client. I am trying to dig through User-defined Exceptions. chapter 8.5 in http://docs.python.org/tut/node10.html I would like to know, if is it OK

Re: MySQL hardcoding?

2008-04-17 Thread John Machin
[EMAIL PROTECTED] wrote: > I've got this error (see the path in last line) > > db=MySQLdb.connect(host='localhost',use_unicode = True, charset = > "Windows-1251",user='root',passwd='12',db='articulos') Can't help with the answer to your question, but this may stave off yet another question:

Request a short code review

2008-04-17 Thread james
Hi all, I am moving my server based scripting over to Python and I am attempting to write more idiomatic python. I have 8 years professional programming experience and I am looking to get to a very high standard of python coding. As such, I was wondering if it was appropriate to post code snippe

Re: Metaprogramming Example

2008-04-17 Thread andrew cooke
bruno: > Ho, and yes : one day, you'll get why it's such a good thing to unite > functions and methods !-) me: > PS Is there anywhere that explains why Decorators (in the context of > functions/methods) are so good? I've read lots of things saying they > are good, but no real justification of why

Building an RPM

2008-04-17 Thread John Sutherland
Hi everyone.. I'm attempting to build an RPM for Python 2.5.2, using the spec file found in the standard tarball (Misc/RPM).. Currently, its failing cause it hasn't 'compiled' the tools .pyc and .pyo's, saying the files aren't found. Anyone have any ideas? (running on CentOS 4.3) --John

Re: How to make this unpickling/sorting demo faster?

2008-04-17 Thread Paul Rubin
Steve Bergman <[EMAIL PROTECTED]> writes: > Anything written in a language that is > 20x slower (Perl, Python, > PHP) than C/C++ should be instantly rejected by users on those grounds > alone. Well, if you time it starting from when you sit down at the computer and start programming, til when the

how do I know if I'm using a debug build of python

2008-04-17 Thread Tim Mitchell
Hi, A quick question: Is there any way for a python script to know if it's being executed by a debug build of python (python_d.exe) instead of python? Thanks Tim -- http://mail.python.org/mailman/listinfo/python-list

Re: Tidy module?

2008-04-17 Thread M.-A. Lemburg
On 2008-04-17 21:00, Mark Reed wrote: > Is there an easy_installable egg with an interface to libtidy? I > found µTidy, but it looks like an inactive project, with no updates > since 2004, so I'm skeptical of its reliability. I found mxTidy, but > it's only available as part of some larger distri

Re: I just killed GIL!!!

2008-04-17 Thread Martin v. Löwis
> An there you have the answer. It's really very simple :-) I'm fairly skeptical that it actually works. If the different Python interpreters all import the same extension module (say, _socket.pyd), windows won't load the DLL twice, but only one time. So you end up with a single copy of _socket, w

Re: index of list of lists

2008-04-17 Thread Ivan Illarionov
On Thu, 17 Apr 2008 05:15:52 +0300, Daniel NL wrote: > yes, there's a thread with the same title, but I believe mine is more > appropriate title. > so, as much as I search on the web, read manuals, tutorials, mail-lists > (including this one) I cannot figure it out how to search a string in a > li

Re: Can't do a multiline assignment!

2008-04-17 Thread Steve Holden
[EMAIL PROTECTED] wrote: > On Apr 17, 11:46 am, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: >> Why not do something like: >> >> class RequestHeadersManager: >> >> def __init__(self, string): >> self._fields = {} >> # Populate self.fields with fields defined in 'string' >> >>

i want to add a timeout to my code

2008-04-17 Thread maehhheeyy
I want to add a timeout so that when I pull out my gps from my serial port, it would wait for a bit then loop and then see if it's there. I also want to add a print statement saying that there is no GPS device found. However when I run my code and unplug my serial port, my code will just hang until

Re: I just killed GIL!!!

2008-04-17 Thread Carl Banks
On Apr 17, 1:03 pm, Jonathan Gardner <[EMAIL PROTECTED]> wrote: > On Apr 17, 1:18 am, Carl Banks <[EMAIL PROTECTED]> wrote: > > > On Apr 17, 3:37 am, Jonathan Gardner <[EMAIL PROTECTED]> > > wrote: > > > If you can't rewrite > > > your algorithm to be disk or network bound, next optimization step i

jazz scale suggester system 3.0 crack

2008-04-17 Thread altami0762
jazz scale suggester system 3.0 crack http://cracks.12w.net F R E E C R A C K S -- http://mail.python.org/mailman/listinfo/python-list

anydvd 3.9.2.1 crack

2008-04-17 Thread altami0762
anydvd 3.9.2.1 crack http://cracks.12w.net F R E E C R A C K S -- http://mail.python.org/mailman/listinfo/python-list

cabage patch kids

2008-04-17 Thread altami0762
cabage patch kids http://cracks.12w.net F R E E C R A C K S -- http://mail.python.org/mailman/listinfo/python-list

call of duty keygen

2008-04-17 Thread altami0762
call of duty keygen http://cracks.12w.net F R E E C R A C K S -- http://mail.python.org/mailman/listinfo/python-list

e-6 patch

2008-04-17 Thread altami0762
e-6 patch http://cracks.12w.net F R E E C R A C K S -- http://mail.python.org/mailman/listinfo/python-list

zillatube cracks keygens

2008-04-17 Thread altami0762
zillatube cracks keygens http://cracks.12w.net F R E E C R A C K S -- http://mail.python.org/mailman/listinfo/python-list

Re: How to make this unpickling/sorting demo faster?

2008-04-17 Thread Steve Bergman
> THe above is applied slavishly by those who value machine time over > peoples time. Do you want to work with them? I understand where you are coming from. But in writing the code snippet I learned something about pickling/unpickling, which I knew *about* but had never actually used before. An

Re: Rounding a number to nearest even

2008-04-17 Thread Lie
On Apr 13, 7:20 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > Lie wrote: > > On Apr 12, 3:44 am, hdante <[EMAIL PROTECTED]> wrote: > [snip] > > > In short, choosing that x.0 is rounded down and x.5 is rounded up is > > arbitrary but not without a reason. > > Don't "arbitrary" and "not without a rea

Re: Importing My Own Script

2008-04-17 Thread Victor Subervi
That worked. Thanks. Victor On Thu, Apr 17, 2008 at 2:18 PM, Raúl Gómez C. <[EMAIL PROTECTED]> wrote: > Victor, you can do this in order to load your own modules: > > import sys,os > sys.path.append(os.getcwd()) > > import your_module > > > > On Fri, Apr 18, 2008 at 12:34 PM, Ben Kaplan <[EMAIL

Re: Python plugin for Firefox

2008-04-17 Thread Todd Whiteman
zelegolas wrote: > Hi, > > It's may be a stupid question but do you if someone tried to create a > python plugin for firefox? > If you know an Open Source project let me know... > > Thanks This was asked just recently on the list (included responses below): Joe P. Cool wrote: > > In 2005 I hea

Error Handling

2008-04-17 Thread Victor Subervi
Hi; I have the following code: try: cursor.execute(sql) print '¡Exito en introducir!' print 'Esta página va a regresar a la página principal del carrito de compras en 10 segundos.' except IntegrityError: print 'Lo siento, pero el ID que entraste está usado actualmen

Re: Importing My Own Script

2008-04-17 Thread Raúl Gómez C.
Victor, you can do this in order to load your own modules: import sys,os sys.path.append(os.getcwd()) import your_module On Fri, Apr 18, 2008 at 12:34 PM, Ben Kaplan <[EMAIL PROTECTED]> wrote: > It might be something in mod python. Try asking on their mailing list. > > - Original Message

Re: Unicode chr(150) en dash

2008-04-17 Thread Martin v. Löwis
> For example, I got that EN DASH out of a web page which states version="1.0" encoding="ISO-8859-1"?> at the beggining. That's why I > did go for that encoding. But if the browser can properly decode that > character using that encoding, how come other applications can't? Please do trust us that

movie collector crack

2008-04-17 Thread ott . deb
movie collector crack http://cracks.12w.net F R E E C R A C K S -- http://mail.python.org/mailman/listinfo/python-list

smoking patch

2008-04-17 Thread ott . deb
smoking patch http://cracks.12w.net F R E E C R A C K S -- http://mail.python.org/mailman/listinfo/python-list

server 2003 activation crack

2008-04-17 Thread ott . deb
server 2003 activation crack http://cracks.12w.net F R E E C R A C K S -- http://mail.python.org/mailman/listinfo/python-list

digital rights management crack

2008-04-17 Thread ott . deb
digital rights management crack http://cracks.12w.net F R E E C R A C K S -- http://mail.python.org/mailman/listinfo/python-list

fable keygen

2008-04-17 Thread ott . deb
fable keygen http://cracks.12w.net F R E E C R A C K S -- http://mail.python.org/mailman/listinfo/python-list

luxor 3 keygen

2008-04-17 Thread ott . deb
luxor 3 keygen http://cracks.12w.net F R E E C R A C K S -- http://mail.python.org/mailman/listinfo/python-list

recycle crack

2008-04-17 Thread ott . deb
recycle crack http://cracks.12w.net F R E E C R A C K S -- http://mail.python.org/mailman/listinfo/python-list

rks fax crack

2008-04-17 Thread ott . deb
rks fax crack http://cracks.12w.net F R E E C R A C K S -- http://mail.python.org/mailman/listinfo/python-list

Tidy module?

2008-04-17 Thread Mark Reed
Is there an easy_installable egg with an interface to libtidy? I found µTidy, but it looks like an inactive project, with no updates since 2004, so I'm skeptical of its reliability. I found mxTidy, but it's only available as part of some larger distribution, and I don't want to replace my Python

Re: sampling without replacement

2008-04-17 Thread Mensanator
On Apr 17, 2:41 am, Paul Rubin wrote: > braver <[EMAIL PROTECTED]> writes: > > Using an array is natural here as it represents "without replacement" > > -- we take an element by removing it from the array.  But in Python > > it's very slow...  What approaches are there to

Re: Can't do a multiline assignment!

2008-04-17 Thread J. Cliff Dyer
On Thu, 2008-04-17 at 13:53 -0400, Steve Holden wrote: > Gary Herron wrote: > > [EMAIL PROTECTED] wrote: > >> On Apr 17, 10:54 am, [EMAIL PROTECTED] wrote: > >> > >>> On 17 avr, 17:40, [EMAIL PROTECTED] wrote: > >>> > >>> Out of sheer curiosity, why do you need thirty (hand-specified and > >>> d

Re: Prob. w/ Script Posting Last Value

2008-04-17 Thread Victor Subervi
On Thu, Apr 17, 2008 at 1:07 PM, Steve Holden <[EMAIL PROTECTED]> wrote: > Victor Subervi wrote: > > > Hi; > > Gabriel provided a lovely script for showing images which I am modifying > > for my needs. I have the following line: > > print '\n' % (d, y) > > where the correct values are entered fo

Re: noobie question about mailman

2008-04-17 Thread [EMAIL PROTECTED]
On 17 avr, 20:04, lg <[EMAIL PROTECTED]> wrote: > Hello, > > I'm pretty new to usenet and totally new to python, so.. hopefully i > won't offend anyone with my naivete. I work at a non-profit > organization where we use mailman for our email lists, and i've > inhereted the task of being list admin

MySQL hardcoding?

2008-04-17 Thread marexposed
I've got this error (see the path in last line) db=MySQLdb.connect(host='localhost',use_unicode = True, charset = "Windows-1251",user='root',passwd='12',db='articulos') File "C:\Python24\Lib\site-packages\MySQLdb\__init__.py", line 74, in Connect return Connection(*args, **kwargs) Fil

Re: What can we do about all the spam that the list is getting?

2008-04-17 Thread Grant Edwards
On 2008-04-17, Mark Shroyer <[EMAIL PROTECTED]> wrote: >>> So download a "real" NNTP client for whatever platform you're >>> on and give its spam filter a shot; clearly Google is not >>> interested in fighting spam itself. >> >> Plonking anything posted via google.groups is the simplest >> answer

Re: Can't do a multiline assignment!

2008-04-17 Thread Paul Hankin
On Apr 17, 5:56 pm, [EMAIL PROTECTED] wrote: > class RequestHeadersManager: > ... >     def __init__(self, headers, linesep): >         headersDict = parse_headers(headers, linesep) > >         for header in headersDict.keys(): > ...[lots of code] Your code is pretty much equivalent to

Re: How to make this unpickling/sorting demo faster?

2008-04-17 Thread Paddy
On Apr 17, 6:15 pm, Steve Bergman <[EMAIL PROTECTED]> wrote: > I'm involved in a discussion thread in which it has been stated that: > > """ > Anything written in a language that is > 20x slower (Perl, Python, > PHP) than C/C++ should be instantly rejected by users on those grounds > alone. > """ >

Re: Profiling, recursive func slower than imperative, normal?

2008-04-17 Thread Terry Reedy
|In that case, I'm not sure you get any performance gain since the queue |has basically the same role as the stack in the recursive version. A |definitive answer calls for an actual test, though. The potential gain comes from not incurring function call overhead and only queueing or stacking the

Re: Prob. w/ Script Posting Last Value

2008-04-17 Thread Steve Holden
Victor Subervi wrote: > Hi; > Gabriel provided a lovely script for showing images which I am modifying > for my needs. I have the following line: > > print '\n' % (d, y) > where the correct values are entered for the variables, and those values > increment (already tested). Here is the slightly

noobie question about mailman

2008-04-17 Thread lg
Hello, I'm pretty new to usenet and totally new to python, so.. hopefully i won't offend anyone with my naivete. I work at a non-profit organization where we use mailman for our email lists, and i've inhereted the task of being list administrator from my sadly-recently-and-unjustly-terminated

Re: Can't do a multiline assignment!

2008-04-17 Thread Michael Torrie
[EMAIL PROTECTED] wrote: > You didn't really write that at the Python's interpreter, did you? > It's wrong. The way that would really go at the interpreter is like I did actually run it through the interpreter, but I didn't copy and past it to the e-mail. Thought that I saw this behavior, but cle

Re: Can't do a multiline assignment!

2008-04-17 Thread s0suk3
On Apr 17, 12:34 pm, Michael Torrie <[EMAIL PROTECTED]> wrote: > > Another thing to consider is that referencing a member of a class or > instance already *is* a dictionary lookup. It's how python works. Thus > dictionaries are optimized to be fast. Since strings are immutable, > python hashes t

Re: Can't do a multiline assignment!

2008-04-17 Thread Steve Holden
Gary Herron wrote: > [EMAIL PROTECTED] wrote: >> On Apr 17, 10:54 am, [EMAIL PROTECTED] wrote: >> >>> On 17 avr, 17:40, [EMAIL PROTECTED] wrote: >>> >>> Out of sheer curiosity, why do you need thirty (hand-specified and >>> dutifully commented) names to the same constant object if you know >>> t

Re: Can't do a multiline assignment!

2008-04-17 Thread s0suk3
On Apr 17, 12:24 pm, Michael Torrie <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > > > There! That's the whole code. I guess the way you suggest is simpler > > and a bit more intuitive, but I was figuring that the way I suggested > > it is more stylish. > > Umm, doesn't defining all tho

Re: Integer dicision

2008-04-17 Thread Mark Wooding
bdsatish <[EMAIL PROTECTED]> wrote: > How does (a/b) work when both 'a' and 'b' are pure integers ? > >>> (9/2) > 4 > >>> (-9/2) > -5 > > Why is it -5 ? I expect it to be -4 ? Because, in C/C++, 9/2 is 4 and > so negative of it, (-9/2) is -4. Some background on the situation: Integer division and

Re: Can't do a multiline assignment!

2008-04-17 Thread Steve Holden
Marco Mariani wrote: > [EMAIL PROTECTED] wrote: > >> Yes, it makes it more readable. And yes, it does make it (a lot) more >> maintainable. Mainly because I don't have those four variables, I have >> about thirty. And I think I won't need to one or two of them, but >> maybe all of them at once. >

Please don't fake interpreter sessions, was Re: Can't do a multiline assignment!

2008-04-17 Thread Peter Otten
Michael Torrie wrote: That's not how Python actually works: > >>> a=myclass(3) > >>> b=myclass(6) > >>> a.classvar1=9 > >>> a.classvar1 > 9 > >>> b.classvar1 > 9 What actually happens is that the a.classvar1 = 9 assignment creates an instance variable that shades the classvar: >>> class A(objec

Re: Can't do a multiline assignment!

2008-04-17 Thread Arnaud Delobelle
On Apr 17, 6:02 pm, [EMAIL PROTECTED] wrote: [...] > I do it with all the separate variables mainly for performance. If I > had the headers in a dict, I'd be looking up a string in a list of > strings (the keys of the dict) everytime I check for a header. Not > that that's going to take more that 0

Re: I just killed GIL!!!

2008-04-17 Thread sturlamolden
On Apr 17, 7:16 pm, Jonathan Gardner <[EMAIL PROTECTED]> wrote: > On Apr 17, 8:19 am, sturlamolden <[EMAIL PROTECTED]> wrote: > > > > > An there you have the answer. It's really very simple :-) > > That's an interesting hack. > > Now, how do the processes communicate with each other without steppin

Re: Can't do a multiline assignment!

2008-04-17 Thread Michael Torrie
[EMAIL PROTECTED] wrote: > I do it with all the separate variables mainly for performance. If I > had the headers in a dict, I'd be looking up a string in a list of > strings (the keys of the dict) everytime I check for a header. Not > that that's going to take more that 0.1 seconds, but the progra

Re: Python module for reading FilePro files?

2008-04-17 Thread Steve Bergman
Thanks. Yes, there is a php-filepro extension that I could hook up with using the command line interpreter. That may well be what I end up doing. Or maybe port the php extension to python. -- http://mail.python.org/mailman/listinfo/python-list

Re: Can't do a multiline assignment!

2008-04-17 Thread s0suk3
On Apr 17, 12:07 pm, Sion Arrowsmith <[EMAIL PROTECTED]> wrote: > <[EMAIL PROTECTED]> wrote: > >In Python, you usually can use parentheses to split something over > >several lines. But you can't use parentheses for an assignment of > >several lines. > > Yes you can, you just need an iterable of th

Re: Can't do a multiline assignment!

2008-04-17 Thread Michael Torrie
[EMAIL PROTECTED] wrote: > > There! That's the whole code. I guess the way you suggest is simpler > and a bit more intuitive, but I was figuring that the way I suggested > it is more stylish. Umm, doesn't defining all those members in the class lead to class variables, not instance variables? I

Re: I just killed GIL!!!

2008-04-17 Thread Rhamphoryncus
On Apr 17, 11:05 am, sturlamolden <[EMAIL PROTECTED]> wrote: > On Apr 17, 6:03 pm, Rhamphoryncus <[EMAIL PROTECTED]> wrote: > > > Interesting. Windows specific, but there's other ways to do the same > > thing more portably. > > I believe you can compile Python as a shared object (.so) on Linux as

help with docutils

2008-04-17 Thread Jonathan Lukens
I am trying generate html from a reST document, both the body of the document and a table of contents, each contained in separate variables. I had initially assumed that there would be a 'toc' key in publish_parts, but apparently there is not. Is there a relatively easy way to achieve this? -- h

Re: I just killed GIL!!!

2008-04-17 Thread Jonathan Gardner
On Apr 17, 9:48 am, sturlamolden <[EMAIL PROTECTED]> wrote: > On Apr 17, 5:46 pm, Hrvoje Niksic <[EMAIL PROTECTED]> wrote: > > > Have you tackled the communication problem? The way I see it, one > > interpreter cannot "see" objects created in the other because they > > have separate pools of ... e

  1   2   3   >