Re: Passing a callable object to Thread

2008-02-15 Thread Jeff Schwab
Paul Rubin wrote: > Jeff Schwab <[EMAIL PROTECTED]> writes: >> Why not? They seem intuitive to me. I would find it weird if you >> couldn't have 0-tuple, and even weirder if you couldn't have a >> 1-tuple. Maybe my brain has been warped by too much C++ code

Re: Passing a callable object to Thread

2008-02-15 Thread Jeff Schwab
Steve Holden wrote: > Paul Rubin wrote: >> Steve Holden <[EMAIL PROTECTED]> writes: >>> Assuming you're right, what alternative would you suggest? Would it >>> allow parenthesized expressions to retain their customary meaning? >> >> It is kind of weird that there is even such a thing as a 1-tuple.

[OT] Re: TRAC - Trac, Project Leads, Python, and Mr. Noah Kantrowitz (sanitizer)

2008-02-16 Thread Jeff Schwab
Ilias Lazaridis wrote: > Essence: Spam spam spam spam... I just looked at your resume. What is Abstract Project Management? -- http://mail.python.org/mailman/listinfo/python-list

Re: TRAC - Trac, Project Leads, Python, and Mr. Noah Kantrowitz (sanitizer)

2008-02-16 Thread Jeff Schwab
Robert Klemme wrote: > On 16.02.2008 13:16, Ilias Lazaridis wrote: > > > > Oh, it's him again. Please do not respond. > > http://dev.eclipse.org/newslists/news.eclipse.foundation/msg00167.html > http://www.encyclopediadramatica.com/index.php/Ilias Thank you. I didn't recognize his name at fi

Re: QOTW: Re: dream hardware

2008-02-16 Thread Jeff Schwab
Aahz wrote: > In article <[EMAIL PROTECTED]>, > Jeff Schwab <[EMAIL PROTECTED]> wrote: >> [EMAIL PROTECTED] wrote: >>> On Feb 14, 10:50 pm, [EMAIL PROTECTED] (Aahz) wrote: >>>> In article <[EMAIL PROTECTED]>, >>>> Steven D'Aprano

Re: How about adding rational fraction to Python?

2008-02-16 Thread Jeff Schwab
Lie wrote: > Would all these problems with floating points be a rational reason to > add rational numbers support in Python or Py3k? (pun not intended) > > I agree, there are some numbers that is rationals can't represent > (like pi, phi, e) but these rounding problems also exist in floating > poi

Re: QOTW: Re: dream hardware

2008-02-16 Thread Jeff Schwab
[EMAIL PROTECTED] wrote: >> IHNTA, IJWTSA >> Thanks, but... That defines IHNTA, but not IJWTSA or IJWTW. "I just >> want to say...?" "I just want to watch?"- Hide quoted text - > > I just want to what? Exactly! -- http://mail.python.org/mailman/listinfo/python-list

Re: QOTW: Re: dream hardware

2008-02-16 Thread Jeff Schwab
Carl Banks wrote: > On Feb 16, 1:39 pm, Jeff Schwab <[EMAIL PROTECTED]> wrote: >> Aahz wrote: >>> In article <[EMAIL PROTECTED]>, >>> Jeff Schwab <[EMAIL PROTECTED]> wrote: >>>> [EMAIL PROTECTED] wrote: >>>>> On Feb 14, 10:50

Re: How about adding rational fraction to Python?

2008-02-16 Thread Jeff Schwab
Carl Banks wrote: > On Feb 16, 3:03 pm, Lie <[EMAIL PROTECTED]> wrote: >> Although rationals have its limitations too, it is a much >> better choice compared to floats/Decimals for most cases. > > Maybe that's true for your use cases, but it's not true for most cases > in general. > > Rationals a

Re: How about adding rational fraction to Python?

2008-02-16 Thread Jeff Schwab
Carl Banks wrote: > On Feb 16, 5:51 pm, Jeff Schwab <[EMAIL PROTECTED]> wrote: >> Carl Banks wrote: >>> On Feb 16, 3:03 pm, Lie <[EMAIL PROTECTED]> wrote: >>>> Although rationals have its limitations too, it is a much >>>> better choice compar

Re: flattening a dict

2008-02-16 Thread Jeff Schwab
Benjamin wrote: > How would I go about "flattening" a dict with many nested dicts > within? The dicts might look like this: > {"mays" : {"eggs" : "spam"}, > "jam" : {"soda" : {"love" : "dump"}}, > "lamba" : 23 > } > I'd like it to put "/" inbetween the dicts to make it a one > dimensional dict and

