Re: A friendlier, sugarier lambda -- a proposal for Ruby-like blocks in python

2006-10-14 Thread Paul Rubin
[EMAIL PROTECTED] writes: > deferred = fetchPage('http://python.org') > def _showResponse(response) > print "fancy formatting: %s" % response.text > deferred.addCallback(_showResponse) > > Lots of Twisted code has to be written backwards like this. But that's just ugly. The f

Re: Python component model

2006-10-14 Thread Kay Schluehr
val bykoski wrote: > Peter Wang wrote: > > Edward, > > > > This isn't in response to any specific one of the 100+ posts on this > > thread, but I justed wanted to encourage you to continue your > > investigation into Python component models and maybe looking for some > > common ground between them.

Re: A friendlier, sugarier lambda -- a proposal for Ruby-like blocks in python

2006-10-14 Thread Kay Schluehr
Paul Rubin wrote: > [EMAIL PROTECTED] writes: > > deferred = fetchPage('http://python.org') > > def _showResponse(response) > > print "fancy formatting: %s" % response.text > > deferred.addCallback(_showResponse) > > > > Lots of Twisted code has to be written backwards like this

Eclim: Vim interface to Eclipse (was: IDE that uses an external editor?)

2006-10-14 Thread Ben Finney
[EMAIL PROTECTED] writes: > One thing that's kept me from even looking at IDEs is that to the > best of my knowledge none of them will integrate properly with > external editors like Emacs or vi. The Eclim project exposes Eclipse functionality and then uses Vim as an interface. Instead of tr

Re: Attribute error

2006-10-14 Thread Ben Finney
"Teja" <[EMAIL PROTECTED]> writes: > What is attribute error? exception AttributeError Raised when an attribute reference or assignment fails. http://docs.python.org/lib/module-exceptions.html#l2h-103> > To be precise : Not precise enough, unfortunately. Please construct a minimal,

Re: Sending binary pickled data through TCP

2006-10-14 Thread Steve Holden
David Hirschfield wrote: > Thanks for the great response. > > Yeah, by "safe" I mean that it's all happening on an intranet with no > chance of malicious individuals getting access to the stream of data. > > The chunks are arbitrary collections of python objects. I'm wrapping > them up a little

Re: A friendlier, sugarier lambda -- a proposal for Ruby-like blocks in python

2006-10-14 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Kay Schluehr wrote: > [EMAIL PROTECTED] wrote: > >> Many have complained about this crippled-ness of lambda, but it >> actually makes some sense. Since Python uses colons and indentation to >> define blocks of code, it would be awkward to close a multiline lambda. >> The

Re: Thread termination

2006-10-14 Thread Nick Craig-Wood
Hendrik van Rooyen <[EMAIL PROTECTED]> wrote: > can't be done from outside without co operation of thread in question. > google this newsgroup Hopefully google will discover also the thread where the above statement is proved to be false ;-) This might be a useful thing to search for... ctypes

Re: A friendlier, sugarier lambda -- a proposal for Ruby-like blocks in python

2006-10-14 Thread Duncan Booth
Paul Rubin wrote: > [EMAIL PROTECTED] writes: >> deferred = fetchPage('http://python.org') >> def _showResponse(response) >> print "fancy formatting: %s" % response.text >> deferred.addCallback(_showResponse) >> >> Lots of Twisted code has to be writ

Re: A friendlier, sugarier lambda -- a proposal for Ruby-like blocks in python

2006-10-14 Thread James Stroud
[EMAIL PROTECTED] wrote: > Hi all -- > > Compared to the Python I know and love, Ruby isn't quite the same. > However, it has at least one terrific feature: "blocks". Whereas in > Python a > "block" is just several lines of locally-scoped-together code, in Ruby > a > "block" defines a closure (an

Re: SOAPpy and callback

2006-10-14 Thread Paul McGuire
"Diez B. Roggisch" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Maybe we have a misunderstanding here. I'm not a native speaker, so bear > with me. > That's okay, I'll type very, very slowly. :) > In CORBA or RMI, there is a notion of an object/interface reference passed > aro

Re: Python component model

