Re: how to proccess the blank in the path on linux

2008-05-22 Thread TheSaint
On 22:26, mercoledì 21 maggio 2008 zhf wrote: > I want ro walk a directory and its sub directory on linux os.path.walk() should do the job. Recursively you should try this, which I found on some web site: 8<-8<-8<-8<-8<-8<- def file_find(folder, f

Re: simple way to touch a file if it does not exist

2008-05-22 Thread Marc 'BlackJack' Rintsch
On Wed, 21 May 2008 17:56:38 -0700, bukzor wrote: > On May 21, 5:37 pm, Nikhil <[EMAIL PROTECTED]> wrote: > >> if os.path.exists('file'): >> open('file', 'w').close() >> >> Right? > > You only want to blank it if it exists? If it doesn't exist you won't > create it. > The .close() is supe

Need help on Soappy

2008-05-22 Thread Shanmuga Rajan
I am developing a application using webservices. I am using Soappy. When i tried to start reading some wsdl files from web service server then i got the following error. Can any one please help me with this. >>> >>> >>> from SOAPpy import WSDL >>> wsdlFile = 'http://192.168.1.81/sdk/vim.wsdl' >>

Re: Bit of List replacing trouble (newbie)

2008-05-22 Thread Bruno Desthuilliers
Zethex a écrit : At the moment i'm doing a piece of work for school and I'm stuck at the moment. I have a list of words, for example: Sentence = ['A', 'dog', 'walked', 'across', 'the', 'street'] Naming convention : variable names are all_lower, so s/Sentence/sentence/ I have another list

Re: Returning to 'try' block after catching an exception

2008-05-22 Thread Duncan Booth
bukzor <[EMAIL PROTECTED]> wrote: > On May 21, 4:33 pm, Karlo Lozovina <[EMAIL PROTECTED]> wrote: >> André <[EMAIL PROTECTED]> wrote >> innews:a9913f2d-0c1a-4492-bf58-5c7 > [EMAIL PROTECTED]: >> >> > How about something like the following (untested) >> >> > done = False >> > while not done: >> >

Re: Publish a program

2008-05-22 Thread python
> appreciate somebody to join and put new views on this project Send us a link to one of the sites with your code, eg. http://python.pastebin.com Malcolm -- http://mail.python.org/mailman/listinfo/python-list

Cython code generation for Py3 complete

2008-05-22 Thread Stefan Behnel
Hi, just a quick announcement that I finished the port of the Cython compiler to the Py3 target platform. While you cannot currently run Cython itself in Py3, you can build the generated C sources unchanged under Py2.3 through 3.0a5. http://cython.org/ There isn't a release yet (though there

Re: Returning to 'try' block after catching an exception

2008-05-22 Thread Karlo Lozovina
alex23 <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > If you know what exception to expect, and you know how to "fix" the > cause, why not just put tests _before_ some_function() is called to > ensure that everything is as it needs to be? Because when you expect exception to occur on som

Re: Returning to 'try' block after catching an exception

2008-05-22 Thread Karlo Lozovina
Duncan Booth <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > Catching only the specific exceptions you think you can handle would > be more Pythonic: that way things like sys.exit() will still work > inside some_function. I know, this was just a somewhat poorly example ;). > I prefer

Re: Returning to 'try' block after catching an exception

2008-05-22 Thread Jake Anderson
alex23 wrote: On May 22, 9:13 am, Karlo Lozovina <[EMAIL PROTECTED]> wrote: In case it's not clear what I meant: after executing some_function() exception SomeExcpetion gets risen. Then, in except block I do something to fix whatever is causing the exception and then I would like to go back t

Re: HTMLParser error

2008-05-22 Thread jonbutler88
On May 22, 2:40 am, alex23 <[EMAIL PROTECTED]> wrote: > On May 22, 8:18 am, [EMAIL PROTECTED] wrote: > > > Sorry, im new to both python and newsgroups, this is all pretty > > confusing. So I need a line in my __init__ function of my class? The > > spider class I made inherits from HTMLParser. Its j

Re: Python and Flaming Thunder

2008-05-22 Thread Duncan Booth
Torsten Bronger <[EMAIL PROTECTED]> wrote: Read data from "input.txt". If data is an error then go to ... >>> >>> Arf ! A goto ! >> >> You are surely aware of the fact that the C source of python also uses >> goto at tons of places. Is that Arf! too? > > In the hands of a skil

Re: Returning to 'try' block after catching an exception

