Re: "do" as a keyword

2007-12-11 Thread Steven D'Aprano
On Tue, 11 Dec 2007 15:06:31 +, Neil Cerutti wrote: > When I use languages that supply do-while or do-until looping constructs > I rarely need them. ... > However, did you have an specific need for a do-while construct? Perhaps > we could show you the alternatives. "Need" is a strong word. Af

Re: Help needed with python unicode cgi-bin script

2007-12-11 Thread Martin v. Löwis
> No what? YES, the "decode error" is complaining that the data supplied > is NOT valid utf-8 data. So it's not utf-8, it's windows-1252, so stop > lying to browsers: like I said, use charset="windows-1252" I think weheh can manage to resist good advise for a long time. Regards, Martin -- http:/

Re: Building python 2.5.1 from source using MSVC 2005

2007-12-11 Thread Martin v. Löwis
> How do i build python 2.5.1 from source using MSVC 2005? > Are there instructions on doing this. See PCbuild8/readme.txt. The instructions may not be correct, and the project files may not work out of the box, so you are on your own wrt. anything that goes wrong - unless you ask here for specif

Re: Best way to protect my new commercial software.

2007-12-11 Thread Steven D'Aprano
On Tue, 11 Dec 2007 13:07:02 +1300, greg wrote: > Tim Chase wrote: >> -Write Lovecraftian code ("import goto" comes to mind) designed to make >> reverse-engineers go insane trying to figure out what you were thinking > > The problem with that is it makes it hard for *you* to figure out what > you

Re: Source formatting fixer?

2007-12-11 Thread Steven D'Aprano
On Mon, 10 Dec 2007 13:55:15 -0800, Bret wrote: > Does anyone know of a package that can be used to "fix" bad formatting > in Python code? I don't mean actual errors, just instances where > someone did things that violate the style guide and render the code > harder to read. > > If nothing exist

Re: Standard Python 2.4 module like "crypt" for Windows?

2007-12-11 Thread Martin v. Löwis
> Is there a module available in the standard library, for Python 2.4 > running on Windows, like "crypt" for Python 2.4 running on *nix > machines? I can't try right now, but I would expect that the Cygwin python distribution has a crypt implementation. If you want a crypt implementation for the

Re: finding dir of main .py file

2007-12-11 Thread John Machin
On Dec 12, 6:50 am, Matt Nordhoff <[EMAIL PROTECTED]> wrote: > ron.longo wrote: > > Nope, maybe I'm not explaining myself well. > > > When I do os.getenv('HOME') I get back None. > > > According to the docs, 'HOME' is the user's home directory on some > > platforms. Which is not what I want. > > >

Re: Counter-spam: Change the subject

2007-12-11 Thread Steven D'Aprano
On Tue, 11 Dec 2007 06:23:43 -0800, Paul McGuire wrote: > On Dec 11, 5:59 am, dfg <[EMAIL PROTECTED]> wrote: >> Breakthrough - How To Turn Your Dull Website into Money Making Website > > > I was surprised at how effectively the spam posting the other day, > "Jesus in the Quran" was masked and de

Re: Is a "real" C-Python possible?

2007-12-11 Thread Steven D'Aprano
On Tue, 11 Dec 2007 11:25:32 -0800, John Nagle wrote: > sturlamolden wrote: >> On 10 Des, 23:49, [EMAIL PROTECTED] (Aahz) wrote: >> >>> "Premature optimization is the root of all evil in programming." >>> --C.A.R. Hoare (often misattributed to Knuth, who was himself quoting >>> Hoare) > > We

Re: need the unsigned value from dl.call()

2007-12-11 Thread Larry Bates
Diez B. Roggisch wrote: > Larry Bates wrote: > >> eliss wrote: >>> I'm using dl.call() to call a C function in an external library. It's >>> working great so far except for one function, which returns an >>> unsigned int in the C version. However, in python it returns a signed >>> value to me. How

Re: Tuples !?!?

2007-12-11 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : > Hi, > > Is the tuple comparison brooked in python ?!?!? Given the size and average level of the user base, I think this would have been noticed. > > Try this If you hope anyone to try anything, please post the *minimal* working code showing the problem. And whi

Re: Is a "real" C-Python possible?

2007-12-11 Thread Bruno Desthuilliers
John Nagle a écrit : > sturlamolden wrote: > >> On 10 Des, 23:49, [EMAIL PROTECTED] (Aahz) wrote: >> >>> "Premature optimization is the root of all evil in programming." >>> --C.A.R. Hoare (often misattributed to Knuth, who was himself quoting >>> Hoare) > > >We're ten years into Python, and

