Re: Execute commands from file

2007-05-16 Thread Steve Holden
tmp123 wrote: > Hello, > > Thanks for your time. > > We have very big files with python commands (more or less, 50 > commands each file). > Those are BIG programs. Presumably other programs are writing them? > It is possible to execute them command by command, like if the > commands was typ

Re: Distributing programs depending on third party modules.

2007-05-16 Thread Kevin Walzer
Bruno Desthuilliers wrote: > Kevin Walzer a écrit : > > Note that if you go that way, neither Windows nor MacOS X are actually > able to cleanly manage such dependencies (which is why the usual > solution on these platforms - or at least on Windows - is to just bundle > everything in a single b

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-16 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Stefan Behnel wrote: > René Fleschenberg wrote: >> Marc 'BlackJack' Rintsch schrieb: >>> There are potential users of Python who don't know much english or no >>> english at all. This includes kids, old people, people from countries >>> that have "letters" that are not tha

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-16 Thread Carsten Haese
On Wed, 2007-05-16 at 14:35 +0200, René Fleschenberg wrote: > You have misread my statements. > > Carsten Haese schrieb: > > There is evidence against your assertions that knowing some English is a > > prerequisite for programming > > I think it is a prerequesite for "real" programming. Yes, I c

Re: Newbie Question: Getting a list of files

2007-05-16 Thread Brian
Hi Steven, Thanks for all of the good advice! Much appreciated. Dusty --- Steven D'Aprano wrote: > On Tue, 15 May 2007 17:12:01 -0700, Brian wrote: > >> How do I, in Python, obtain a recursive list of files in a specified >> directory, including the subdirectories, etc? For example, in the ol

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-16 Thread Neil Hodgson
Eric Brunel: > Funny you talk about Japanese, a language I'm a bit familiar with and > for which I actually know some input methods. The thing is, these only > work if you know the transcription to the latin alphabet of the word you > want to type, which closely match its pronunciation. So if y

Re: Distributing programs depending on third party modules.

2007-05-16 Thread Kevin Walzer
Tina I wrote: > Kevin Walzer wrote: > And maybe the smartest thing to do would be to dump PyQt and just go for > tkinter, however ugly it is :/ Tkinter doesn't have to be ugly. I sell a proprietary Tkinter app commercially on OS X: http://www.codebykevin.com/phynchronicity-running.png It tak

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-16 Thread Eric Brunel
On Wed, 16 May 2007 15:46:10 +0200, Neil Hodgson <[EMAIL PROTECTED]> wrote: > Eric Brunel: > >> Funny you talk about Japanese, a language I'm a bit familiar with and >> for which I actually know some input methods. The thing is, these only >> work if you know the transcription to the latin a

Re: Newbie Question: Getting a list of files

2007-05-16 Thread Gerard Flanagan
On May 16, 2:12 am, Brian <[EMAIL PROTECTED]> wrote: > How do I, in Python, obtain a recursive list of files in a specified > directory, including the subdirectories, etc? import os def iter_dirs(root, dirs=False): stack = [root] while stack: dir = stack.pop(0) for f in (

Re: Quote aware split

2007-05-16 Thread Tim Arnold
"Ondrej Baudys" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi, > > After trawling through the archives for a simple quote aware split > implementation (ie string.split-alike that only splits outside of > matching quote) and coming up short, I implemented a quick and dirty > fun

Unusual i/o problems

2007-05-16 Thread saif . shakeel
Hi, I am parsing an xml file ,before that i have replaced a string in the original xml file with another and made a new xml file which will now be parsed.I am also opening some more files for output.The following code shows some i/o commands. file_input = raw_input("Enter The ODX File Path:") i

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-16 Thread Neil Hodgson
Eric Brunel: > Have you ever tried to enter anything more than 2 or 3 characters like > that? No, only for examples. Lengthy texts are either already available digitally or are entered by someone skilled in the language. > I did. It just takes ages. Come on: are you really serious about

Re: Unusual i/o problems

2007-05-16 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > Hi, > I am parsing an xml file ,before that i have replaced a string in > the original xml file with another and made a new xml file which will > now be parsed.I am also opening some more files for output.The > following code shows some i/o commands. > file_input = r

Re: Unusual i/o problems

2007-05-16 Thread Peter Otten
[EMAIL PROTECTED] wrote: > output_file = open(test_file,"w") ... > input_xml_sec = open(output_file,'r') Can you spot the problem now? To prevent it, use a naming convention that allows you to distinguish between file /names/ and file /objects/. > But i am getting an error o

Re: Trying to choose between python and java

2007-05-16 Thread Aahz
In article <[EMAIL PROTECTED]>, Aahz <[EMAIL PROTECTED]> wrote: >In article <[EMAIL PROTECTED]>, >Anthony Irwin <[EMAIL PROTECTED]> wrote: >> >>#5 someone said that they used to use python but stopped because the >>language changed or made stuff depreciated (I can fully remember >>which) and old

Re: How to do basic CRUD apps with Python

2007-05-16 Thread Joshua J. Kugler
On Sunday 13 May 2007 15:20, walterbyrd wrote: > With PHP, libraries, apps, etc. to do basic CRUD are everywhere. Ajax > and non-Ajax solutions abound. > > With Python, finding such library, or apps. seems to be much more > difficult to find. > > I thought django might be a good way, but I can n

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-16 Thread Eric Brunel
On Wed, 16 May 2007 16:29:27 +0200, Neil Hodgson <[EMAIL PROTECTED]> wrote: > Eric Brunel: > >> Have you ever tried to enter anything more than 2 or 3 characters like >> that? > > No, only for examples. Lengthy texts are either already available > digitally or are entered by someone skil

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-16 Thread Gregor Horvath
Eric Brunel schrieb: > Highly improbable in the general context. If I stumble on a source code > in Chinese, Russian or Hebrew, I wouldn't be able to figure out a single > sound. If you get source code in a programming language that you don't know you can't figure out a single sound too. How i

Re: Trying to choose between python and java

2007-05-16 Thread Matimus
> I tend to use the shebang #!/usr/bin/env python in my scripts so far > but I imagine that having that would not work on say windows. Or is > there some kind of file extension association for people running > windows instead of the shebang? The shebang is ignored in Windows (as far as I know). Th

Re: Newbie Question: Getting a list of files

2007-05-16 Thread Ant
On May 16, 3:07 pm, Gerard Flanagan <[EMAIL PROTECTED]> wrote: ... > import os > > def iter_dirs(root, dirs=False): ... Rather than rolling your own directory walker: The same iterator using os.walk: def iter_dirs(root, dirs=False): for root, directories, files in os.walk(root): if d

remove all elements in a list with a particular value

2007-05-16 Thread Lisa
I am reading in data from a text file. I want to enter each value on the line into a list and retain the order of the elements. The number of elements and spacing between them varies, but a typical line looks like: ' SRCPARAM 1 6.35e-07 15.00 340.00 1.10 3.0 ' Why does the followi

Re: remove all elements in a list with a particular value

2007-05-16 Thread Larry Bates
Lisa wrote: > I am reading in data from a text file. I want to enter each value on > the line into a list and retain the order of the elements. The number > of elements and spacing between them varies, but a typical line looks > like: > > ' SRCPARAM 1 6.35e-07 15.00 340.00 1.10 3.0

Re: setting an attribute

2007-05-16 Thread 7stud
On May 16, 2:24 am, Bruno Desthuilliers wrote: > 7stud a écrit : > > > > > "When you bind (on either a class or an instance) an attribute whose > > name is not special...you affect only the __dict__ entry for the > > attribute(in the class or instance, respectively)." > > > In light of that statem

calldll for Python 2.5

2007-05-16 Thread Larry Bates
I've implemented several libraries using calldll (originally on Python 2.2) and posted recipe on ASPN for a general implementation http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/146847. If I were doing it over again today, I would use ctypes, but I have thousands of lines of library code t

Re: removing common elemets in a list

2007-05-16 Thread John Zenger
On May 16, 2:17 am, [EMAIL PROTECTED] wrote: > Hi, > Suppose i have a list v which collects some numbers,how do i > remove the common elements from it ,without using the set() opeartor. > Thanks Submit this as your homework answer -- it wi

Re: remove all elements in a list with a particular value

2007-05-16 Thread John Zenger
On May 16, 11:21 am, Lisa <[EMAIL PROTECTED]> wrote: > I am reading in data from a text file. I want to enter each value on > the line into a list and retain the order of the elements. The number > of elements and spacing between them varies, but a typical line looks > like: > > ' SRCPARAM 1

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-16 Thread Paul Boddie
On 16 May, 15:49, Carsten Haese <[EMAIL PROTECTED]> wrote: > > [*] And if you respond that they must know "some" English in the form of > keywords and such, the answer is no, they need not. It is not hard for > Europeans to learn to visually recognize a handful of simple Chinese > characters withou

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-16 Thread Eric Brunel
On Wed, 16 May 2007 17:14:32 +0200, Gregor Horvath <[EMAIL PROTECTED]> wrote: > Eric Brunel schrieb: > >> Highly improbable in the general context. If I stumble on a source code >> in Chinese, Russian or Hebrew, I wouldn't be able to figure out a >> single sound. > > If you get source code i

Re: remove all elements in a list with a particular value

2007-05-16 Thread Lisa
Great. Thanks for your help. -- http://mail.python.org/mailman/listinfo/python-list

Re: calldll for Python 2.5

2007-05-16 Thread Thomas Heller
Larry Bates schrieb: > I've implemented several libraries using calldll (originally on > Python 2.2) and posted recipe on ASPN for a general implementation > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/146847. > If I were doing it over again today, I would use ctypes, but I > have thous

pymssql query

2007-05-16 Thread m . biddiscombe
Hi, I'm trying to use pymssql to execute a stored procedure. Currently, I have an Excel spreadsheet that uses VBA in this manner: Private Function CreateNewParrot(connDb As ADODB.Connection) As Long Dim objCommand As ADODB.Command Dim iParrot As Long Dim bSuccess As Boolean Set objComman

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-16 Thread Gregor Horvath
Eric Brunel schrieb: > > The point is that today, I have a reasonable chance of being able to > read, understand and edit any Python code. With PEP 3131, it will no > more be true. That's what bugs me. That's just not true. I and others in this thread have stated that they use German or other

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-16 Thread Istvan Albert
As a non-native English speaker, On May 13, 11:44 am, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > - should non-ASCII identifiers be supported? why? No. I don't think it adds much, I think it will be a little used feature (as it should be), every python instructor will start their class by say

Re: calldll for Python 2.5

2007-05-16 Thread Robin Becker
Thomas Heller wrote: > Larry Bates schrieb: >> I've implemented several libraries using calldll (originally on >> Python 2.2) and posted recipe on ASPN for a general implementation >> http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/146847. >> If I were doing it over again today, I would use

Re: Execute commands from file

2007-05-16 Thread Martin Blume
"tmp123" schrieb > > We have very big files with python commands > (more or less, 50 commands each file). > > It is possible to execute them command by command, inp = open(cmd_file) for line in inp: exec line might help. You don't get quite the same feeling as "like if the commands wa

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-16 Thread Gregor Horvath
Istvan Albert schrieb: > Here is something that just happened and relates to this subject: I > had to help a student run some python code on her laptop, she had > Windows XP that hid the extensions. I wanted to set it up such that > the extension is shown. I don't have XP in front of me but when I

Declaring variables

2007-05-16 Thread HMS Surprise
I looked in the language but did not find a switch for requiring variables to be declared before use. Is such an option available? Thanks, jvh -- http://mail.python.org/mailman/listinfo/python-list

Re: Declaring variables

2007-05-16 Thread Grant Edwards
On 2007-05-16, HMS Surprise <[EMAIL PROTECTED]> wrote: > I looked in the language but did not find a switch for requiring > variables to be declared before use. Still trying to write Pascal, eh? ;) > Is such an option available? No. However, there are utilities to "proofread" your code should

zipfile stupidly broken

2007-05-16 Thread Martin Maney
To quote from zipfile.py (2.4 library): # Search the last END_BLOCK bytes of the file for the record signature. # The comment is appended to the ZIP file and has a 16 bit length. # So the comment may be up to 64K long. We limit the search for the # signature to a few Kbytes at th

A bug in cPickle?

2007-05-16 Thread Victor Kryukov
Hello list, The following behavior is completely unexpected. Is it a bug or a by- design feature? Regards, Victor. - from pickle import dumps from cPickle import dumps as cdumps print dumps('1001799')==dumps(str(1001799)) print cdumps('1001799')==cdumps(str(1001799)) outpu

cPickle.dumps differs from Pickle.dumps; looks like a bug.

2007-05-16 Thread Victor Kryukov
Hello list, I've found the following strange behavior of cPickle. Do you think it's a bug, or is it by design? Best regards, Victor. from pickle import dumps from cPickle import dumps as cdumps print dumps('1001799')==dumps(str(1001799)) print cdumps('1001799')==cdumps(str(1001799)) outputs T

~!~ Britneys New BOOBS

2007-05-16 Thread deepbroke6
http://scargo.in - Download pics and videos of Britneys new Boob job see her new tits naked! -- http://mail.python.org/mailman/listinfo/python-list

Re: Interesting list Validity (True/False)

2007-05-16 Thread [EMAIL PROTECTED]
On May 16, 4:12 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Wed, 16 May 2007 03:16:59 -0300, [EMAIL PROTECTED] > <[EMAIL PROTECTED]> escribió: > > > > > > > On May 15, 7:07 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> > > wrote: > >> import gmpy > >> a = 2**177149-1 > >>

Re: A bug in cPickle?

2007-05-16 Thread Chris Cioffi
On 16 May 2007 10:06:20 -0700, Victor Kryukov <[EMAIL PROTECTED]> wrote: > Hello list, > > The following behavior is completely unexpected. Is it a bug or a by- > design feature? > > Regards, > Victor. > > - > > from pickle import dumps > from cPickle import dumps as cdumps > > prin

Re: pymssql query

2007-05-16 Thread Tim Golden
[EMAIL PROTECTED] wrote: > Hi, > > I'm trying to use pymssql to execute a stored procedure. Currently, I > have an Excel spreadsheet that uses VBA in this manner: > > Private Function CreateNewParrot(connDb As ADODB.Connection) As Long > Dim objCommand As ADODB.Command > Dim iParrot As Long >

pyhdf

2007-05-16 Thread jsaacmk
Has anyone had success installing the pyhdf library with python 2.4 under linux 2.6.18 (debian)? I have installed the HDF library and development package from apt and have downloaded the pyhdf installation files. I've had failures in two ways: 1) When I install, I do not wish to use the szip libr

python shell

2007-05-16 Thread Krypto
I have been using python shell to test small parts of the big program. What other ways can I use the shell effectively. My mentor told me that you can virtually do anything from testing your program to anything in the shell. Any incite would be useful. -- http://mail.python.org/mailman/listinfo/p

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-16 Thread [EMAIL PROTECTED]
Christophe wrote: > [EMAIL PROTECTED] a ecrit : > > Christophe wrote: > >> [EMAIL PROTECTED] a ecrit : > >>> Steven D'Aprano wrote: > I would find it useful to be able to use non-ASCII characters for heavily > mathematical programs. There would be a closer correspondence between the > >>>

Typed named groups in regular expression

2007-05-16 Thread Hugo Ferreira
Hi! Is it possible to "automagically" coerce the named groups to python types? e.g.: >>> type(re.match('(?P\d*)', '123').groupdict()['x']) But what I'm looking forward is for the type to be 'int'. Cheers! Hugo Ferreira -- http://mail.python.org/mailman/listinfo/python-list

Re: Trying to choose between python and java

2007-05-16 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Terry Reedy <[EMAIL PROTECTED]> wrote: > >"Anthony Irwin" <[EMAIL PROTECTED]> wrote in message >news:[EMAIL PROTECTED] . . . >| #5 someone said that they used to use python but stopped because t

Re: Trying to choose between python and java

2007-05-16 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Paul Melis <[EMAIL PROTECTED]> wrote: >Anthony Irwin wrote: >> Hi All, >> >> I am currently trying to decide between using python or java and have a >> few quick questions about python that you may be able to help with. >> >> #1 Does python have something like ja

Re: Trying to choose between python and java

2007-05-16 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Paul Melis <[EMAIL PROTECTED]> wrote: . . . >your program comes out on the other platforms. You could use a GUI >toolkit that draws its own widgets instead of one that uses the native >control

Re: A new project.

2007-05-16 Thread Clement
On May 16, 1:09 pm, [EMAIL PROTECTED] wrote: > I am interested in organizing and taking part in a project that would > create a virtual world much like the one described in Neal > Stephenson's 'Snow Crash'. I'm not necessarily talking about > something 3d and I'm not talking about a game either.

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-16 Thread rurpy
On May 16, 9:04 am, "Eric Brunel" <[EMAIL PROTECTED]> wrote: > On Wed, 16 May 2007 16:29:27 +0200, Neil Hodgson   > > <[EMAIL PROTECTED]> wrote: ...snip... > > Each of these can be handled reasonably considering their frequency of   > > occurrence. I have never learned Japanese but have had to deal

Python + Cairo widget examples.. where can i get them?

2007-05-16 Thread Mark
Hey, a while ago i found a widget somewhere that was written in python with the cairo extension. that widget wasn't just a window.. it was a window without decorations and a red round thing in it. now i was trying to find that thing again and i`ve searched over a million blogs (oke not that much

Re: python shell

2007-05-16 Thread Thorsten Kampe
* Krypto (16 May 2007 10:38:27 -0700) > I have been using python shell to test small parts of the big program. > What other ways can I use the shell effectively. My mentor told me > that you can virtually do anything from testing your program to > anything in the shell. Any incite would be useful.

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-16 Thread laurentszyster
On May 13, 5:44 pm, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > PEP 1 specifies that PEP authors need to collect feedback from the > community. As the author of PEP 3131, I'd like to encourage comments > to the PEP included below, either here (comp.lang.python), or to > [EMAIL PROTECTED] > > In

Python-URL! - weekly Python news and links (May 16)

2007-05-16 Thread Cameron Laird
QOTW: "Sometimes you just have to take the path of least distaste". - Grant Edwards "I want to choose my words carefully here, so I'm not misunderstood. They're a bunch of fucking idiots." - Charles Wang, billionaire chairman of software giant Computer Associates, asked to assess the quality of

Re: tkinter button state = DISABLED

2007-05-16 Thread Gabriel Genellina
En Wed, 16 May 2007 03:22:17 -0300, Hendrik van Rooyen <[EMAIL PROTECTED]> escribió: > "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > >> Maybe there is a confusion here. You code above means that, when the >> event >> "The leftmost MOUSE BUTTON was released" happens over your BUTTON WIDGET

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-16 Thread rurpy
"Hendrik van Rooyen" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > <[EMAIL PROTECTED]> wrote: > > First "while" is a keyword and will remain "while" so > > that has nothing to do with anything. > > I think this cuts right down to why I oppose the PEP. > It is not so much for techn

Re: Declaring variables

2007-05-16 Thread HMS Surprise
No haven't had to endure Pascal. Mostly C/C++, Tcl, and assembler. Oh yeah, and a (thankfully) short stint of Ada. But I glad to hear of the proofing tools. Working a lot of data parsed from web pages and the developer there a different naming convention from what I am accustomed so sometimes I i

Re: Spotting Crashed Application

2007-05-16 Thread MRAB
On May 16, 1:55 am, Steve Holden <[EMAIL PROTECTED]> wrote: > Robert Rawlins - Think Blue wrote: > > > Hello Guys, > > > I've got an application that I've written, and it sits in an embedded > > system, from time to time the application will crash, I'm not quite sure > > what's causing this, but as

Re: How to do basic CRUD apps with Python

2007-05-16 Thread Joshua J. Kugler
On Monday 14 May 2007 18:46, James T. Dennis wrote: > I'm thinking of some sort of class/module that would generate > various sorts of HTML forms by default, but also allow one to > sub-class each of the form/query types to customize the contents. Turbogears has catwalk, which is already an int

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-16 Thread [EMAIL PROTECTED]
On May 16, 12:54 pm, Gregor Horvath <[EMAIL PROTECTED]> wrote: > Istvan Albert schrieb: > > > Here is something that just happened and relates to this subject: I > > had to help a student run some python code on her laptop, she had > > Windows XP that hid the extensions. I wanted to set it up such

Re: zipfile stupidly broken

2007-05-16 Thread Gabriel Genellina
En Wed, 16 May 2007 12:18:35 -0300, Martin Maney <[EMAIL PROTECTED]> escribió: > So the author knows that there's a hard limit of 64K on the comment > size, but feels it's more important to fail a little more quickly when > fed something that's not a zipfile - or a perfectly legitimate zipfile >

Re: How to do basic CRUD apps with Python

2007-05-16 Thread Joshua J. Kugler
Sorry about the duplicate post! My news reader never showed my first reply! j -- Posted via a free Usenet account from http://www.teranews.com -- http://mail.python.org/mailman/listinfo/python-list

Re: removing common elemets in a list

2007-05-16 Thread Michael Bentley
On May 16, 2007, at 10:36 AM, John Zenger wrote: > On May 16, 2:17 am, [EMAIL PROTECTED] wrote: >> Hi, >> Suppose i have a list v which collects some numbers,how do i >> remove the common elements from it ,without using the set() opeartor. >>

Re: Execute commands from file

2007-05-16 Thread Steve Holden
Martin Blume wrote: > "tmp123" schrieb > >> We have very big files with python commands >> (more or less, 50 commands each file). >> >> It is possible to execute them command by command, > > inp = open(cmd_file) > for line in inp: > exec line > > might help. You don't get quite the sam

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-16 Thread Matthew Woodcraft
Eric Brunel <[EMAIL PROTECTED]> wrote: > Joke aside, this just means that I won't ever be able to program math in > ADA, because I have absolutely no idea on how to do a 'pi' character on my > keyboard. Just in case it wasn't clear: you could of course continue to use the old name 'Pi' instead

Re: Typed named groups in regular expression

2007-05-16 Thread Steve Holden
Hugo Ferreira wrote: > Hi! > > Is it possible to "automagically" coerce the named groups to python types? > e.g.: > type(re.match('(?P\d*)', '123').groupdict()['x']) > > > But what I'm looking forward is for the type to be 'int'. > > Cheers! > > Hugo Ferreira So apply the "int()" funct

Re: Jessica Simpson Sports new "Boob Job"!!!@

2007-05-16 Thread gtski
"wb" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On May 14, 2:09 am, [EMAIL PROTECTED] wrote: > > > If her boobs getting any bigger she won't be able to stand up. > Im afraid of boobs. they are not on men I suck. -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-16 Thread rurpy
On May 16, 1:44 am, René Fleschenberg <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] schrieb: > > I'm not sure how you conclude that no problem exists. > > - Meaningful identifiers are critical in creating good code. > > I agree. > > > - Non-english speakers can not create or understand > > engli

