My OSDC.il Python Talks

2006-03-09 Thread Miki Tebeka
Hello All, Last week I gave three Python talks at OSDC.il (http://osdc.org.il/). If you are truly bored you can find the talks and demo source code at http://one.fsphost.com/tebeka/OSDC/ Bye. -- Miki Tebeka <[EMAIL PROTECT

Re: processing the genetic code with python?

2006-03-09 Thread Tim Roberts
"David E. Konerding DSD staff" <[EMAIL PROTECTED]> wrote: > >I don't really understand precisely what you're trying to do. > >First off, those aren't base pairs, they're bases. Only when you have >double-stranded >DNA (or RNA, or some other oddball cases) would they be base pairs. Isn't that j

Weekly Python Patch/Bug Summary

2006-03-09 Thread Kurt B. Kaiser
Patch / Bug Summary ___ Patches : 386 open ( +4) / 3089 closed (+10) / 3475 total (+14) Bugs: 889 open ( +9) / 5636 closed (+12) / 6525 total (+21) RFE : 212 open ( +1) / 201 closed ( +0) / 413 total ( +1) New / Reopened Patches __ db4.4 sup

Re: It is fun.the result of str.lower(str())

2006-03-09 Thread Tim Roberts
"Sullivan WxPyQtKinter" <[EMAIL PROTECTED]> wrote: > >Guess what would be the result of these functions: > str.lower('ASFA') str.join(str(),['1','1','1']) str.join('a','b') > >If you guess them correctly, please explain. Can you tell us what you expected these to do? It might help fut

Threading.Lock() question

2006-03-09 Thread Alvin A. Delagon
I have a multithreaded application that spawns threads which query a database server. During stress test I encountered some threads failing due "lost connection errors" and sometimes the actual script itself dies due to a "Segmentation Fault". I realized that it might be a deadlock situation so

Re: cgi problem

2006-03-09 Thread Tim Roberts
Paul Rubin wrote: > >Thomas Guettler <[EMAIL PROTECTED]> writes: >> > back to the originating url, i.e. I want the cgi to send a 302 redirect. >> >> I have this setup for a small script (for bigger things I use quixote)... > >Thanks. It looks like you've written your cgi

Re: cgi problem

2006-03-09 Thread Paul Rubin
Tim Roberts <[EMAIL PROTECTED]> writes: > Yes, but the CGI module doesn't write anything, so the advice of writing a > "Location:" header still applies. Aha, it's coming from CGIHTTPServer.py:CGIHTTPRequestHandler.run_cgi() where it says self.send_response(200, "Script output follows") I

Re: Bidirectional communication over unix socket (named pipe)

2006-03-09 Thread Ross Ridge
Donn Cave wrote: > The other part of the problem remains, as I don't know > how to get data to actually go both ways. The problem here is that datagram sockets don't send data from one process to another, they send data from one address to another. In this case, the client isn't able to receive

Re: Simple questions on use of objects (probably faq)

2006-03-09 Thread bruno at modulix
Brian Elmegaard wrote: > bruno at modulix <[EMAIL PROTECTED]> writes: > > >>Now how you could do it the OO way (Q&D, not really tested): > > > Something goes wrong in my 2.3 So it's time to move to 2.4x !-) What is "going wrong" exactly ? > when I change the syntax to > _add_instance=classm

implementation of "complex" type

2006-03-09 Thread Russ
I tried the following: >>> x = complex(4) >>> y = x >>> y *= 2 >>> print x, y (4+0j) (8+0j) But when I tried the same thing with my own class in place of "complex" above, I found that both x and y were doubled. I'd like to make my class behave like the "complex" class. Can someone tell me the tri

Re: Learning different languages

2006-03-09 Thread Christoph Hess
"Harry George" <[EMAIL PROTECTED]> wrote: > "gene tani" <[EMAIL PROTECTED]> writes: > >> Rich wrote: >> > Hi, >> > >> > (this is a probably a bit OT here, but comp.lang seems rather >> > desolated, so I'm not sure I would get an answer there. And right now >> > I'm in the middle of learning Pytho

Re: Threading.Lock() question

2006-03-09 Thread Alvin A. Delagon
I think I just found out my problem. How stupid of me, I should've created an instance of lock in the class Process instead of class Send. Good Heaven's python's threading rocks! I stress tested the server script having two clients sending requests on a while 1 loop without even a time.sleep()

Re: implementation of "complex" type

2006-03-09 Thread Mikael Olofsson
Russ wrote: x = complex(4) y = x y *= 2 print x, y > > (4+0j) (8+0j) > > But when I tried the same thing with my own class in place of > "complex" above, I found that both x and y were doubled. I'd like to > make my class behave like the "complex" class. Can someone tell me the >

accesibility of the namespace

2006-03-09 Thread Petr Jakes
In my code I have relatively wide dictionary definition (about 100 rows). I would like to put it in to the different file (module) because of the main code readability (say the name of the file will be "my_dictionary.py") In the dictionary I have strings formatted using % operator like: lcd={2:"Y

Python Evangelism

2006-03-09 Thread Steve Holden
I've been thinking (and blogging) about python evangelism since PyCon, as a result of which I created a squidoo lens: http://www.squidoo.com/pythonlogy Imagine my surprise at discovering that this has gone up in rank (by number of views) from # 442,000 or so to #153! Clearly there's some mi

Re: New python.org website

2006-03-09 Thread Doug Bromley
I much prefer the look and feel of the potential Ruby websites being developed at the moment.  The Python site is very corporate and academic which could put many early adopters off.  I'm sure you've all heard accusations that Python doesn't have the marketing drive of Ruby.  Perhaps this is an exa

Re: Threading.Lock() question

2006-03-09 Thread Alvin A. Delagon
@ Dennis Thanks for the quick heads up! You're right! I noticed the bug on my script just after sending out my question. Yes, I'm using MySQLdb but I did a wrapper for it to further simplify my script that why the sample script I wrote is a little bit different. Thanks again! Python rules!!! ^_

Re: implementation of "complex" type

2006-03-09 Thread Juho Schultz
Russ wrote: > I tried the following: > > x = complex(4) y = x y *= 2 print x, y > > (4+0j) (8+0j) > > But when I tried the same thing with my own class in place of > "complex" above, I found that both x and y were doubled. I'd like to > make my class behave like the "complex" cl

How to dervie from an instance object?

2006-03-09 Thread reinsn
Hi, I am currently working with ZopeX3. Because python doesn't include concept of interfaces, those were defined by the module zope.interface. So interfaces were defined like: class IMyInterface(zope.interface.Interface): . I have looked into the module zope.interface and found, that zo

Re: Python Evangelism

2006-03-09 Thread Just
In article <[EMAIL PROTECTED]>, Steve Holden <[EMAIL PROTECTED]> wrote: > I've been thinking (and blogging) about python evangelism since PyCon, > as a result of which I created a squidoo lens: > >http://www.squidoo.com/pythonlogy > > Imagine my surprise at discovering that this has gone u

embedding Python: how to avoid memory leaks?

2006-03-09 Thread Andrew Trevorrow
No response to my last message, so I'll try a different tack... Does anyone know of, or even better, has anyone here written a C++ application for Mac/Windows that allows users to run Python scripts from within the app? Not just once, but many times in a single session, and without leaking memory

Re: generators shared among threads

2006-03-09 Thread jess . austin
Bryan, You'll get the same result without the lock. I'm not sure what this indicates. It may show that the contention on the lock and the race condition on i aren't always problems. It may show that generators, at least in CPython 2.4, provide thread safety for free. It does seem to disprove m

Re: license preamble template

2006-03-09 Thread Alan Mackenzie
Xah Lee <[EMAIL PROTECTED]> wrote on 4 Mar 2006 10:21:11 -0800: > I noticed, that in just about all emacs programs on the web (elisp > code), it comes with this template text as its preamble: [ ] > ;; This program is distributed in the hope that it will be useful, but > ;; WITHOUT ANY WARRAN

Re: Python Evangelism

2006-03-09 Thread Gerard Flanagan
Steve Holden wrote: > I've been thinking (and blogging) about python evangelism since PyCon, > as a result of which I created a squidoo lens: > >http://www.squidoo.com/pythonlogy > > Imagine my surprise at discovering that this has gone up in rank (by > number of views) from # 442,000 or so to

Re: Python Evangelism

2006-03-09 Thread Doug Bromley
Python is in desperate need of marketing and I don't think its new site will help it.The Ruby community has a fanaticism we could learn from and its going some way to 'converting' me.  The community is alive, growing, shouting from the roof tops while the Python community seems to sit in its ivory

Re: Simple questions on use of objects (probably faq)

2006-03-09 Thread Brian Elmegaard
bruno at modulix <[EMAIL PROTECTED]> writes: > So it's time to move to 2.4x !-) I guess so. > What is "going wrong" exactly ? def _add_instance(cls, instance): _add_instance=classmethod(_add_instance) cls._instances.append(instance) gives me: d:/DTU/80494 $ python.exe ooo.py Tr

Re: implementation of "complex" type

2006-03-09 Thread Steven D'Aprano
On Thu, 09 Mar 2006 01:15:57 -0800, Russ wrote: > I tried the following: > x = complex(4) y = x y *= 2 print x, y > (4+0j) (8+0j) > > But when I tried the same thing with my own class in place of > "complex" above, I found that both x and y were doubled. I'd like to > make my

[OT] .DS_Store files (was Re: Removing .DS_Store files from mac folders)

2006-03-09 Thread Dan Sommers
On Thu, 09 Mar 2006 17:19:15 +1300, Greg Ewing <[EMAIL PROTECTED]> wrote: > I don't think that deleting the .DS_Store files is the > right approach to this, for various reasons: [ ... ] > * It might not even work, since the .DS_Store could > get re-created in between your purge and creating >

Re: RAD tutorials and tools for GUI development with Python?

2006-03-09 Thread Ravi Teja
>> Interesting link, but the focus there seems to be encoperating Python into >> Delphi apps in Windows. My focus is more getting Delphi like GUI building, >> but coding python on Linux. According to the web site http://mmm-experts.com/VersionHistory.aspx?ProductId=3 it supports Lazarus, which

Re: Simple questions on use of objects (probably faq)

2006-03-09 Thread Brian Elmegaard
James Stroud <[EMAIL PROTECTED]> writes: > You should look into __cmp__ and other magic methods. This is probably > the type of functionality you seem to be after. Good example, I need to look at the magic methods. What I want is to get the value of another variable in C. Would I need to use __re

Re: embedding Python: how to avoid memory leaks?

2006-03-09 Thread Torsten Bronger
Hallöchen! Andrew Trevorrow <[EMAIL PROTECTED]> writes: > [...] > > [...] Not just once, but many times in a single session, and > without leaking memory. Preferably an open source app so I can > see how it's done. > > Our app (http://golly.sourceforge.net/) currently uses calls > like these ev

Re: New python.org website

2006-03-09 Thread Nicola Musatti
Michael Tobis wrote: [...] > On the other hand, (since I think the design, while not brilliant, is > good) fixing the logo is something that can be achieved without too > much fuss. The obviously perfect logo would be Kaa's face: http://disney.go.com/vault/archives/villains/kaa/kaa.html After al

Re: accesibility of the namespace

2006-03-09 Thread Steven D'Aprano
On Thu, 09 Mar 2006 01:42:55 -0800, Petr Jakes wrote: > In my code I have relatively wide dictionary definition (about 100 > rows). > > I would like to put it in to the different file (module) because of the > main code readability (say the name of the file will be > "my_dictionary.py") > > In t

Re: advice on this little script

2006-03-09 Thread Kent Johnson
Alex Martelli wrote: > John Salerno <[EMAIL PROTECTED]> wrote: >... > >>I think the 'from time import sleep' looks cleaner, because I'm only >>taking what I need (is an import any more expensive than this from?), >>but I also feel like the 'time.sleep' syntax is much more >>self-describing a

Re: Learning different languages

2006-03-09 Thread Frithiof Andreas Jensen
"Terry Hancock" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Tuesday 07 March 2006 04:44 pm, Rich wrote: > I've been trying to get my kids to learn a little Python for some > time, but it hasn't been too easy for them yet. Then, out of the > blue, they want to learn Lua. > >

Re: Simple questions on use of objects (probably faq)

2006-03-09 Thread Steven D'Aprano
On Thu, 09 Mar 2006 12:24:05 +0100, Brian Elmegaard wrote: > James Stroud <[EMAIL PROTECTED]> writes: > >> You should look into __cmp__ and other magic methods. This is probably >> the type of functionality you seem to be after. > > Good example, I need to look at the magic methods. > What I wan

Alternative style sheets - Re: New python.org website

2006-03-09 Thread Magnus Lycka
Phoe6 wrote: > beta.python.org evolved very nice and noticed today the new python.org > website going live. There is a change in the look n feel, wherein it > looks "more official" and maximum possible information about python is > now directly accessible from the home page itself. Kudoes to the

Re: accesibility of the namespace

2006-03-09 Thread Petr Jakes
Thanks Steven, credit is mentioned to be a calculated value changed at run-time and your "third hand" suggestion is exactly what I was looking for. Petr Jakes -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple questions on use of objects (probably faq)

2006-03-09 Thread Steven D'Aprano
On Thu, 09 Mar 2006 11:54:11 +0100, Brian Elmegaard wrote: >> What is "going wrong" exactly ? > > def _add_instance(cls, instance): > _add_instance=classmethod(_add_instance) > cls._instances.append(instance) > > gives me: > d:/DTU/80494 $ python.exe ooo.py > Traceback (most recen

Re: [OT] .DS_Store files (was Re: Removing .DS_Store files from mac folders)

2006-03-09 Thread Eric Deveaud
Dan Sommers wrote: > If these are both true, then *new* .DS_Store files could > be created after I've made the list and before I've made > the tarball. not python related, but in order to creater the tarball without the .DS_Store files why don't you use the --exclude=PATTERN option from tar ??

Re: question about slicing with a step length

2006-03-09 Thread André
Terry Reedy wrote: > > John Salerno wrote: > >> Given: > > > numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] > > > can someone explain to me why > > > numbers[10:0:-2] results in [10, 8, 6, 4, 2]? > > It appears that s[i:j:-1] is s[(j+1):(i+1)] .reverse()'ed. For 'numbers', > this is 10, 9, 8, 7, 6, 5,

Re: grayscale pixel based graphics with pygame

2006-03-09 Thread Brian L. Troutwine
Thank you, but that wasn't quite what I was looking for. I do admit, however, that my post wasn't very clear (writting while exceptionally tired is not a very clever thing to do.) As Terry mentioned below this should be a question for the pygame mailing lists, so I'll take it there. Thanks again t

Re: Simple questions on use of objects (probably faq)

2006-03-09 Thread Brian Elmegaard
Steven D'Aprano <[EMAIL PROTECTED]> writes: > Can you explain more carefully what you are trying to do? If you want the > square of the maximum value, just do this: I want to get the value of another attribute of the instance with maximum x. I know I could do it like you suggest for the case wi

Re: grayscale pixel based graphics with pygame

2006-03-09 Thread Brian L. Troutwine
Geez, I apologize for my post being so vague. I was terribly tired when I wrote that, and should have known better than to post. I was not aware of the pygame mailing list. I will take this question there. -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple questions on use of objects (probably faq)

2006-03-09 Thread Brian Elmegaard
Steven D'Aprano <[EMAIL PROTECTED]> writes: > What you probably think you want is something like this: Thanks, that made it run. Now I need to study what classmethods are. > I say "think you want" because I don't know what problem you are trying to > solve with this messy, self-referential, piec

Inter-module globals

2006-03-09 Thread Anton81
Hi, I want to use globals that are immediately visible in all modules. My attempts to use "global" haven't worked. Suggestions? Anton -- http://mail.python.org/mailman/listinfo/python-list

Re: Inter-module globals

2006-03-09 Thread Jorge Godoy
Anton81 <[EMAIL PROTECTED]> writes: > I want to use globals that are immediately visible in all modules. My > attempts to use "global" haven't worked. Suggestions? Use a module and a class variables for that. Import your module and read/update class variables as you need them. -- Jorge Godoy

Re: embedding Python: how to avoid memory leaks?

2006-03-09 Thread Andrew Trevorrow
> > Our app (http://golly.sourceforge.net/) currently uses calls > > like these every time a user decides to run a script: > > > >Py_Initialize(); > >PyRun_SimpleString("execfile('foo.py')"); > > Does PyRun_AnyFile show the same effect? That's the way I'm about > to go. I couldn't get th

Re: implementation of "complex" type

2006-03-09 Thread cfbolz
Hi! Russ wrote: > I tried the following: > > >>> x = complex(4) > >>> y = x > >>> y *= 2 > >>> print x, y > (4+0j) (8+0j) > > But when I tried the same thing with my own class in place of > "complex" above, I found that both x and y were doubled. I'd like to > make my class behave like the "comple

Re: cgi problem

2006-03-09 Thread Kent Johnson
Paul Rubin wrote: > Tim Roberts <[EMAIL PROTECTED]> writes: > >>Yes, but the CGI module doesn't write anything, so the advice of writing a >>"Location:" header still applies. > > > Aha, it's coming from CGIHTTPServer.py:CGIHTTPRequestHandler.run_cgi() > where it says > > self.send_respo

Re: Simple questions on use of objects (probably faq)

2006-03-09 Thread bruno at modulix
Steven D'Aprano wrote: (snip) > I say "think you want" because I don't know what problem you are trying to > solve with this messy, self-referential, piece of code. This messy piece of code is mine, thanks !-) And it's not "self-referential" - it introduces a references cycle (class object -> in

Re: Simple questions on use of objects (probably faq)

2006-03-09 Thread bruno at modulix
Brian Elmegaard wrote: > bruno at modulix <[EMAIL PROTECTED]> writes: > > >>So it's time to move to 2.4x !-) > > > I guess so. > > > >>What is "going wrong" exactly ? > > > def _add_instance(cls, instance): > _add_instance=classmethod(_add_instance) > cls._instances.append(in

Re: How to dervie from an instance object?

2006-03-09 Thread bruno at modulix
reinsn wrote: > Hi, > > I am currently working with ZopeX3. Because python doesn't include > concept of interfaces, It does, but implicitly. The interface of an object is the set of messages it understands. > those were defined by the module zope.interface. > > So interfaces were defined like:

Re: New python.org website

2006-03-09 Thread Magnus Lycka
Nicola Musatti wrote: > The obviously perfect logo would be Kaa's face: > http://disney.go.com/vault/archives/villains/kaa/kaa.html The Soviet version is better, and I think most of the Maugli movies are made before 1973, which means that they aren't copyrighted outside the former Soviet Union. (D

Re: embedding Python: how to avoid memory leaks?

2006-03-09 Thread Martin v. Löwis
Andrew Trevorrow wrote: > Our app (http://golly.sourceforge.net/) currently uses calls > like these every time a user decides to run a script: > >Py_Initialize(); >PyRun_SimpleString("execfile('foo.py')"); >Py_Finalize(); > > But even if foo.py is *empty* the above calls result in a m

Re: accesibility of the namespace

2006-03-09 Thread Petr Jakes
Ops. My keyboard (fingers) was faster than my mind :( So There is more than one "run-time changed variable" in the dictionary and not all strings in the dictionary are formatted using % operator. Example: lcd={ 2:{2:(("Enter you choice"),("Your kredit= %3d" % (kredit)))}, 4:{2:(("Your choic

Re: embedding Python: how to avoid memory leaks?

2006-03-09 Thread Torsten Bronger
Hallöchen! [EMAIL PROTECTED] (Andrew Trevorrow) writes: > [...] > > I couldn't get the PyRun_*File* calls to work on Windows, presumably > because of the FILE* problem mentioned in the docs. Which compiler do you use? Tschö, Torsten. -- Torsten Bronger, aquisgrana, europa vetusICQ

Re: Inter-module globals

2006-03-09 Thread Schüle Daniel
Anton81 wrote: > Hi, > > I want to use globals that are immediately visible in all modules. My > attempts to use "global" haven't worked. Suggestions? > > Anton I think a dictionary would work here as well as list but not strings and int's # module1 settings = { "release" : "1.0",

Re: accesibility of the namespace

2006-03-09 Thread Mikael Olofsson
Petr Jakes wrote: > Ops. My keyboard (fingers) was faster than my mind :( > So > There is more than one "run-time changed variable" in the dictionary > and not all strings in the dictionary are formatted using % operator. > Example: > lcd={ > 2:{2:(("Enter you choice"),("Your kredit= %3d" %

Re: Python Evangelism

2006-03-09 Thread Steve Holden
Doug Bromley wrote: > Python is in desperate need of marketing and I don't think its new site > will help it. > The Ruby community has a fanaticism we could learn from and its going > some way to 'converting' me. The community is alive, growing, shouting > from the roof tops while the Python co

Re: Python Evangelism

2006-03-09 Thread Fredrik Lundh
Doug Bromley wrote: > I can see Ruby overtaking Python if we don't ALL do something about it. on the other hand, people have posted "I can see XXX overtaking Python if we don't ALL do something about it NOW" messages for as long as I've been using Python. the best thing I've seen in the recent "

Re: why no block comments in Python?

2006-03-09 Thread Benji York
Terry Hancock wrote: > I'm thinking this might be a use-case for the new support for > doctests in a separate file. Having doctests in their own file is (IMHO) a majorly under appreciated feature of doctest. The ability to do either nice user (as in developer) docs with known good examples or w

String functions: what's the difference?

2006-03-09 Thread Harro de Jong
(absolute beginner here, sorry if this seems basic) Section 7.10 of 'How to Think Like a Computer Scientist' contains this discussion of string.find and other string functions: (quote) We can use these constants and find to classify characters. For example, if find(lowercase, ch) returns a valu

Re: Python Evangelism

2006-03-09 Thread rtilley
Steve Holden wrote: > Doug Bromley wrote: >> I can see Ruby overtaking Python if we don't ALL do something about it. I think it's the name. Python. Let's change it to something nicer. Think about it... if you found a Ruby, you'd pick it up and put it in your pocket. If you ran across a Python, y

how to get a page's html code via a proxy

2006-03-09 Thread JuHui
who can help me? please give me a sample code. thanks a lot. -- http://mail.python.org/mailman/listinfo/python-list

Re: encoding problem

2006-03-09 Thread Martin v. Löwis
Yves Glodt wrote: > It seems in general I have trouble with special characters... > What is the python way to deal with éàè öäü etc... > > print 'é' fails here, > print u'é' as well :-( > > How am I supposed to print non-ascii characters the correct way? The second form should be used, but not i

Re: String functions: what's the difference?

2006-03-09 Thread Martin v. Löwis
Harro de Jong wrote: > I've tried all three, but the function is so small (test a single letter) I > can't measure the difference. I'm using time.time() to see how long it takes > to > execute the function. > I could use a loop to increase execution time, but then I might be measuring > mostly

First script, please comment and advise

2006-03-09 Thread Pedro Graca
I'm sure this isn't very pythonic; comments and advice appreciated def curious(text): """ Return the words in input text scrambled except for the first and last letter. """ new_text = "" word = "" for ch in text: if ch in "abcdefghijklmnopqrstuvwxy

opensource prayer

2006-03-09 Thread gen_tricomi
I and my opensource brothers/sisters are one. all i have is thiers. therefore i will keep my source code open for them. we are free and will remain free because freedom is the goal of evolution. OM OM OM REPEAT THIS TO YOUR SELF AS OFTEN AS POSSIBLE AS REGULARLY AS POSSIBLE TO STRENGHTEN OUR COMMUN

Re: Simple questions on use of objects (probably faq)

2006-03-09 Thread Brian Elmegaard
bruno at modulix <[EMAIL PROTECTED]> writes: > May I suggest that you first learn the language syntax and basics ?-) I'll try -- Brian (remove the sport for mail) http://www.et.web.mek.dtu.dk/Staff/be/be.html http://www.rugbyklubben-speed.dk -- http://mail.python.org/mailman/listinfo/python-li

Re: how to get a page's html code via a proxy

2006-03-09 Thread Fredrik Lundh
"JuHui" wrote: > who can help me? did you check the documentation ? a quick look in the library index might have helped you find this page http://docs.python.org/lib/module-urllib.html (search for "proxy" on that page to learn how urllib handles proxies) > please give me a sample code.

Re: encoding problem

2006-03-09 Thread Scott David Daniels
Yves Glodt wrote: > It seems in general I have trouble with special characters... > What is the python way to deal with éàè öäü etc... > > print 'é' fails here, This should probably stay true. > print u'é' as well :-( This is an issue with how your output is connected. What OS, what code page, wh

Re: Learning different languages

2006-03-09 Thread gene tani
Harry George wrote: > > re the OP: > > I find I have to concentrate on one language for a while (several > programs) to ramp up on the syntax, semantics, idioms, and libraries. > Then I'm safe to wander off and learn other languages. When it comes > time to do a project, I use one main language u

Re: Python Evangelism

2006-03-09 Thread Doug Bromley
A defector!Release the hounds!Burn the scum! -- http://mail.python.org/mailman/listinfo/python-list

Re: First script, please comment and advise

2006-03-09 Thread Just
In article <[EMAIL PROTECTED]>, Pedro Graca <[EMAIL PROTECTED]> wrote: > I'm sure this isn't very pythonic; comments and advice appreciated > > > def curious(text): > """ Return the words in input text scrambled except for the first and > last letter. """ > new_text

Re: advice on this little script

2006-03-09 Thread Grant Edwards
On 2006-03-09, John Salerno <[EMAIL PROTECTED]> wrote: > Grant Edwards wrote: >> On 2006-03-09, John Salerno <[EMAIL PROTECTED]> wrote: >> >>> from time import sleep >>> >>> minutes = input('Enter the number of minutes to wait: ') >>> >>> for x in range(minutes): >>> sleep(1.0) >>> minutes

Re: Python Evangelism

2006-03-09 Thread Dale Strickland-Clark
rtilley wrote: > Psychology is important. Just as important as good design. I think this > fact doesn't sink in to the Python community. You speak of fluff and ribbons and glitter. I think most people here are less concerned with psychology and more interested in pychology. -- Dale Strickland-C

Re: String functions: what's the difference?

2006-03-09 Thread gry
First, don't appologize for asking questions. You read, you thought, and you tested. That's more than many people on this list do. Bravo! One suggestion: when asking questions here it's a good idea to always briefly mention which version of python and what platform (linux, windows, etc) you're

Re: Python Evangelism

2006-03-09 Thread Dale Strickland-Clark
Steve Holden wrote: > Any suggestions for improvement? > > regards > Steve Get rid of the scarey face? :-) -- Dale Strickland-Clark Riverhall Systems www.riverhall.co.uk We're recruiting. See the web site for details. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Evangelism

2006-03-09 Thread Andrew Gwozdziewycz
On 3/9/06, rtilley <[EMAIL PROTECTED]> wrote: > > Doug Bromley wrote: > >> I can see Ruby overtaking Python if we don't ALL do something about it. > > I think it's the name. Python. Let's change it to something nicer. Think > about it... if you found a Ruby, you'd pick it up and put it in your > p

Re: python debugging question

2006-03-09 Thread Harry George
[EMAIL PROTECTED] writes: > I am a python newbie. I have writen some 500 lines of code. There are 4 > classes and in all 5 files. > > Now, I am trying to run the program. I am getting wrong values for the > simulation results. > Is there any debugging facilities in python which would let me go st

Re: Python Evangelism

2006-03-09 Thread rtilley
Dale Strickland-Clark wrote: > rtilley wrote: > > >>Psychology is important. Just as important as good design. I think this >>fact doesn't sink in to the Python community. > > > You speak of fluff and ribbons and glitter. Yes, I know. Great products, ideas and methods have lost mind share to

ANN: CherryPy-2.2.0-rc1 released

2006-03-09 Thread remi
Hello everyone, I'm happy to announce that the first release candidate for CherryPy-2.2.0 is now available. This release includes various bugfixes, a new benchmarking tool and improved WSGI support. Check out this great post from Christian Wyglendowski to see how you can run multiple WSGI-Cherry

Re: is there any overheard with try/except statements?

2006-03-09 Thread John Salerno
Alex Martelli wrote: > In general, it's more frequent for EAFP to be handier and more solid, > and performance may well not matter -- but if you find yourself trying > to squeeze every last drop of performance from a region of your code > that profiling has shown to be a bottleneck, module timeit

Re: Simple questions on use of objects (probably faq)

2006-03-09 Thread Michael
Brian Elmegaard wrote: ... > The code that runs: > > class Foo: > def __init__(self,x): > self.x=x > > y=[] > y.append(Foo(10.0)) > y.append(Foo(110.0)) > y.append(Foo(60.0)) > > ys=[] > y_max=0.0 > y_min=0.0 > > for s in y: > ys.extend([s.x]) > y_max=max(s.x,y_max) > y_

A bit OT: Python prompts display as nested mail quotes in Thunderbird

2006-03-09 Thread Joel Hedlund
Hi Sorry to bother you with my OT problems, but my newsgroup reader (Thunderbird) displays explicitly written python prompts as triple nested mail quotes (with lines in alternating colors in the margins). That's pretty tiresome to look at in a python newsgroup. Therefore, I'm looking for a way

Re: advice on this little script

2006-03-09 Thread John Salerno
Steve Holden wrote: > You might also want to synchronize to a caesium clock, but the guy is > timing his laundry, for Pete's sake! Can we agree your approach, while > theoretically sound, might be a little over-complicated for a first > application? LOL. Thanks, I was about to fall out of my c

Re: New python.org website

2006-03-09 Thread msoulier
I don't mind the logo or the colour scheme, but I do mind the first paragraph in bolded text. What, you figure the readers can't figure out how to find "What is Python?" by themselves? Bold should be used sparingly. This is serious overuse. Otherwise, I like it. -- http://mail.python.org/mailma

Re: advice on this little script

2006-03-09 Thread John Salerno
Alex Martelli wrote: > I only use the 'from' statement to import specific modules from a > package, never to import specific objects (functions, classes, or > whatever) from a module. I like that. So in my case I'd use 'import time' (which I actually already changed last night). I think especial

Re: how to get a page's html code via a proxy

2006-03-09 Thread JuHui
thank you! I am not good at it. -- http://mail.python.org/mailman/listinfo/python-list

Re: advice on this little script

2006-03-09 Thread Alex Martelli
Kent Johnson <[EMAIL PROTECTED]> wrote: ... > If you use from xx import yy, searching for yy will show you its > provenance as well. But when seeing the barename yy, it gives no clue whether the module you're reading used 'from xx import yy' or defined yy in any other way (localy, globally, or

Re: Python Evangelism

2006-03-09 Thread Felipe Almeida Lessa
Em Qui, 2006-03-09 às 09:51 +, Steve Holden escreveu: > I've been thinking (and blogging) about python evangelism since PyCon, > as a result of which I created a squidoo lens: > >http://www.squidoo.com/pythonlogy > > Imagine my surprise at discovering that this has gone up in rank (by >

Re: First script, please comment and advise

2006-03-09 Thread bearophileHUGS
My version is similar to Just one: from random import shuffle def scramble_text(text): """Return the words in input text string scrambled except for the first and last letter.""" def scramble_word(word): if len(word) < 4: return word core = list(word[1:-1]) shu

Hashtables in pyhton ...

2006-03-09 Thread Konrad Mühler
Hi, are there predefinded chances to use hashtables in python? How can I use Hashtable in python? Or do I have to implement this on my own? Thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: why no block comments in Python?

2006-03-09 Thread msoulier
> (and if you don't, you can quickly comment out regions by putting them > inside a triple-quoted string.) Although that will use up memory, as opposed to a comment. Still, it's simple enough in an editor like Vim or Emacs to highlight a region, and define a macro to add/remove #s. Any Python IDE

Re: why no block comments in Python?

2006-03-09 Thread Roy Smith
msoulier <[EMAIL PROTECTED]> wrote: >> (and if you don't, you can quickly comment out regions by putting them >> inside a triple-quoted string.) > >Although that will use up memory, as opposed to a comment. I can't imagine a realistic scenario where the amount of memory wasted by triple-quoting ou

Re: why no block comments in Python?

2006-03-09 Thread Peter Otten
msoulier wrote: >> (and if you don't, you can quickly comment out regions by putting them >> inside a triple-quoted string.) > > Although that will use up memory, as opposed to a comment. Doesn't seem so: >>> def f(): ... "docstring" ... "another string" ... a = 42 ... "yet ano

Re: Hashtables in pyhton ...

2006-03-09 Thread Max M
Konrad Mühler wrote: > Hi, > > are there predefinded chances to use hashtables in python? How can I use > Hashtable in python? Or do I have to implement this on my own? >>> a_hash_is_a_dict = {'key':'value'} >>> a_hash_is_a_dict['key2'] = 'value 2' >>> a_hash_is_a_dict['key'] 'value' -- h

Re: advice on this little script

2006-03-09 Thread Alex Martelli
John Salerno <[EMAIL PROTECTED]> wrote: > Alex Martelli wrote: > > > I only use the 'from' statement to import specific modules from a > > package, never to import specific objects (functions, classes, or > > whatever) from a module. > > I like that. So in my case I'd use 'import time' (which I

Re: Inline assignments

2006-03-09 Thread jillson
Coming from a background that exposed me to far too many languages, I find the latter two examples (i.e. use try/except) to be horrible solutions. It's not a matter of light/heavy weight, it's a matter of using exceptions for normal loop flow control is a really bad idea. 1) I think it's less cle

  1   2   3   >