Re: finding dir of main .py file

2007-12-11 Thread Stefan Reichör
Shane Geiger <[EMAIL PROTECTED]> writes: > Some usage of __file__ will always get what you want in various situations: > > print __file__ > > print modulename.__file__ > > print os.getcwd() + "/" + __file__ > > > > > > Rick Dooling wrote: >> On Dec 11, 10:08 am, "ron.longo" <[EMAIL PROTECTED]>

Re: Is anyone happy with csv module?

2007-12-11 Thread Bruno Desthuilliers
massimo s. a écrit : > Hi, > > I'm struggling to use the python in-built csv module, and I must say > I'm less than satisfied. Apart from being rather poorly documented, I > find it especially cumbersome to use, and also rather limited. What I > dislike more is that it seems working by *rows* inst

mailbox.Maildir question/problem

2007-12-11 Thread tinnews
I am trying to write a utility to remove empty maildir mailboxes. It sounds like this should be very simple but it's proving really difficult. I'm doing this on a Fedora 7 system with python 2.5. The first question is how to detect whether a directory is a maildir mailbox. The following code sn

Re: newbie

2007-12-11 Thread Bruno Desthuilliers
Whizzer a écrit : > Is OReilly's Learning Python a good place to start learning to program? I can't tell - I already had some experience as a (professional) programmer when I met Python, and it was quite a few years ago. But Mark Lutz's "Programming Python" is one of the very few CS books that

Re: Is a "real" C-Python possible?

2007-12-11 Thread Diez B. Roggisch
John Nagle schrieb: > sturlamolden wrote: >> On 10 Des, 23:49, [EMAIL PROTECTED] (Aahz) wrote: >> >>> "Premature optimization is the root of all evil in programming." >>> --C.A.R. Hoare (often misattributed to Knuth, who was himself quoting >>> Hoare) > >We're ten years into Python, and it's s

Re: Building python 2.5.1 from source using MSVC 2005

2007-12-11 Thread black_13
On Dec 11, 2:22 pm, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > > How do i build python 2.5.1 from source using MSVC 2005? > > Are there instructions on doing this. > > See PCbuild8/readme.txt. > > The instructions may not be correct, and the project files > may not work out of the box, so you a

Re: Dumb newbie back in shell

2007-12-11 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : (top-post corrected, once again... duh.) > Bruno Desthuilliers wrote: >>[EMAIL PROTECTED] a écrit : >> >>Martin, would you _please_ learn to quote properly ? top-posting and >>keeping the whole text of the previous posts are two really annoying >>practices. TIA >>(snip

instead of reading cookies (plan B)

2007-12-11 Thread Vincent Hirth
I was just thinking of an alternative to reading cookies directly - at least in my case. What if I create a PHP file that contains the cookies in 2 lines, such as this? Myusername Mypassword What would the python script look like if I wanted to open the file and put the 2 values in vari

Re: Is anyone happy with csv module?

2007-12-11 Thread Duncan Booth
"massimo s." <[EMAIL PROTECTED]> wrote: > 1) Is there a good tutorial, example collection etc. on the csv module > that I'm missing? Yes, see http://docs.python.org/lib/csv-examples.html > 2) Is there an alternative csv read/write module? No but feel free to write your own > 3) In case anyone el

Re: finding dir of main .py file

2007-12-11 Thread Ron Provost
Thanks, didn't realize it would be quite so easy. - Original Message - From: "Matt Nordhoff" <[EMAIL PROTECTED]> To: "ron.longo" <[EMAIL PROTECTED]> Cc: Sent: Tuesday, December 11, 2007 2:50 PM Subject: Re: finding dir of main .py file > ron.longo wrote: >> Nope, maybe I'm not explain

Re: Is anyone happy with csv module?

2007-12-11 Thread John Machin
On Dec 12, 6:14 am, "massimo s." <[EMAIL PROTECTED]> wrote: > Hi, > > I'm struggling to use the python in-built csv module, and I must say > I'm less than satisfied. Apart from being rather poorly documented, Patches are welcome :-) > I > find it especially cumbersome to use, Can you be more spe

Re: Is anyone happy with csv module?

2007-12-11 Thread massimo s.
On 11 Dic, 22:37, John Machin <[EMAIL PROTECTED]> wrote: > On Dec 12, 6:14 am, "massimo s." <[EMAIL PROTECTED]> wrote: > > > Hi, > > > I'm struggling to use the python in-built csv module, and I must say > > I'm less than satisfied. Apart from being rather poorly documented, > > Patches are welcome