2006-10-14 Thread Edward Diener No Spam
Peter Wang wrote: > Edward Diener wrote: >> It looks as if traits is an attempt to create a "property" in the >> component terminology which I originally specified. I will take a look >> at it. > > Traits is frighteningly similar to the requirements that you laid out > in your post (the example fo

Re: Python component model

2006-10-14 Thread Edward Diener No Spam
Kay Schluehr wrote: > val bykoski wrote: >> Peter Wang wrote: >>> Edward, >>> >>> This isn't in response to any specific one of the 100+ posts on this >>> thread, but I justed wanted to encourage you to continue your >>> investigation into Python component models and maybe looking for some >>> comm

Twisted Deferreds (was: Re: A friendlier, sugarier lambda -- a proposal for Ruby-like blocks in python)

2006-10-14 Thread Bjoern Schliessmann
Paul Rubin wrote: > But that's just ugly. The fetchPage function should take the > callback as an argument. In an asynchronous system it would even > be buggy. It won't, in my understanding/experience, since the local context must first terminate before the reactor takes control again and hand

Re: terminate execfile

2006-10-14 Thread Paddy
Teja wrote: > Teja wrote: > > > How to terminate execfile() in the middle of its execution. Any > > pointers ??? > > Its very urgent please > > > > > > Thanks > > Teja.P > > Can I raise an interrupt using PyErr_SetInterrupt??? Is so , does any > one know how to do it? I presume there is on

Re: Attribute error

2006-10-14 Thread Max Erickson
"Teja" <[EMAIL PROTECTED]> wrote: > Hi all, > > What is attribute error? what causes that error, especially with COM > objects? > > To be precise : > > Attribute Error: LCAS.LabcarController.writeLogWindow() > > Here, LCAS is a COM object > > Thanks > Teja.P > LabcarController might be

Reverse string-formatting (maybe?)

2006-10-14 Thread Dustan
Is there any builtin function or module with a function similar to my made-up, not-written deformat function as follows? I can't imagine it would be too easy to write, but possible... >>> template = 'I am %s, and he %s last %s.' >>> values = ('coding', "coded', 'week') >>> formatted = template % v

Re: wxPython installation interferes with win32ui/win32gui

2006-10-14 Thread robert
Gabriel Genellina wrote: > At Friday 13/10/2006 19:33, robert wrote: > >> > c:\Python23\pythonw.exe.manifest >> > c:\Python23python.exe.manifest >> > >> >> I found out that in fact when I move away these 2 files to a backup >> location after a wx installation, things go well again. >> >> What at a

Re: Python component model

2006-10-14 Thread Steve Holden
Edward Diener No Spam wrote: > Kay Schluehr wrote: > >>val bykoski wrote: >> >>>Peter Wang wrote: >>> Edward, This isn't in response to any specific one of the 100+ posts on this thread, but I justed wanted to encourage you to continue your investigation into Python component

Re: IDE that uses an external editor?

2006-10-14 Thread robert
[EMAIL PROTECTED] wrote: > One thing that's kept me from even looking at IDEs is that to the best of my > knowledge none of them will integrate properly with external editors like > Emacs or vi. I know lots of tools support "Emacs-like keybindings", but > believe me, I've never found one that does

Re: Standard Forth versus Python: a case study

2006-10-14 Thread jacko
Paddy wrote: > werty wrote: > > Apples/oranges ? programmers are making very little $$ today . > >Thats software ! No one is makin money on obsolete Forth , > > so why a comparisom ? > > > > Ultimately the best OpSys will be free and millions of lines of code > > obsoleted . Because n

Re: Reverse string-formatting (maybe?)

