Re: along the lines, hash and obj. id.

2008-02-26 Thread castironpi
On Feb 25, 11:30 pm, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On Mon, 25 Feb 2008 17:55:18 -0800 (PST), [EMAIL PROTECTED] declaimed > the following in comp.lang.python: > > > I'd like to do this: > > > a= list( range( 5 ) ) > > assert a== [ 0, 1, 2, 3, 4 ] > > for i in ref( a ): > >     i.ref

executing a python program by specifying only its name in terminal or command line

2008-02-26 Thread bharath venkatesh
hi, i wanna run a python program by specifying only its name ex prog with the arguments in the terminal or command line instead of specifying python prog in the terminal to run the program not even specifying the it with .py extension .. for example i want to run the python program named pro

Problems Generating HTML With pydoc

2008-02-26 Thread Juha S.
Hi, I'm trying to generate HTML docs for a Python package (directory) currently containing an empty __init__.py and a Module.py file with some classes and docstrings. I tried using the command "F:\path\to\project\pydoc.py -w myPackage" at the Vista command prompt, and I get "wrote myPackage.ht

Re: Is crawling the stack "bad"? Why?

2008-02-26 Thread Steve Holden
Russell Warren wrote: > Thanks Ian... I didn't know about threading.local before but have been > experimenting and it will likely come in quite handy in the future. > For this particular case it does basically seem like a replacement for > the threadID indexed dictionary, though. ie: I'll still ne

Re: PHP Developer highly interested in Python (web development) with some open questions...

2008-02-26 Thread CE
about the encryption: is ur product more valuable than the linux kernel? -- http://mail.python.org/mailman/listinfo/python-list

Re: executing a python program by specifying only its name in terminal or command line

2008-02-26 Thread Steve Holden
bharath venkatesh wrote: > hi, >i wanna run a python program by specifying only its name ex prog > with the arguments in the terminal or command line instead of specifying > python prog in the terminal to run the program not even specifying the > it with .py extension .. > for example i

Re: executing a python program by specifying only its name in terminal or command line

2008-02-26 Thread Robert Bossy
Steve Holden wrote: > bharath venkatesh wrote: > >> hi, >>i wanna run a python program by specifying only its name ex prog >> with the arguments in the terminal or command line instead of specifying >> python prog in the terminal to run the program not even specifying the >> it with .

Re: __getattribute__ meta class?

2008-02-26 Thread grflanagan
On Feb 26, 3:43 am, "bambam" <[EMAIL PROTECTED]> wrote: > I have a class containing a series of classes like this: > > class Th(Externaldevice): > class _Communicate(commandset2.CommandSet_Communicate): > def __getattribute__(self,attrname): > attr = > commandset2.CommandSet_Communicate

Re: buliding log files

2008-02-26 Thread Thinker
diljeet kaur wrote: > hi > im working on pyqt environment > i want to know how to take log or how to build log files of the output > > > Looking for last minute shopping deals? Find them fast with Yahoo! > Search. >

how to measure memory usage on Mac OSX ?

2008-02-26 Thread masayuki.takagi
hi all, i want to measure memory usage of my python process on Mac OSX. i tired resource module, but it doesn't work on OSX. how can i get it ? thnx. -- masayuki takagi -- http://mail.python.org/mailman/listinfo/python-list

RE: Web site for comparing languages syntax

2008-02-26 Thread Andreas Tawn
>Sebastian Bassi wrote: >> I know there is one site with wikimedia software installed, that is >> made for comparing the syntax of several computer languages (Python >> included). But don't remember the URL. Anyone knows this site? > >http://99-bottles-of-beer.net/ > >is one such site, though I don

Re: how to measure memory usage on Mac OSX ?

2008-02-26 Thread 7stud
On Feb 26, 3:43 am, "masayuki.takagi" <[EMAIL PROTECTED]> wrote: > hi all, > > i want to measure memory usage of my python process on Mac OSX. > > i tired resource module, but it doesn't work on OSX. > > how can i get it ? > > thnx. > > -- masayuki takagi #mac osx 10.4.7 import resource print res

Re: Question about PyPI and 'easy_install'

2008-02-26 Thread Vsevolod Balashov
On Feb 24, 10:38 pm, makoto kuwata <[EMAIL PROTECTED]> wrote: > Hi, > > I have a trouble around PyPI and easy_install. > > I have developed OSS (Tenjin) and registered it to > PyPI.http://pypi.python.org/pypi/Tenjin/0.6.1 > > But I can't install it by 'easy_install' command. > Hi! I`m think this

Re: network programming: how does s.accept() work?

2008-02-26 Thread 7stud
On Feb 25, 10:00 pm, Roy Smith <[EMAIL PROTECTED]> wrote: > In article > <[EMAIL PROTECTED]>, > >  7stud <[EMAIL PROTECTED]> wrote: > > But your claim that the server doesn't change its port flies in the > > face of every description I've read about TCP connections and > > accept().  The articles a

