Re: Any reason why cStringIO in 2.5 behaves different from 2.4?

2007-07-26 Thread Stefan Behnel
Stefan Scholl wrote: > Stefan Behnel <[EMAIL PROTECTED]> wrote: >> The XML is *not* well-formed if you pass Python unicode instead of a byte >> encoded string. Read the XML spec. > > Pointers, please. There you have it: http://www.w3.org/TR/xml/#charencoding """ In the absence of information pr

Re: zip() function troubles

2007-07-26 Thread Paul Rubin
Peter Otten <[EMAIL PROTECTED]> writes: > When you are allocating a lot of objects without releasing them the garbage > collector kicks in to look for cycles. Try switching it off: I think that is the answer. The zip took almost 2 minutes without turning gc off, but takes 1.25 seconds with gc off

Re: C API -- Two questions

2007-07-26 Thread Marc 'BlackJack' Rintsch
On Fri, 27 Jul 2007 00:34:22 +, beginner wrote: > 2) How can I make the arguments less picky without writing a lot of > type conversion code? My function really needs a tuple as its > argument. For example, f( (1,2,3) ) would work. However, in order to > make it easy to use, I am thinking that

Re: zip() function troubles

2007-07-26 Thread Terry Reedy
"Istvan Albert" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] || if you try it yourself you'll see that it is very easy to generate 10 | million tuples, No it is not on most machines. | on my system it takes 3 (!!!) seconds to do the following: | | size = 10**7 | data = [] | for

Re: zip() function troubles

2007-07-26 Thread Peter Otten
Istvan Albert wrote: > I've been debugging the reason for a major slowdown in a piece of > code ... and it turns out that it was the zip function. In the past > the lists that were zipped were reasonably short, but once the size > exceeded 10 million the zip function slowed to a crawl. Note that >

Re: Any reason why cStringIO in 2.5 behaves different from 2.4?

2007-07-26 Thread Stefan Scholl
Chris Mellon <[EMAIL PROTECTED]> wrote: > XML is not a string. It's a specific type of bytestream. If you want > to work with XML, then generate well-formed XML in the correct > encoding. There's no reason you should have an XML document (as > opposed to values extracted from that document) in unic

Re: How to tell when a socket is closed on the other end?

2007-07-26 Thread Roy Smith
Jay Loden <[EMAIL PROTECTED]> wrote: > The goal of this > portion of the test suite we are writing for the project is to determine if a > remote server is behaving properly by closing a socket from the server side > based on a client-side command. > > Really what's needed is a way to make sure

Re: automatic type conversion for comparison operators

2007-07-26 Thread Dan Bishop
On Jul 26, 8:04 pm, Russ <[EMAIL PROTECTED]> wrote: > Dan Bishop wrote: > > BTW, are you a former Pascal programmer? > > No. Why do you ask? [The code snippet I wrote was made up to get a > point across. I > did not actually use that function name in my code.] I just have a hypothesis that former

Re: How to tell when a socket is closed on the other end?

2007-07-26 Thread Josiah Carlson
Jay Loden wrote: > Roy Smith wrote: >> In article <[EMAIL PROTECTED]>, >> billiejoex <[EMAIL PROTECTED]> wrote: >> >>> Hi there. >>> I'm setting up test suite for a project of mine. >>> >From test suite, acting as a client, I'd like to know, in certain >>> situations, if the socket is closed on th

Weekly Python Patch/Bug Summary

2007-07-26 Thread Kurt B. Kaiser
Patch / Bug Summary ___ Patches : 399 open ( +5) / 3836 closed ( +9) / 4235 total (+14) Bugs: 1056 open (+10) / 6776 closed ( +3) / 7832 total (+13) RFE : 263 open ( +1) / 294 closed ( +1) / 557 total ( +2) New / Reopened Patches __ utilize 2

Re: pyparser and recursion problem