2008-05-22 Thread alex23
On May 22, 6:15 pm, Karlo Lozovina <[EMAIL PROTECTED]> wrote: > Because when you expect exception to occur on something like 0.01% of > cases, and you have 4 or 5 exceptions and the code to test for each > conditions that cause exceptions is quite long and burried deep inside > some other code it's

Re: Python and Flaming Thunder

2008-05-22 Thread Bruno Desthuilliers
Daniel Fetchinson a écrit : Or just: If command is "quit" ... Hmmm. In Flaming Thunder, I'm using "is" (and "is an", "is a", etc) for assigning and checking types. For example, to read data from a file and check for errors: Read data from "input.txt". If data is an error then go to

Re: Showing the method's class in expection's traceback

2008-05-22 Thread Bruno Desthuilliers
Agustin Villena a écrit : And not that useful - why would one care about the function being defined in class X or Y when one have the exact file and line ? I have 3 reasons: 1) My developing time is expended running unit tests and browsing tracebacks to find which is the real problem. Knowing

Re: HTMLParser error

2008-05-22 Thread alex23
On May 22, 6:22 pm, [EMAIL PROTECTED] wrote: > Still getting very odd errors though, this being the latest: > > Traceback (most recent call last): > File "spider.py", line 38, in > [...snip...] > raise InvalidURL("nonnumeric port: '%s'" % host[i+1:]) > httplib.InvalidURL: nonnumeric port: ''

Re: Bug in floating-point addition: is anyone else seeing this?

2008-05-22 Thread Ross Ridge
Henrique Dante de Almeida <[EMAIL PROTECTED]> wrote: > Finally (and the answer is obvious). 387 breaks the standards and >doesn't use IEEE double precision when requested to do so. Actually, the 80387 and the '87 FPU in all other IA-32 processors do use IEEE 745 double-precision arithmetic when r

Re: writing python extensions in assembly

2008-05-22 Thread James A. Donald
On Fri, 16 May 2008 11:21:39 -0400, "inhahe" <[EMAIL PROTECTED]> wrote: > They say that the C++ optimizer can usually optimize > better than a person coding in assembler by hand can, > but I just can't believe that, at least for me, > because when I code in assembler, if one hand compiles C++

Re: C-like assignment expression?

2008-05-22 Thread Antoon Pardon
On 2008-05-21, Diez B. Roggisch <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > >> On May 21, 1:47 pm, Hrvoje Niksic <[EMAIL PROTECTED]> wrote: >> >>> Although that solution is pretty, it is not the canonical solution >>> because it doesn't cover the important case of "if" bodies needing t

Re: Bug in floating-point addition: is anyone else seeing this?

2008-05-22 Thread Diez B. Roggisch
Dave Parker wrote: > On May 21, 7:01 pm, Carl Banks <[EMAIL PROTECTED]> wrote: >> The crucial thing is not to slow down the calculations with useless >> bells and whistles. > > Are you running your simulations on a system that does or does not > support the "useless bell and whistle" of correct r

Re: Bug in floating-point addition: is anyone else seeing this?

2008-05-22 Thread Iain King
On May 22, 1:14 am, bukzor <[EMAIL PROTECTED]> wrote: > On May 21, 3:28 pm, Dave Parker <[EMAIL PROTECTED]> wrote: > > > On May 21, 4:21 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > > > > Which is exactly what the python decimal module does. > > > Thank you (and Jerry Hill) for pointing that

merging the global namespaces of two modules

2008-05-22 Thread Fabrizio Pollastri
Hi, just an import problem: a program imports two modules, modA and modB, each module do not known anything about the other module (i.e. no cross imports in them), both modules needs to refer to some functions that are defined in the global namespace of the other module. There is a possible so

Re: simple way to touch a file if it does not exist

2008-05-22 Thread Ken Starks
After os.path.exists, you need to check it _is_ a file, and not a directory. Giampaolo Rodola' wrote: On 22 Mag, 01:15, Nikhil <[EMAIL PROTECTED]> wrote: what are the simple ways? I could think of os.open(), os.exec(touch file) are there any simpler methods? Just use os.path.exists to check

Sort contents of a file By date

2008-05-22 Thread Zaid Anwer
Hi, I have a query :- Is there any command or link that could help me to sort the content of a file by date. File has couple of thousands lines every line starts with timestamp(Date,Time) and then Log information. It has some duplicate lines as well that has only timestamps same, I want to remo

wsdl2py throwing error while creating client side code

2008-05-22 Thread Shan
I am developing an application using web services in python (ZSI Zolera Sopa Infrastructure) I am trying to create client side code of the wsdl file in the web service using wsdl2py. But i ended with an error from wsdl2py Here is the code [EMAIL PROTECTED] wsdl]$ wsdl2py -b -f vimService.wsdl