Re: Tkinter Menu Item Activation

2008-02-26 Thread Eric Brunel
On Fri, 22 Feb 2008 13:30:06 +0100, <[EMAIL PROTECTED]> wrote: [snip] > Sub problems: how to change state of menu item? how to detect changes > in Text widget? If you have a reasonably recent tcl/tk version (>= 8.4), you should have a edit_modified() method on your Text telling you if it has bee

download students tutorials,ebooks,softwares here for Free!!!!

2008-02-26 Thread priya4u
download students tutorials,ebooks,softwares here for Free Download Softwares Ebooks Students tutorials Games Ring tones Wallpapers and Lots of fun everything for FREE only at www.studentshangout.com -- http://mail.python.org/mailman/listinfo/python-list

Re: network programming: how does s.accept() work?

2008-02-26 Thread 7stud
On Feb 25, 10:08 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > There can be many TCP connections to a server all using the same > endpoint. Take a look at the traffic coming out of any busy web server: > everything that comes out of the same server comes from port 80. That > doesn't stop it listeni

Re: how to measure memory usage on Mac OSX ?

2008-02-26 Thread masayuki.takagi
On 2月26日, 午後8:02, 7stud <[EMAIL PROTECTED]> wrote: > On Feb 26, 3:43 am, "masayuki.takagi" <[EMAIL PROTECTED]> wrote: > > > hi all, > > > i want to measure memory usage of my python process on Mac OSX. > > > i tired resource module, but it doesn't work on OSX. > > > how can i get it ? > > > thnx. >

Re: How about adding rational fraction to Python?

2008-02-26 Thread Lie
On Feb 25, 5:41 am, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > On Sun, 24 Feb 2008 10:09:37 -0800, Lie wrote: > > On Feb 25, 12:46 am, Steve Holden <[EMAIL PROTECTED]> wrote: > >> Lie wrote: > >> > On Feb 18, 1:25 pm, Carl Banks <[EMAIL PROTECTED]> wrote: > >> >> On Feb 17, 1:4

Re: How about adding rational fraction to Python?

2008-02-26 Thread Lie
On Feb 25, 5:41 am, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > On Sun, 24 Feb 2008 10:09:37 -0800, Lie wrote: > > On Feb 25, 12:46 am, Steve Holden <[EMAIL PROTECTED]> wrote: > >> Lie wrote: > >> > On Feb 18, 1:25 pm, Carl Banks <[EMAIL PROTECTED]> wrote: > >> >> On Feb 17, 1:4

Re: Article of interest: Python pros/cons for the enterprise

2008-02-26 Thread Paul Boddie
On 25 Feb, 19:44, Nicola Musatti <[EMAIL PROTECTED]> wrote: > > Witness the kind of > libraries/framework that used to and still come with some commercial C+ > + implementation, and even some free/open source ones; Boost, ACE and > wxWidgets are the first

Re: How about adding rational fraction to Python?

2008-02-26 Thread Lie
On Feb 25, 11:34 am, casevh <[EMAIL PROTECTED]> wrote: > On Feb 24, 7:56 pm, Mensanator <[EMAIL PROTECTED]> wrote: > > > But that doesn't mean they become less manageable than > > other unlimited precision usages. Did you see my example > > of the polynomial finder using Newton's Forward Difference

Re: urllib slow on Leopard

2008-02-26 Thread Paul Boddie
On 24 Feb, 22:14, Stefan Behnel <[EMAIL PROTECTED]> wrote: > > It likely tries to load the DTD in the background, which requires network > access. > > http://www.w3.org/blog/systeam/2008/02/08/w3c_s_excessive_dtd_traffic This is principally concerned with the standard library XML modules, not url

Re: How about adding rational fraction to Python?

2008-02-26 Thread Lie
On Feb 25, 1:58 pm, Carl Banks <[EMAIL PROTECTED]> wrote: > What part of "repeated additions and divisions" don't you understand? What part of additions and subtractions don't you understand? I'm invalidating half of your statement, the division part, but validating another half, the additions par

Re: network programming: how does s.accept() work?

2008-02-26 Thread Hrvoje Niksic
7stud <[EMAIL PROTECTED]> writes: > When you surf the Web, say to http://www.google.com, your Web browser > is a client. The program you contact at Google is a server. When a > server is run, it sets up business at a certain port, say 80 in the > Web case. It then waits for clients to contact it.

Re: How about adding rational fraction to Python?

2008-02-26 Thread Lie
On Feb 25, 11:18 pm, Carl Banks <[EMAIL PROTECTED]> wrote: > On Feb 25, 9:41 am, Mensanator <[EMAIL PROTECTED]> wrote: > > > > > On Feb 25, 12:58�am, Carl Banks <[EMAIL PROTECTED]> wrote: > > > > On Feb 24, 10:56 pm, Mensanator <[EMAIL PROTECTED]> wrote: > > > > > But that doesn't mean they become