2007-07-26 Thread pyscottishguy
Hey, Thanks Neil and Paul! After reading Neil's advice I started playing around with the setParseAction method, and then I found Paul's script 'macroExpander.py' (http://pyparsing.wikispaces.com/space/showimage/ macroExpander.py). With only a few modifications to macroExpander.py (and reversing

Re: Comparing Dictionaries

2007-07-26 Thread Ben Finney
Kenneth Love <[EMAIL PROTECTED]> writes: > In other words, I consider these two dictionaries to be equivalent: > > { 'dog' : 'bone', 'cat' : 'fever', 'mouse' : 'mickey' } > { 'mouse' : 'mickey', 'dog' : 'bone', 'cat' : 'fever' } > > while these two are not: > > { 'dog' : 'bone', 'ca

Re: instantiate a 'classobj'

2007-07-26 Thread Steve Holden
westymatt wrote: > I have a class where a parameter to its constructor is a type(param) = > 'classobj'. How would I go about instantiating that given it has no > constructor. > Just call the parameter: if it's of type classobj then it's callable, and calling it will create an instance of the cla

Re: instantiate a 'classobj'

2007-07-26 Thread [EMAIL PROTECTED]
On Jul 26, 7:03 pm, westymatt <[EMAIL PROTECTED]> wrote: > I have a class where a parameter to its constructor is a type(param) = > 'classobj'. How would I go about instantiating that given it has no > constructor. A old style class may not have a __new__ attribute, but it's still callable, rig

Re: pyparser and recursion problem

2007-07-26 Thread Paul McGuire
On Jul 26, 3:27 pm, Neil Cerutti <[EMAIL PROTECTED]> wrote: > > Hopefully I'll have time to help you a bit more later, or Paul > MaGuire will swoop down in his pyparsing powered super-suit. ;) > There's no need to fear...! Neil was dead on, and your parser is almost exactly right. Congratulations

reading data form an ISA port

2007-07-26 Thread Gabriel Dragffy
Dear list members I must admit I am a new user of Python, but it is a language that I enjoy using. For one of my university projects I need to write a program that can read several bytes from an ISA port. It has been suggested to me that I look at using C or Pyinline. If I can I would pre

Re: Learning Jython?

2007-07-26 Thread Benjamin
Paul Rubin wrote: > Matt Bitten <[EMAIL PROTECTED]> writes: > > It looks like Jython is for me. That said, I have two questions: > > (1) Am I thinking straight here? Or is there some other solution that > > a knows-Python-but-not-Java programmer might use? You could convert to the whole world to u

Re: zip() function troubles

2007-07-26 Thread Paul Rubin
Istvan Albert <[EMAIL PROTECTED]> writes: > Now it takes over two minutes to do this: > > size = 10**7 > a = [ 0 ] * size > b = zip(a,a) OK, I'm getting similar results under 64 bit Pytnon 2.4.4c1 and also under 2.5. About 103 seconds for 10**7 and 26 seconds for 5*10**6. So it looks like zip is

Re: zip() function troubles

2007-07-26 Thread Istvan Albert
On Jul 26, 9:33 pm, Paul Rubin wrote: > Do a top or vmstat while that is happening and see if you are > swapping. You are allocating 10 million ints and 10 million tuple > nodes, = 20 million objects. Although, even at 100 bytes per object > that would be 1GB which wou

instantiate a 'classobj'

2007-07-26 Thread westymatt
I have a class where a parameter to its constructor is a type(param) = 'classobj'. How would I go about instantiating that given it has no constructor. -- http://mail.python.org/mailman/listinfo/python-list

Re: zip() function troubles

2007-07-26 Thread Paul Rubin
Istvan Albert <[EMAIL PROTECTED]> writes: > I tested this on a linux server system with 4Gb of RAM > a = [ 0 ] * 10**7 > takes miliseconds, but say the > b = zip(a,a) > will take a very long time to finish: Do a top or vmstat while that is happening and see if you are swapping. You are allocating

Re: zip() function troubles

2007-07-26 Thread Istvan Albert
On Jul 26, 7:44 pm, Paul Rubin wrote: > Istvan Albert <[EMAIL PROTECTED]> writes: > > exceeded 10 million the zip function slowed to a crawl. Note that > > there was memory available to store over 100 million items. > > How many bytes is that? Maybe the items (heap-alloc

Re: How to tell when a socket is closed on the other end?

2007-07-26 Thread Walker Lindley
The easiest way I've found is to just surround every socket-related thing you do with try/except. the except statement is something like "except socket.error, err_info". then the err_info variable will have a tuple containing the BSD socket error number and the text of the error. You can reference

Re: Another C API Question

2007-07-26 Thread Farshid Lashkari
beginner wrote: > I know obj is a number, but I do not know the exact type. How can I > convert it to double without writing a giant switch() that exhausts > every single type of number? Try using the PyFloat_AsDouble(...) function, it should be able to convert an object to a double, as long as t

Re: Reading files, splitting on a delimiter and newlines.

2007-07-26 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : > On Jul 25, 8:46 am, [EMAIL PROTECTED] wrote: > >>Hello, >> >>I have a situation where I have a file that contains text similar to: >> >>myValue1 = contents of value1 >>myValue2 = contents of value2 but >>with a new line here >>myValue3 = conten

Re: Why PHP is so much more popular for web-development

2007-07-26 Thread Bruno Desthuilliers
SamFeltus a écrit : > PHP is just a more inclusive community. The PHP community is more > concerned with the casual user and the end user. This is PHP's core > strength, and one of Python's core weaknesses. The Python community > would be wise to adopt PHP's concern for the end user. This asse

Re: Another C API Question

2007-07-26 Thread Robert Kern
beginner wrote: > Hi, > > I run into another C API question. What is the simplest way to convert > an PyObject into a double? > > For example, I have > > PyObject *obj; > > I know obj is a number, but I do not know the exact type. How can I > convert it to double without writing a giant switch

Another C API Question

2007-07-26 Thread beginner
Hi, I run into another C API question. What is the simplest way to convert an PyObject into a double? For example, I have PyObject *obj; I know obj is a number, but I do not know the exact type. How can I convert it to double without writing a giant switch() that exhausts every single type of

Re: automatic type conversion for comparison operators

2007-07-26 Thread Russ
Dan Bishop wrote: > BTW, are you a former Pascal programmer? No. Why do you ask? [The code snippet I wrote was made up to get a point across. I did not actually use that function name in my code.] > > But Python > > somehow compares the function pointer with an integer without > > complaining.

Re: generating objects of a type from a name.

2007-07-26 Thread tsuraan
I'm not sure what a visual object is, but to create an instance of an object whose name is known, you can use "eval": >>> oname = 'list' >>> obj = eval(oname)() >>> obj [] >>> type(obj) Hope that helps! On 26/07/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I'm trying to generate visual p

Re: SQLObject 0.9.1

2007-07-26 Thread Sherm Pendley
Steve Holden <[EMAIL PROTECTED]> writes: > Sherm Pendley wrote: >> Steve Holden <[EMAIL PROTECTED]> writes: >> >>> Sherm Pendley wrote: Gerardo Herzig <[EMAIL PROTECTED]> writes: > So..at 11:23 we got version 0.7.8...at 11:30 was version 0.8.5...now > there is a 0.9.1 version??

Re: code indentation

2007-07-26 Thread Steve Holden
Ben Finney wrote: > Steve Holden <[EMAIL PROTECTED]> writes: > >> We should be making allowances for this particular poster on account >> of relative youth: I hadn't realised earlier, but we are dealing >> with a fourteen-year-old. > > I don't believe that's true. One of the great advantages of d

Re: SQLObject 0.9.1

2007-07-26 Thread Steve Holden
Sherm Pendley wrote: > Steve Holden <[EMAIL PROTECTED]> writes: > >> Sherm Pendley wrote: >>> Gerardo Herzig <[EMAIL PROTECTED]> writes: >>> So..at 11:23 we got version 0.7.8...at 11:30 was version 0.8.5...now there is a 0.9.1 version?? Have a coffe dude >>> Sounds more to me like he ne

Re: code indentation

2007-07-26 Thread Ben Finney
[EMAIL PROTECTED] writes: > here is my failed example of try with string: > > kl="n=90;if n==90:print'kajmakimar'" > > for line in kl.split(";"): > li=[] > m=li.append(line) > if line.endswith(':'): > m.append("\n\t\t\t\t\t\t\t\t") > print m The list.append method re

C API -- Two questions

2007-07-26 Thread beginner
Hi Everyone, I am writing a C extension and encountered two problems. 1) How can I include a description of the arguments? I can include a description string. No problem. But whenever I say help(my_func) it shows the arguments are "... ". However, if a function is defined in python, I will defini

Re: question about math module notation

2007-07-26 Thread Paul Rubin
Dan Bishop <[EMAIL PROTECTED]> writes: > > I was surprised to find that gives an exact (integer, not > > floating-point) answer. Still, I think it's better to say 2**64 > > which also works for (e.g.) 2**1 where math.pow(2,1) > > raises an exception. > > It *is* binary floating point. Po

generating objects of a type from a name.

2007-07-26 Thread chris . lyon
I'm trying to generate visual python objects from django objects and therefore have objects called 'Ring' and 'Cylinder' as django objects and I want to create objects of those names in visual. I can cludge it in varius ways by using dir and lots of if lookups but is there a way of doing this tha

Re: question about math module notation

2007-07-26 Thread Dan Bishop
On Jul 26, 3:59 pm, Paul Rubin wrote: > brad <[EMAIL PROTECTED]> writes: > > Ah yes, that works too... thanks. I've settled on doing it this way: > > print int(math.pow(2,64)) > > I like the added parenthesis :) > > I was surprised to find that gives an exact (integer, no

Re: removing items from a dictionary ?

2007-07-26 Thread Ben Finney
Stef Mientki <[EMAIL PROTECTED]> writes: > I want to remove some items from a dictionary, > so I would expect this should work: > > Nets = {} > ... fill the dictionary Nets > > for net in Nets: > if net.upper() in Eagle_Power_Nets : > del Nets [ net ] Don't change the thing you'

Re: SQLObject 0.9.1

2007-07-26 Thread Sherm Pendley
Steve Holden <[EMAIL PROTECTED]> writes: > Sherm Pendley wrote: >> Gerardo Herzig <[EMAIL PROTECTED]> writes: >> >>> So..at 11:23 we got version 0.7.8...at 11:30 was version 0.8.5...now >>> there is a 0.9.1 version?? Have a coffe dude >> >> Sounds more to me like he needs to lay off the coffee, o

Re: SQLObject 0.9.1

2007-07-26 Thread Steve Holden
Sherm Pendley wrote: > Gerardo Herzig <[EMAIL PROTECTED]> writes: > >> So..at 11:23 we got version 0.7.8...at 11:30 was version 0.8.5...now >> there is a 0.9.1 version?? Have a coffe dude > > Sounds more to me like he needs to lay off the coffee, or at least switch > to decaffeinated for a while

Re: From D

2007-07-26 Thread Ben Finney
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > > The str.split method has no bearing on this discussion, > > It most certainly does. To make '123 456' into an integer, > you split it and then join it. Indeed. Which has nothing to do with the Python syntax for creating a numeric literal in cod

Re: code indentation

2007-07-26 Thread Ben Finney
Steve Holden <[EMAIL PROTECTED]> writes: > We should be making allowances for this particular poster on account > of relative youth: I hadn't realised earlier, but we are dealing > with a fourteen-year-old. I don't believe that's true. One of the great advantages of discussion over the internet i

Re: From D

2007-07-26 Thread Ben Finney
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > So, just as > > >>> int('123' '456') > 123456 > > is not an error, the proposal is that > > >>> a = 123 456 > SyntaxError: invalid syntax > > will not be an error either. More directly: Just as these three statements create the

Re: zip() function troubles

2007-07-26 Thread Paul Rubin
Istvan Albert <[EMAIL PROTECTED]> writes: > exceeded 10 million the zip function slowed to a crawl. Note that > there was memory available to store over 100 million items. How many bytes is that? Maybe the items (heap-allocated boxed integers in your code example) are bigger than you expect. --

Re: Learning Jython?

2007-07-26 Thread Paul Rubin
Matt Bitten <[EMAIL PROTECTED]> writes: > It looks like Jython is for me. That said, I have two questions: > (1) Am I thinking straight here? Or is there some other solution that > a knows-Python-but-not-Java programmer might use? You are thinking of embedding Jython in a web applet? Probably not

Re: automatic type conversion for comparison operators

2007-07-26 Thread Dan Bishop
On Jul 26, 6:22 pm, Russ <[EMAIL PROTECTED]> wrote: > I posted a message on this several days ago, but it apparently got > lost > in googlespace, so I'll try it again. > > I recently discovered a bug in my code that apparently resulted from > the automatic conversion of a function pointer to an int

zip() function troubles

2007-07-26 Thread Istvan Albert
Hello all, I've been debugging the reason for a major slowdown in a piece of code ... and it turns out that it was the zip function. In the past the lists that were zipped were reasonably short, but once the size exceeded 10 million the zip function slowed to a crawl. Note that there was memory av

Re: From D

2007-07-26 Thread Tim Williams
On 26/07/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: >> The str.split method has no bearing on this discussion, > It most certainly does. To make '123 456' into an integer, > you split it and then join it. > >>> z = '123 456' > >>> y = z.split() > >>> x = ''.join(y) > >>> w = int(x) > >>> w

automatic type conversion for comparison operators

2007-07-26 Thread Russ
I posted a message on this several days ago, but it apparently got lost in googlespace, so I'll try it again. I recently discovered a bug in my code that apparently resulted from the automatic conversion of a function pointer to an integer. Say you have a class member function called getCount(),

RE: From D

2007-07-26 Thread Ryan Ginstrom
> On Behalf Of Leo Petr > Digits are grouped in 2s in India and in 4s in China and Japan. This is not entirely true in Japan's case. When written without Japanese characters, Japan employs the same format as the US, for example: 1,000,000 (However, they would read this as 百万 (hyaku man), literall

Learning Jython?

2007-07-26 Thread Matt Bitten
Hi, all. I'm in a situation where I need to be writing a bunch of quick-y (hopefully) self-contained programs that anyone can run from a web page. Java applets are the obvious way to do this. However, I don't know much Java, and, frankly, right now I don't feel much like learning it. I *am* pretty

Re: code indentation

2007-07-26 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: > On 26 srp, 13:43, Steve Holden <[EMAIL PROTECTED]> wrote: >> Thorsten Kampe wrote: >>> * (Wed, 25 Jul 2007 11:22:03 -0700) On 25 srp, 17:31, Wildemar Wildenburger <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: >>> And while we're on the topic of com

Re: is_iterable function.

2007-07-26 Thread Neil Cerutti
On 2007-07-26, George Sakkis <[EMAIL PROTECTED]> wrote: > That's not the only problem; try a string element to see it > break too. More importantly, do you *always* want to handle > strings as iterables ? > > The best general way to do what you're trying to is pass > is_iterable() as an optional ar

Comparing Dictionaries

2007-07-26 Thread Kenneth Love
Hello, I am new to Python, but not programming. I would like to start my Python career by developing programs according to the "best practices" of the industry. Right now, that appears to be unit tests, patterns, and source code control. So, I am trying to write a unit test for some code that

Re: SQLObject 0.9.1

2007-07-26 Thread Sherm Pendley
Gerardo Herzig <[EMAIL PROTECTED]> writes: > So..at 11:23 we got version 0.7.8...at 11:30 was version 0.8.5...now > there is a 0.9.1 version?? Have a coffe dude Sounds more to me like he needs to lay off the coffee, or at least switch to decaffeinated for a while. :-) sherm-- -- Web Hosting b

Re: CSV Issue

2007-07-26 Thread Rohan
On Jul 26, 2:32 pm, John Machin <[EMAIL PROTECTED]> wrote: > On Jul 27, 7:19 am, Rohan <[EMAIL PROTECTED]> wrote: > > > f = open("/home/t/tp/va/e7.csv", "ab") > > a means Append -- you are appending the data that you expect to the > EXISTING contents of the file. Hello John, Yea silly mistake, wri

Re: removing items from a dictionary ?

2007-07-26 Thread Stef Mientki
Paul Rubin wrote: > Stef Mientki <[EMAIL PROTECTED]> writes: >>> for net in Nets.keys(): >>> # Nets.iterkeys() would avoid building the list >>> # but that runs the same risks as your original >>> if net.upper() in in Eagle_Power_Nets : >>> del Nets[net] >>> >> than

Re: SQLObject 0.9.1

2007-07-26 Thread Gerardo Herzig
Oleg Broytmann wrote: >Hello! > >I'm pleased to announce the 0.9.1 release of SQLObject. > > >What is SQLObject >= > >SQLObject is an object-relational mapper. Your database tables are described >as classes, and rows are instances of those classes. SQLObject is meant to be >easy

Re: I am giving up perl because of assholes on clpm -- switching to Python

2007-07-26 Thread brad
James Stroud wrote: > Midway through a semester in college, after a few days (or was it a few > weeks?) of...well...lets just say I was studying real hard...I got lost > on my way to o-chem and wandered into the interior design department by > accident and found what I like to call "the motherlo

Re: CSV Issue

2007-07-26 Thread John Machin
On Jul 27, 7:19 am, Rohan <[EMAIL PROTECTED]> wrote: > f = open("/home/t/tp/va/e7.csv", "ab") a means Append -- you are appending the data that you expect to the EXISTING contents of the file. -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: Snobol 1.0

2007-07-26 Thread John J. Lee
(Sorry if this appears twice, accidentally included c.l.py.announce the first time where it was (correctly) rejected, not sure if that means it didn't get through to c.l.py either). greg <[EMAIL PROTECTED]> writes: > Aahz wrote: >> So adding >> SNOBOL patterns to another library would be a wonder

Re: is_iterable function.

2007-07-26 Thread George Sakkis
On Jul 26, 2:56 pm, Neil Cerutti <[EMAIL PROTECTED]> wrote: > On 2007-07-26, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > > > > > On Thu, 26 Jul 2007 15:02:39 +, Neil Cerutti wrote: > > >> Based on the discussions in this thread (thanks all for your > >> thoughts), I'm settling for: >

CSV Issue

2007-07-26 Thread Rohan
I'm having a trouble consider this import csv f = open("/home/t/tp/va/some7.csv", "rb") reader =csv.reader(f) rows =[] for row in reader: rows.append(row) rows[1].append('1') print rows f = open("/home/t/tp/va/e7.csv", "ab") writer =csv.writer(f) writer.writerows(rows) f.close() In the f

Re: Why PHP is so much more popular for web-development

2007-07-26 Thread Paul Rubin
"Chris Mellon" <[EMAIL PROTECTED]> writes: > Would you make this directory name be the username+the password? If > not, why not? The answer is the same reason why this isn't a reliable > method of security. I would not store plaintext passwords in a database, but that doesn't mean it's security by

Re: I am giving up perl because of assholes on clpm -- switching to Python

2007-07-26 Thread Paul Rubin
John K Masters <[EMAIL PROTECTED]> writes: > As a complete amateur in the world of programming (barring 25 years > programming machine tools in the aerospace industry) I would like to > point out that the more arcane the ['language', 'operating system', > 'application'] the more unfriendly the comm

Re: Why PHP is so much more popular for web-development

2007-07-26 Thread Chris Mellon
On 26 Jul 2007 13:26:33 -0700, Paul Rubin <"http://phr.cx"@nospam.invalid> wrote: > Steve Holden <[EMAIL PROTECTED]> writes: > > > That sounds trivial to ameliorate (at least somewhat) by putting your > > > uploads in a directory whose name is known only to you (let's say it's > > > a random 20-let

Re: I am giving up perl because of assholes on clpm -- switching to Python

2007-07-26 Thread James Stroud
Steve Holden wrote: > Sadly there are too few female members of > either c.l.py or c.l.p.m for it to make much difference. Midway through a semester in college, after a few days (or was it a few weeks?) of...well...lets just say I was studying real hard...I got lost on my way to o-chem and wand

Re: I am giving up perl because of assholes on clpm -- switching to Python

2007-07-26 Thread John K Masters
On 16:33 Thu 26 Jul , brad wrote: > [EMAIL PROTECTED] wrote: > > Python is a better language, with php support, anyway, but I am fed up > > with attitudes of comp.lang.perl.misc. Assholes in this newsgroup ruin > > Perl experience for everyone. Instead of being helpful, snide remarks, > > back-

Re: Any reason why cStringIO in 2.5 behaves different from 2.4?

2007-07-26 Thread Chris Mellon
On 7/26/07, Stefan Scholl <[EMAIL PROTECTED]> wrote: > Stefan Behnel <[EMAIL PROTECTED]> wrote: > > The XML is *not* well-formed if you pass Python unicode instead of a byte > > encoded string. Read the XML spec. > > Pointers, please. > > Last time I read that part of the spec was when a customer's

Re: removing items from a dictionary ?

2007-07-26 Thread Paul Rubin
Stef Mientki <[EMAIL PROTECTED]> writes: > > for net in Nets.keys(): > > # Nets.iterkeys() would avoid building the list > > # but that runs the same risks as your original > > if net.upper() in in Eagle_Power_Nets : > > del Nets[net] > > > thanks Steve, > that does

Re: question about math module notation

2007-07-26 Thread Gary Herron
Stargaming wrote: > On Thu, 26 Jul 2007 15:54:11 -0400, brad wrote: > > >> How does one make the math module spit out actual values without using >> engineer or scientific notation? >> >> I get this from print math.pow(2,64): 1.84467440737e+19 >> >> I want this: >> 18,446,744,073,709,551,616 >>

Re: question about math module notation

2007-07-26 Thread Paul Rubin
brad <[EMAIL PROTECTED]> writes: > Ah yes, that works too... thanks. I've settled on doing it this way: > print int(math.pow(2,64)) > I like the added parenthesis :) I was surprised to find that gives an exact (integer, not floating-point) answer. Still, I think it's better to say 2**64 which als

Cincinnati PUG

2007-07-26 Thread Arlinghaus, Andrea
Hello! I am a recruiter in the area and I am currently looking to fill a Python opportunity. I was wondering if you or anyone you might know would be interested in a job opportunity OR if I could possibly give you the job description to post. I would be happy to give you more information and an

Re: I am giving up perl because of assholes on clpm -- switching toPython

2007-07-26 Thread Hendrik van Rooyen
James Matthews wrote: >Wow! They might leave this newsgroup now also! Would be a pity, somehow - there seems to be a dearth of female posters here ;-) - Hendrik -- http://mail.python.org/mailman/listinfo/python-list

curses/urwid simple menu

2007-07-26 Thread crony
Hello. Could you help me...I need to create application with urwid or curses support. Have you got a pretty simple example with it? -- Pozdrawiam Leszek Miś Nothing is secure, paranoia is your friend. -- http://mail.python.org/mailman/listinfo/python-list

Re: code indentation

2007-07-26 Thread Michael L Torrie
[EMAIL PROTECTED] wrote: > > .so maybe if you can help me with this? If I understand you correctly, you're trying to make a "pretty-printer" in python, right? Something that will take arbitrary python source code, recognize the blocks and so forth, and then emit clean python code (text) with

Re: removing items from a dictionary ?

2007-07-26 Thread Stef Mientki
> > Since it isn't practical to iterate over Eagle_Power_Nets and test for > presence in your Nets dict, you have to iterate over at least the keys > of Nets. You could just iterate over the keys rather than the whole > table, though: > > for net in Nets.keys(): > # Nets.iterkeys() wou

Re: question about math module notation

2007-07-26 Thread brad
Paul Rubin wrote: > print 2**64 Ah yes, that works too... thanks. I've settled on doing it this way: print int(math.pow(2,64)) I like the added parenthesis :) -- http://mail.python.org/mailman/listinfo/python-list

Re: Any reason why cStringIO in 2.5 behaves different from 2.4?

2007-07-26 Thread Stefan Scholl
Stefan Behnel <[EMAIL PROTECTED]> wrote: > The XML is *not* well-formed if you pass Python unicode instead of a byte > encoded string. Read the XML spec. Pointers, please. Last time I read that part of the spec was when a customer's consulting company switched to ISO-8859-15 without saying someth

Re: I am giving up perl because of assholes on clpm -- switching to Python

2007-07-26 Thread Paul Rubin
M brad <[EMAIL PROTECTED]> writes: > Out of the pan and into the fire. :) Welcome to the world of Ph.D's in > Computer Science. You think the Perl guys have attitude, just wait and > see what you're in for over here. I think you'll find attitudes in any > programming language... just different type

Re: I am giving up perl because of assholes on clpm -- switching to Python

2007-07-26 Thread brad
[EMAIL PROTECTED] wrote: > Python is a better language, with php support, anyway, but I am fed up > with attitudes of comp.lang.perl.misc. Assholes in this newsgroup ruin > Perl experience for everyone. Instead of being helpful, snide remarks, > back-biting, scare tactings, and so on proliferate an

Re: question about math module notation

2007-07-26 Thread Paul Rubin
brad <[EMAIL PROTECTED]> writes: > 18,446,744,073,709,551,616 > > I'm lazy... I don't want to convert it manually :) print 2**64 -- http://mail.python.org/mailman/listinfo/python-list