Re: ?

2008-05-22 Thread Ruediger
Paul Hankin wrote: > This is better written using takewhile... > itertools.takewhile(lambda x: x != value, iterable) > > But if you really need to reinvent the wheel, perhaps this is simpler? > > def test(iterable, value, op=operator.ne): > for x in iterable: > if not op(x, value):

Re: Showing the method's class in expection's traceback

2008-05-22 Thread Duncan Booth
Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > Not to say that your concerns are pointless, and that things cannot be > improved somehow, but this is not that trivial, and there may be > ambuiguities in some not so rare cases. It might be worth considering an alternative approach here: a form

Re: Bug in floating-point addition: is anyone else seeing this?

2008-05-22 Thread Diez B. Roggisch
> > This person who started this thread posted the calculations showing > that Python was doing the wrong thing, and filed a bug report on it. > > If someone pointed out a similar problem in Flaming Thunder, I would > agree that Flaming Thunder was doing the wrong thing. > > I would fix the prob

Re: "indexed properties"...

2008-05-22 Thread David C. Ullrich
On Wed, 21 May 2008 12:47:44 +0200, pataphor <[EMAIL PROTECTED]> wrote: >On Tue, 20 May 2008 10:40:17 -0500 >"David C. Ullrich" <[EMAIL PROTECTED]> wrote: > >> > > Today's little joke: Long ago I would have solved >> > > this by storing the data as a list of rows and _also_ >> > > a list of column

Re: How do I know when all threads are done?

2008-05-22 Thread Christian Heimes
Zerge schrieb: > I can launch threads just fine, but then I have to do a time.sleep(n) > so the main thread from which they where launched will wait for all > the threads to return. > > How can I detect when all threads are done and then return control to > the main threads? import threading thr

Re: wsdl2py throwing error while creating client side code

2008-05-22 Thread Jeff
Looks to me like you have the incorrect version of ZSI installed. -- http://mail.python.org/mailman/listinfo/python-list

Re: merging the global namespaces of two modules

2008-05-22 Thread Jeff
Can you be more specific? modA and modB don't import from each other but both need to access objects in the global namespace of what module? The controlling application? Or do you mean that, for example, modA needs to access some functions in modB, but does not have import statements to do so, a

Re: Python and Flaming Thunder

2008-05-22 Thread s0suk3
On May 21, 10:34 am, Dave Parker <[EMAIL PROTECTED]> wrote: > On May 20, 7:05 pm, Collin <[EMAIL PROTECTED]> wrote: > > > Personally, FT is a bit meh to me. The way you issue your statements I > > always think something is wrong, mainly because when I want to define, > > say, x, in python I'd go: >

Re: merging the global namespaces of two modules

2008-05-22 Thread Fabrizio Pollastri
Jeff wrote: Can you be more specific? modA and modB don't import from each other but both need to access objects in the global namespace of what module? The controlling application? Or do you mean that, for example, modA needs to access some functions in modB, but does not have import statem

Re: merging the global namespaces of two modules

2008-05-22 Thread Bruno Desthuilliers
Fabrizio Pollastri a écrit : Hi, just an import problem: a program imports two modules, modA and modB, each module do not known anything about the other module (i.e. no cross imports in them), both modules needs to refer to some functions that are defined in the global namespace of the other

Re: Python and Flaming Thunder

2008-05-22 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : (snip) Maybe if I have a kid someday I'll teach him Flaming Thunder! (just kidding, you prick). Err... Could we please avoid name calling, gentlemens ? -- http://mail.python.org/mailman/listinfo/python-list

ANN: Wing IDE 3.1.1 released

2008-05-22 Thread Wingware
Hi, Wingware has released version 3.1.1 of Wing IDE. This bug fix release is available for all three product levels of Wing IDE. *Release Highlights* This release includes the following: * Template tool properly supports 2nd+ like-named fields * Several VI mode improvements * Replace in selec

Re: can someone with guessing a number

2008-05-22 Thread abhilash pp
Gary, There is a problem in using this sys.exit() if you are working in windows IDLE, then it will ask you for an 'exit altogether' so either change your 'while' clause or restructure your whole program to fit your idea :-) to avoid failed and success messages together cheers , abhilash On Wed

Re: simple way to touch a file if it does not exist

2008-05-22 Thread Giampaolo Rodola'
On 22 Mag, 11:54, Ken Starks <[EMAIL PROTECTED]> wrote: > After os.path.exists, you need to check it _is_ a > file, and not a directory. > > > > Giampaolo Rodola' wrote: > > On 22 Mag, 01:15, Nikhil <[EMAIL PROTECTED]> wrote: > >> what are the simple ways? > >> I could think of os.open(), os.exec(t