Re: Tuples !?!?

2007-12-11 Thread Berco Beute
> > Is the tuple comparison brooked in python ?!?!? > > No. > > > Thanks. > > You're welcome. HHH! That just made my day. Too funny. 2B -- http://mail.python.org/mailman/listinfo/python-list

Re: Is anyone happy with csv module?

2007-12-11 Thread massimo s.
On 11 Dic, 20:24, "Guilherme Polo" <[EMAIL PROTECTED]> wrote: > > Post your actual problem so you can get more accurate help. Hi Guilhermo, I have not an actual problem. I'm just trying to use the CSV module and I mostly can get it working. I just think its interface is much less than perfect. I'

Building Python2.4.1 with idle on HPUX11

2007-12-11 Thread Looney, James B
I've been trying to build Python 2.4.1 on an HPUX11. Python builds ok, but idle has issues. And what I don't know is how to determine whether or not Python discovers the tcl/tk libraries (.sl) and headers, or if there's some other problem. If someone has thoughts on either how to invoke 'configu

Re: Tuples !?!?

2007-12-11 Thread aaragao
Ok. This is small code. The problem is '2' != 2 there is a way of converting 'some number' in number ? Thanks. # -*- coding: cp1252 -*- import random import csv import struct import array # resultados para colocar nos campos def gera_string(res): # acampo3 acampo1=((0,5,'muito

Re: Building python 2.5.1 from source using MSVC 2005

2007-12-11 Thread Martin v. Löwis
> I was able to build the subversion source using the PCbuild8/ > readme.txt instructions. However how do i install the compiled > interpreter and libraries so it can be used with swig or wxpython > (win32). I'm not sure why you want to install it - just run it from where it was built. If you w

Re: Counter-spam: Change the subject

2007-12-11 Thread Paul McGuire
On Dec 11, 2:28 pm, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > On Tue, 11 Dec 2007 06:23:43 -0800, Paul McGuire wrote: > > On Dec 11, 5:59 am, dfg <[EMAIL PROTECTED]> wrote: > >> Breakthrough - How To Turn Your Dull Website into Money Making Website > > > > > I was surprised a

[no subject]

2007-12-11 Thread katie smith
How on earth do I convert strings to lists. I have a string with a list it in it and I'm trying to convert it into a list. Please help me. Ex."[16, 16, 2, 16, 2, 16, 8, 16]"-string to [16, 16, 2, 16, 2, 16, 8, 16] -list ___

Re: Source formatting fixer?

2007-12-11 Thread Gabriel Genellina
En Tue, 11 Dec 2007 12:22:11 -0300, Jesse Jaggars <[EMAIL PROTECTED]> escribi�: > Bret wrote: >> Does anyone know of a package that can be used to "fix" bad formatting >> in Python code? I don't mean actual errors, just instances where >> someone did things that violate the style guide and rend

Rewriting Recipe/410687 without map and lambda