Re: pyparser and recursion problem

2007-07-26 Thread Neil Cerutti
On 2007-07-26, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Using pyparser, I'm trying to parse a string like this: > >:Start: first SECOND THIRD :SECOND: second1 | second2 :THIRD: third1 | > FOURTH :FOURTH: fourth1 | fourth2 > > I want the parser to do the following: > 1) Get the text for the :

Re: I am giving up perl because of assholes on clpm -- switching to Python

2007-07-26 Thread David Formosa (aka ? the Platypus)
["Followup-To:" header set to comp.lang.perl.misc.] On Thu, 26 Jul 2007 09:38:34 -0700, Paul Boddie <[EMAIL PROTECTED]> wrote: [...] > you'd show off your community a bit > better by entertaining even the most naive questions - people have to > start somewhere, you know. However asking a good qu

Re: Why PHP is so much more popular for web-development

2007-07-26 Thread Paul Rubin
Steve Holden <[EMAIL PROTECTED]> writes: > > That sounds trivial to ameliorate (at least somewhat) by putting your > > uploads in a directory whose name is known only to you (let's say it's > > a random 20-letter string). The parent directory can be protected to > > not allow reading the subdirect

Re: question about math module notation

2007-07-26 Thread brad
Stargaming wrote: > Explicitly converting it to `int` works for me. (Without the 3-digit- > block notation, of course.) Thank you! -- http://mail.python.org/mailman/listinfo/python-list