Re: "indexed properties"...

2008-05-22 Thread pataphor
On Thu, 22 May 2008 06:26:41 -0500 David C. Ullrich <[EMAIL PROTECTED]> wrote: > On Wed, 21 May 2008 12:47:44 +0200, pataphor <[EMAIL PROTECTED]> > wrote: > >Using the trick of encapsulating the values inside single-element > >lists one can make a transposition of the matrix and get > >synchronici

Loading contents behind the scenes

2008-05-22 Thread s0suk3
Hi, I wanted to know how cautious it is to do something like: f = file("filename", "rb") f.read() for a possibly huge file. When calling f.read(), and not doing anything with the return value, what is Python doing internally? Is it loading the content of the file into memory (regardless of whethe

problem boost::python::import

2008-05-22 Thread Frédéric Degraeve
Hello, I tried this code with vs7-8 and boost1.34.1-1.35.0 and my python is a 2.4. The call to Cpython works well but boost::python doesn't work. I've got an exception about an access violation reading location 0x. help, please? thank you. Frédéric #include "stdafx.h" #include #includ

Re: merging the global namespaces of two modules

2008-05-22 Thread Diez B. Roggisch
Fabrizio Pollastri wrote: > Jeff wrote: >> Can you be more specific? modA and modB don't import from each other >> but both need to access objects in the global namespace of what >> module? The controlling application? > >> Or do you mean that, for >> example, modA needs to access some function

Re: Loading contents behind the scenes

2008-05-22 Thread A.T.Hofkamp
On 2008-05-22, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hi, I wanted to know how cautious it is to do something like: > > f = file("filename", "rb") > f.read() > > for a possibly huge file. When calling f.read(), and not doing > anything with the return value, what is Python doing internally?

Re: Loading contents behind the scenes

2008-05-22 Thread s0suk3
On May 22, 8:51 am, "A.T.Hofkamp" <[EMAIL PROTECTED]> wrote: > On 2008-05-22, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > Hi, I wanted to know how cautious it is to do something like: > > > f = file("filename", "rb") > > f.read() > > > for a possibly huge file. When calling f.read(), and not

Re: Loading contents behind the scenes

2008-05-22 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > On May 22, 8:51 am, "A.T.Hofkamp" <[EMAIL PROTECTED]> wrote: >> On 2008-05-22, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: >> >> > Hi, I wanted to know how cautious it is to do something like: >> >> > f = file("filename", "rb") >> > f.read() >> >> > for a possibly huge

Re: persistent deque version 4

2008-05-22 Thread inhahe
"inhahe" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > 4. can someone tell me if the way i'm using the decorator is sane? i've > never used decorators before. it just seems ridiculous to a) define a > lambda that just throws away the parameter, and b) define a meaningless >

Re: Bug in floating-point addition: is anyone else seeing this?

2008-05-22 Thread Mark Dickinson
On May 22, 5:09 am, Ross Ridge <[EMAIL PROTECTED]> wrote: > Henrique Dante de Almeida  <[EMAIL PROTECTED]> wrote: > > > Finally (and the answer is obvious). 387 breaks the standards and > >doesn't use IEEE double precision when requested to do so. > > Actually, the 80387 and the '87 FPU in all othe

Re: Bug in floating-point addition: is anyone else seeing this?

2008-05-22 Thread Mark Dickinson
On May 22, 6:57 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > > > I wonder how you would accomplish that, given that there is no fix. > > http://hal.archives-ouvertes.fr/hal-00128124 > > Diez For anyone still following the discussion, I highly recommend the above mentioned paper; I found it

Re: Showing the method's class in expection's traceback

2008-05-22 Thread Agustin Villena
On May 22, 5:19 am, Bruno Desthuilliers wrote: > Agustin Villena a écrit : > > >> And not that useful - why would one care about the function being > >> defined in class X or Y when one have the exact file and line ? > > > I have 3 reasons: > > > 1) My developing time is expended running unit test

Re: php vs python

2008-05-22 Thread Nick Craig-Wood
Damon Getsman <[EMAIL PROTECTED]> wrote: > PHP has great support for accessing a MySQL database, Actually I'd say PHP's mysql support is lacking a very important feature. mysql_query() doesn't support parameters (or placeholders, usually '?') which means that unless you use mysql_real_escape_str

Re: Python and Flaming Thunder