Python Web Programming - looking for examples of solid high-traffic sites

2007-05-16 Thread Victor Kryukov
Hello list, our team is going to rewrite our existing web-site, which has a lot of dynamic content and was quickly prototyped some time ago. Today, as we get better idea of what we need, we're going to re-write everything from scratch. Python is an obvious candidate for our team: everybody knows

try

2007-05-16 Thread HMS Surprise
I read in the ref man that try-except-finally did not work in earlier versions, I am using jython 2.2. Does this imply that try-except without finally does not work either? I get a syntax error on the else below. Some of the functions embedded in the try section try to convert strings to ints, etc

Re: try

2007-05-16 Thread Robert Kern
HMS Surprise wrote: > I read in the ref man that try-except-finally did not work in earlier > versions, I am using jython 2.2. Does this imply that try-except > without finally does not work either? I get a syntax error on the else > below. Some of the functions embedded in the try section try to >

How do I count the number of spaces at the left end of a string?

2007-05-16 Thread walterbyrd
I don't know exactly what the first non-space character is. I know the first non-space character will be * or an alphanumeric character. -- http://mail.python.org/mailman/listinfo/python-list

Re: How do I count the number of spaces at the left end of a string?

2007-05-16 Thread Daniel Nogradi
> I don't know exactly what the first non-space character is. I know the > first non-space character will be * or an alphanumeric character. How about: >>> mystring = 'ksjfkfjkfjds ' >>> print len( mystring ) - len( mystring.lstrip( ) ) 4 HTH, Daniel -- http://mail.python.org/mailman/li