Re: Python Memory Manager

2008-02-18 Thread Jeff Schwab
[EMAIL PROTECTED] wrote: > > Paul Rubin wrote: >> The problem here is with a high allocation rate, you have to GC a lot >> more often, which typically involves copying live data. > > This is last century's issue. Copying data, RAM to RAM, is nearly free > using the Intel architecture. What's "th

Re: Passing a callable object to Thread

2008-02-18 Thread Jeff Schwab
Lie wrote: > On Feb 16, 12:29 pm, Jeff Schwab <[EMAIL PROTECTED]> wrote: >> Paul Rubin wrote: >>> Jeff Schwab <[EMAIL PROTECTED]> writes: >>>> Why not? They seem intuitive to me. I would find it weird if you >>>> couldn't have 0-

Re: flattening a dict

2008-02-18 Thread Jeff Schwab
Arnaud Delobelle wrote: > On Feb 18, 10:22 pm, Steven D'Aprano <[EMAIL PROTECTED] > cybersource.com.au> wrote: > [...] >> The problem with lambdas comes from people trying to hammer multi- >> expression functions into a single-expression lambda, hence obfuscating >> the algorithm. That's no differe

Re: Passing a callable object to Thread

2008-02-18 Thread Jeff Schwab
[EMAIL PROTECTED] wrote: > On Feb 18, 4:26 pm, Jeff Schwab <[EMAIL PROTECTED]> wrote: >> Lie wrote: >>> On Feb 16, 12:29 pm, Jeff Schwab <[EMAIL PROTECTED]> wrote: >>>> Paul Rubin wrote: >>>>> Jeff Schwab <[EMAIL PROTECTED]> write

Re: Passing a callable object to Thread

2008-02-18 Thread Jeff Schwab
Paul Rubin wrote: > Jeff Schwab <[EMAIL PROTECTED]> writes: >>>> In CS, a tuple is a kind of data structure that is specifically not >>>> identical with any of its elements. That's the sort of tuple used in >>>> Python. > > The usual CS

name of client module

2008-02-18 Thread Jeff Schwab
Q1: When a module is imported, is there any way for the module to determine the name of the client code's module? Q2: My understanding is that the code in a module is executed only on the first import of that module. Is there any way to have a hook invoked on subsequent imports, and for that h

Re: Passing a callable object to Thread

2008-02-18 Thread Jeff Schwab
Paul Rubin wrote: > Jeff Schwab <[EMAIL PROTECTED]> writes: >> I think you're a little confused about the meaning of "numeric >> literal." (5+1) is not a numeric literal. Neither is >> (99+1). >> >> The flyweight pa

Re: name of client module

2008-02-18 Thread Jeff Schwab
Nick Stinemates wrote: > Jeff Schwab wrote: >> Q1: When a module is imported, is there any way for the module to >> determine the name of the client code's module? >> > Why would you ever want to do this? >> Q2: My understanding is that the code in a modul

Re: name of client module

2008-02-18 Thread Jeff Schwab
Nick Stinemates wrote: >> I'm not saying I don't want to do that. I'm saying that, in addition to >> what you've written, I want foo to know it's being imported, and by whom. Please don't snip so much. > You're still not explaining a real example of what this could be used for. Why would you s

Re: ROUNDING???

2008-02-18 Thread Jeff Schwab
7stud wrote: > On Feb 18, 7:57 pm, katie smith <[EMAIL PROTECTED]> wrote: >> in python im doing the problem 255/494 >> >> it keeps giving me 0 instead of .51 >> what am i doing wrong? >> >> please help me I have been looking for hours >> >> >>

Re: name of client module

2008-02-18 Thread Jeff Schwab
Nick Stinemates wrote: > Jeff Schwab wrote: >> Nick Stinemates wrote: >> >>>> I'm not saying I don't want to do that. I'm saying that, in addition to >>>> what you've written, I want foo to know it's being imported, and by who

Re: name of client module

2008-02-18 Thread Jeff Schwab
Ben Finney wrote: > Nick Stinemates <[EMAIL PROTECTED]> writes: > >> Ah, I snipped because I was only replying to that specific part and >> thought there was an archive of the rest. If that is unconventional >> I'll stop. > > Please continue snipping the parts that aren't relevant to your reply.

Re: how to finish a while loop...