2007-12-11 Thread sofeng
I would like to use the following recipe to transpose a list of lists with different lengths. http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/410687 Here is an example of what I would like to do: Python 2.5.1 (r251:54863, May 18 2007, 16:56:43) [GCC 3.4.4 (cygming special, gdc 0.12, usin

Re: Tuples !?!?

2007-12-11 Thread aaragao
On 11 Dez, 22:02, [EMAIL PROTECTED] wrote: > Ok. This is small code. > > The problem is '2' != 2 there is a way of converting 'some number' in > number ? > > Thanks. > > # -*- coding: cp1252 -*- > import random > import csv > import struct > import array > > # resultados para colocar nos campos > d

Re: Is a "real" C-Python possible?

2007-12-11 Thread sturlamolden
On 11 Des, 20:25, John Nagle <[EMAIL PROTECTED]> wrote: > Shed Skin effort. Its author writes "Am I the only one seeing the potential > of an implicitly statically typed Python-like-language that runs at > practically the same speed as C++?" Don't forget about Pyrex and PyPy's RPython. By the wa

Re: Is anyone happy with csv module?

2007-12-11 Thread John Machin
On Dec 12, 8:49 am, "massimo s." <[EMAIL PROTECTED]> wrote: > On 11 Dic, 22:37, John Machin <[EMAIL PROTECTED]> wrote: > > > On Dec 12, 6:14 am, "massimo s." <[EMAIL PROTECTED]> wrote: > > > > Hi, > > > > I'm struggling to use the python in-built csv module, and I must say > > > I'm less than satis

Re: need the unsigned value from dl.call()

2007-12-11 Thread eliss
On Dec 11, 12:38 pm, Larry Bates <[EMAIL PROTECTED]> wrote: > Diez B. Roggisch wrote: > > Larry Bates wrote: > > >> eliss wrote: > >>> I'm using dl.call() to call a C function in an external library. It's > >>> working great so far except for one function, which returns an > >>> unsigned int in the

Re: Tuples !?!?

2007-12-11 Thread NethanO
On 12/11/2007 5:08 PM, [EMAIL PROTECTED] wrote: > On 11 Dez, 22:02, [EMAIL PROTECTED] wrote: >> Ok. This is small code. >> >> The problem is '2' != 2 there is a way of converting 'some number' in >> number ? >> >>> ord('2') 50 >>> chr(50) == '2' True >>> int('2') 2 >>> int('2') == 2 True

Re: Block comments

2007-12-11 Thread MartinRinehart
Bruno Desthuilliers wrote: > Is the array of lines the appropriate data structure here ? I've done tokenizers both as an array of lines and as a long string. The former has seemed easier when the language treats EOL as a statement separator. re not letting literal strings in code terminate bloc

Re: Matching XML Tag Contents with Regex

2007-12-11 Thread Chris
On Dec 11, 1:08 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > Chris wrote: > > On Dec 11, 11:41 am, garage <[EMAIL PROTECTED]> wrote: > >> > Is what I'm trying to do possible with Python's Regex library? Is > >> > there an error in my Regex? > > >> Search for '*?' onhttp://docs.python.org/lib

Re: Is anyone happy with csv module?

2007-12-11 Thread [EMAIL PROTECTED]
On Dec 12, 10:49 am, "massimo s." <[EMAIL PROTECTED]> wrote: > > Accessing the data by columns *instead* of by rows would definitely > > not be appreciated by people who are using the csv module to read > > millions of lines of data. > > I don't want anything *instead*, I would like *additional*.

Re:

2007-12-11 Thread Jeff McNeil
Python 2.5 (r25:51918, Sep 19 2006, 08:49:13) [GCC 4.0.1 (Apple Computer, Inc. build 5341)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> a = '[1,2,3,4,5]' >>> eval (a, {}, {}) [1, 2, 3, 4, 5] >>> But note that 'eval' is generally not such a good idea unless

Re:

2007-12-11 Thread Tim Chase
> How on earth do I convert strings to lists. I have a string > with a list it in it and I'm trying to convert it into a > list. Please help me. > > Ex."[16, 16, 2, 16, 2, 16, 8, 16]"-string to > [16, 16, 2, 16, 2, 16, 8, 16] -list If you trust your input, you can just do >>> s = "[16, 16, 2,

Re: instead of reading cookies (plan B)

2007-12-11 Thread Gabriel Genellina
En Tue, 11 Dec 2007 17:34:50 -0300, Vincent Hirth <[EMAIL PROTECTED]> escribi�: > I was just thinking of an alternative to reading cookies directly - at > least > in my case. What if I create a PHP file that contains the cookies in 2 > lines, such as this? > (To make it more clear:) --- begi

Elementtree find problem

2007-12-11 Thread Willemsjunk
I tried the tips I found in other posts but I still get 'none' back: import easygui as eg import xml.etree.ElementTree as ET import sys #kml source is: # #http://earth.google.com/kml/2.2";> # #Simple placemark #Attached to the ground. Intelligently places itself # at the height of

String of integers separated by commas surrounded by square brackets to a list (was Re:)

2007-12-11 Thread Tim Couper
It looks like you have a string which starts and ends with square brackets and is a repeated group of (integer, comma (and perhaps space)). What you don't have is a "string with a list in it" :-) One solution: s="[16, 16, 2, 16, 2, 16, 8, 16]" mylist=[int(s.strip()) for s in s[1:-1].split(','

Re: Is anyone happy with csv module?

2007-12-11 Thread Ben Finney
"massimo s." <[EMAIL PROTECTED]> writes: > Yes, but maybe I was in the wrong. I'm not so bold to submit patches > to an official Python module without asking. Be bold. The worst that can happen is that your patch will be rejected. Any discussion that happens can only improve your understanding (a

Re: need the unsigned value from dl.call()

2007-12-11 Thread eliss
On Dec 11, 2:28 pm, eliss <[EMAIL PROTECTED]> wrote: > On Dec 11, 12:38 pm, Larry Bates <[EMAIL PROTECTED]> wrote: > > > > > Diez B. Roggisch wrote: > > > Larry Bates wrote: > > > >> eliss wrote: > > >>> I'm using dl.call() to call a C function in an external library. It's > > >>> working great so

Re: Best way to protect my new commercial software.

2007-12-11 Thread Ben Finney
Steven D'Aprano <[EMAIL PROTECTED]> writes: > Why is this a problem? The more time the Original Poster spends > struggling to maintain his copy-protected in-house software that > nobody else wants, the less time he will have to go out and cause > mischief by writing something useful and copy-prote

Re: Help needed with python unicode cgi-bin script

2007-12-11 Thread weheh
John & Martin, Thanks for your help and kind words of encouragement. Still, what you have suggested doesn't seem to work, unless I'm not understanding your directive to encode as 'windows-1252'. Here's my program in full: #!C:/Program Files/Python23/python.exe import cgi, cgitb import sys, code

Re: Is anyone happy with csv module?

2007-12-11 Thread Gabriel Genellina
En Tue, 11 Dec 2007 18:49:27 -0300, massimo s. <[EMAIL PROTECTED]> escribi�: > On 11 Dic, 22:37, John Machin <[EMAIL PROTECTED]> wrote: >> On Dec 12, 6:14 am, "massimo s." <[EMAIL PROTECTED]> wrote: >> >> > Hi, >> >> > I'm struggling to use the python in-built csv module, and I must say >> > I'm

Re: need the unsigned value from dl.call()

2007-12-11 Thread Gabriel Genellina
En Tue, 11 Dec 2007 19:28:34 -0300, eliss <[EMAIL PROTECTED]> escribi�: > On Dec 11, 12:38 pm, Larry Bates <[EMAIL PROTECTED]> wrote: >> Diez B. Roggisch wrote: >> > Larry Bates wrote: >> >> eliss wrote: >> >>> working great so far except for one function, which returns an >> >>> unsigned int in

Re: Distinguishing attributes and methods

2007-12-11 Thread Florian Diesch
MonkeeSage <[EMAIL PROTECTED]> wrote: > It seems that I've got a short-circuit somewhere here. I understand > that everything is an object and the the storage/lookup system is > object-agnostic, and that it is only the descriptors (or "tags" as I > called them generically) that determine how an at

Re: Elementtree find problem

2007-12-11 Thread Larry Bates
[EMAIL PROTECTED] wrote: > I tried the tips I found in other posts but I still get 'none' back: > > import easygui as eg > import xml.etree.ElementTree as ET > import sys > > #kml source is: > # > #http://earth.google.com/kml/2.2";> > # > #Simple placemark > #Attached to the ground. Int

Re: Help needed with python unicode cgi-bin script

2007-12-11 Thread Martin v. Löwis
> Thanks for your help and kind words of encouragement. Still, what you have > suggested doesn't seem to work, unless I'm not understanding your directive > to encode as 'windows-1252'. Please read John's message again. Nowhere he said you should "encode as 'windows-1252'". Instead, he said 'use

Re: String of integers separated by commas surrounded by square brackets to a list (was Re:)

2007-12-11 Thread Larry Bates
Tim Couper wrote: > It looks like you have a string which starts and ends with square > brackets and is a repeated group of (integer, comma (and perhaps > space)). What you don't have is a "string with a list in it" :-) > > One solution: > > s="[16, 16, 2, 16, 2, 16, 8, 16]" > > mylist=[int(s.

Re: Is anyone happy with csv module?

2007-12-11 Thread massimo s.
On 12 Dic, 00:08, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > Note that all the above (as any operation involving a whole *column*) > requires reading the whole file in memory. Working by rows, on the other > hand, only requires holding ONE row at a time. For big files this is > significant. >

Re: Matching XML Tag Contents with Regex

2007-12-11 Thread Diez B. Roggisch
> I was hoping a simple pattern like .*text.* wouldn't be too > complicated for Regex, but now I'm starting to agree with you. Parsing > the entire XML Dom would probably be a lot easier. That's one of the common problems with rexes and XML/HTML. They start out fast and easy, but at some point t

Re: need the unsigned value from dl.call()

2007-12-11 Thread MRAB
On Dec 11, 10:51 pm, eliss <[EMAIL PROTECTED]> wrote: > On Dec 11, 2:28 pm, eliss <[EMAIL PROTECTED]> wrote: > > > > > On Dec 11, 12:38 pm, Larry Bates <[EMAIL PROTECTED]> wrote: > > > > Diez B. Roggisch wrote: > > > > Larry Bates wrote: > > > > >> eliss wrote: > > > >>> I'm using dl.call() to call

Re: Zipfile content reading via an iterator?

2007-12-11 Thread Gabriel Genellina
En Tue, 11 Dec 2007 17:14:14 -0300, Tim Chase <[EMAIL PROTECTED]> escribi�: > I'm dealing with several large items that have been zipped up to > get quite impressive compression. However, uncompressed, they're > large enough to thrash my memory to swap and in general do bad > performance-relate

Re: Help needed with python unicode cgi-bin script

2007-12-11 Thread weheh
> What does the browser say what the encoding of the page is? > > What browser are you using, and did you configure it to default to > UTF-8 for all pages? (which you should not have done) > Browser is both IE and Firefox. IE is defaulting to UTF8. If I force it to "Encoding > Western European (Wi

Re: Help needed with python unicode cgi-bin script

2007-12-11 Thread weheh
p.s. I modified the code to break things out more explicitly: #!C:/Program Files/Python23/python.exe import cgi, cgitb import sys, codecs import os,msvcrt cgitb.enable() print u"""Content-Type: text/html http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"; > http://www.w3.org/1999/xhtml";

Re: TCP reset caused by socket.py

2007-12-11 Thread Gabriel Genellina
En Tue, 11 Dec 2007 10:51:13 -0300, Object01 <[EMAIL PROTECTED]> escribi�: > I've been working with the source code for Trac (http:// > trac.edgewall.org/) lately and have run across a bizarre problem. It > seems that all POST requests to Trac's standalone server (tracd) have > a random chance of

Re: Is anyone happy with csv module?

2007-12-11 Thread John Machin
On Dec 12, 10:35 am, "massimo s." <[EMAIL PROTECTED]> wrote: > > For example, I never ever looked into itertools. I am also not so > familiar with iterators. Itertools seem fantastic, and I'll definitely > look into them, however I can't but feel it's a bit strange that > someone wanting a quick cs

Is Python really a scripting language?

2007-12-11 Thread Ron Provost
OK, I don't mean to start any sort of war or flaming or anything here but I really need to discuss this with other afficionados of Python - I know none other than myself. I'm a software developer. Where I work, the dominant development language is Java with some mostly-legacy C/C++ software.

Re: Help needed with python unicode cgi-bin script

2007-12-11 Thread John Machin
On Dec 12, 11:06 am, "weheh" <[EMAIL PROTECTED]> wrote: > p.s. I modified the code to break things out more explicitly: > > #!C:/Program Files/Python23/python.exe > import cgi, cgitb > import sys, codecs > import os,msvcrt > > cgitb.enable() > > print u"""Content-Type: text/html > > "http://www.w3

Re: Is anyone happy with csv module?

2007-12-11 Thread Bruno Desthuilliers
massimo s. a écrit : > On 11 Dic, 20:24, "Guilherme Polo" <[EMAIL PROTECTED]> wrote: > > >>Post your actual problem so you can get more accurate help. > > > Hi Guilhermo, > I have not an actual problem. Yes you do - even if you don't realize it yet !-) > I'm just trying to use the CSV module

Re: Is anyone happy with csv module?

2007-12-11 Thread Bruno Desthuilliers
massimo s. a écrit : (snip) > (Btw: who is using csv to read >10**6 lines of data?) > Count me in. Never had to work on an RDBM dump ? -- http://mail.python.org/mailman/listinfo/python-list

Re: Tuples !?!?

2007-12-11 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : > Ok. This is small code. > > The problem is '2' != 2 It would indeed be a problem if this expression eval'd to True. That's the case in some, hem, 'languages', and believe me it's *not* the RightThing. > there is a way of converting 'some number' in > number ? ass

Re: Is a "real" C-Python possible?

2007-12-11 Thread Bruno Desthuilliers
sturlamolden a écrit : -snip) > We could include optional static typing in > Python, Please wait - going to get my gun... -- http://mail.python.org/mailman/listinfo/python-list

Re: Block comments

2007-12-11 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : (snip about tokenizers - not exactly my domain, sorry) > > Have I got those quotes right? Perfect !-) -- http://mail.python.org/mailman/listinfo/python-list

[no subject]

2007-12-11 Thread katie smith
I tried your suggestions and all that came up was the error Traceback (most recent call last): File "C:\Python25\empire\Empire Strategy.pyw", line 1788, in NewMap1= eval (NewMap1, {}, {}) File "", line 1 Tropical Islands ^ SyntaxError: invalid syntax And what is thi

Fw:

2007-12-11 Thread katie smith
I'm sorry this is the error Traceback (most recent call last): File "C:\Python25\empire\Empire Strategy.pyw", line 1788, in eval(NewMap1, {}, {}) File "", line 1 Tropical Islands ^ SyntaxError: invalid syntax - Forwarded Message From: katie smith <[EMAIL

Fw:

2007-12-11 Thread katie smith
WAHHH! for all of you who helped thankyou all of your ideas worked perfectly. I found what was causing the error and corrected. thankyou for the replies. Never miss a thing. Make Yahoo your home page. h

Re:

2007-12-11 Thread Jeff McNeil
>>> a = '[1,2,3,4]' >>> b = 'Tropical Islands' >>> eval(a) [1, 2, 3, 4] >>> eval(b) Traceback (most recent call last): File "", line 1, in ? File "", line 1 Tropical Islands ^ SyntaxError: unexpected EOF while parsing >>> For eval to work, your string has to contain a va

eval raising SyntaxError (was No Subject)

2007-12-11 Thread J. Clifford Dyer
On Tue, 2007-12-11 at 16:55 -0800, katie smith wrote: > I tried your suggestions and all that came up was the error > Traceback (most recent call last): > File "C:\Python25\empire\Empire Strategy.pyw", line 1788, in > > NewMap1= eval (NewMap1, {}, {}) > File "", line 1 > Tropical Isla

[no subject]

2007-12-11 Thread katie smith
Nevermind I always seem to find the answer on my own after i post the topic. i used len(string) and it counted the letters in string... why do I always do this Be a better friend, newshound, and know-it-

[no subject]

2007-12-11 Thread katie smith
I tried googling and yahooing to find the answer and there was to many conflicting results so i just decided to ask to simple question here. How do i could the number of letters in a string no a single letter all of them. ex. 'Count this String' should turn into an integer saying 17 ___

Re:

2007-12-11 Thread Jeff McNeil
I'd suggest you take some time and go through some of the online Python documentation in detail. The tutorials and whatnot posted on the website are quite good (available at http://docs.python.org/doc/). You can probably find answers to a lot of the questions you might have in there. -Jeff On 12/

replacing built-in exception types

2007-12-11 Thread Nishkar Grover
I'm trying to replace a built-in exception type and here's a simplified example of what I was hoping to do... >>> >>> import exceptions, __builtin__ >>> >>> zeroDivisionError = exceptions.ZeroDivisionError >>> >>> class Foo(zeroDivisionError): ... bar = 'bar' ... >>> >>> exceptions.Z

Text widget updates only after calling method exits (threading issue?)

2007-12-11 Thread mariox19
Are Tkinter widgets running on their own thread? If I try to make a simple application that will print the letters A to Z to a Tkinter Text widget, and I space the printing of each letter by 1 second, it seems no text will appear in the Text widget until the method exits. Take a look at this snip

Re: Is Python really a scripting language?

2007-12-11 Thread Calvin Spealman
The term "scripting language" is a pretty misunderstood one these days. I hold the opinion that what it is supposed to mean can, today, apply to any language. C, even, is a scripting language. All any of our software today is doing is calling out to some other component and simply acting as

Re:

2007-12-11 Thread Calvin Spealman
My first reaction is that if you have this and dont know how to get the list from it then maybe you are not as sure as you could be that you want to have such a string in the first place. Why do you have this list in a string? On Dec 11, 2007, at 5:14 PM, katie smith wrote: How on earth do

Re: Is anyone happy with csv module?

2007-12-11 Thread John Machin
massimo s. wrote: > If your line of reasoning is "well, but you can write a function here > and there", well, why bothering writing a csv parser at all? You can > parse it yourself with a couple of Python lines! :) > > I would be *very* interested to see those couple of lines. Here is some test