low price laptop

2008-02-26 Thread Richi
Compaq Presario Intel Laptop Model No: 1980Tu :-# Intel Pentium Processor Dual-core Processor T2080 1.73 GHz # Intel 965 GM chipset # 512MB DDR-2 RAM # 80 GB SATA Hard disk # 8X Super Multi double layer drive (8 # 5 GB) more cheapest laptops available Please visit -http://

Re: network programming: how does s.accept() work?

2008-02-26 Thread Frank Millman
7stud wrote: > > If two sockets are bound to the same host and port on the server, how > does data sent by the client get routed? Can both sockets recv() the > data? I have learned a lot of stuff I did not know before from this thread, so I think I can answer that. There must be a layer of sof

Re: network programming: how does s.accept() work?

2008-02-26 Thread Steve Holden
7stud wrote: > On Feb 25, 10:00 pm, Roy Smith <[EMAIL PROTECTED]> wrote: >> In article >> <[EMAIL PROTECTED]>, >> >> 7stud <[EMAIL PROTECTED]> wrote: >>> But your claim that the server doesn't change its port flies in the >>> face of every description I've read about TCP connections and >>> accept

Re: Article of interest: Python pros/cons for the enterprise

2008-02-26 Thread Nicola Musatti
On Feb 26, 12:58 pm, Paul Boddie <[EMAIL PROTECTED]> wrote: > On 25 Feb, 19:44, Nicola Musatti <[EMAIL PROTECTED]> wrote: > > > > > Witness the kind of > > libraries/framework that used to and still come with some commercial C+ > > + implementation, and even some free/open source ones; Boost, ACE a

Re: is there enough information?

2008-02-26 Thread castironpi
> Create a class which will ensure > turn-taking of events, using a get method with and integer index, by > waiting for the prior index to complete before starting the next. from thread import start_new_thread as launch from threading import Lock import time from functools import partial class Wi

Re: Article of interest: Python pros/cons for the enterprise

2008-02-26 Thread Nicola Musatti
On Feb 24, 5:25 am, Paul Rubin wrote: > Jeff Schwab <[EMAIL PROTECTED]> writes: > > > there's actually a published book specifically about C++ pitfalls. > > > Mercy, a whole book? > > http://search.barnesandnoble.com/booksearch/isbnInquiry.asp?EAN=97802... Read the title

Re: Article of interest: Python pros/cons for the enterprise

2008-02-26 Thread Nicola Musatti
On Feb 25, 3:59 pm, Sebastian Kaliszewski <[EMAIL PROTECTED]> wrote: [...] > 1. Your "generic" resource-management infrastructure is not generic to begin > with! It does not work for mutually dependant resources. How so? Could you give a concrete example? > 2. Your "generic" infrastructure increa

Re: Article of interest: Python pros/cons for the enterprise

2008-02-26 Thread Carl Banks
On Feb 26, 6:58 am, Paul Boddie <[EMAIL PROTECTED]> wrote: > The Lisp > scene has also been plagued by an unnecessary deference to commercial > interests, which means that the hottest topic on comp.lang.lisp right > now is probably Paul Graham's much-anticipated but arguably > disappointing Lisp "s

Indentation and optional delimiters

2008-02-26 Thread bearophileHUGS
This is the best praise of semantic indentation I have read so far, by Chris Okasaki: http://okasaki.blogspot.com/2008/02/in-praise-of-mandatory-indentation-for.html A quotation: >Imagine my surprise when I started teaching this language and found the >students picking it up faster than any langu

Re: Odd behaviour of *.pth files and Apache

2008-02-26 Thread D'Arcy J.M. Cain
On Tue, 26 Feb 2008 03:01:33 -0200 "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Sat, 23 Feb 2008 12:52:45 -0200, D'Arcy J.M. Cain <[EMAIL PROTECTED]> > escribió: > > I have more information now. It seems that it recurses the .pth files > > it finds in PYTHONPATH but not for directories fo

blog

2008-02-26 Thread yoga
www.bussines-yoga.blogspot.com My Search Funds Ok so this is not tech/gadget related but i had to post about this I have found a great new site and it is earning me £0।03 for every single I make on the net www.bussines-yoga.blogspot.com My search funds have teamed up with ask.com So basicall

Re: buliding log files

2008-02-26 Thread subeen
On Feb 26, 3:58 pm, Thinker <[EMAIL PROTECTED]> wrote: > diljeet kaur wrote: > > hi > > im working on pyqt environment > > i want to know how to take log or how to build log files of the output > > > > > Looking for last minut

Re: How about adding rational fraction to Python?

2008-02-26 Thread cokofreedom
What is it with people and double++ posting... If you have a lot to say, say it together and take the time to slow down, re-read it and not just fly it out, line by line, by line, by line... To answer only the following: > That's creepy for people that are new to programming and doesn't know > h