2008-02-20 Thread Jeff Schwab
icarus wrote: > Opened up a regular console and executed it > from there. > And voilait works! Well, after this I'm going back to the old > trusty shell. +1 QOTW -- http://mail.python.org/mailman/listinfo/python-list

Re: class object using widget

2008-02-20 Thread Jeff Schwab
asit wrote: > from Tkinter import * # get widget classes > from tkMessageBox import askokcancel # get canned std dialog > > class Quitter(Frame): # subclass our GUI > def __init__(self, parent=None): # constructor method >

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

2008-02-21 Thread Jeff Schwab
Bruno Desthuilliers wrote: > Carl Banks a écrit : >> On Feb 20, 8:58 am, Tim Chase <[EMAIL PROTECTED]> wrote: You Used Python to Write WHAT? http://www.cio.com/article/185350 >>> """ >>> Furthermore, the power and expressivity that Python offers means >>> that it may require more skilled

Re: newbie in python

2008-02-21 Thread Jeff Schwab
[EMAIL PROTECTED] wrote: > I'm very interesed to learn python and really willing to do so,but > unfortunately dont know where to start, or what programs need to > install to start. There are several good replies already on this thread, but in case any experienced programmers searching the Google

Re: Return value of an assignment statement?

2008-02-21 Thread Jeff Schwab
mrstephengross wrote: > Hi all. In C, an assignment statement returns the value assigned. For > instance: > > int x > int y = (x = 3) > > In the above example, (x=3) returns 3, which is assigned to y. > > In python, as far as I can tell, assignment statements don't return > anything: > >

Re: Return value of an assignment statement?

2008-02-21 Thread Jeff Schwab
John Henry wrote: > On Feb 21, 1:48 pm, John Henry <[EMAIL PROTECTED]> wrote: >> On Feb 21, 1:43 pm, mrstephengross <[EMAIL PROTECTED]> wrote: >> >> >> >>> Hi all. In C, an assignment statement returns the value assigned. For >>> instance: >>> int x >>> int y = (x = 3) >>> In the above example,

Re: Return value of an assignment statement?

2008-02-21 Thread Jeff Schwab
mrstephengross wrote: >> What you can't do (that I really miss) is have a tree of assign-and-test >> expressions: >> import re >> pat = re.compile('some pattern') >> if m = pat.match(some_string): >> do_something(m) > > Yep, this is exactly what I am (was) tryin

Re: Return value of an assignment statement?

2008-02-21 Thread Jeff Schwab
[EMAIL PROTECTED] wrote: > On 21 fév, 23:19, John Henry <[EMAIL PROTECTED]> wrote: >> On Feb 21, 2:06 pm, Jeff Schwab <[EMAIL PROTECTED]> wrote: >> >> >> >>> John Henry wrote: >>>> On Feb 21, 1:48 pm, John Henry <[EMAIL PROTECTED]>

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

2008-02-21 Thread Jeff Schwab
Carl Banks wrote: > On Feb 21, 1:22 pm, Nicola Musatti <[EMAIL PROTECTED]> wrote: >> There are other downsides to garbage collection, as the fact that it >> makes it harder to implement the Resource Acquisition Is >> Initialization idiom, due to the lack of deterministic destruction. > > That's no

Re: Return value of an assignment statement?

2008-02-21 Thread Jeff Schwab
Terry Reedy wrote: > "Jeff Schwab" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > | That's the same behavior I would expect in C, on the grounds that C > | What I found confusing at first was > | that the same variable will eith

Re: Return value of an assignment statement?

2008-02-21 Thread Jeff Schwab
[EMAIL PROTECTED] wrote: > On 21 fév, 23:06, Jeff Schwab <[EMAIL PROTECTED]> wrote: >> John Henry wrote: >>> On Feb 21, 1:48 pm, John Henry <[EMAIL PROTECTED]> wrote: >>>> On Feb 21, 1:43 pm, mrstephengross <[EMAIL PROTECTED]> wrote: >>>&

Re: Return value of an assignment statement?

2008-02-21 Thread Jeff Schwab
Steve Holden wrote: > Jeff Schwab wrote: >> [EMAIL PROTECTED] wrote: > [...] >>> Now there's no reason to feel nervous about this. All you have to >>> remember is that Python never copy anything unless explicitely asked >>> for. >> >> It

Re: Return value of an assignment statement?