Re: Is anyone happy with csv module?

2007-12-11 Thread Istvan Albert
On Dec 11, 2:14 pm, "massimo s." <[EMAIL PROTECTED]> wrote: > dislike more is that it seems working by *rows* instead than by > *columns*. you can easily transpose the data to get your columns, for a data file that looks like this: data.txt A,B,C 1,2,3 10,20,30 100,200,300 do the foll

Re: Is anyone happy with csv module?

2007-12-11 Thread Cliff Wells
On Wed, 2007-12-12 at 09:50 +1100, Ben Finney wrote: > "massimo s." <[EMAIL PROTECTED]> writes: > > Yes, but it's natural for a spreadsheet-like thing to have organized > > columns of data, often. > > Perhaps, but that's not relevant. CSV is a serialisation format for > tabular data, and is only

Re: replacing built-in exception types

2007-12-11 Thread Nishkar Grover
I'm trying to replace the built-in base exception class with a subclass of itself in python 2.5 because we can no longer add attributes to that... % python2.4 -c 'import exceptions; exceptions.Exception.bar = 1234' % python2.5 -c 'import exceptions; exceptions.Exception.bar = 1234' Traceback (m

Re: replacing built-in exception types

2007-12-11 Thread Calvin Spealman
Why would you do this? How to do it, if its even possible, is far less important than if you should even attempt it in the first place. On Dec 11, 2007, at 3:51 PM, Nishkar Grover wrote: > > I'm trying to replace a built-in exception type and here's a > simplified > example of what I was hopi