dict.get and str.xsplit

2008-02-26 Thread bearophileHUGS
When I use dictionaries I find the dict.get() method very handy, and I'd like to use it often, but I think it's quite slow. This is a small benchmark: from random import randrange from timeit import default_timer as clock def main(N, M): keys = list(set(randrange(2*N) for n in xrange(N)))

Re: dict.get and str.xsplit

2008-02-26 Thread Marc 'BlackJack' Rintsch
On Tue, 26 Feb 2008 06:02:12 -0800, bearophileHUGS wrote: > This is a real difference, that has real impact on the programs I > write, so I often use the if/else approach, despite the dict.get() > method being semantically fitter and shorter. > So can the dict.get() method be speed up? And if not,

Re: How about adding rational fraction to Python?

2008-02-26 Thread J. Cliff Dyer
On Tue, 2008-02-26 at 04:29 -0800, Lie wrote: > > J Cliff Dyer: > > I'm in the camp that believes that 3/4 does indeed yield the integer > 0, > > but should be spelled 3//4 when that is the intention. > > That's creepy for people that are new to programming and doesn't know > how CPUs work and are

Re: How about adding rational fraction to Python?

2008-02-26 Thread D'Arcy J.M. Cain
On Tue, 26 Feb 2008 08:55:22 -0500 "J. Cliff Dyer" <[EMAIL PROTECTED]> wrote: > Of course. That's why I think you ought to spell it 3//4. Nobody gets > confused when a strange operator that they've never seen before does > something unusual. Average Jo off the street looks at python code and > s

Re: Article of interest: Python pros/cons for the enterprise

2008-02-26 Thread Marc 'BlackJack' Rintsch
On Tue, 26 Feb 2008 05:23:11 -0800, Nicola Musatti wrote: > At least in C++ resource management only becomes more complicated if you > need more control. I think this is the point where so many people here disagree. I'm coming from a "garbage collection" background in OOP programming. In C++ re

Re: dict.get and str.xsplit

2008-02-26 Thread Steve Holden
Marc 'BlackJack' Rintsch wrote: > On Tue, 26 Feb 2008 06:02:12 -0800, bearophileHUGS wrote: > >> This is a real difference, that has real impact on the programs I >> write, so I often use the if/else approach, despite the dict.get() >> method being semantically fitter and shorter. >> So can the di

Re: dict.get and str.xsplit

2008-02-26 Thread castironpi
On Feb 26, 8:14 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > On Tue, 26 Feb 2008 06:02:12 -0800, bearophileHUGS wrote: > > This is a real difference, that has real impact on the programs I > > write, so I often use the if/else approach, despite the dict.get() > > method being semantica

Re: How about adding rational fraction to Python?

2008-02-26 Thread Marc 'BlackJack' Rintsch
On Tue, 26 Feb 2008 04:29:18 -0800, Lie wrote: >> J Cliff Dyer: >> I'm in the camp that believes that 3/4 does indeed yield the integer 0, >> but should be spelled 3//4 when that is the intention. > > That's creepy for people that are new to programming and doesn't know > how CPUs work and are us

Re: Article of interest: Python pros/cons for the enterprise

2008-02-26 Thread Aaron Watters
On Feb 25, 8:29 am, Nicola Musatti <[EMAIL PROTECTED]> wrote: > > And the migration to Python is due in large part because of an > > additional factor of 3-4x in personal productivity (over Java). > > Improvements in runtime performance wouldn't hurt, but for many > > applications that's not an iss

Re: dict.get and str.xsplit

2008-02-26 Thread Marc 'BlackJack' Rintsch
On Tue, 26 Feb 2008 06:33:01 -0800, castironpi wrote: > On Feb 26, 8:14 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: >> On Tue, 26 Feb 2008 06:02:12 -0800, bearophileHUGS wrote: >> > This is a real difference, that has real impact on the programs I >> > write, so I often use the if/else

Re: dict.get and str.xsplit

2008-02-26 Thread bearophileHUGS
Marc 'BlackJack' Rintsch: > I guess it's the method lookup that's the slow part. Factor it out of the > loop and measure again:: I did know of that optimization, but sometimes I "forget" about it... The new timings: Output timings, best of 3, unloaded CPU: 2.32 s with adict.get 1.56 s with "in"

Re: How about adding rational fraction to Python?

2008-02-26 Thread Marc 'BlackJack' Rintsch
On Tue, 26 Feb 2008 09:29:55 -0500, D'Arcy J.M. Cain wrote: > If 3/4 ever returned 0.75 in any language I would drop that language. Then prepare to drop Python from version 3 on: Python 3.0a1 (py3k, Aug 31 2007, 21:20:42) [GCC 4.1.2 (Ubuntu 4.1.2-0ubuntu4)] on linux2 Type "help", "copyright", "c