Re: question about math module notation

2007-07-26 Thread Stargaming
On Thu, 26 Jul 2007 15:54:11 -0400, brad wrote: > How does one make the math module spit out actual values without using > engineer or scientific notation? > > I get this from print math.pow(2,64): 1.84467440737e+19 > > I want this: > 18,446,744,073,709,551,616 > > I'm lazy... I don't want to c

question about math module notation

2007-07-26 Thread brad
How does one make the math module spit out actual values without using engineer or scientific notation? I get this from print math.pow(2,64): 1.84467440737e+19 I want this: 18,446,744,073,709,551,616 I'm lazy... I don't want to convert it manually :) -- http://mail.python.org/mailman/listinfo/

pyparser and recursion problem

2007-07-26 Thread pyscottishguy
Hi, Using pyparser, I'm trying to parse a string like this: :Start: first SECOND THIRD :SECOND: second1 | second2 :THIRD: third1 | FOURTH :FOURTH: fourth1 | fourth2 I want the parser to do the following: 1) Get the text for the :Start: label e.g ('first SECOND THIRD') 2) Do nothing with the l

Re: Fwd: I am giving up perl because of assholes on clpm -- switching to Python

2007-07-26 Thread Kay Schluehr
On Jul 26, 8:18 pm, jed drury <[EMAIL PROTECTED]> wrote: > Hey, Perl's new motto is "There is more than 1 way to > be an ASSHOLE!" Do you think the unique asshole constraint feels more natural? I tend to agree. -- http://mail.python.org/mailman/listinfo/python-list

