RE: Set Date and Time on Python

2012-04-26 Thread Shambhu Rajak
-Original Message- From: Dave Angel [mailto:d...@davea.name] Sent: 26/04/2012 4:31 PM To: viral shah Cc: python-list@python.org Subject: Re: Set Date and Time on Python On 04/26/2012 03:09 AM, viral shah wrote: > Hi > > I'm very new to Python programming. > > Please help me to add date

Re: why () is () and [] is [] work in other way?

2012-04-26 Thread Paul Rubin
Steven D'Aprano writes: > I'm seeing code generated by the Haskell GHC compiler being 2-4 times > slower than code from the C gcc compiler, and on average using 2-3 times > as much memory (and as much as 7 times). Alioth isn't such a great comparison, because on the one hand you get very carefu

Re: why () is () and [] is [] work in other way?

2012-04-26 Thread Chris Angelico
On Fri, Apr 27, 2012 at 12:47 PM, Steven D'Aprano wrote: > On Thu, 26 Apr 2012 17:16:10 -0700, Adam Skutt wrote: > >> On Apr 26, 7:33 pm, Steven D'Aprano > +comp.lang.pyt...@pearwood.info> wrote: >>> On Thu, 26 Apr 2012 12:22:55 -0700, Adam Skutt wrote: >>> > I often wonder what the world would be

Re: why () is () and [] is [] work in other way?

2012-04-26 Thread Devin Jeanpierre
On Thu, Apr 26, 2012 at 7:33 PM, Steven D'Aprano wrote: > On Thu, 26 Apr 2012 12:22:55 -0700, Adam Skutt wrote: > >> I often wonder what the world would be like if Python, C#, and Java >> embraced value types more, and had better support for pure functions. > > They would be slower, require more m

Re: why () is () and [] is [] work in other way?

2012-04-26 Thread OKB (not okblacke)
Adam Skutt wrote: > If I write a function that does a value comparison, then it should > do value comparison on _every type that can be passed to it_, > regardless of whether the type is a primitive or an object, whether > it has value or reference semantics, and regardless of how value > compari

Re: why () is () and [] is [] work in other way?

2012-04-26 Thread Steven D'Aprano
On Thu, 26 Apr 2012 17:16:10 -0700, Adam Skutt wrote: > On Apr 26, 7:33 pm, Steven D'Aprano +comp.lang.pyt...@pearwood.info> wrote: >> On Thu, 26 Apr 2012 12:22:55 -0700, Adam Skutt wrote: >> > I often wonder what the world would be like if Python, C#, and Java >> > embraced value types more, and

John Carmack glorifying functional programing in 3k words

2012-04-26 Thread Xah Lee
John Carmack glorifying functional programing in 3k words http://www.altdevblogaday.com/2012/04/26/functional-programming-in-c/ where was he ten years ago? O, and btw, i heard that Common Lispers don't do functional programing, is that right? Fuck Common Lispers. Yeah, fuck them. One bunch of F

Re: why () is () and [] is [] work in other way?

2012-04-26 Thread Mark Lawrence
On 27/04/2012 00:57, Adam Skutt wrote: ...And Saint Adam Skutt raised the hand grenade up on high, saying, "O LORD, bless this Thy hand grenade that with it Thou mayest blow Thine Id to tiny bits, in Thy mercy." And the LORD did grin and the people did feast upon the lambs and sloths and carp

Re: why () is () and [] is [] work in other way?

2012-04-26 Thread Paul Rubin
Adam Skutt writes: >> harder to use, and far, far less popular. > Alas, these two are probably true. Haskell is kind of abstruse and has a notoriously steep learning curve, as it's mostly meant as a research testbed and as a playground for language geeks. ML/OCaml is by all accounts much easier,

Re: why () is () and [] is [] work in other way?

2012-04-26 Thread Adam Skutt
On Apr 26, 7:33 pm, Steven D'Aprano wrote: > On Thu, 26 Apr 2012 12:22:55 -0700, Adam Skutt wrote: > > I often wonder what the world would be like if Python, C#, and Java > > embraced value types more, and had better support for pure functions. > > They would be slower, require more memory, Funny

Re: why () is () and [] is [] work in other way?