2008-05-22 Thread Nick Craig-Wood
Dave Parker <[EMAIL PROTECTED]> wrote: > But after getting input from children and teachers, etc, it started > feeling right. > > For example, consider the two statements: > > x = 8 > x = 10 > > The reaction from most math teachers (and kids) was "one of those is > wrong because

Re: Showing the method's class in expection's traceback

2008-05-22 Thread Tim Golden
Agustin Villena wrote: I don't see things like you, because I'm accustomed to design my software though classes and see the code in an "object = software's functional atom/component" way I agree that python's dynamic nature make things complicated here, but for me it its just an implementation pr

Re: Publish a program

2008-05-22 Thread TheSaint
On 22:32, mercoledì 21 maggio 2008 [EMAIL PROTECTED] wrote: >> appreciate somebody to join and put new views on this project > > Send us a link to one of the sites with your code, eg. > http://python.pastebin.com Thank you! Go to : http://it.geocities.com/call_me_not_now/index.html -- http://ma

Re: Publish a program

2008-05-22 Thread TheSaint
On 10:48, giovedì 22 maggio 2008 alex23 wrote: > Have you thought about putting the full project somewhere like > http://code.google.com/ ? Greatly apreciated your suggestion, unfortunately I saw it a bit late ;) My project is available at http://it.geocities.com/call_me_not_now/index.html I li

Re: problem boost::python::import

2008-05-22 Thread brad
Frédéric Degraeve wrote: Hello, I tried this code with vs7-8 and boost1.34.1-1.35.0 and my python is a 2.4.. Try the boost users list: To subscribe or unsubscribe via the World Wide Web, visit http://lists.boost.org/mailman/listinfo.cgi/boost-users -- http://mail.python.org/mailman/lis

Books for learning how to write "big" programs

2008-05-22 Thread duli
Hi: I would like recommendations for books (in any language, not necessarily C++, C, python) which have walkthroughs for developing a big software project ? So starting from inception, problem definition, design, coding and final delivery on a single theme or application. Most of the code I have w

Re: Showing the method's class in expection's traceback

2008-05-22 Thread Bruno Desthuilliers
Agustin Villena a écrit : On May 22, 5:19 am, Bruno Desthuilliers wrote: Agustin Villena a écrit : And not that useful - why would one care about the function being defined in class X or Y when one have the exact file and line ? I have 3 reasons: 1) My developing time is expended running uni

Restarting a program

2008-05-22 Thread Geoldr
Hello all, I have written a simple program, and at the end of it, instead of it closing I would like it to restart from the beggining. Is there a way to do this? Put my code into a class function, or something? I guess I could do a while loop, but I think if there is a way to run my code if it's in

Re: Struct usage and varying sizes of h, l, etc

2008-05-22 Thread Ethan Furman
John Machin wrote: Robert Kern wrote: Ethan Furman wrote: Greetings, I'm looking at the struct module for binary packing of ints and floats. The documentation refers to C datatypes. It's been many years since I looked at C, but I seem to remember that the data type sizes were not fixed

Re: conventions/requirements for 'is' vs '==', 'not vs '!=', etc

2008-05-22 Thread inhahe
>Ma: Symbolic identity is a mathematical relation >Mb: Symbols are acausal >m: Matter is causal >C: Symbolic identity is not defined on matter. What is defined on matter then? You're saying all symbolism is not defined on matter. Much of our thinking about the world itself is symbolic. How do

Python is slow

2008-05-22 Thread cm_gui
Python is slow.Almost all of the web applications written in Python are slow. Zope/Plone is slow, sloow, so very slooow. Even Google Apps is not faster. Neither is Youtube. Facebook and Wikipedia (Mediawiki), written in PHP, are so much faster than Python. Okay, they probably use caching o

Re: php vs python

2008-05-22 Thread notbob
On 2008-05-22, Larry Bates <[EMAIL PROTECTED]> wrote: > Check out the Pylons blog tutorial. You will have a simple blog up and > running > in less than 30 minutes and have a platform to extend it with as much > functionality as you want later on. > > Larry Bates > > Pylons blog tutorial: > > h

Re: conventions/requirements for 'is' vs '==', 'not vs '!=', etc

2008-05-22 Thread inhahe
"inhahe" <[EMAIL PROTECTED]> wrote in message news:... > >Ma: Symbolic identity is a mathematical relation >>Mb: Symbols are acausal >>m: Matter is causal >>C: Symbolic identity is not defined on matter. > I do think though that a computer languages claiming operations on 'identity', as vis a vi

Re: conventions/requirements for 'is' vs '==', 'not vs '!=', etc