Re: replacing built-in exception types

2007-12-11 Thread Calvin Spealman
Similarly I would ask then, why would you want to set class attributes on the built-in Exception classes? On Dec 11, 2007, at 9:29 PM, Nishkar Grover wrote: > > I'm trying to replace the built-in base exception class with a > subclass of itself in python 2.5 because we can no longer add > a

RE:changing fonts?

2007-12-11 Thread jyoung79
Hi Greg, > You can also use the MacOSX Character Palette to go hunting > for unicode characters. You can get to it from Terminal using > "Special Characters..." on the Edit menu. There's a search > box down the bottom where you can enter part of the unicode > name of a character, e.g. "GREEK" will

Re: newbie

2007-12-11 Thread gsal
After reading the "which book" threads, looking to the references of the page aforementioned and reading reviews on the books at Amazon.com...the two finalists were of course the one from Lutz and the one from Chun...a couple of comments here and there, tipped the scale towards Chun's Python Progra

Re: GetPath to variable

2007-12-11 Thread Gabriel Genellina
En Tue, 11 Dec 2007 09:01:30 -0300, Bruno Desthuilliers <[EMAIL PROTECTED]> escribi�: > Connolly a écrit : >> Hey there, new Python user here. >> [...] self.dialong.GetPath is created, after this it (would) goes into >> a variable >> and is stored in a config file I'm creating using the Config