Re: Indentation and optional delimiters

2008-02-26 Thread castironpi
On Feb 26, 7:36 am, [EMAIL PROTECTED] wrote: > This is the best praise of semantic indentation I have read so far, by > Chris > Okasaki:http://okasaki.blogspot.com/2008/02/in-praise-of-mandatory-indentatio... > > A quotation: > > >Imagine my surprise when I started teaching this language and found

Re: How about adding rational fraction to Python?

2008-02-26 Thread Carl Banks
On Feb 26, 9:29 am, "D'Arcy J.M. Cain" <[EMAIL PROTECTED]> wrote: > On Tue, 26 Feb 2008 08:55:22 -0500 > "J. Cliff Dyer" <[EMAIL PROTECTED]> wrote: > > > Of course. That's why I think you ought to spell it 3//4. Nobody gets > > confused when a strange operator that they've never seen before does

Re: dict.get and str.xsplit

2008-02-26 Thread castironpi
On Feb 26, 8:40 am, [EMAIL PROTECTED] wrote: > Marc 'BlackJack' Rintsch: > > > I guess it's the method lookup that's the slow part.  Factor it out of the > > loop and measure again:: > > I did know of that optimization, but sometimes I "forget" about it... > The new timings: > > Output timings, bes

Re: How about adding rational fraction to Python?

2008-02-26 Thread Lie
On Feb 26, 9:02 pm, [EMAIL PROTECTED] wrote: > > That's creepy for people that are new to programming and doesn't know > > how CPUs work and are used to general mathematics. That means most > > people. As programming language are now more accessible to regular > > people without specialized Compute

Re: dict.get and str.xsplit

2008-02-26 Thread marek . rocki
[EMAIL PROTECTED] napisał(a): > It's slower still, despite doing the lookup two times half of the > times (half keys are present in the test set). The "in" is an > operator, it's faster than a method call, but I don't understand the > other details. Now the difference between 1.78 and 1.56 is small

Andy Pausch (of Alice fame) -- last lecture

2008-02-26 Thread Aaron Watters
Hi folks. Andy Pausch who headed up the Alice project which aims to teach 3D animation using Python has gained additional fame from his "last lecture" where he talks about being diagnosed with terminal pancreatic cancer, and comments on life in general. http://www.cs.cmu.edu/~pausch/ You've pr

Re: How about adding rational fraction to Python?

2008-02-26 Thread D'Arcy J.M. Cain
On Tue, 26 Feb 2008 06:45:45 -0800 (PST) Carl Banks <[EMAIL PROTECTED]> wrote: > On Feb 26, 9:29 am, "D'Arcy J.M. Cain" <[EMAIL PROTECTED]> wrote: > > If 3/4 ever returned 0.75 in any language I would drop that language. > > Have fun dropping Python, then, chief. Integer division with / is > alre

Re: How about adding rational fraction to Python?

2008-02-26 Thread D'Arcy J.M. Cain
On Tue, 26 Feb 2008 06:59:44 -0800 (PST) Lie <[EMAIL PROTECTED]> wrote: > The problem lies on which maths is the real maths? In real world, 3/4 > is 0.75 is 0.75 and that's an unchangeable fact, so programming Which real world is that? In my real world 3/4 is 0 with a remainder of 3. What happen

Re: Web site for comparing languages syntax

2008-02-26 Thread Thomas Guettler
Sebastian Bassi schrieb: > Hello, > > I know there is one site with wikimedia software installed, that is > made for comparing the syntax of several computer languages (Python > included). But don't remember the URL. Anyone knows this site? > It does not use wikimedia, but it's good: http://ple

Re: Andy Pausch (of Alice fame) -- last lecture

2008-02-26 Thread Aaron Watters
On Feb 26, 10:03 am, Aaron Watters <[EMAIL PROTECTED]> wrote: > Hi folks. Andy Pausch who headed up the Alice project > which aims to teach 3D animation using Python ... Oops. It looks like Alice 1.0 was Python; 2.0 is java, but whatever. -- Aaron Watters === http://www.xfeedme.com/nucular/pyd

Re: How about adding rational fraction to Python?

2008-02-26 Thread Lie
On Feb 26, 10:17 pm, "D'Arcy J.M. Cain" <[EMAIL PROTECTED]> wrote: >Carl Banks <[EMAIL PROTECTED]> wrote: >> On Feb 26, 9:29 am, "D'Arcy J.M. Cain" <[EMAIL PROTECTED]> wrote: >> > If 3/4 ever returned 0.75 in any language I would drop that language. > >> Have fun dropping Python, then, chief. Inte

Break lines?

2008-02-26 Thread saneman
I have made this string: TITLE = 'Efficiency of set operations: sort model, (cphstl::set::insert(p,e)^n cphstl::set::insert(e)), integer' But I am not allowed to break the line like that: IndentationError: unexpected indent How do I break a line? -- http://mail.pytho