2006-10-14 Thread Tim Chase
template = 'I am %s, and he %s last %s.' values = ('coding', "coded', 'week') formatted = template % values formatted > 'I am coding, and he coded last week.' deformat(formatted, template) > ('coding', 'coded', 'week') > > expanded (for better visual): deformat('I am

Re: Reverse string-formatting (maybe?)

2006-10-14 Thread Tim Chase
template = 'I am %s, and he %s last %s.' values = ('coding', "coded', 'week') formatted = template % values formatted > 'I am coding, and he coded last week.' deformat(formatted, template) > ('coding', 'coded', 'week') > > expanded (for better visual): deformat('I am

Re: Reverse string-formatting (maybe?)

2006-10-14 Thread Peter Otten
Dustan wrote: > Is there any builtin function or module with a function similar to my > made-up, not-written deformat function as follows? I can't imagine it > would be too easy to write, but possible... > template = 'I am %s, and he %s last %s.' values = ('coding', "coded', 'week') >>>

Re: Best IDE?

2006-10-14 Thread robert
Ahmer wrote: > What do you guys use? > Why? > What do you like and hate about it? > What platform(s) is it avalable on? > How much does it cost? > etc. On Windows... I uninstalled Komodo (several times; fat, crashes, slow debugger ...) I uninstalled Wing I uninstalled Boa I uninstalled PythonWork

Re: Python component model

2006-10-14 Thread Roel Schroeven
Edward Diener No Spam schreef: > It would be easier for me if you could get an NG somewhere for > Enthought, perhaps on GMane, since I always find mailing lists much more > clunky than a good NG. But that is up to Enthought. FYI: you don't necessarily depend on Enthought for that; anyone can ask

a odd thing of "from __future__ import ..."

2006-10-14 Thread [EMAIL PROTECTED]
i can't use "from __future__ import ..." statement import two statesments in the same time. for the simple code: from __future__ import with_statement, division with file('url.txt','r') as f: for line in f: print line it can't run until i change the first sentence to below from __futur

locals() and globals()

2006-10-14 Thread Paolo Pantaleo
Hi this exaple: def lcl(): n=1 x=locals() x["n"]=100 print "n in lcl() is:" +str(n) #This will say Name error #x["new"]=1 #print new n=1 x=globals() x["n"]=100 print "gobal n is:" +str(n) x["new"]=1 print "new is:" +str(new) lcl() produces gobal n is:100 new is:1 n

Re: IDE that uses an external editor?

2006-10-14 Thread Slawomir Nowaczyk
On Fri, 13 Oct 2006 12:04:56 -0500 [EMAIL PROTECTED] wrote: #> One thing that's kept me from even looking at IDEs is that to the #> best of my knowledge none of them will integrate properly with #> external editors like Emacs or vi. To the best of *my* knowledge, Emacs integrates pretty well with

Re: locals() and globals()

2006-10-14 Thread Fredrik Lundh
Paolo Pantaleo wrote: > why accessing the names dictionary globals() and locals() gives > different results? the documentation has the answer: "The contents of this dictionary should not be modified; changes may not affect the values of local variables used by the interpreter" http:

Re: How to share session with IE

2006-10-14 Thread John J. Lee
Cameron Walsh <[EMAIL PROTECTED]> writes: [...] > Another option instead of making your program run through a series of > clicks and text inputs, which is difficult to program, is to browse > the html source until you find the name of the script that processes > the login, and use python to request

Re: Motions.

2006-10-14 Thread Dr. Pastor
Thank you Sir! Gerrit Holl wrote: > On 2006-10-11 00:26:38 +0200, Dr. Pastor wrote: == Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News== http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups = East and West-Coast Server Farms - Tota

Re: How to share session with IE

2006-10-14 Thread John J. Lee
"zdp" <[EMAIL PROTECTED]> writes: [...] > 1. Use the cookie of IE, so I don't need to code to logon. That means I > must use ClientCookie. I found some example in the docs and the > newsgroup. Below is some code based on the docs of ClientCookie. But > the page I get is still the page told me must

Re: Best IDE?

2006-10-14 Thread BartlebyScrivener
Fuzzyman wrote: > Hmm... only 31 results over a period of 8 years. That's a couple of > orders of magnitude less than I would have guessed. Well, if you take the quotes off of "best ide" then you get 342. rd -- http://mail.python.org/mailman/listinfo/python-list

Re: Thread termination

2006-10-14 Thread Hendrik van Rooyen
"Nick Craig-Wood" <[EMAIL PROTECTED]> wrote: > Hendrik van Rooyen <[EMAIL PROTECTED]> wrote: > > can't be done from outside without co operation of thread in question. > > google this newsgroup > > Hopefully google will discover also the thread where the above statement is > proved to be false

Can I set up a timed callback without Tkinter or twisted or something?

2006-10-14 Thread Hendrik van Rooyen
Hi, I want to do the equivalent of the after thingy in tkinter - setting up in effect a timed call back. My use case is as a "supervisory" timer - I want to set up an alarm, which I want to cancel if the expected occurrence occurs - but its not a GUI app. My googling gets a lot of stuff pointing

Making a shorter shebang

2006-10-14 Thread veracon
Long story short, in order to use Python 2.5, I've compiled it in my own account on my hosting. It works fantastic as /home/my_username/python2.5, but the shebang is a bit long. Is there a way to shorten it (environment variables?) or, even better, make /usr/bin/env python point to it? Thanks in a

Re: Making a shorter shebang

2006-10-14 Thread Jerry
/usr/bin/env just searches your PATH variable to find it, but it does so in order. So, if you want it to find your python instead of a system provided one, just alter your PATH variable and put /home/my_username/python2.5 in front of everything else. example in .profile: PATH=/home//python2.5:$P

Re: wing ide vs. komodo?

2006-10-14 Thread Paul Boddie
Heikki Toivonen wrote: > Paul Boddie wrote: > > hg wrote: > >> PS: I also was taken aback by the fact that the PyDev license was > >> "per-year" ... it's like buying Word for a year only ... isn't it ? > > > > Flashbacks to the age of shareware seem to be commonplace in the realm > > of Eclipse, or

Re: Making a shorter shebang

2006-10-14 Thread veracon
Thanks a lot! Jerry wrote: > /usr/bin/env just searches your PATH variable to find it, but it does > so in order. So, if you want it to find your python instead of a > system provided one, just alter your PATH variable and put > /home/my_username/python2.5 in front of everything else. > > example

Re: PyDoc and mod_python

2006-10-14 Thread John J. Lee
Fredrik Lundh <[EMAIL PROTECTED]> writes: > durumdara wrote: > > > I need to write documentation for my mod_python website, for the > > base classes, functions, modules. > > The problem, that mod_python is imported "apache" that not existing > > in the normal, pythonic way (only in Apache). > >

Re: Making a shorter shebang

2006-10-14 Thread veracon
Actually, it appears to still be using the default binary (/usr/bin/python). Can I be sure it's actually reading the .profile file? I'm executing through regular CGI in Apache. veracon wrote: > Thanks a lot! > > Jerry wrote: > > /usr/bin/env just searches your PATH variable to find it, but it does

Re: Can I set up a timed callback without Tkinter or twisted or something?

2006-10-14 Thread Scott David Daniels
Hendrik van Rooyen wrote: > I want to do the equivalent of the after thingy in tkinter - setting up in > effect a timed call back. > > My use case is as a "supervisory" timer - I want to set up an alarm, which I > want to cancel if the expected occurrence occurs - but its not a GUI app. Use a thr

Re: locals() and globals()

2006-10-14 Thread Kay Schluehr
Paolo Pantaleo wrote: > Hi > > this exaple: > > def lcl(): > n=1 > x=locals() > x["n"]=100 > print "n in lcl() is:" +str(n) > #This will say Name error > #x["new"]=1 > #print new > > > n=1 > x=globals() > x["n"]=100 > print "gobal n is:" +str(n) > x["new"]=1 > print "new

Re: Can I set up a timed callback without Tkinter or twisted or something?

2006-10-14 Thread hg
Hendrik van Rooyen wrote: > Hi, > > I want to do the equivalent of the after thingy in tkinter - setting up in > effect a timed call back. > > My use case is as a "supervisory" timer - I want to set up an alarm, which I > want to cancel if the expected occurrence occurs - but its not a GUI app. >

Re: a odd thing of "from __future__ import ..."

2006-10-14 Thread Peter Otten
[EMAIL PROTECTED] wrote: > i can't use "from __future__ import ..." statement import two > statesments in the same time. > why? python2.5/windows. This is a bug: http://groups.google.com/group/comp.lang.python/msg/05fdd5118638f3cd?hl=en&; Peter -- http://mail.python.org/mailman/listinfo/pytho

Re: A friendlier, sugarier lambda -- a proposal for Ruby-like blocks in python

2006-10-14 Thread Paul Boddie
Kay Schluehr wrote: > > Spreading tiny function definitions all over the code > may be finally not such a good idea compared with a few generic methods > that get just called? OO might run out of fashion these days but Python > is not Java and Pythons OO is pretty lightweight. I think you've succe

Re: Making a shorter shebang

2006-10-14 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, veracon wrote: > Actually, it appears to still be using the default binary > (/usr/bin/python). Can I be sure it's actually reading the .profile > file? I'm executing through regular CGI in Apache. The `~/.profile` is executed when *you* log into your account. CGI scripts

Re: optparse: add trailing text in help message?

2006-10-14 Thread Steven Bethard
Count László de Almásy wrote: > Is there a standard way with optparse to include a blurb of text after > the usage section, description, and the list of options? This is > often useful to include examples or closing comments when the help > message is printed out. Many of the GNU commands do this

Re: Making a shorter shebang

2006-10-14 Thread veracon
Thanks, at least now I know I wasn't doing something wrong. Marc 'BlackJack' Rintsch wrote: > In <[EMAIL PROTECTED]>, veracon wrote: > > > Actually, it appears to still be using the default binary > > (/usr/bin/python). Can I be sure it's actually reading the .profile > > file? I'm executing throu

Re: optparse: add trailing text in help message?

2006-10-14 Thread Duncan Booth
"Count László de Almásy" <[EMAIL PROTECTED]> wrote: > Is there a standard way with optparse to include a blurb of text after > the usage section, description, and the list of options? This is > often useful to include examples or closing comments when the help > message is printed out. Many of t

Re: SPE for 2.5?

2006-10-14 Thread John DeRosa
On 13 Oct 2006 17:41:12 -0700, "Fuzzyman" <[EMAIL PROTECTED]> wrote: > >John Salerno wrote: >> Does anyone know if SPE is compatible with Python 2.5? I don't see a >> Windows exe file for 2.5, so I wasn't sure if I should use the 2.4 version. >> > >Certainly worth trying the 2.4 version, but it's

Re: Starting out.

2006-10-14 Thread [EMAIL PROTECTED]
Hendrik van Rooyen wrote: > <[EMAIL PROTECTED]> wrote: > > 8< > > > Well, I'm on vacation this week, so 5 pm means nothing to me: > > > > teetertotter > > > > from the Consolidated Word List from puzzlers.org. > > > > Yes, it's also spelled with a hyphen or a space, but as

Re: IDE that uses an external editor?

2006-10-14 Thread skip
Slawomir> #> One thing that's kept me from even looking at IDEs is that Slawomir> #> to the best of my knowledge none of them will integrate Slawomir> #> properly with external editors like Emacs or vi. Slawomir> To the best of *my* knowledge, Emacs integrates pretty well Slaw

.doc to html and pdf conversion with python

2006-10-14 Thread Alexander Klingenstein
I need to take a bunch of .doc files (word 2000) which have a little text including some tables/layout and mostly pictures and comvert them to a pdf and extract the text and images separately too. If I have a pdf, I can do create the html with pdftohtml called from python with popen. However I n

Re: Starting out.

2006-10-14 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > (according to the Urban Dictionary). talk about reliable sources... -- http://mail.python.org/mailman/listinfo/python-list

Re: .doc to html and pdf conversion with python

2006-10-14 Thread Paul McNett
Alexander Klingenstein wrote: > I need to take a bunch of .doc files (word 2000) which have a little text > including some tables/layout and mostly pictures and comvert them to a pdf > and extract the text and images separately too. If I have a pdf, I can do > create the html with pdftohtml call

Re: IDE that uses an external editor?

2006-10-14 Thread Slawomir Nowaczyk
On Sat, 14 Oct 2006 13:01:17 -0500 [EMAIL PROTECTED] wrote: #> #> Slawomir> #> One thing that's kept me from even looking at IDEs is that #> Slawomir> #> to the best of my knowledge none of them will integrate #> Slawomir> #> properly with external editors like Emacs or vi. #> #>

Re: File read-write mode: problem appending after reading

2006-10-14 Thread Frederic Rentsch
Tim, Thanks a lot for your input. I seemed to notice that everything works fine without setting the cursor as long as it stops before the end of the file. Is that also a coincidence that may not work? Frederic Tim Peters wrote: > [Frederic Rentsch] > >>Working with read and write

Re: .doc to html and pdf conversion with python

2006-10-14 Thread [EMAIL PROTECTED]
Alexander Klingenstein wrote: > I need to take a bunch of .doc files (word 2000) which have a little text > including some tables/layout and mostly pictures and comvert them to a pdf > and extract the text and images > separately too. If I have a pdf, I can do > create the html with pdftohtml ca

ANN: ElementFilter - find and remove elements and attributes from ElementTree XML

2006-10-14 Thread Gerard Flanagan
An add-on for ElementTree. Info and download here: http://www.gflanagan.net/site/python/utils/elementfilter/index.html Gerard -- http://mail.python.org/mailman/listinfo/python-list

Re: wing ide vs. komodo?

2006-10-14 Thread [EMAIL PROTECTED]
Paul Boddie wrote: > hg wrote: > > > > Eric3 is very nice and moving forward ... I believe it is based on the > > QT library which free ... yet not so free under windows (i have yet to > > understand the business model). > > There are snapshots of Eric4 available, apparently. See here for more: >

Re: File read-write mode: problem appending after reading

2006-10-14 Thread Tim Peters
[Frederic Rentsch] > Thanks a lot for your input. I seemed to notice that everything > works fine without setting the cursor as long as it stops before the end > of the file. Is that also a coincidence that may not work? "if you want to read following a write, or write following a read, on

broken links on effbot.org

2006-10-14 Thread Gerard Flanagan
The links here seem to be broken: http://effbot.org/zone/element-index.htm#documentation I'm getting: sorry, /zone/page.cgi?page=element does not exist sorry, /zone/page.cgi?page=pythondoc-elementtree-ElementTree does not exist It was working two days ago, possibly yesterday (13th Oct). G

Re: Insert characters into string based on re ?

2006-10-14 Thread Frederic Rentsch
Matt wrote: > I am attempting to reformat a string, inserting newlines before certain > phrases. For example, in formatting SQL, I want to start a new line at > each JOIN condition. Noting that strings are immutable, I thought it > best to spllit the string at the key points, then join with '\n'. >

Re: A friendlier, sugarier lambda -- a proposal for Ruby-like blocks in python

2006-10-14 Thread brenocon
Kay Schluehr wrote: > The with statement is already implemented in Python 2.5. > > http://docs.python.org/whatsnew/pep-343.html > > The main difference between the with statement and Ruby blocks is that > the with-statement does not support loops. Yielding a value of a > function decorated with a c

Re: optparse: add trailing text in help message?

2006-10-14 Thread Count László de Almásy
Thanks for the help, all. Somone pointed out the 'epilogue' attribute to OptionParser that is new in Python 2.5, which does exactly what I am looking for. I did read the optparse docs for 2.5 fully before posting this question, and now that I've taken a second look, I see that epilog is NOT DOCUM

Relative import bug or not?

2006-10-14 Thread Alexey Borzenkov
After reading PEP-0328 I wanted to give relative imports a try: # somepkg/__init__.py # somepkg/test1.py from __future__ import absolute_import from . import test2 if __name__ == "__main__": print "Test" # somepkg/test2.py But it complaints: C:\1\somepkg>test1.py Traceback (most recent c

Ok. This IS homework ...

2006-10-14 Thread spawn
but I've been struggling with this for far too long and I'm about to start beating my head against the wall. My assignment seemed simple: create a program that will cacluate the running total of user inputs until it hits 100. At 100 it should stop. That's not the problem, in fact, that part work

Re: A friendlier, sugarier lambda -- a proposal for Ruby-like blocks in python

2006-10-14 Thread Alexey Borzenkov
[EMAIL PROTECTED] wrote: > Compared to the Python I know and love, Ruby isn't quite the same. > However, it has at least one terrific feature: "blocks". Well, I particularly like how Boo (http://boo.codehaus.org) has done it: func(a, b, c) def(p1, p2, p3): stmts I was so attached to these

Re: Ok. This IS homework ...

2006-10-14 Thread Paul Rubin
"spawn" <[EMAIL PROTECTED]> writes: > That's not the problem, in fact, that part works. It's the adding > that isn't working. How can my program add 2 + 7 and come up with 14? > while running: > guess = int(raw_input('I\'ll need another number : ')) > running_to