How do I tell the difference between the end of a text file, and an empty line in a text file?

2007-05-16 Thread walterbyrd
Python's lack of an EOF character is giving me a hard time. I've tried: - s = f.readline() while s: . . s = f.readline() and --- s = f.readline() while s != '' . . s = f.readline() --- In both cases, the loop ends as soon it encounters an empty line in the file, i.e. xx

Re: cPickle.dumps differs from Pickle.dumps; looks like a bug.

2007-05-16 Thread Nick Vatamaniuc
On May 16, 1:13 pm, Victor Kryukov <[EMAIL PROTECTED]> wrote: > Hello list, > > I've found the following strange behavior of cPickle. Do you think > it's a bug, or is it by design? > > Best regards, > Victor. > > from pickle import dumps > from cPickle import dumps as cdumps > > print dumps('100179

Re: How do I tell the difference between the end of a text file, and an empty line in a text file?

2007-05-16 Thread James Stroud
walterbyrd wrote: > Python's lack of an EOF character is giving me a hard time. > > I've tried: > [ stuff ] for s in f: do_whatever_with_s(s) James -- http://mail.python.org/mailman/listinfo/python-list

Re: How do I tell the difference between the end of a text file, and an empty line in a text file?

2007-05-16 Thread Grant Edwards
On 2007-05-16, walterbyrd <[EMAIL PROTECTED]> wrote: > Python's lack of an EOF character is giving me a hard time. No it isn't. > s = f.readline() > while s: > . > . > s = f.readline() > s = f.readline() > while s != '' > . > . > s = f.readline() Neither one of your examples is legal Python

Re: How do I count the number of spaces at the left end of a string?

2007-05-16 Thread James Stroud
walterbyrd wrote: > I don't know exactly what the first non-space character is. I know the > first non-space character will be * or an alphanumeric character. > This is another of the hundreds of ways: py> for i,c in enumerate(astring): ... if c != ' ': break ... py> print i -- http://mail.p

Re: How do I tell the difference between the end of a text file, and an empty line in a text file?

2007-05-16 Thread James Stroud
Grant Edwards wrote: > On 2007-05-16, walterbyrd <[EMAIL PROTECTED]> wrote: > > >>Python's lack of an EOF character is giving me a hard time. > > > No it isn't. > > >>s = f.readline() >>while s: >>. >>. >>s = f.readline() > > > > >>s = f.readline() >>while s != '' >>. >>. >>s = f.readline

Re: How do I count the number of spaces at the left end of a string?

2007-05-16 Thread Steven Howe
walterbyrd wrote: > I don't know exactly what the first non-space character is. I know the > first non-space character will be * or an alphanumeric character. > > using builtin function rindex st = 'asblde ' >>> st.rindex(' ') sph -- HEX: 09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0

Re: cPickle.dumps differs from Pickle.dumps; looks like a bug.

2007-05-16 Thread Daniel Nogradi
> > I've found the following strange behavior of cPickle. Do you think > > it's a bug, or is it by design? > > > > Best regards, > > Victor. > > > > from pickle import dumps > > from cPickle import dumps as cdumps > > > > print dumps('1001799')==dumps(str(1001799)) > > print cdumps('1001799')==cdum

Re: A new project.

2007-05-16 Thread John Nagle
Clement wrote: > On May 16, 1:09 pm, [EMAIL PROTECTED] wrote: > >>I am interested in organizing and taking part in a project that would >>create a virtual world much like the one described in Neal >>Stephenson's 'Snow Crash'. That's a perfectly reasonable idea. It takes money and people to p

Re: cPickle.dumps differs from Pickle.dumps; looks like a bug.

2007-05-16 Thread Nick Vatamaniuc
On May 16, 1:13 pm, Victor Kryukov <[EMAIL PROTECTED]> wrote: > Hello list, > > I've found the following strange behavior of cPickle. Do you think > it's a bug, or is it by design? > > Best regards, > Victor. > > from pickle import dumps > from cPickle import dumps as cdumps > > print dumps('100179

Re: cPickle.dumps differs from Pickle.dumps; looks like a bug.

2007-05-16 Thread Chris Mellon
On 5/16/07, Daniel Nogradi <[EMAIL PROTECTED]> wrote: > > > I've found the following strange behavior of cPickle. Do you think > > > it's a bug, or is it by design? > > > > > > Best regards, > > > Victor. > > > > > > from pickle import dumps > > > from cPickle import dumps as cdumps > > > > > > pri

Re: cPickle.dumps differs from Pickle.dumps; looks like a bug.

2007-05-16 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Daniel Nogradi wrote: > The OP was not comparing identity but equality. So it looks like a > real bug, I think the following should be True for any function f: > > if a == b: f(a) == f(b) > > or not? In [74]: def f(x): : return x / 2 : In [75]: a = 5

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-16 Thread rurpy
On May 16, 11:41 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Christophe wrote: snip... > > Who displays stack frames? Your code. Whose code includes unicode > > identifiers? Your code. Whose fault is it to create a stack trace > > display procedure that cannot handle unicode? You. > >

Re: A bug in cPickle?

2007-05-16 Thread infidel
ActivePython 2.5.1.1 as well: PythonWin 2.5.1 (r251:54863, May 1 2007, 17:47:05) [MSC v.1310 32 bit (Intel)] on win32. Portions Copyright 1994-2006 Mark Hammond - see 'Help/About PythonWin' for further copyright information. >>> from pickle import dumps >>> from cPickle import dumps as cdumps >>>

pyExcelerator bug?

2007-05-16 Thread tkpmep
My program creates three lists: the first has dates expressed as strings, the second has floats that are strictly positive, and the third has floats that are strictly negative. I have no trouble writing the data in these lists to a .csv file using the csv module using the following code. outfile =

Re: cPickle.dumps differs from Pickle.dumps; looks like a bug.

2007-05-16 Thread Daniel Nogradi
> > > > I've found the following strange behavior of cPickle. Do you think > > > > it's a bug, or is it by design? > > > > > > > > Best regards, > > > > Victor. > > > > > > > > from pickle import dumps > > > > from cPickle import dumps as cdumps > > > > > > > > print dumps('1001799')==dumps(str(100

Re: zipfile stupidly broken

2007-05-16 Thread Larry Bates
Martin Maney wrote: > To quote from zipfile.py (2.4 library): > > # Search the last END_BLOCK bytes of the file for the record signature. > # The comment is appended to the ZIP file and has a 16 bit length. > # So the comment may be up to 64K long. We limit the search for the > #

Re: python shell

2007-05-16 Thread [EMAIL PROTECTED]
On May 16, 12:38 pm, Krypto <[EMAIL PROTECTED]> wrote: > I have been using python shell to test small parts of the big program. > What other ways can I use the shell effectively. My mentor told me > that you can virtually do anything from testing your program to > anything in the shell. Any incite

refcount differences in 2.5

2007-05-16 Thread Gabriel Genellina
Hi With Python 2.5, there is a change on the reference count of objects compared with previous versions (as reported by sys.getrefcount). All Python versions from 2.1 thru 2.4 gave these same results: Python 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] on win32 Type "copyright", "cr

Re: Quote aware split

2007-05-16 Thread obaudys
On May 16, 8:51 pm, "BJörn Lindqvist" <[EMAIL PROTECTED]> wrote: > How is the code different from shlex.split? Shlex only splits by whitespace. I needed something to split out SQL statements from a Postgresql dump, so the ideal way of doing that is to split by semicolons. However, postgresql fun

Re: Declaring variables

2007-05-16 Thread Matimus
On May 16, 9:57 am, HMS Surprise <[EMAIL PROTECTED]> wrote: > I looked in the language but did not find a switch for requiring > variables to be declared before use. > > Is such an option available? > > Thanks, > > jvh You do have to declare a variable before use. You do so by assigning it a value

Re: Declaring variables

2007-05-16 Thread Steve Holden
Matimus wrote: > On May 16, 9:57 am, HMS Surprise <[EMAIL PROTECTED]> wrote: >> I looked in the language but did not find a switch for requiring >> variables to be declared before use. >> >> Is such an option available? >> >> Thanks, >> >> jvh > > You do have to declare a variable before use. You

Re: Typed named groups in regular expression

2007-05-16 Thread Miki
Hello Hugo, > Is it possible to "automagically" coerce the named groups to python types? > e.g.: Not that I know of, however I use the following idiom: match = my_regexp.find(some_string) def t(name, convert=str): return convert(match.group(name)) myint = t("field1", int) HTH, -- Miki <[EM

<    1   2   3   >