Re: Indentation and optional delimiters

2008-02-26 Thread bearophileHUGS
[EMAIL PROTECTED]: > Why not b = copyonwrite( a )? > Subclass the interpreter-- make your own session. Your idea may work, but I am talking about a new language (with some small differences, not a revolution). Making such language efficient enough may require to add some complex tricks, copy-on-wr

Re: How about adding rational fraction to Python?

2008-02-26 Thread Arnaud Delobelle
On Feb 26, 2:45 pm, Carl Banks <[EMAIL PROTECTED]> wrote: > On Feb 26, 9:29 am, "D'Arcy J.M. Cain" <[EMAIL PROTECTED]> wrote: > > > On Tue, 26 Feb 2008 08:55:22 -0500 > > "J. Cliff Dyer" <[EMAIL PROTECTED]> wrote: > > > > Of course.  That's why I think you ought to spell it 3//4.  Nobody gets > > >

Re: Web site for comparing languages syntax

2008-02-26 Thread bearophileHUGS
There is this site too, I have written many small programs for it: http://www.codecodex.com/wiki/index.php?title=Main_Page Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list

Re: dict.get and str.xsplit

2008-02-26 Thread bearophileHUGS
[EMAIL PROTECTED]: > As for the original prooblem, why not use > defaultdict? I think it's the most idiomatic way to achieve what we > want. And also the fastest one, according to my quick-and-dirty tests: It adds the new keys, I can't accept that: >>> from collections import defaultdict as dd >>

Re: How about adding rational fraction to Python?

2008-02-26 Thread Hrvoje Niksic
"D'Arcy J.M. Cain" <[EMAIL PROTECTED]> writes: > I have not been following Python development that closely lately so > I was not aware of that. I guess I won't be going to Python 3 then. > It's great that Python wants to attract young, new programmers. Too > bad about us old farts I guess. Befor

Re: Break lines?

2008-02-26 Thread Tim Chase
> I have made this string: > > TITLE = 'Efficiency of set operations: sort model, >(cphstl::set::insert(p,e)^n cphstl::set::insert(e)), integer' > > But I am not allowed to break the line like that: > > IndentationError: unexpected indent > > How do I break a line? Dep

Re: Web site for comparing languages syntax

2008-02-26 Thread Sebastian Bassi
On 2/26/08, Andreas Tawn <[EMAIL PROTECTED]> wrote: > Maybe http://www.rosettacode.org ? That's a wiki. YES!!!. Thank you!! -- Sebastián Bassi (セバスティアン). Diplomado en Ciencia y Tecnología. Curso Biologia molecular para programadores: http://tinyurl.com/2vv8w6 GPG Fingerprint: 9470 0980 620D ABFC

Re: Break lines?

2008-02-26 Thread Bill Scherer
saneman wrote: > I have made this string: > > > TITLE = 'Efficiency of set operations: sort model, >(cphstl::set::insert(p,e)^n cphstl::set::insert(e)), integer' > > But I am not allowed to break the line like that: > > IndentationError: unexpected indent > > How do I break

Re: Break lines?

2008-02-26 Thread saneman
Tim Chase wrote: >> I have made this string: >> >> TITLE = 'Efficiency of set operations: sort model, >> (cphstl::set::insert(p,e)^n cphstl::set::insert(e)), integer' >> >> But I am not allowed to break the line like that: >> >> IndentationError: unexpected indent >> >> How do I b

Re: using PIL for PCA analysis

2008-02-26 Thread harryos
>Paul McGuire wrote > # following approx fromhttp://www.dfanning.com/ip_tips/color2gray.html > grayscale = lambda (R,G,B) : int(0.3*R + 0.59*G + 0.11*B) > print [ [ grayscale(rgb) for rgb in row ] for row in sampledata ] Paul in PIL handbook ,they mention a Luma transform on page15, under the im

Re: Getting python docstings