Re: removing items from a dictionary ?

2007-07-26 Thread Alex Popescu
Stef Mientki <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > hello, > > I want to remove some items from a dictionary, > so I would expect this should work: > >Nets = {} >... fill the dictionary Nets > >for net in Nets: > if net.upper() in Eagle_Power_Nets : >de

Re: From D

2007-07-26 Thread Kay Schluehr
On Jul 25, 7:22 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On Jul 24, 6:08 pm, Steven D'Aprano > > > > <[EMAIL PROTECTED]> wrote: > > On Tue, 24 Jul 2007 20:09:00 +0200, Bjoern Schliessmann wrote: > > > Stargaming wrote: > > >> On Tue, 24 Jul 2007 03:19:53 -0700, bearophileHUGS wrote: > >

Re: removing items from a dictionary ?

2007-07-26 Thread martyw
Stef Mientki wrote: > hello, > > I want to remove some items from a dictionary, > so I would expect this should work: > > Nets = {} > ... fill the dictionary Nets > > for net in Nets: > if net.upper() in Eagle_Power_Nets : > del Nets [ net ] > > > But it gives me > MessageF

Re: removing items from a dictionary ?

2007-07-26 Thread Steve Holden
Stef Mientki wrote: > hello, > > I want to remove some items from a dictionary, > so I would expect this should work: > >Nets = {} >... fill the dictionary Nets > >for net in Nets: > if net.upper() in Eagle_Power_Nets : >del Nets [ net ] > > > But it gives me > Message