2008-02-21 Thread Jeff Schwab
Steve Holden wrote: > mrstephengross wrote: >>> What you can't do (that I really miss) is have a tree of assign-and-test >>> expressions: >>> import re >>> pat = re.compile('some pattern') >>> if m = pat.match(some_string): >>> do_something(m) >> >> Yep, this is

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

2008-02-21 Thread Jeff Schwab
Carl Banks wrote: > On Feb 21, 7:17 pm, Jeff Schwab <[EMAIL PROTECTED]> wrote: >> Carl Banks wrote: >>> On Feb 21, 1:22 pm, Nicola Musatti <[EMAIL PROTECTED]> wrote: >>>> There are other downsides to garbage collection, as the fact that it >>>>

Re: Return value of an assignment statement?

2008-02-21 Thread Jeff Schwab
George Sakkis wrote: > On Feb 21, 7:21 pm, Jeff Schwab <[EMAIL PROTECTED]> wrote: >> Steve Holden wrote: >>> Jeff Schwab wrote: >>>> [EMAIL PROTECTED] wrote: >>> [...] >>>>> Now there's no reason to feel nervous about this. All you

Re: Return value of an assignment statement?

2008-02-21 Thread Jeff Schwab
Aahz wrote: > In article <[EMAIL PROTECTED]>, > Jeff Schwab <[EMAIL PROTECTED]> wrote: >> [EMAIL PROTECTED] wrote: >>> There's nothing like a variable "storing" anything in Python. All you >>> have are names to (references to) objects bi

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

2008-02-22 Thread Jeff Schwab
Carl Banks wrote: > On Feb 22, 12:23 am, Jeff Schwab <[EMAIL PROTECTED]> wrote: >> Carl Banks wrote: >>> On Feb 21, 7:17 pm, Jeff Schwab <[EMAIL PROTECTED]> wrote: >>>> Carl Banks wrote: >>>>> On Feb 21, 1:22 pm, Nicola Musatti <[EMAIL PR

Re: Return value of an assignment statement?

2008-02-22 Thread Jeff Schwab
George Sakkis wrote: > On Feb 22, 12:26 am, Jeff Schwab <[EMAIL PROTECTED]> wrote: > >>> On the other hand, "a = b" does always the same thing; unlike C++, '=' >>> is not an operator and therefore it cannot be overriden by the class >>> o

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

2008-02-22 Thread Jeff Schwab
Nicola Musatti wrote: > The real sad thing is that nobody is likely to convince Guido to turn > CPython into C++Python ;-) How difficult would that be? Could it be done in stages? I would be willing to spend some time on that kind of project. Since I know almost nothing about Python internal

Re: Equivalent of system()?

2008-02-22 Thread Jeff Schwab
Max wrote: > Is there a Python equivalent of C++'s system()? More or less. You probably want subprocess.Popen: >>> import subprocess >>> subprocess.Popen("echo hello", shell=True) hello http://docs.python.org/lib/node533.html#CHILD_LINKS -- http://mail.python.org/mailman/listinfo/python-lis

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

2008-02-23 Thread Jeff Schwab
Bruno Desthuilliers wrote: > Jeff Schwab a écrit : >> Bruno Desthuilliers wrote: >>> Carl Banks a écrit : >>>> On Feb 20, 8:58 am, Tim Chase <[EMAIL PROTECTED]> wrote: >>>>>> You Used Python to Write WHAT? >>>>>> http

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

2008-02-23 Thread Jeff Schwab
George Sakkis wrote: > On Feb 22, 2:15 pm, Jeff Schwab <[EMAIL PROTECTED]> wrote: > >> Nicola Musatti wrote: >>> The real sad thing is that nobody is likely to convince Guido to turn >>> CPython into C++Python ;-) >> How difficult would that be? Could it

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

2008-02-23 Thread Jeff Schwab
Ryan Ginstrom wrote: >> On Behalf Of Jeff Schwab >> When I see this silliness again and again, it really breaks >> my heart > > If you allow your heart to be broken by others' opinions, you're setting > yourself up for a lot of disappointment IMHO. It'

Re: Return value of an assignment statement?

2008-02-23 Thread Jeff Schwab
[EMAIL PROTECTED] wrote: >> What you can't do (that I really miss) is have a tree of assign-and-test >> expressions: >> >> import re >> pat = re.compile('some pattern') >> >> if m = pat.match(some_string): >> do_something(m) >> else if m = pat.match(other

Re: Return value of an assignment statement?