2008-02-26 Thread Rufman
> You know that `epydoc` supports reStructuredText as markup language!? > *what* exactly *do* you want? Yes, I do... i was wondering if docutils (http:// docutils.sourceforge.net/) could do that as well (get my reStructuredText documentation) Stephane -- http://mail.python.org/mailman/listin

Re: What does this bogus code in urlparse do?

2008-02-26 Thread Chris Mellon
On Mon, Feb 25, 2008 at 11:04 PM, John Nagle <[EMAIL PROTECTED]> wrote: > See > "http://svn.python.org/view/python/trunk/Lib/urlparse.py?rev=60163&view=markup"; > > Look at "urljoin". > > What does the code marked "# XXX The stuff below is bogus in various > ways..." do? > > I think it's an at

Re: How about adding rational fraction to Python?

2008-02-26 Thread D'Arcy J.M. Cain
On Tue, 26 Feb 2008 16:49:10 +0100 Hrvoje Niksic <[EMAIL PROTECTED]> wrote: > "D'Arcy J.M. Cain" <[EMAIL PROTECTED]> writes: > > > I have not been following Python development that closely lately so > > I was not aware of that. I guess I won't be going to Python 3 then. > > It's great that Python

Re: Break lines?

2008-02-26 Thread Tim Chase
> Ok thanks! Btw why double quotes " instead of single ' ? Either one will do...there's not much difference. I try to use double-quotes most of the time, just so when I include an apostrophe in-line (which I do more often than I include a double-quote in-line), I don't have to think. strin

Re: dict.get and str.xsplit

2008-02-26 Thread marek . rocki
[EMAIL PROTECTED] napisał(a): > [EMAIL PROTECTED]: > > As for the original prooblem, why not use > > defaultdict? I think it's the most idiomatic way to achieve what we > > want. And also the fastest one, according to my quick-and-dirty tests: > > It adds the new keys, I can't accept that: Right,

Re: Indentation and optional delimiters

2008-02-26 Thread castironpi
On Feb 26, 9:45 am, [EMAIL PROTECTED] wrote: > [EMAIL PROTECTED]: > > > Why not b = copyonwrite( a )? > > Subclass the interpreter-- make your own session. > > Your idea may work, but I am talking about a new language (with some > small differences, not a revolution). Making such language efficient

Re: is there enough information?

2008-02-26 Thread Preston Landers
On Feb 26, 1:45 am, [EMAIL PROTECTED] wrote: > Two options occurred to me, which the first showed up in the earlier > extremely skeletal and cryptic post: Perhaps you would be more likely to get the kind of help you seem to want if you refrained from posting "cryptic and skeletal" messages. The f

Re: How about adding rational fraction to Python?

2008-02-26 Thread Lie
On Feb 26, 9:33 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > On Tue, 26 Feb 2008 04:29:18 -0800, Lie wrote: > >> J Cliff Dyer: > >> I'm in the camp that believes that 3/4 does indeed yield the integer 0, > >> but should be spelled 3//4 when that is the intention. > > > That's creepy fo

How to turn a list of tuples into a dictionary?

2008-02-26 Thread mrstephengross
Let's say I've got a list of tuples, like so: ( ('a', '1'), ('b', '2'), ('c', '3') And I want to turn it into a dictionary in which the first value of each tuple is a key and the second value is a value, like so: { 'a' -> '1', 'b' -> '2', 'c' -> '3' } Is there a way to do this with a single

Re: How about adding rational fraction to Python?

2008-02-26 Thread Jeff Schwab
J. Cliff Dyer wrote: > On Tue, 2008-02-26 at 04:29 -0800, Lie wrote: >>> J Cliff Dyer: >>> I'm in the camp that believes that 3/4 does indeed yield the integer >> 0, >>> but should be spelled 3//4 when that is the intention. >> That's creepy for people that are new to programming and doesn't know >

Re: How to turn a list of tuples into a dictionary?

2008-02-26 Thread castironpi
On Feb 26, 11:00 am, mrstephengross <[EMAIL PROTECTED]> wrote: > Let's say I've got a list of tuples, like so: > >   ( ('a', '1'), ('b', '2'), ('c', '3') > > And I want to turn it into a dictionary in which the first value of > each tuple is a key and the second value is a value, like so: > >   { '

Python-URL! - weekly Python news and links (Feb 26)

2008-02-26 Thread Gabriel Genellina
QOTW: "I think not enough is made of the fact that Python combines legibility and power better than any other platform." - Michael Tobis http://mail.python.org/pipermail/advocacy/2008-February/000518.html "C++ is a compile-time, type-checked language, which means it is totally safer for newbi

Re: Article of interest: Python pros/cons for the enterprise

2008-02-26 Thread Paul Rubin
Nicola Musatti <[EMAIL PROTECTED]> writes: > > http://search.barnesandnoble.com/booksearch/isbnInquiry.asp?EAN=97802... > Read the title. This is about "C Traps and Pitfalls". Whoops, I think the same author wrote a similar one about C++. He hangs out here on this newsgroup sometimes. I didn't

Re: How to turn a list of tuples into a dictionary?

2008-02-26 Thread Paul Rubin
mrstephengross <[EMAIL PROTECTED]> writes: > ( ('a', '1'), ('b', '2'), ('c', '3') I'm not trying to be snide, but have you tried looking in the manual? See http://python.org/doc/lib and look at the section about built-in types, if you want to know things about tuples or dictionaries. -- http:/

Re: How to turn a list of tuples into a dictionary?

2008-02-26 Thread D'Arcy J.M. Cain
On Tue, 26 Feb 2008 09:00:54 -0800 (PST) mrstephengross <[EMAIL PROTECTED]> wrote: > Let's say I've got a list of tuples, like so: > > ( ('a', '1'), ('b', '2'), ('c', '3') > > And I want to turn it into a dictionary in which the first value of > each tuple is a key and the second value is a val

Re: Article of interest: Python pros/cons for the enterprise

2008-02-26 Thread Jeff Schwab
Nicola Musatti wrote: > On Feb 24, 5:25 am, Paul Rubin wrote: >> Jeff Schwab <[EMAIL PROTECTED]> writes: there's actually a published book specifically about C++ pitfalls. >>> Mercy, a whole book? >> http://search.barnesandnoble.com/booksearch/isbnInquiry.asp?EAN=978

Re: How about adding rational fraction to Python?

2008-02-26 Thread Steve Holden
D'Arcy J.M. Cain wrote: > On Tue, 26 Feb 2008 08:55:22 -0500 > "J. Cliff Dyer" <[EMAIL PROTECTED]> wrote: >> Of course. That's why I think you ought to spell it 3//4. Nobody gets >> confused when a strange operator that they've never seen before does >> something unusual. Average Jo off the stre

Re: How about adding rational fraction to Python?

2008-02-26 Thread D'Arcy J.M. Cain
On Tue, 26 Feb 2008 09:01:57 -0800 Jeff Schwab <[EMAIL PROTECTED]> wrote: > Or Jo thinks // is a typo, and helpfully "fixes" it. Exactly. "Programmers" who use a language without learning it are apt to do anything. -- D'Arcy J.M. Cain <[EMAIL PROTECTED]> | Democracy is three wolves htt

Re: Article of interest: Python pros/cons for the enterprise

2008-02-26 Thread Jeff Schwab
Jeff Schwab wrote: > Nicola Musatti wrote: >> On Feb 24, 5:25 am, Paul Rubin wrote: >>> Jeff Schwab <[EMAIL PROTECTED]> writes: > there's actually a published book specifically about C++ pitfalls. Mercy, a whole book? >>> http://search.barnesandnoble.com/booksear

Re: is there enough information?

2008-02-26 Thread castironpi
On Feb 26, 10:59 am, Preston Landers <[EMAIL PROTECTED]> wrote: > On Feb 26, 1:45 am, [EMAIL PROTECTED] wrote: > > > Two options occurred to me, which the first showed up in the earlier > > extremely skeletal and cryptic post: > > Perhaps you would be more likely to get the kind of help you seem t

Re: Reading a keypress

2008-02-26 Thread Jeff Schwab
Dennis Lee Bieber wrote: > On Mon, 25 Feb 2008 17:48:21 -0800, Jeff Schwab <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: >> What about curses? >> >> http://docs.python.org/lib/module-curses.html >> http://adamv.com/dev/python/curses/ > > I don't consider needing a 3rd pa

Re: How to turn a list of tuples into a dictionary?

2008-02-26 Thread mrstephengross
> How about this? > d = dict(tuples) Aha! I hadn't realized it could be so simple. --Steve -- http://mail.python.org/mailman/listinfo/python-list

Re: Indentation and optional delimiters

2008-02-26 Thread bearophileHUGS
[EMAIL PROTECTED]: > It's Unpythonic to compile a machine instruction out of a script. But > maybe in the right situations, with the right constraints on a > function, certain chunks could be native, almost like a mini- > compilation. How much machine instruction do you want to support? This lan

Re: How about adding rational fraction to Python?

2008-02-26 Thread Grant Edwards
On 2008-02-26, Lie <[EMAIL PROTECTED]> wrote: >> I'm in the camp that believes that 3/4 does indeed yield the integer 0, >> but should be spelled 3//4 when that is the intention. > > That's creepy for people that are new to programming and doesn't know > how CPUs work and are used to general mathe

Re: How about adding rational fraction to Python?

2008-02-26 Thread Grant Edwards
On 2008-02-26, Steve Holden <[EMAIL PROTECTED]> wrote: > D'Arcy J.M. Cain wrote: >> On Tue, 26 Feb 2008 08:55:22 -0500 >> "J. Cliff Dyer" <[EMAIL PROTECTED]> wrote: >>> Of course. That's why I think you ought to spell it 3//4. Nobody gets >>> confused when a strange operator that they've never se

Re: is there enough information?

2008-02-26 Thread Preston Landers
On Feb 26, 11:13 am, [EMAIL PROTECTED] wrote: > All I asked for was, ideas. Nope, you didn't. You said exactly this: "Specify {...} Is it enough?" and included a snipped of code that was not standalone, provided no context or explanatory information, and gave us no clue what you might be trying

Re: is there enough information?

2008-02-26 Thread Marc 'BlackJack' Rintsch
On Tue, 26 Feb 2008 09:13:35 -0800, castironpi wrote: > Back home, the original post would be interesting, so I wrote it. So you think of this group as your personal notepad. That explains a lot. :-/ Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

  1   2   3   >