Re: code indentation

2007-07-26 Thread vedrandekovic
On 26 srp, 13:43, Steve Holden <[EMAIL PROTECTED]> wrote: > Thorsten Kampe wrote: > > * (Wed, 25 Jul 2007 11:22:03 -0700) > >> On 25 srp, 17:31, Wildemar Wildenburger <[EMAIL PROTECTED]> wrote: > >>> [EMAIL PROTECTED] wrote: > > And while we're on the topic of communication: The original poste

encode/decode misunderstanding

2007-07-26 Thread Tim Arnold
Hi, I'm beginning to understand the encode/decode string methods, but I'd like confirmation that I'm still thinking in the right direction: I have a file of latin1 encoded text. Let's say I put one line of that file into a string variable 'tocline', as follows: tocline = 'Ficha Datos de p\xe9rdi

removing items from a dictionary ?

2007-07-26 Thread Stef Mientki
hello, I want to remove some items from a dictionary, so I would expect this should work: Nets = {} ... fill the dictionary Nets for net in Nets: if net.upper() in Eagle_Power_Nets : del Nets [ net ] But it gives me Message File Name LinePosition Traceback

Re: Fwd: I am giving up perl because of assholes on clpm -- switching to Python

2007-07-26 Thread Steve Holden
jed drury wrote: > Hey, Perl's new motto is "There is more than 1 way to > be an ASSHOLE!" As you have just demonstrated. regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC/Ltd http://www.holdenweb.com Skype: holdenweb http://del.icio.us/steve.

Re: Why PHP is so much more popular for web-development

2007-07-26 Thread Steve Holden
Paul Rubin wrote: > Jeffrey Froman <[EMAIL PROTECTED]> writes: >> Consider a PHP-based CMS that allows users to upload files. Because the >> application runs as the webserver user, uploaded files, and the directory >> where they reside, must be accessible and writable by that user. It is the >> sam

  1   2   >