2008-02-23 Thread Jeff Schwab
Jeff Schwab wrote: > mrstephengross wrote: >> Hi all. In C, an assignment statement returns the value assigned. For >> instance: >> >> int x >> int y = (x = 3) >> >> In the above example, (x=3) returns 3, which is assigned to y. >> >&g

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

2008-02-23 Thread Jeff Schwab
Paul Rubin wrote: > Jeff Schwab <[EMAIL PROTECTED]> writes: >> The most traditional, easiest way to open a file in C++ is to use an >> fstream object, so the file is guaranteed to be closed when the >> fstream goes out of scope. > > Python has this too, except i

Re: Return value of an assignment statement?

2008-02-23 Thread Jeff Schwab
Arnaud Delobelle wrote: > On Feb 23, 3:44 pm, Jeff Schwab <[EMAIL PROTECTED]> wrote: >> actions = ( >> ('some_string', do_something), >> ('other_string', do_other_thing)) >> >> def find

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

2008-02-23 Thread Jeff Schwab
Carl Banks wrote: > On Feb 23, 6:40 am, Jeff Schwab <[EMAIL PROTECTED]> wrote: >> Recently, I've had a few replies in tones that imply I'm on the brink of >> entering several kill-files, mostly because I express disagreement with >> a few closely held belief

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

2008-02-23 Thread Jeff Schwab
Matthew Woodcraft wrote: > Jeff Schwab <[EMAIL PROTECTED]> wrote: >> The most traditional, easiest way to open a file in C++ is to use an >> fstream object, so the file is guaranteed to be closed when the fstream >> goes out of scope. > > Out of interest, what

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

2008-02-23 Thread Jeff Schwab
Terry Reedy wrote: > "Jeff Schwab" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > [snip discussion of 'with' statements] > > | Yes, this seems to be the Python way: For each popular feature of some > | other language, create a le

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