Re: Ok. This IS homework ...

2006-10-14 Thread Max Erickson
"spawn" <[EMAIL PROTECTED]> wrote: > but I've been struggling with this for far too long and I'm about > to start beating my head against the wall. > -- > > I tried adding an additional "while" statement to capture the > second number, but it didn't seem to solve my proble

Re: Ok. This IS homework ...

2006-10-14 Thread Brett Hoerner
spawn wrote: > while running: > guess = int(raw_input('Enter an integer that I can use to add : ')) > subtotal = guess > while running: > guess = int(raw_input('I\'ll need another number : ')) > running_total = guess + subtotal You keep adding the orig

Re: Ok. This IS homework ...

2006-10-14 Thread spawn
> Also, you never break out of your deepest loop, why are you using two > nested infinite-loops anyway? > > Regards, > Brett Hoerner Umm ..because I'm new to programming? Actually, they do end. If I move my "guess" variable outside the outermost loop, then it becomes infinte. I know, I trie

Re: IDE that uses an external editor?

2006-10-14 Thread Ben Finney
Slawomir Nowaczyk <[EMAIL PROTECTED]> writes: > Well, I haven't yet seen a definition of "Integrated Development > Environment" which would exclude Emacs... +1 QOTW Amen to that. -- \ "Never use a long word when there's a commensurate diminutive | `\ av

Re: A friendlier, sugarier lambda -- a proposal for Ruby-like blocks in python

2006-10-14 Thread bearophileHUGS
Alexey Borzenkov: > I was so attached to these "nameless" def-forms that I was even shocked > when I found that this doesn't work in python: > f = def(a, b): > return a*b > Another good feature of Boo, btw. I think Boo has some good things worth consideration (and maybe worth to copy) and so

Bug in urllib?

2006-10-14 Thread goyatlah
urllib.url2pathname("http://127.0.0.1:1030/js.cgi?pca&r=12181";) gives IOError : Bad Url, only coz of the :1030 which should be accurate portnumber. Is it something I did wrong, or a bug. And what to do to avoid this (except rewriting url2pathname)? TIA Dolf -- http://mail.python.org/mailman/lis

Re: A friendlier, sugarier lambda -- a proposal for Ruby-like blocks in python

2006-10-14 Thread Alexey Borzenkov
[EMAIL PROTECTED] wrote: > but maybe it reduces code readabilty a bit for people > that have just started to program: > > mul2 = def(a, b): > return a * b > > Instead of: > > def mul2(a, b): > return a * b For such simple cases, yes. What about: button.click += def(obj): # do stuff

Re: Starting out.

2006-10-14 Thread [EMAIL PROTECTED]
Fredrik Lundh wrote: > [EMAIL PROTECTED] wrote: > > > (according to the Urban Dictionary). > > talk about reliable sources... Well, as far as doing the research to prove them wrong, I'll give it a miss. > > -- http://mail.python.org/mailman/listinfo/python-list

Re: optparse: add trailing text in help message?

2006-10-14 Thread Steven Bethard
Duncan Booth wrote: from optparse import OptionParser usage = "usage: %prog [options] arg1 arg2" epilog = "that's all folks!" parser = OptionParser(usage=usage, epilog=epilog) parser.parse_args(['', '--help']) > Usage: [options] arg1 arg2 > > Options: > -h, --help show

Need a function. Any built-in function or module for this?

2006-10-14 Thread wcc
Hello group, I need to write a function to get input from user. The prompt will be like this: Specify direction[Left/Right/Up/Down] or : And if user type "L" or , the function will return "Left", if user type "R", the function will return "Right", etc.. My quick search in python reference did no

Re: Need a function. Any built-in function or module for this?

2006-10-14 Thread Paul Rubin
"wcc" <[EMAIL PROTECTED]> writes: > Specify direction[Left/Right/Up/Down] or : > > And if user type "L" or , the function will return "Left", if > user type "R", the function will return "Right", etc.. Hmm: def getchoice(prompt, choices, default): """prompt is a format string with a %s where

Re: Ok. This IS homework ...

2006-10-14 Thread Rainy
spawn wrote: > > Also, you never break out of your deepest loop, why are you using two > > nested infinite-loops anyway? > > > > Regards, > > Brett Hoerner > > Umm ..because I'm new to programming? Actually, they do end. If I > move my "guess" variable outside the outermost loop, then it bec

Re: broken links on effbot.org

2006-10-14 Thread Rainy
Gerard Flanagan wrote: > The links here seem to be broken: > > http://effbot.org/zone/element-index.htm#documentation > > I'm getting: > > sorry, /zone/page.cgi?page=element does not exist > > sorry, /zone/page.cgi?page=pythondoc-elementtree-ElementTree does not > exist > > It was working two

Re: a odd thing of "from __future__ import ..."

2006-10-14 Thread [EMAIL PROTECTED]
Peter, thanks for the info. Peter Otten wrote: > [EMAIL PROTECTED] wrote: > > > i can't use "from __future__ import ..." statement import two > > statesments in the same time. > > > why? python2.5/windows. > > This is a bug: > > http://groups.google.com/group/comp.lang.python/msg/05fdd5118638f3cd?h

Re: Relative import bug or not?

2006-10-14 Thread [EMAIL PROTECTED]
Alexey Borzenkov wrote: > After reading PEP-0328 I wanted to give relative imports a try: > > # somepkg/__init__.py > > > # somepkg/test1.py > from __future__ import absolute_import > from . import test2 > > if __name__ == "__main__": > print "Test" > > # somepkg/test2.py > > > But it compla

Re: Bug in urllib?

2006-10-14 Thread Christoph Zwerschke
goyatlah wrote: > urllib.url2pathname("http://127.0.0.1:1030/js.cgi?pca&r=12181";) > gives IOError : Bad Url, only coz of the :1030 which should be > accurate portnumber. Is it something I did wrong, or a bug. And what > to do to avoid this (except rewriting url2pathname)? >>> help(urllib.url2pat

Re: OT: What's up with the starship?

2006-10-14 Thread T. Bryan
Thomas Heller wrote: > I cannot connect to starship.python.net: neither http, nor can I login > interactively with ssl (and the host key seems to have changed as well). > > Does anyone know more? starship.python.net was compromised. It looked like a rootkit may have been installed. The volunte

Re: Ok. This IS homework ...

2006-10-14 Thread Brett Hoerner
spawn wrote: > Actually, they do end. If I > move my "guess" variable outside the outermost loop, then it becomes > infinte. I know, I tried it. Huh? When does "running" ever evaluate to false (therefore breaking either of the loops)? -- http://mail.python.org/mailman/listinfo/python-list

Re: Ok. This IS homework ...

2006-10-14 Thread Chris Johnson
spawn wrote: > but I've been struggling with this for far too long and I'm about to > start beating my head against the wall. > > My assignment seemed simple: create a program that will cacluate the > running total of user inputs until it hits 100. At 100 it should stop. > That's not the problem

problem with the 'math' module in 2.5?

2006-10-14 Thread Chris
>>> from math import * >>> sin(0) 0.0 >>> sin(pi) 1.2246063538223773e-016 >>> sin(2*pi) -2.4492127076447545e-016 >>> cos(0) 1.0 >>> cos(pi) -1.0 >>> cos(2*pi) 1.0 The cosine function works fine, but I'm getting weird answers for sine. Is this a bug? Am I doing something wrong? -- http://mail.pyt

Re: problem with the 'math' module in 2.5?

2006-10-14 Thread [EMAIL PROTECTED]
Chris wrote: > >>> from math import * > >>> sin(0) > 0.0 > >>> sin(pi) > 1.2246063538223773e-016 > >>> sin(2*pi) > -2.4492127076447545e-016 > >>> cos(0) > 1.0 > >>> cos(pi) > -1.0 > >>> cos(2*pi) > 1.0 > > The cosine function works fine, but I'm getting weird answers for sine. > Is this a bug? Am

Re: problem with the 'math' module in 2.5?

2006-10-14 Thread Max Erickson
"Chris" <[EMAIL PROTECTED]> wrote: from math import * sin(0) > 0.0 sin(pi) > 1.2246063538223773e-016 sin(2*pi) > -2.4492127076447545e-016 cos(0) > 1.0 cos(pi) > -1.0 cos(2*pi) > 1.0 > > The cosine function works fine, but I'm getting weird answers for > sine. Is

Re: problem with the 'math' module in 2.5?

2006-10-14 Thread Max Erickson
Max Erickson <[EMAIL PROTECTED]> wrote: > > Try sin(pi*0.5) to see similar behavior to cos(pi) or cos(pi*2). > Uhh, switch that, cos(pi*0.5)... -- http://mail.python.org/mailman/listinfo/python-list

Re: problem with the 'math' module in 2.5?

2006-10-14 Thread Chris
sin(pi*0.5) is what I expected, but I expected to get 0 for sin(pi). Max Erickson wrote: > "Chris" <[EMAIL PROTECTED]> wrote: > > from math import * > sin(0) > > 0.0 > sin(pi) > > 1.2246063538223773e-016 > sin(2*pi) > > -2.4492127076447545e-016 > cos(0) > > 1.0 > cos(

Re: problem with the 'math' module in 2.5?

2006-10-14 Thread Carsten Haese
On 14 Oct 2006 20:33:13 -0700, Chris wrote > >>> from math import * > >>> sin(0) > 0.0 > >>> sin(pi) > 1.2246063538223773e-016 > >>> sin(2*pi) > -2.4492127076447545e-016 > >>> cos(0) > 1.0 > >>> cos(pi) > -1.0 > >>> cos(2*pi) > 1.0 > > The cosine function works fine, but I'm getting weird answers

Re: problem with the 'math' module in 2.5?

2006-10-14 Thread Chris
I don't understand what that number came from. My calculator gives me cos(pi*.5) = 0, and my interpreter gives me cos(pi*0.5) = 6.1230317691118863e-017. Max Erickson wrote: > Max Erickson <[EMAIL PROTECTED]> wrote: > > > > Try sin(pi*0.5) to see similar behavior to cos(pi) or cos(pi*2). > > > >

Re: .doc to html and pdf conversion with python

2006-10-14 Thread [EMAIL PROTECTED]
google won't do a good job with .doc files but they may do pdf to html and back.. It's per each I just mentioned it to make fun of them here is my resume converted from a monster.com .doc file http://docs.google.com/View?docid=dftrj73t_3cfwjdv [EMAIL PROTECTED] wrote: > Alexander Klingenstein w

Re: problem with the 'math' module in 2.5?

2006-10-14 Thread Chris
Oh, ok that explains it. Is that why my 16-bit calculator gives me 0? Carsten Haese wrote: > On 14 Oct 2006 20:33:13 -0700, Chris wrote > > >>> from math import * > > >>> sin(0) > > 0.0 > > >>> sin(pi) > > 1.2246063538223773e-016 > > >>> sin(2*pi) > > -2.4492127076447545e-016 > > >>> cos(0) > > 1.0

Re: problem with the 'math' module in 2.5?

2006-10-14 Thread David Lees
Chris wrote: > sin(pi*0.5) is what I expected, but I expected to get 0 for sin(pi). > http://docs.python.org/tut/node16.html david -- http://mail.python.org/mailman/listinfo/python-list

  1   2   >