Re: Is a "real" C-Python possible?

2007-12-11 Thread Terry Reedy
"sturlamolden" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | We could include optional static typing in | Python, and have an optional static optimizing native compiler for | selected portions of code. Python 3 will have optional 'type' annotations, where 'type' includes abstrac

Re: Counter-spam: Change the subject

2007-12-11 Thread Terry Reedy
"Paul McGuire" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | On Dec 11, 2:28 pm, Steven D'Aprano <[EMAIL PROTECTED] | | > My ISP does a good job at filtering the spam from this newsgroup. If | > yours does not, I feel your pain, but rather than replying to the spam | > and changin

Re: Is a "real" C-Python possible?

2007-12-11 Thread Kay Schluehr
On Dec 12, 4:45 am, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > "sturlamolden" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > | We could include optional static typing in > | Python, and have an optional static optimizing native compiler for > | selected portions of code. > > Pyth

Re: Rewriting Recipe/410687 without map and lambda

2007-12-11 Thread Terry Reedy
"sofeng" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] |I would like to use the following recipe to transpose a list of lists | with different lengths. http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/410687 | | Here is an example of what I would like to do: | | Python 2.5.1

Re: "do" as a keyword

2007-12-11 Thread Terry Reedy
"Steven D'Aprano" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] || | But loops that run at least once is a basic element of algorithms. | Perhaps not as common as the zero or more times of the while loop, but | still fundamental. It is a shame it has to be faked using: | | while Tru

Re: Is Python really a scripting language?

2007-12-11 Thread Terry Reedy
"Ron Provost" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] But here's my problem, most of my coworkers, when they see my apps and learn that they are written in Python ask questions like, "Why would you write that in a scripting language?" Whenever I hear a comment like that I

Re: Help needed with python unicode cgi-bin script

2007-12-11 Thread weheh
John and Martin, Thanks for your help. However, I have identified the culprit to be with Apache and the command: AddDefaultCharset utf-8 which forces my browser to utf-8 encoding. It looks like your suggestions to change charset were incorrect. My example works equally well with charset=utf

Re: Loading an exe icon into a pixmap/bitmap

2007-12-11 Thread Shane Geiger
Are you looking for these kinds of tools? In Debian: icoutils - Extract MS Windows icons and cursors I don't recall where I saw this: FileJuicer - Extract images from Powerpoint, PDF, HTML, and CAB files [EMAIL PROTECTED] wrote: > I've been searching for a way to load an icon from an executabl

<    1   2   3   >