2012-04-26 Thread Adam Skutt
On Thu, Apr 26, 2012 at 5:39 PM, Ian Kelly wrote: > On Thu, Apr 26, 2012 at 1:34 PM, Adam Skutt wrote: >> What I think you want is what I said above: ValueError raised when >> either operand is a /temporary/ object.  Really, it should probably be >> a parse-time error, since you could (and should

Re: Re: why () is () and [] is [] work in other way?

2012-04-26 Thread Adam Skutt
On Thu, Apr 26, 2012 at 12:05 PM, Evan Driscoll wrote: > This thread has already beaten a dead horse enough that the horse came back > as a zombie and was re-killed, but I couldn't help but respond to this part: > > > On 01/-10/-28163 01:59 PM, Adam Skutt wrote: >> >> Code that relies on the ident

Re: why () is () and [] is [] work in other way?

2012-04-26 Thread Adam Skutt
On Apr 26, 6:34 pm, Kiuhnm wrote: > On 4/26/2012 20:54, Adam Skutt wrote: > > On Apr 26, 12:02 pm, Kiuhnm  wrote: > >> On 4/26/2012 16:00, Adam Skutt wrote: > >>> On Apr 26, 9:37 am, Kiuhnm   wrote: > >> The fact that you think that that's "differing behaviour" is what makes > >> it a misfeature.

Re: why () is () and [] is [] work in other way?

2012-04-26 Thread Mark Lawrence
On 20/04/2012 20:10, dmitrey wrote: I have spent some time searching for a bug in my code, it was due to different work of "is" with () and []: () is () True [] is [] False (Python 2.7.2+ (default, Oct 4 2011, 20:03:08) [GCC 4.6.1] ) Is this what it should be or maybe yielding unified resu

Re: why () is () and [] is [] work in other way?

2012-04-26 Thread Steven D'Aprano
On Thu, 26 Apr 2012 12:22:55 -0700, Adam Skutt wrote: > I often wonder what the world would be like if Python, C#, and Java > embraced value types more, and had better support for pure functions. They would be slower, require more memory, harder to use, and far, far less popular. Some other lang

Re: why () is () and [] is [] work in other way?

2012-04-26 Thread Paul Rubin
Nobody writes: > All practical languages have some implementation-defined behaviour, often > far more problematic than Python's. The usual reason for accepting implementation-defined behavior is to enable low-level efficiency hacks written for specific machines. C and C++ are used for that sort

Re: why () is () and [] is [] work in other way?

2012-04-26 Thread Kiuhnm
On 4/26/2012 20:54, Adam Skutt wrote: On Apr 26, 12:02 pm, Kiuhnm wrote: On 4/26/2012 16:00, Adam Skutt wrote: On Apr 26, 9:37 am, Kiuhnm wrote: On 4/26/2012 13:45, Adam Skutt wrote: On Apr 26, 1:48 am, John Nagle wrote: This assumes that everything is, internally, an object.

Re: why () is () and [] is [] work in other way?

2012-04-26 Thread Nobody
On Thu, 26 Apr 2012 11:31:39 -0700, John Nagle wrote: > I would suggest that "is" raise ValueError for the ambiguous cases. > If both operands are immutable, "is" should raise ValueError. That's the > case where the internal representation of immutables shows through. This breaks one of the m

Re: why () is () and [] is [] work in other way?

2012-04-26 Thread Chris Angelico
On Fri, Apr 27, 2012 at 8:04 AM, Ian Kelly wrote: > You can't check ref counts at parse time. I know, and it'd be impossible to recognize at parse time for any but the most trivial cases (since names can always be rebound). The detection of temporaries can only be done at run time. ChrisA -- ht

RE: Web Scraping - Output File

2012-04-26 Thread Prasad, Ramit
> > I am having some difficulty generating the output I want from web > > scraping. Specifically, the script I wrote, while it runs without any > > errors, is not writing to the output file correctly. It runs, and > > creates the output .txt file; however, the file is blank (ideally it > > should b

Re: why () is () and [] is [] work in other way?

2012-04-26 Thread Ian Kelly
On Thu, Apr 26, 2012 at 3:51 PM, Chris Angelico wrote: > On Fri, Apr 27, 2012 at 7:39 AM, Ian Kelly wrote: >> I'm not sure precisely what you mean by "temporary object", so I am >> taking it to mean an object that is referenced only by the VM stack >> (or something equivalent for other implementa

Re: Half-baked idea: list comprehensions with "while"

2012-04-26 Thread Ian Kelly
On Thu, Apr 26, 2012 at 11:57 AM, Kiuhnm wrote: > On 4/26/2012 19:48, Paul Rubin wrote: >> >> Roy Smith  writes: >>> >>> x = [a for a in iterable while a] >> >> >> from itertools import takewhile >> >> x = takewhile(bool, a) > > > I see that as a 'temporary' solution, otherwise we wouldn't need 'i

Re: why () is () and [] is [] work in other way?

2012-04-26 Thread Chris Angelico
On Fri, Apr 27, 2012 at 7:39 AM, Ian Kelly wrote: > I'm not sure precisely what you mean by "temporary object", so I am > taking it to mean an object that is referenced only by the VM stack > (or something equivalent for other implementations). > > In that case: no, you can't.  Take "f() is g()",

Re: (3.2) Overload print() using the C API?

2012-04-26 Thread Chris Angelico
On Fri, Apr 27, 2012 at 5:28 AM, Peter Faulks wrote: > Cheers, > > Yes was aware this would (might) be possible in 3.x only. > > "All you have to do is assign to print". Sounds great! Can some kind soul > hit me with a clue stick? Were do I look in the API? (We prefer to avoid top-posting on this

Re: why () is () and [] is [] work in other way?

2012-04-26 Thread Ian Kelly
On Thu, Apr 26, 2012 at 1:34 PM, Adam Skutt wrote: > What I think you want is what I said above: ValueError raised when > either operand is a /temporary/ object.  Really, it should probably be > a parse-time error, since you could (and should) make the > determination at parse time. I'm not sure

Re: Web Scraping - Output File

2012-04-26 Thread SMac2347
On Apr 26, 2:19 pm, Kiuhnm wrote: > On 4/26/2012 19:54, smac2...@comcast.net wrote: > > > > > > > > > > > Hello, > > > I am having some difficulty generating the output I want from web > > scraping. Specifically, the script I wrote, while it runs without any > > errors, is not writing to the outpu

Re: Web Scraping - Output File

2012-04-26 Thread Jon Clements
comcast.net> writes: > > Hello, > > I am having some difficulty generating the output I want from web > scraping. Specifically, the script I wrote, while it runs without any > errors, is not writing to the output file correctly. It runs, and > creates the output .txt file; however, the file is

Re: why () is () and [] is [] work in other way?

2012-04-26 Thread Adam Skutt
On Apr 26, 2:31 pm, John Nagle wrote: > On 4/26/2012 4:45 AM, Adam Skutt wrote: > > On Apr 26, 1:48 am, John Nagle  wrote: > >> On 4/25/2012 5:01 PM, Steven D'Aprano wrote: > > >>> On Wed, 25 Apr 2012 13:49:24 -0700, Adam Skutt wrote: > > Though, maybe it's better to use a different keyword t

Re: (3.2) Overload print() using the C API?

2012-04-26 Thread Peter Faulks
Cheers, Yes was aware this would (might) be possible in 3.x only. "All you have to do is assign to print". Sounds great! Can some kind soul hit me with a clue stick? Were do I look in the API? On 27/04/2012 4:26 AM, Chris Angelico wrote: On Fri, Apr 27, 2012 at 3:57 AM, Peter Faulks wrote

Re: why () is () and [] is [] work in other way?

2012-04-26 Thread Adam Skutt
On Apr 26, 1:34 pm, rusi wrote: > On Apr 26, 7:44 pm, Adam Skutt wrote: > > On Apr 26, 10:18 am, rusi wrote: > > > > On Apr 26, 4:42 pm, Adam Skutt wrote: > > > > > In a mathematical sense, you're saying that given f(x) = x+2, using > > > > f(x) is somehow more "direct" (whatever the hell that

Re: cmd2, an extenstion of cmd that parses its argument list

2012-04-26 Thread anntzer . lee
On Sunday, March 18, 2012 10:12:24 PM UTC-7, anntz...@gmail.com wrote: > Dear all, > > I would like to announce the first public release of cmd2, an extension of > the standard library's cmd with argument parsing, here: > https://github.com/anntzer/cmd2. > Due to an already existing Cmd2 on PyP

Re: ANN: cmd2, an extenstion of cmd that parses its argument line

2012-04-26 Thread anntzer . lee
I have renamed the project to parsedcmd, which is also a better description of what the module does. https://github.com/anntzer/parsedcmd On Monday, March 19, 2012 6:14:44 AM UTC-7, xDog Walker wrote: > On Sunday 2012 March 18 22:11, anntzer@gmail.com wrote: > > I would like to announce the f

Re: why () is () and [] is [] work in other way?

2012-04-26 Thread Adam Skutt
On Apr 26, 12:02 pm, Kiuhnm wrote: > On 4/26/2012 16:00, Adam Skutt wrote: > > On Apr 26, 9:37 am, Kiuhnm wrote: > >> On 4/26/2012 13:45, Adam Skutt wrote: > > >>> On Apr 26, 1:48 am, John Naglewrote: > This assumes that everything is, internally, an object. In > CPython, >

Re: why () is () and [] is [] work in other way?

2012-04-26 Thread John Nagle
On 4/26/2012 4:45 AM, Adam Skutt wrote: On Apr 26, 1:48 am, John Nagle wrote: On 4/25/2012 5:01 PM, Steven D'Aprano wrote: On Wed, 25 Apr 2012 13:49:24 -0700, Adam Skutt wrote: Though, maybe it's better to use a different keyword than 'is' though, due to the plain English connotations of t

Re: (3.2) Overload print() using the C API?

2012-04-26 Thread Chris Angelico
On Fri, Apr 27, 2012 at 3:57 AM, Peter Faulks wrote: > I want to extend an embedded interpreter so that calls to print() are > automagically sent to a C++ gui (windows exe) via a callback function in the > DLL. > > Then I'll be able to do this: > > test.py > import printoverload > > printo

Re: Web Scraping - Output File

2012-04-26 Thread Kiuhnm
On 4/26/2012 19:54, smac2...@comcast.net wrote: > Hello, > > I am having some difficulty generating the output I want from web > scraping. Specifically, the script I wrote, while it runs without any > errors, is not writing to the output file correctly. It runs, and > creates the output .txt file;

Re: Web Scraping - Output File

2012-04-26 Thread MRAB
On 26/04/2012 18:54, smac2...@comcast.net wrote: Hello, I am having some difficulty generating the output I want from web scraping. Specifically, the script I wrote, while it runs without any errors, is not writing to the output file correctly. It runs, and creates the output .txt file; however,

Re: why () is () and [] is [] work in other way?

2012-04-26 Thread Terry Reedy
On 4/26/2012 1:48 AM, John Nagle wrote: This assumes that everything is, internally, an object. In CPython, that's the case, because Python is a naive interpreter and everything, including numbers, is "boxed". That's not true of PyPy or Shed Skin. So does "is" have to force the creation of a te

Re: Half-baked idea: list comprehensions with "while"

2012-04-26 Thread Kiuhnm
On 4/26/2012 19:48, Paul Rubin wrote: Roy Smith writes: x = [a for a in iterable while a] from itertools import takewhile x = takewhile(bool, a) I see that as a 'temporary' solution, otherwise we wouldn't need 'if' inside of list comprehensions either. Kiuhnm -- http://mail.python.org/m

(3.2) Overload print() using the C API?

2012-04-26 Thread Peter Faulks
G'day, I want to extend an embedded interpreter so that calls to print() are automagically sent to a C++ gui (windows exe) via a callback function in the DLL. Then I'll be able to do this: test.py import printoverload printoverload.set_stdout() printoverload.set_stderr() print("th

Web Scraping - Output File

2012-04-26 Thread SMac2347
Hello, I am having some difficulty generating the output I want from web scraping. Specifically, the script I wrote, while it runs without any errors, is not writing to the output file correctly. It runs, and creates the output .txt file; however, the file is blank (ideally it should be populated

Re: Half-baked idea: list comprehensions with "while"

2012-04-26 Thread Paul Rubin
Roy Smith writes: > x = [a for a in iterable while a] from itertools import takewhile x = takewhile(bool, a) -- http://mail.python.org/mailman/listinfo/python-list

Re: Half-baked idea: list comprehensions with "while"

2012-04-26 Thread Kiuhnm
On 4/26/2012 19:02, Roy Smith wrote: I'm not seriously suggesting this as a language addition, just an interesting idea to simplify some code I'm writing now: x = [a for a in iterable while a] which equates to: x = [] for a in iterable: if not a: break x.append(a) It does

Re: why () is () and [] is [] work in other way?

2012-04-26 Thread rusi
On Apr 26, 7:44 pm, Adam Skutt wrote: > On Apr 26, 10:18 am, rusi wrote: > > > On Apr 26, 4:42 pm, Adam Skutt wrote: > > > > In a mathematical sense, you're saying that given f(x) = x+2, using > > > f(x) is somehow more "direct" (whatever the hell that even means) than > > > using 'x+2'.  That's

Re: Half-baked idea: list comprehensions with "while"

2012-04-26 Thread Mark Lawrence
On 26/04/2012 18:02, Roy Smith wrote: I'm not seriously suggesting this as a language addition, just an interesting idea to simplify some code I'm writing now: x = [a for a in iterable while a] which equates to: x = [] for a in iterable: if not a: break x.append(a) It does

Re: Half-baked idea: list comprehensions with "while"

2012-04-26 Thread Ian Kelly
On Thu, Apr 26, 2012 at 11:02 AM, Roy Smith wrote: > I'm not seriously suggesting this as a language addition, just an interesting > idea to simplify some code I'm writing now: > > x = [a for a in iterable while a] > > which equates to: > > x = [] > for a in iterable: >    if not a: >        brea

Re: Half-baked idea: list comprehensions with "while"

2012-04-26 Thread Chris Kaynor
On Thu, Apr 26, 2012 at 10:02 AM, Roy Smith wrote: > > I'm not seriously suggesting this as a language addition, just an interesting > idea to simplify some code I'm writing now: > > x = [a for a in iterable while a] > > which equates to: > > x = [] > for a in iterable: >    if not a: >        br

Re: Half-baked idea: list comprehensions with "while"

2012-04-26 Thread Chris Rebert
On Thu, Apr 26, 2012 at 10:02 AM, Roy Smith wrote: > I'm not seriously suggesting this as a language addition, just an interesting > idea to simplify some code I'm writing now: > > x = [a for a in iterable while a] > > which equates to: > > x = [] > for a in iterable: >    if not a: >        brea

Half-baked idea: list comprehensions with "while"

2012-04-26 Thread Roy Smith
I'm not seriously suggesting this as a language addition, just an interesting idea to simplify some code I'm writing now: x = [a for a in iterable while a] which equates to: x = [] for a in iterable: if not a: break x.append(a) It does has a few things going for it. It doesn't

Re: why () is () and [] is [] work in other way?

2012-04-26 Thread Ian Kelly
On Thu, Apr 26, 2012 at 3:10 AM, Steven D'Aprano wrote: > But I was actually referring to something more fundamental than that. The > statement "a is b" is a *direct* statement of identity. "John is my > father." "id(a) == id(b)" is *indirect*: "The only child of John's > grandfather is the parent

Re: Is "PyIntBlocks are never returned to the system before shutdown" right?

2012-04-26 Thread Terry Reedy
On 4/26/2012 10:21 AM, ZHONG Chen wrote: "PyIntBlocks are never returned to the system before shutdown" I saw this comment in Python 2.6.8's source code: Objects/intobject.c line 25 But in the function PyInt_ClearFreeList() It will call PyMem_FREE(list) for empty int block. Why? Before procee

Re: csv: No fields, or one field?

2012-04-26 Thread Terry Reedy
On 4/26/2012 9:12 AM, Neil Cerutti wrote: On 2012-04-26, Neil Cerutti wrote: I made the following wrong assumption about the csv EBNF recognized by Python (ignoring record seps): record -> field {delim field} Is that in the docs? There's at least some csv "standard" documents requiring m

Re: Re: why () is () and [] is [] work in other way?

2012-04-26 Thread Evan Driscoll
This thread has already beaten a dead horse enough that the horse came back as a zombie and was re-killed, but I couldn't help but respond to this part: On 01/-10/-28163 01:59 PM, Adam Skutt wrote: Code that relies on the identity of a temporary object is generally incorrect. This is why C++

Re: Strange __import__() behavior

2012-04-26 Thread Kiuhnm
On 4/26/2012 17:19, Frank Miles wrote: On Wed, 25 Apr 2012 23:03:36 +0200, Kiuhnm wrote: On 4/25/2012 22:05, Frank Miles wrote: I have an exceedingly simple function that does a "named import". It works perfectly for one file "r"- and fails for the second "x". If I reverse the order of being

Re: why () is () and [] is [] work in other way?

2012-04-26 Thread Kiuhnm
On 4/26/2012 16:00, Adam Skutt wrote: On Apr 26, 9:37 am, Kiuhnm wrote: On 4/26/2012 13:45, Adam Skutt wrote: On Apr 26, 1:48 am, John Naglewrote: On 4/25/2012 5:01 PM, Steven D'Aprano wrote: On Wed, 25 Apr 2012 13:49:24 -0700, Adam Skutt wrote: Though, maybe it's better to

Re: Strange __import__() behavior

2012-04-26 Thread Frank Miles
On Wed, 25 Apr 2012 23:03:36 +0200, Kiuhnm wrote: > On 4/25/2012 22:05, Frank Miles wrote: >> I have an exceedingly simple function that does a "named import". It >> works perfectly for one file "r"- and fails for the second "x". >> >> If I reverse the order of being called, it is still "x" that f

RuntimeWarning: Unable to load template engine entry point

2012-04-26 Thread sajuptpm
Hi, I am using Ubuntu 12.04 precise Python 2.7 turbogears 2.0.3 Getting following errors when doing turbogears setup. Have any way to fix this without upgrade to turbogears 2.0.4. Using /home/saju/cmt-enterprise/tg2env/lib/python2.7/site-packages/ BytecodeAssembler-0.3-py2.7.egg Searching for

Re: why () is () and [] is [] work in other way?

2012-04-26 Thread Adam Skutt
On Apr 26, 10:18 am, rusi wrote: > On Apr 26, 4:42 pm, Adam Skutt wrote: > > > > > In a mathematical sense, you're saying that given f(x) = x+2, using > > f(x) is somehow more "direct" (whatever the hell that even means) than > > using 'x+2'.  That's just not true.  We freely and openly interchan

Re: why () is () and [] is [] work in other way?

2012-04-26 Thread Chris Angelico
On Fri, Apr 27, 2012 at 12:00 AM, Adam Skutt wrote: > C# and Python do have a misfeature: '==' is identity comparison only > if operator== / __eq__ is not overloaded.  Identity comparison and > value comparison are disjoint operations, so it's entirely > inappropriate to combine them. So what sho

Re: why () is () and [] is [] work in other way?

2012-04-26 Thread Adam Skutt
On Apr 26, 9:37 am, Kiuhnm wrote: > On 4/26/2012 13:45, Adam Skutt wrote: > > > > > > > > > > > On Apr 26, 1:48 am, John Nagle  wrote: > >> On 4/25/2012 5:01 PM, Steven D'Aprano wrote: > > >>> On Wed, 25 Apr 2012 13:49:24 -0700, Adam Skutt wrote: > > Though, maybe it's better to use a differe

Is "PyIntBlocks are never returned to the system before shutdown" right?

2012-04-26 Thread ZHONG Chen
"PyIntBlocks are never returned to the system before shutdown" I saw this comment in Python 2.6.8's source code: Objects/intobject.c line 25 But in the function PyInt_ClearFreeList() It will call PyMem_FREE(list) for empty int block. Why? -- myheimu 2012.4 School of Software, 2007, Tsinghu

Re: why () is () and [] is [] work in other way?

2012-04-26 Thread rusi
On Apr 26, 4:42 pm, Adam Skutt wrote: > > In a mathematical sense, you're saying that given f(x) = x+2, using > f(x) is somehow more "direct" (whatever the hell that even means) than > using 'x+2'.  That's just not true.  We freely and openly interchange > them all the time doing mathematics.  Pro

Re: Upgrading from 2.7 to 3.x

2012-04-26 Thread Kiuhnm
On 4/26/2012 15:02, deuteros wrote: On Thu 26 Apr 2012 07:37:20a, Kiuhnm wrote in news:4f993382$0$1378$4fafb...@reader2.news.tin.it: Python 2.7.3 and 3.2.3 (the latest versions) can coexist. Just install Python 3.2.3 in a different directory (python32, for instance). Python has been "forked"

Re: why () is () and [] is [] work in other way?

2012-04-26 Thread Kiuhnm
On 4/26/2012 13:45, Adam Skutt wrote: On Apr 26, 1:48 am, John Nagle wrote: On 4/25/2012 5:01 PM, Steven D'Aprano wrote: On Wed, 25 Apr 2012 13:49:24 -0700, Adam Skutt wrote: Though, maybe it's better to use a different keyword than 'is' though, due to the plain English connotations of the

Re: Upgrading from 2.7 to 3.x

2012-04-26 Thread Andrew Berg
On 4/26/2012 8:02 AM, deuteros wrote: > So how do I tell my IDE (Eclipse with PyDev) which version of Python I > want to use? When you start a new PyDev project, it will ask. -- CPython 3.2.3/3.3.0a2 | Windows NT 6.1.7601.17790 -- http://mail.python.org/mailman/listinfo/python-list

Re: csv: No fields, or one field?

2012-04-26 Thread Neil Cerutti
On 2012-04-26, Neil Cerutti wrote: > I made the following wrong assumption about the csv EBNF > recognized by Python (ignoring record seps): > > record -> field {delim field} > > There's at least some csv "standard" documents requiring my > interprestion, e.g., > > http://mastpoint.curzonnassau.co

Re: csv: No fields, or one field?

2012-04-26 Thread Neil Cerutti
On 2012-04-26, Tim Roberts wrote: > Neil Cerutti wrote: > >>Is there an explanation or previous dicussion somewhere for the >>following behavior? I haven't yet trolled the csv mailing list >>archive, though that would probably be a good place to check. >> >>Python 3.2 (r32:88445, Feb 20 2011, 21:

Re: Upgrading from 2.7 to 3.x

2012-04-26 Thread deuteros
On Thu 26 Apr 2012 07:37:20a, Kiuhnm wrote in news:4f993382$0$1378$4fafb...@reader2.news.tin.it: > Python 2.7.3 and 3.2.3 (the latest versions) can coexist. Just install > Python 3.2.3 in a different directory (python32, for instance). > > Python has been "forked" into 2.x and 3.x because some

Re: Overlayong PDF Files

2012-04-26 Thread Adam Tauno Williams
On Wed, 2012-04-25 at 13:36 -0500, Greg Lindstrom wrote: > I would like to take an existing pdf file which has the image of a > health care claim and overlay the image with claim data (insured name, > address, procedures, etc.). I'm pretty good with reportlab -- in > fact, I've created a form clos

Re: why () is () and [] is [] work in other way?

2012-04-26 Thread Arnaud Delobelle
On 26 April 2012 12:42, Adam Skutt wrote: > On Apr 26, 5:10 am, Steven D'Aprano +comp.lang.pyt...@pearwood.info> wrote: >> On Wed, 25 Apr 2012 20:50:21 -0700, Adam Skutt wrote: >> > On Apr 25, 8:01 pm, Steven D'Aprano > > +comp.lang.pyt...@pearwood.info> wrote: >> >> On Wed, 25 Apr 2012 13:49:24

Re: why () is () and [] is [] work in other way?

2012-04-26 Thread Chris Angelico
On Thu, Apr 26, 2012 at 10:12 PM, Robert Kern wrote: > Yes. Win64 has 64-bit pointers and 32-bit C longs (and thus 32-bit Python > ints). > > It returns a Python long. Ah, that solves that one. Definite improvement in Python 3 with the merging of the two types, though. Machine integers are simply

Re: why () is () and [] is [] work in other way?

2012-04-26 Thread Kiuhnm
On 4/26/2012 2:01, Steven D'Aprano wrote: On Wed, 25 Apr 2012 13:49:24 -0700, Adam Skutt wrote: Though, maybe it's better to use a different keyword than 'is' though, due to the plain English connotations of the term; I like 'sameobj' personally, for whatever little it matters. Really, I think

Re: why () is () and [] is [] work in other way?

2012-04-26 Thread Robert Kern
On 4/26/12 12:56 PM, Chris Angelico wrote: Side point: In Python 2, id() returns an int, not a long. Is it possible to be running Python on a 64-bit machine with a 32-bit int type? Yes. Win64 has 64-bit pointers and 32-bit C longs (and thus 32-bit Python ints). And if so, what does CPython d

Re: Upgrading from 2.7 to 3.x

2012-04-26 Thread Andrew Berg
On 4/26/2012 6:37 AM, Kiuhnm wrote: > Python has been "forked" into 2.x and 3.x because some breaking changes > ought to be made to the language in order to improve it and clean it up. That's not really a good way to put it. 2.6 and 2.7 will get security fixes, but there won't be a 2.8 unless some

Re: why () is () and [] is [] work in other way?

2012-04-26 Thread Chris Angelico
On Thu, Apr 26, 2012 at 9:42 PM, Adam Skutt wrote: > Would you call the result of casting a C pointer to an int an > address?  If so, you must call the result of id() an address as well-- > you can't dereference either of them.  If not, then you need to > provide an alternate name for the result o

Re: why () is () and [] is [] work in other way?

2012-04-26 Thread Adam Skutt
On Apr 26, 1:48 am, John Nagle wrote: > On 4/25/2012 5:01 PM, Steven D'Aprano wrote: > > > On Wed, 25 Apr 2012 13:49:24 -0700, Adam Skutt wrote: > > >> Though, maybe it's better to use a different keyword than 'is' though, > >> due to the plain English > >> connotations of the term; I like 'sameob

Re: why () is () and [] is [] work in other way?

2012-04-26 Thread Adam Skutt
On Apr 26, 5:10 am, Steven D'Aprano wrote: > On Wed, 25 Apr 2012 20:50:21 -0700, Adam Skutt wrote: > > On Apr 25, 8:01 pm, Steven D'Aprano > +comp.lang.pyt...@pearwood.info> wrote: > >> On Wed, 25 Apr 2012 13:49:24 -0700, Adam Skutt wrote: > >> > Though, maybe it's better to use a different keywo

Re: Upgrading from 2.7 to 3.x

2012-04-26 Thread Kiuhnm
On 4/26/2012 13:37, Kiuhnm wrote: On 4/26/2012 5:08, deuteros wrote: I'm fairly new to Python I have version 2.7 installed on my computer. However my professor wants us all to use the latest version of Python. How do I go about upgrading? Do I just install the new version? Do I have to do anythi

Re: Upgrading from 2.7 to 3.x

2012-04-26 Thread Kiuhnm
On 4/26/2012 5:08, deuteros wrote: I'm fairly new to Python I have version 2.7 installed on my computer. However my professor wants us all to use the latest version of Python. How do I go about upgrading? Do I just install the new version? Do I have to do anything with the old version already ins

Re: Set Date and Time on Python

2012-04-26 Thread Dave Angel
On 04/26/2012 03:09 AM, viral shah wrote: > Hi > > I'm very new to Python programming. > > Please help me to add date and time ! > > Following is the code done by me. > > import datetime > class Module > type(datetime.datetime) > > Now what's the next to do for displaying date and time ? > You

Re: why () is () and [] is [] work in other way?

2012-04-26 Thread Steven D'Aprano
On Wed, 25 Apr 2012 20:50:21 -0700, Adam Skutt wrote: > On Apr 25, 8:01 pm, Steven D'Aprano +comp.lang.pyt...@pearwood.info> wrote: >> On Wed, 25 Apr 2012 13:49:24 -0700, Adam Skutt wrote: >> > Though, maybe it's better to use a different keyword than 'is' >> > though, due to the plain English >>

Overlayong PDF Files

2012-04-26 Thread Greg Lindstrom
I would like to take an existing pdf file which has the image of a health care claim and overlay the image with claim data (insured name, address, procedures, etc.). I'm pretty good with reportlab -- in fact, I've created a form close to the CMS 1500 (with NPI), but it's not close enough for scann

Re: why () is () and [] is [] work in other way?

2012-04-26 Thread Steven D'Aprano
On Wed, 25 Apr 2012 22:48:33 -0700, John Nagle wrote: > On 4/25/2012 5:01 PM, Steven D'Aprano wrote: >> On Wed, 25 Apr 2012 13:49:24 -0700, Adam Skutt wrote: >> >>> Though, maybe it's better to use a different keyword than 'is' though, >>> due to the plain English >>> connotations of the term; I l

ANN: eGenix mxODBC - Python ODBC Database Interface 3.1.2

2012-04-26 Thread eGenix Team: M.-A. Lemburg
ANNOUNCING eGenix.com mxODBC - Python ODBC Database Interface Version 3.1.2 mxODBC is our commercially supported Python extension providing ODBC database connectivity to Py

Set Date and Time on Python

2012-04-26 Thread viral shah
Hi I'm very new to Python programming. Please help me to add date and time ! Following is the code done by me. import datetime class Module type(datetime.datetime) Now what's the next to do for displaying date and time ? -- http://mail.python.org/mailman/listinfo/python-list