2008-05-22 Thread inhahe
"inhahe" <[EMAIL PROTECTED]> wrote in message news:... > > "inhahe" <[EMAIL PROTECTED]> wrote in message news:... >> >Ma: Symbolic identity is a mathematical relation >>>Mb: Symbols are acausal >>>m: Matter is causal >>>C: Symbolic identity is not defined on matter. >> > > I do think though that a

Re: Markov Analysis Help

2008-05-22 Thread Andrew Lee
dave wrote: Hi Guys, I've written a Markov analysis program and would like to get your comments on the code As it stands now the final input comes out as a tuple, then list, then tuple. Something like ('the', 'water') ['us'] ('we', 'took')..etc... I'm still learning so I don't know any ad

Why is math.pi slightly wrong?

2008-05-22 Thread Dutton, Sam
I've noticed that the value of math.pi -- just entering it at the interactive prompt -- is returned as 3.1415926535897931, whereas (as every pi-obsessive knows) the value is 3.1415926535897932... (Note the 2 at the end.) Is this a precision issue, or from the underlying C, or something else? Ho

Re: php vs python

2008-05-22 Thread notbob
On 2008-05-21, Paul Rubin wrote: > Knowing lots of languages is good for you. php is probably your > quickest route to getting a rudimentary web app running. Python > is a longer term project. Do both. Good advice. Thank you. nb -- http://mail.python.org/mailman/listinfo/python-list

Re: Python and Flaming Thunder

2008-05-22 Thread Mensanator
On May 22, 10:30 am, Nick Craig-Wood <[EMAIL PROTECTED]> wrote: > Dave Parker <[EMAIL PROTECTED]> wrote: > >  But after getting input from children and teachers, etc, it started > >  feeling right. > > >  For example, consider the two statements: > > >       x = 8 > >       x = 10 > > >  The reacti

Re: Python is slow

2008-05-22 Thread Mike Driscoll
On May 22, 11:14 am, cm_gui <[EMAIL PROTECTED]> wrote: > Python is slow.    Almost all of the web applications written in > Python are slow.   Zope/Plone is slow, sloow, so very slooow.  Even > Google Apps is not faster.   Neither is Youtube. > Facebook and Wikipedia (Mediawiki), written in PHP, ar

Re: Loading contents behind the scenes

2008-05-22 Thread MRAB
On May 22, 3:20 pm, [EMAIL PROTECTED] wrote: > On May 22, 8:51 am, "A.T.Hofkamp" <[EMAIL PROTECTED]> wrote: > > > > > On 2008-05-22, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > > Hi, I wanted to know how cautious it is to do something like: > > > > f = file("filename", "rb") > > > f.read() >

Re: Restarting a program

2008-05-22 Thread Mike Driscoll
On May 22, 10:59 am, Geoldr <[EMAIL PROTECTED]> wrote: > Hello all, I have written a simple program, and at the end of it, > instead of it closing I would like it to restart from the beggining. > Is there a way to do this? Put my code into a class function, or > something? > I guess I could do a wh

Re: Why is math.pi slightly wrong?

2008-05-22 Thread Jerry Hill
On Thu, May 22, 2008 at 12:32 PM, Dutton, Sam <[EMAIL PROTECTED]> wrote: > I've noticed that the value of math.pi -- just entering it at the interactive > prompt -- is returned as 3.1415926535897931, whereas (as every pi-obsessive > knows) the value is 3.1415926535897932... (Note the 2 at the end

Re: Python is slow

2008-05-22 Thread Dan Upton
On Thu, May 22, 2008 at 12:14 PM, cm_gui <[EMAIL PROTECTED]> wrote: > Python is slow.Almost all of the web applications written in > Python are slow. Zope/Plone is slow, sloow, so very slooow. Even > Google Apps is not faster. Neither is Youtube. > Facebook and Wikipedia (Mediawiki), writt

Re: Why is math.pi slightly wrong?

2008-05-22 Thread inhahe
"Dutton, Sam" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I've noticed that the value of math.pi -- just entering it at the > interactive prompt -- is returned as 3.1415926535897931, whereas (as every > pi-obsessive knows) the value is 3.1415926535897932... (Note the 2 at the

Re: Why is math.pi slightly wrong?

2008-05-22 Thread inhahe
"Dutton, Sam" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I've noticed that the value of math.pi -- just entering it at the > interactive prompt -- is returned as 3.1415926535897931, whereas (as every > pi-obsessive knows) the value is 3.1415926535897932... (Note the 2 at the

Re: List of disk drives on Windows?