2008-02-23 Thread Jeff Schwab
Paul Rubin wrote: > "Terry Reedy" <[EMAIL PROTECTED]> writes: >> | Yes, this seems to be the Python way: For each popular feature of some >> | other language, create a less flexible Python feature that achieves the >> | same effect in the most common cases (e.g. lambda to imitate function >> | lit

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

2008-02-23 Thread Jeff Schwab
Matthew Woodcraft wrote: > Jeff Schwab <[EMAIL PROTECTED]> wrote: >> Matthew Woodcraft wrote: >>> Jeff Schwab <[EMAIL PROTECTED]> wrote: >>>> The most traditional, easiest way to open a file in C++ is to use an >>>> fstream object, s

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

2008-02-23 Thread Jeff Schwab
Paul Rubin wrote: > Jeff Schwab <[EMAIL PROTECTED]> writes: >> So to use the Perl example: If you want to sort a list using some >> arbitrary snippet of code as the comparison function, you can write: >> sort { code to compare $a and $b } @elements > > Yes, y

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

2008-02-23 Thread Jeff Schwab
Paul Rubin wrote: > Jeff Schwab <[EMAIL PROTECTED]> writes: >> One great thing about C is that >> a programmer can realistically hope to know the entire language >> definition; maybe Guido would like the same to be true of Python. > > C is horrendously complicate

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

2008-02-23 Thread Jeff Schwab
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=9780201179286 > >>> C

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

2008-02-24 Thread Jeff Schwab
Matthew Woodcraft wrote: > Jeff Schwab <[EMAIL PROTECTED]> wrote: >> Matthew Woodcraft wrote: >>> I see. Then, unless you don't care about data loss passing silently, >>> this 'most traditional' way to open a file is unsuitable for files >>

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

2008-02-24 Thread Jeff Schwab
Larry Bugbee 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 issue. (If optional data typing were You mean stat

Re: Create multiple directories

2008-02-24 Thread Jeff Schwab
Paul Lemelle wrote: > I am somewhat new to Python and I am trying to create a program that > automatically creates directories from a range of numbers. I > researched the os.mkdir & os.makedirs methods, but they do not seem to > (I don't know) how to include an argumnet to step through my list. >

Re: object identity and hashing

2008-02-24 Thread Jeff Schwab
[EMAIL PROTECTED] wrote: > Can someone explain this? > a= {} Create an empty dict and bind it to the name a. a[(3,)]= 0 Set the key/value pair (3,):0 to the dict. (3,) in a Is (3,) one of the keys in the dict? > True Yes, it is. (3,) is (3,) Create two separate tuples

Re: object identity and hashing

2008-02-25 Thread Jeff Schwab
[EMAIL PROTECTED] wrote: > On Feb 24, 9:28 pm, George Sakkis <[EMAIL PROTECTED]> wrote: >> >> [1]http://www.martinfowler.com/eaaCatalog/identityMap.html > > [1] illustrates a case in which 'a is a' returns False, and in the > other corner of the DeMorgan table, there is 'a is b' returns True for >

Re: Reading a keypress

2008-02-25 Thread Jeff Schwab
Dennis Lee Bieber wrote: > On Mon, 25 Feb 2008 10:35:54 -0800 (PST), wyleu > <[EMAIL PROTECTED]> declaimed the following in > comp.lang.python: > >> I'm trying to read a single keypress on Linux but expect to have the >> programme running on Windows platform as well and find the mention in >> the

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: 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 <http://[EMAIL PROTECTED]> wrote: >> Jeff Schwab <[EMAIL PROTECTED]> writes: >>>> there's actually a published book specifically about C++ pitfalls. >>> Mercy, a whole book? >> http://sea

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 <http://[EMAIL PROTECTED]> wrote: >>> Jeff Schwab <[EMAIL PROTECTED]> writes: >>>>> there's actually a published book specifically about C++ pitfalls. >>>

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/ >

Re: is there enough information?

2008-02-26 Thread Jeff Schwab
[EMAIL PROTECTED] wrote: > 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

Re: How about adding rational fraction to Python?

2008-02-26 Thread Jeff Schwab
Grant Edwards wrote: > I guess it must depend on where you went to shool. Temple Israel. You? -- http://mail.python.org/mailman/listinfo/python-list

Re: is there enough information?

2008-02-26 Thread Jeff Schwab
[EMAIL PROTECTED] wrote: > On Feb 26, 11:37 am, Jeff Schwab <[EMAIL PROTECTED]> wrote: >> [EMAIL PROTECTED] wrote: >>> On Feb 26, 10:59 am, Preston Landers <[EMAIL PROTECTED]> wrote: >>>> On Feb 26, 1:45 am, [EMAIL PROTECTED] wrote: >>>>>

Re: is there enough information?

2008-02-26 Thread Jeff Schwab
[EMAIL PROTECTED] wrote: > On Feb 26, 12:04 pm, Jeff Schwab <[EMAIL PROTECTED]> wrote: >> [EMAIL PROTECTED] wrote: >>> On Feb 26, 11:37 am, Jeff Schwab <[EMAIL PROTECTED]> wrote: >>>> [EMAIL PROTECTED] wrote: >>>>> On Feb 26, 10:59 am, Pre

Re: is there enough information?

2008-02-26 Thread Jeff Schwab
[EMAIL PROTECTED] wrote: > On Feb 26, 12:37 pm, Jeff Schwab <[EMAIL PROTECTED]> wrote: >> [EMAIL PROTECTED] wrote: >>> On Feb 26, 12:04 pm, Jeff Schwab <[EMAIL PROTECTED]> wrote: >>>> [EMAIL PROTECTED] wrote: >>>>> On Feb 26, 11:37 am, Jeff

Re: How about adding rational fraction to Python?

2008-02-26 Thread Jeff Schwab
J. Cliff Dyer wrote: > On Tue, 2008-02-26 at 13:51 -0500, D'Arcy J.M. Cain wrote: >> On Tue, 26 Feb 2008 13:39:38 -0500 >> "J. Cliff Dyer" <[EMAIL PROTECTED]> wrote: >> a = 2 * 2 >> b = 20 * 20 >> type(a) >>> >> type(b) >>> >> A long int is still integral which is

Re: How about adding rational fraction to Python?

2008-02-26 Thread Jeff Schwab
Paul Rubin wrote: > "D'Arcy J.M. Cain" <[EMAIL PROTECTED]> writes: >>> http://en.wikipedia.org/wiki/Natural_number >> Recheck the context. I was talking about the natural result, not >> natural numbers. > > The natural result of doing arithmetic with natural numbers is more > natural numbers.

Re: How about adding rational fraction to Python?

2008-02-26 Thread Jeff Schwab
Grant Edwards wrote: > On 2008-02-26, Jeff Schwab <[EMAIL PROTECTED]> wrote: >> Grant Edwards wrote: >> >>> I guess it must depend on where you went to shool. >> Temple Israel. You? > > Good one. :) I make a lot of typo's on Usenet, so I'm

Re: is there enough information?

2008-02-26 Thread Jeff Schwab
[EMAIL PROTECTED] wrote: > On Feb 26, 12:42 pm, Jeff Schwab <[EMAIL PROTECTED]> wrote: ... >>>>> th1 th2 >>>>> set cmd >>>>> run cmd >>>>> get result >>>>> acknowledge >>>&g

Re: Adobe CS3

2008-02-26 Thread Jeff Schwab
D'Arcy J.M. Cain wrote: > On Tue, 26 Feb 2008 12:58:53 -0800 > Tobiah <[EMAIL PROTECTED]> wrote: >>> A: Because it messes up the order in which people normally read text. >>> Q: Why is top-posting such a bad thing? >> But then again, when just adding a quip to a long thread in which >> the readers

Re: How about adding rational fraction to Python?

2008-02-26 Thread Jeff Schwab
Mark Dickinson wrote: > On Feb 26, 9:00 pm, Paul Rubin wrote: >> Certainly, I'd expect that if x and y are both integers and x is an >> exact multiple of y, then x/y will be computable and not overflow. >> But try computing 10**5000 / 10**4000 under future division (that

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

2008-02-27 Thread Jeff Schwab
Aahz wrote: > In article <[EMAIL PROTECTED]>, > Carl Banks <[EMAIL PROTECTED]> wrote: >> On Feb 24, 7:03 pm, [EMAIL PROTECTED] (Aahz) wrote: >>> In article <[EMAIL PROTECTED]>, >>> Jeff Schwab <[EMAIL PROTECTED]> wrote: >>>> (3)

Re: Pythons & Ladders

2008-02-27 Thread Jeff Schwab
Benoit wrote: > I've been teaching myself the python language over the past few months > using Mark Lutz' Learning Python, 3ed. Python is also the first > programming language I've ever taken up. I find the language easy to > learn and rather productive in relation to the introductory course on C

Re: Pythons & Ladders

2008-02-28 Thread Jeff Schwab
Marc 'BlackJack' Rintsch wrote: > On Wed, 27 Feb 2008 19:18:27 -0800, Jeff Schwab wrote: > >> Benoit wrote: >>> I've been teaching myself the python language over the past few months >>> using Mark Lutz' Learning Python, 3ed. Python is also the

Re: Pythons & Ladders

2008-02-28 Thread Jeff Schwab
Marc 'BlackJack' Rintsch wrote: > On Thu, 28 Feb 2008 10:34:45 -0800, Jeff Schwab wrote: > >>> Hey a flame bait. I'll bite. >> Excuse me? Somebody posts about an introductory course on C++ covering >> "dynamic arrays using pointers" and lite

Re: Pythons & Ladders

2008-02-28 Thread Jeff Schwab
Benoit wrote: > Forgive my language concerning C++ as its turned the thread into > something I did not intend. I merely wished to point out that Python > was easier for me to learn than C++. To Schwab, its likely that Mark > Lutz is simply a better instructor than my professor. Sorry for hijackin

Re: Book Recomendations

2008-03-01 Thread Jeff Schwab
Ira Solomon wrote: > I am an experienced programmer (40 years). I've done Algol (if you've > heard of that you must be old too), PL/1, VB,VBA, a little C, and a > few other odd languages (e.g. Taskmate). > I'm interested in learning Python and have downloaded a slew of books. > Too many. > I'd lik

Re: How about adding rational fraction to Python?

2008-03-02 Thread Jeff Schwab
Paul Rubin wrote: > I can live with int/int=float but > find it sloppy and would be happier if int/int always threw an error > (convert explicitly if you want a particular type result). Better yet, how hard would it be to define an otherwise int-like type that did not define a non-flooring divisi

Re: Book Recomendations

2008-03-02 Thread Jeff Schwab
> Ira Solomon wrote: >> I am an experienced programmer (40 years) . . . >> I'm interested in learning Python > js wrote: >> I wonder why nobody mension Python Cookbook yet . . . >> and Python Standard Library Because cookbooks are not supposed to be language introductions. They are collec

Re: First post from a Python newbiw

2008-03-02 Thread Jeff Schwab
Christoph Zwerschke wrote: > Marc 'BlackJack' Rintsch schrieb: >> On Sun, 02 Mar 2008 14:15:09 +, Steve Turner wrote: >> >>> Apart from doing something like >>> a=[0,0,0] >>> b=[0,0,0] >>> c=[0,0,0] >>> d=[a,b,c] >>> >>> is there a better way of creating d?? >> >> a = [[0] * 3 for dummy in xran

Re: How about adding rational fraction to Python?

2008-03-02 Thread Jeff Schwab
Paul Rubin wrote: > Jeff Schwab <[EMAIL PROTECTED]> writes: >> Better yet, how hard would it be to define an otherwise int-like type >> that did not define a non-flooring division operator? Are there any >> real use cases for such a type? > > User defined types

Re: First post from a Python newbiw

2008-03-02 Thread Jeff Schwab
[EMAIL PROTECTED] wrote: > is there a better way of creating d?? a = [[0] * 3 for dummy in xrange(3)] >> Each element of a refers to a distinct array. >> >>> Why not simply [[0]*3]*3 ? >> All three elements of the result refer to the same array. > > ... whereas you reassign all three elem

Re: SV: Polymorphism using constructors

2008-03-04 Thread Jeff Schwab
What does "SV" in the subject mean? -- http://mail.python.org/mailman/listinfo/python-list

Re: SV: Polymorphism using constructors

2008-03-04 Thread Jeff Schwab
Tommy Grav wrote: > > On Mar 4, 2008, at 4:53 PM, Jeff Schwab wrote: > >> What does "SV" in the subject mean? > > SV = "Svar" is the Norwegian word for Reply. Thanks. Serves me right for not speaking Norwegian. -- http://mail.python.org/mailman/listinfo/python-list

OT[1]: Re: SV: Polymorphism using constructors

2008-03-05 Thread Jeff Schwab
Dennis Lee Bieber wrote: > On Tue, 4 Mar 2008 20:06:38 -0500, Tommy Grav <[EMAIL PROTECTED]> declaimed > the following in comp.lang.python: > >> SV = "Svar" is the Norwegian word for Reply. >> > Ah, good... In my working life, "SV" => "Space Vehicle", often used > to differentiate between th

Re: OT[1]: Re: SV: Polymorphism using constructors

2008-03-05 Thread Jeff Schwab
Dennis Lee Bieber wrote: > On Wed, 05 Mar 2008 08:26:04 -0800, Jeff Schwab <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > >> Which is which? Aren't those both part of the space vehicle? Btw, do >> you work for government or industry?

Re: Regarding coding style

2008-03-07 Thread Jeff Schwab
K Viltersten wrote: > I've been recommended reading of: > http://www.python.org/dev/peps/pep-0008/ > and in there i saw two things that i need to get elaborated. > > > 1. When writing English, Strunk and White apply. > > Where can i download it? Am i actually > expected to read the whole book?

Re: Distributed App - C++ with Python for Portability?

2008-03-11 Thread Jeff Schwab
Roopan wrote: > I assume the C++/Python binding is fairly painless. http://www.boost.org/libs/python/doc/tutorial/doc/html/index.html A. :) -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there Python equivalent to Perl BEGIN{} block?

2008-03-12 Thread Jeff Schwab
Alex wrote: > The subject says pretty much all, i would very appreciate an answer. I > tried to search the various forums and groups, but didn't find any > specific answer... I'd like an answer to this, too. In Perl, I mostly used it for one-liners, when a variable needed to be initialized to s

Re: How to port Python code into C++ code automatically?

2008-03-12 Thread Jeff Schwab
Bo wrote: > I want to port a Python project (about 10,000 line python code) to C+ > +. Is there any automatically tool to do this kind of things? e.g., That's not trivial. Python is very heavily oriented toward run-time processing, whereas C++ favors compile-time processing. > e.g., SWIG(http:/

Re: Is there Python equivalent to Perl BEGIN{} block?

2008-03-13 Thread Jeff Schwab
Paddy wrote: > On Mar 13, 7:03 pm, Jonathan Gardner <[EMAIL PROTECTED]> > wrote: >> On Mar 12, 6:37 pm, Carl Banks <[EMAIL PROTECTED]> wrote: > > <> >> And leave out the magical -p and -n. If you want to iterate through a >> file, "for line in sys.stdin:". > > Or better still: > > import fil

Re: Need Script For read multiple files(.txt) from a folder

2008-03-14 Thread Jeff Schwab
Chris wrote: > On Mar 14, 8:36 am, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: >> On Thu, 13 Mar 2008 21:28:18 -0700 (PDT), jai_python >> <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: >> >>> hi frenz I Need a Python Script For read multiple files(.txt) from a >>> folder and wri

<    1   2   3   >