2008-05-22 Thread Bob Greschke
On 2008-05-20 13:18:08 -0600, Bob Greschke <[EMAIL PROTECTED]> said: This MUST have been asked before, but I can't seem to Google the right thing.  How can I get a list of drives on a Windows box, like ["C:\", "D:\"], like I can if I do something like listdir("/Volumes") on a Mac? Thanks! Bo

Re: Why is math.pi slightly wrong?

2008-05-22 Thread Mark Dickinson
On May 22, 12:32 pm, "Dutton, Sam" <[EMAIL PROTECTED]> wrote: > I've noticed that the value of math.pi -- just entering it at the interactive > prompt -- is returned as 3.1415926535897931, whereas (as every pi-obsessive > knows) the value is 3.1415926535897932... (Note the 2 at the end.) > There

Re: Python is slow

2008-05-22 Thread inhahe
I don't get what the issue is between sites that use Python and being slow, if there is one, because there's a website online that shows the results of a dozen or so benchmarks when comparing any two languages. Python beats PHP in almost all the benchmarks. (it also beats almost all the other

Re: Bug in floating-point addition: is anyone else seeing this?

2008-05-22 Thread Henrique Dante de Almeida
On May 22, 6:09 am, Ross Ridge <[EMAIL PROTECTED]> wrote: > Henrique Dante de Almeida  <[EMAIL PROTECTED]> wrote: > > > Finally (and the answer is obvious). 387 breaks the standards and > >doesn't use IEEE double precision when requested to do so. > > Actually, the 80387 and the '87 FPU in all othe

Re: Python is slow

2008-05-22 Thread Jason Scheirer
On May 22, 9:14 am, cm_gui <[EMAIL PROTECTED]> wrote: > Python is slow.    Almost all of the web applications written in > Python are slow.   Zope/Plone is slow, sloow, so very slooow.  Even > Google Apps is not faster.   Neither is Youtube. > Facebook and Wikipedia (Mediawiki), written in PH

import X vs from x import *

2008-05-22 Thread notnorwegian
import Tkinter from Tkinter import * i have a program where if i comment out either of those import- statements i get an error. i thought they meant the same thing and from was supposed to be just to imort just a specific function and the * imports everything in the module. but aparently the abov

Re: Books for learning how to write "big" programs

2008-05-22 Thread Kurt Smith
On Thu, May 22, 2008 at 10:55 AM, duli <[EMAIL PROTECTED]> wrote: > Hi: > I would like recommendations for books (in any language, not > necessarily C++, C, python) which have walkthroughs for developing > a big software project ? So starting from inception, problem > definition, design, coding and

Re: import X vs from x import *

2008-05-22 Thread inhahe
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > import Tkinter > from Tkinter import * > > i have a program where if i comment out either of those import- > statements i get an error. > > i thought they meant the same thing and from was supposed to be just > to imort just a specific

Re: Code For Five Threads To Process Multiple Files?

2008-05-22 Thread tdahsu
On May 21, 11:41 am, [EMAIL PROTECTED] wrote: > On May 21, 11:13 am, "A.T.Hofkamp" <[EMAIL PROTECTED]> wrote: > > > > > On 2008-05-21, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > > I'd appreciate any help.  I've got a list of files in a directory, and > > > I'd like to iterate through that l

Re: Books for learning how to write "big" programs

2008-05-22 Thread Dan Upton
On Thu, May 22, 2008 at 1:49 PM, Kurt Smith <[EMAIL PROTECTED]> wrote: > On Thu, May 22, 2008 at 10:55 AM, duli <[EMAIL PROTECTED]> wrote: >> Hi: >> I would like recommendations for books (in any language, not >> necessarily C++, C, python) which have walkthroughs for developing >> a big software p

statically linking release build on mac

2008-05-22 Thread Patrick Stinson
I get an error reporting an unfound symbol using a statically linked release build of python2.5 on a OSX-Tiger. This works fine on leopard, where the system default python is version 2.5.1 - the same version that I'm using to link to. Sorry, I'm currently screwing with my configs and don't have a

Re: Python is slow

2008-05-22 Thread Arnaud Delobelle
cm_gui <[EMAIL PROTECTED]> writes: > Python is slow.Almost all of the web applications written in > Python are slow. Zope/Plone is slow, sloow, so very slooow. Even > Google Apps is not faster. Neither is Youtube. > Facebook and Wikipedia (Mediawiki), written in PHP, are so much faster >

Producing multiple items in a list comprehension

2008-05-22 Thread Joel Koltner
Is there an easy way to get a list comprehension to produce a flat list of, say, [x,2*x] for each input argument? E.g., I'd like to do something like: [ [x,2*x] for x in range(4) ] ...and receive [ 0,0,1,2,2,4,3,6] ...but of course you really get a list of lists: [[0, 0], [1, 2], [2, 4], [3,

Re: import X vs from x import *

2008-05-22 Thread Tommy Grav
On May 22, 2008, at 1:44 PM, [EMAIL PROTECTED] wrote: import Tkinter With this you call functions from Tkinter as Tkinter.function() from Tkinter import * Here you just call function() i have a program where if i comment out either of those import- statements i get an error. i thoug

Re: Returning to 'try' block after catching an exception

2008-05-22 Thread inhahe
Might have a stack overflow issue, if it retries too many times? "alex23" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On May 22, 6:15 pm, Karlo Lozovina <[EMAIL PROTECTED]> wrote: >> Because when you expect exception to occur on something like 0.01% of >> cases, and you have 4 o

Re: import X vs from x import *

2008-05-22 Thread J. Cliff Dyer
On Thu, 2008-05-22 at 10:44 -0700, [EMAIL PROTECTED] wrote: > import Tkinter > from Tkinter import * > > i have a program where if i comment out either of those import- > statements i get an error. > > i thought they meant the same thing and from was supposed to be just > to imort just a specific

Re: php vs python

2008-05-22 Thread Mike Driscoll
On May 21, 3:10 pm, notbob <[EMAIL PROTECTED]> wrote: > I'm not posting this just to initiate some religious flame war, though it's > the perfect subject to do so.  No, I actaully want some serious advice about > these two languages and since I think usenet is the best arena to find it, > here ya'

2 different versions of python compiling files.

2008-05-22 Thread TkNeo
I am trying to upgrade from python 2.3 to 2.4 but not all machines can be upgraded. Can you guys tell me if this scenario is possible. 1. Any machine that uses .py files that use libraries that require 2.4 will have 2.4 on it. 2. rest of the machines will have 2.3 now there is a shared drive. let

Re: Restarting a program

2008-05-22 Thread Geoldr
On May 22, 10:07 am, Mike Driscoll <[EMAIL PROTECTED]> wrote: > On May 22, 10:59 am, Geoldr <[EMAIL PROTECTED]> wrote: > > > Hello all, I have written a simple program, and at the end of it, > > instead of it closing I would like it to restart from the beggining. > > Is there a way to do this? Put

Re: Python is slow

2008-05-22 Thread [EMAIL PROTECTED]
On 22 mai, 18:14, cm_gui <[EMAIL PROTECTED]> wrote: > Python is slow. Oh, a troll... > Almost all of the web applications written in > Python are slow. Zope/Plone is slow, sloow, so very slooow. Even > Google Apps is not faster. Neither is Youtube. > Facebook and Wikipedia (Mediawiki), wri

Re: Python and Flaming Thunder

2008-05-22 Thread Mel
Mensanator wrote: > On May 22, 10:30 am, Nick Craig-Wood <[EMAIL PROTECTED]> wrote: >> Dave Parker <[EMAIL PROTECTED]> wrote: >> > But after getting input from children and teachers, etc, it started >> > feeling right. >> >> > For example, consider the two statements: >> >> > x = 8 >> > x = 10 >>

Re: Why is math.pi slightly wrong?

2008-05-22 Thread Mensanator
On May 22, 11:32 am, "Dutton, Sam" <[EMAIL PROTECTED]> wrote: > I've noticed that the value of math.pi -- just entering it at the interactive > prompt -- is returned as 3.1415926535897931, whereas (as every pi-obsessive > knows) the value is 3.1415926535897932... (Note the 2 at the end.) > > Is t

Re: Restarting a program

2008-05-22 Thread Mike Driscoll
On May 22, 1:38 pm, Geoldr <[EMAIL PROTECTED]> wrote: > On May 22, 10:07 am, Mike Driscoll <[EMAIL PROTECTED]> wrote: > > > > > On May 22, 10:59 am, Geoldr <[EMAIL PROTECTED]> wrote: > > > > Hello all, I have written a simple program, and at the end of it, > > > instead of it closing I would like i

Re: Why is math.pi slightly wrong?

2008-05-22 Thread Dan Upton
On Thu, May 22, 2008 at 2:53 PM, Mensanator <[EMAIL PROTECTED]> wrote: > On May 22, 11:32 am, "Dutton, Sam" <[EMAIL PROTECTED]> wrote: >> I've noticed that the value of math.pi -- just entering it at the >> interactive prompt -- is returned as 3.1415926535897931, whereas (as every >> pi-obsessive

  1   2   >