Re: web frameworks that support Python 3

2009-08-23 Thread Graham Dumpleton
On Aug 24, 6:34 am, Sebastian Wiesner wrote: > At Sunday 23 August 2009 22:13:16 you wrote:> I use Chinese and therefore > Unicode very heavily, and so Python 3 is > > an unavoidable choice for me. > > Python 2.x supports Unicode just as well as Python 3.  Every common web > framework works perfe

Re: Is Python what I need?

2009-08-23 Thread c
> I'm interested in developing computer based, interactive programs That is so open-ended it could mean anything. If you give a much more specified idea of what you are imagining creating, people could be helpful. > for students in a special school who have an aversion to pen and paper. Aversi

Re: basic thread question

2009-08-23 Thread John Nagle
Jan Kaliszewski wrote: 18-08-2009 o 22:10:15 Derek Martin wrote: I have some simple threaded code... If I run this with an arg of 1 (start one thread), it pegs one cpu, as I would expect. If I run it with an arg of 2 (start 2 threads), it uses both CPUs, but utilization of both is less than

Re: Need cleanup advice for multiline string

2009-08-23 Thread Mensanator
On Aug 23, 2:25�pm, Stefan Behnel wrote: > Mensanator wrote: > > asking how many Jews you can fit into a Volswagen. > > None, because it's already full. A spelling error does not make it any less offensive. > > (or "voll" as those who design Volkswagens would put it...) > > Stefan -- http://ma

sgmllib.py

2009-08-23 Thread elsa
Hi all, I'm new to both this forum and Python, and I've got a bit stuck trying to learn how to parse HTML here is my problem I'm using a textbook that uses sgmllib.py for all its examples. I'm aware that sgmllib is not in the current release, however I want to get it to work, as I have python

Re: Most "active" coroutine library project?

2009-08-23 Thread Doron Tal
On Sun, Aug 23, 2009 at 6:02 PM, Phillip B Oldham wrote: > I've been taking a look at the multitude of coroutine libraries > available for Python, but from the looks of the projects they all seem > to be rather "quiet". I'd like to pick one up to use on a current > project but can't deduce which i

Re: __import__(x) VS __import__(x, {}, {}, [''])

2009-08-23 Thread Phil
"If you call it without a value for 'globals', it uses the current value of globals()." Thanks, this is what I was trying to ask. I typed my question up way too fast before dinner. You've been great help. -- http://mail.python.org/mailman/listinfo/python-list

Literal concatenation, strings vs. numbers (was: Numeric literals in other than base 10 - was Annoying octal notation)

2009-08-23 Thread Ben Finney
greg writes: > J. Cliff Dyer wrote: > > > What happens if you use a literal like 0x10f 304? > > To me the obvious thing to do is concatenate them textually and then > treat the whole thing as a single numeric literal. Anything else > wouldn't be sane, IMO. Yet, as was pointed out, that behaviour

Re: __import__(x) VS __import__(x, {}, {}, [''])

2009-08-23 Thread greg
Phil wrote: I am trying to understand the difference between __import__(x) and __import__(x, {}, {}, ['']). The documentations wording was a bit weird for me to understand: "The standard implementation does not use its locals argument at all, and uses its globals only to determine the package co

Re: Numeric literals in other than base 10 - was Annoying octal notation

2009-08-23 Thread Ben Finney
Max Erickson writes: > At some point, abandoning direct support for literals and just > having a function that can handle different bases starts to make a > lot of sense to me: > > >>> int('100', 8) > 64 > >>> int('100', 10) > 100 > >>> int('100', 16) > 256 > >>> int('100', 2) > 4 > >>> int('10

Re: Is python faster than java?

2009-08-23 Thread sturlamolden
On 23 Aug, 21:59, Emile van Sebille wrote: > Speed of what? Development? User interaction? Responsiveness to queries? My personal view on the 'Is Python faster than Java' question: - Coding? Yes, if you program 'pythonic'. - String handling? Often. - I/O and networking? Often. - Iteration?

Re: IOError: [Errno 22] invalid mode ('wb') or filename: in windows xp while making tarfile

2009-08-23 Thread John Machin
Dave Angel ieee.org> writes: > John Machin wrote: > > Erik Max Francis alcyone.com> writes: > I also suspect the "pipe" symbol. I don't know if it's an invalid > character to Windows, but it's certainly a bad idea. The '|' character > means something special to the shell. The "pipe" cha

Re: Is Python what I need?

2009-08-23 Thread Dave Angel
newbie wrote: Hi all I'm interested in developing computer based, interactive programs for students in a special school who have an aversion to pen and paper. I've searched the net to find ready made software that will meet my needs but it is either written to a level much higher than these stude

Re: Python/Fortran interoperability

2009-08-23 Thread Richard Maine
sturlamolden wrote: > Does anyone use OOP in Fortran anyway? Presumably not many people yet because... > And Fortran 2003 compilers are not ubiquitous. I'd not only agree, I'd say that was quite a bit understated. Last time I checked, the number of Fortran 2003 compilers available on the most

Re: What is the recommended library for xml parsing?

2009-08-23 Thread bot
voodoorai2000 on gmail.com has asked me for the current status of our votation.. so here you go: +1 => 1 vote -1 => 0 votes Time Line: -- (2009-08-24 01:25:11) Raimond Garcia: +1 Visit the fancy votation page: * http://letsdecide.us/4130bc4e0051016cb377d3436f4e8e683ed820ed -- http://ma

Re: Numeric literals in other than base 10 - was Annoying octal notation

2009-08-23 Thread greg
J. Cliff Dyer wrote: What happens if you use a literal like 0x10f 304? To me the obvious thing to do is concatenate them textually and then treat the whole thing as a single numeric literal. Anything else wouldn't be sane, IMO. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: Python/Fortran interoperability

2009-08-23 Thread sturlamolden
On 24 Aug, 02:57, nos...@see.signature (Richard Maine) wrote: > Yes, it is no surprise that the C interop stuff fails to address this, > since it isn't in C. Something different/extra would be needed, which is > exactly what Nick said. I'm going to jump out of the middle of this now. > The only re

Re: IOError: [Errno 22] invalid mode ('wb') or filename: in windows xp while making tarfile

2009-08-23 Thread Dave Angel
John Machin wrote: Erik Max Francis alcyone.com> writes: Ryniek90 wrote: Is its the '|\U' literal fault in path '|C:\\Users\\Ryniek's WinSe7en\\MyNewGGBackup(2009-08-23 14:59:02).tar.bz2|' ? What is "the '|\U' literal fault" ??? It's probably a misleading error from

Re: Python/Fortran interoperability

2009-08-23 Thread sturlamolden
On 24 Aug, 01:59, sturlamolden wrote: > subroutine foobar(cstr) bind(c, name='foobar') >     use, intrinsic :: iso_c_binding >     type(c_ptr) :: cstr >     character(*), pointer :: fstr >     call c_f_pointer(cptr, fptr) Actually, this does not work, as it is illegal to create a pointer to a ch

Re: What is the recommended library for xml parsing?

2009-08-23 Thread Raimond Garcia
+1 ::results:: Cheers, Peter Petrelli On Mon, Aug 24, 2009 at 12:59 AM, Chris Rebert wrote: > On Sun, Aug 23, 2009 at 3:07 PM, Raimond Garcia > wrote: > > Is there a good build in library or should I use a third party one? > > xml.etree.ElementTree: > http://docs.python.org/library/xml.etre

Re: Numeric literals in other than base 10 - was Annoying octal notation

2009-08-23 Thread Max Erickson
"bartc" wrote: > > "Scott David Daniels" wrote in message > news:kn2dnszr5b0bwazxnz2dnuvz_s-dn...@pdx.net... >> James Harris wrote:... >>> Another option: > > It can be assumed however that .9. isn't in binary? > > That's a neat idea. But an even simpler scheme might be: > > .octal.100 > .d

Re: Python/Fortran interoperability

2009-08-23 Thread Richard Maine
sturlamolden wrote: > On 24 Aug, 02:26, nos...@see.signature (Richard Maine) wrote: > > > You missed the word "OOP", which seemed like the whole point. Not that > > the particular word is used in the Fortran standard, but it isn't hard > > to guess that he means a derived type that uses some of

Re: Newbie: list comprehension troubles..

2009-08-23 Thread Chris Rebert
On Sun, Aug 23, 2009 at 5:09 PM, Ben Finney wrote: > Chris Rebert writes: > >> tlist = [pair for pair in ((obj, obj.intersect(ray)) for obj in >> self.objs) if pair[1] is not None] >> >> Should it be done? Probably not. [Compared to a ‘for’ suite with an >> ‘if’ suite, it's] less readable and less

Re: install package in a particular python version

2009-08-23 Thread David Lyon
On Thu, 20 Aug 2009 20:53:18 -0700 (PDT), Steve1234 wrote: > Benjamin suggested: > sudo python2.5 setup.py install > and it works. This makes sense, thanks. > > I downloaded pythonpkgmgr from source and installed it. I got the > error that reguired wx package was missing. I couldn't find this

Re: Python/Fortran interoperability

2009-08-23 Thread sturlamolden
On 24 Aug, 02:26, nos...@see.signature (Richard Maine) wrote: > You missed the word "OOP", which seemed like the whole point. Not that > the particular word is used in the Fortran standard, but it isn't hard > to guess that he means a derived type that uses some of the OOP > features. Inheritance,

Re: Protecting against callbacks queuing up?

2009-08-23 Thread MRAB
Esben von Buchwald wrote: Hello I'm using Python for S60 1.9.7 on my Nokia phone. I've made a program that gets input from an accelerometer sensor, and then calculates some stuff and displays the result. The sensor framework API does a callback to a function defined by me, every time new da

Re: Need cleanup advice for multiline string

2009-08-23 Thread Steven D'Aprano
On Sun, 23 Aug 2009 20:52:16 +0200, Stefan Behnel wrote: > Simon Brunning wrote: >> 2009/8/11 Robert Dailey: >>> On Aug 11, 3:40 pm, Bearophile wrote: There are gals too here. >>> It's a figure of speech. And besides, why would I want programming >>> advice from a woman? lol. Thanks for the h

Protecting against callbacks queuing up?

2009-08-23 Thread Esben von Buchwald
Hello I'm using Python for S60 1.9.7 on my Nokia phone. I've made a program that gets input from an accelerometer sensor, and then calculates some stuff and displays the result. The sensor framework API does a callback to a function defined by me, every time new data is available. The prob

Re: Newbie: list comprehension troubles..

2009-08-23 Thread Ben Finney
Chris Rebert writes: > tlist = [pair for pair in ((obj, obj.intersect(ray)) for obj in > self.objs) if pair[1] is not None] > > Should it be done? Probably not. [Compared to a ‘for’ suite with an > ‘if’ suite, it's] less readable and less efficient. I disagree on the “less efficient”, unless you

Re: Python/Fortran interoperability

2009-08-23 Thread sturlamolden
On 24 Aug, 01:59, sturlamolden wrote: > subroutine foobar(cstr) bind(c, name='foobar') >     use, intrinsic :: iso_c_binding >     type(c_ptr) :: cstr >     character(*), pointer :: fstr >     call c_f_pointer(cptr, fptr) > Which means that you can write a wrapper in Fortran callable from C, tha

Re: Newbie: list comprehension troubles..

2009-08-23 Thread Terry Reedy
Chris Rebert wrote: On Sun, Aug 23, 2009 at 4:27 PM, mm wrote: Hi, I'm trying to replace this... # this works but there must be a more pythonic way, right? 'Pythonic' is readable, if nothing else tlist = [] for obj in self.objs: t = obj.intersect(ray)

Re: Python/Fortran interoperability

2009-08-23 Thread sturlamolden
On 24 Aug, 00:02, Dennis Lee Bieber wrote: >         That's a C language problem -- since a string in C is just an array > of character. The last FORTRAN dialect (and implementation) I used > passed strings On 24 Aug, 00:02, Dennis Lee Bieber wrote: > values -- FORTRAN strings were typically s

Re: Newbie: list comprehension troubles..

2009-08-23 Thread Chris Rebert
On Sun, Aug 23, 2009 at 4:27 PM, mm wrote: > Hi, I'm trying to replace this... > >        # this works but there must be a more pythonic way, right? >        tlist = [] >        for obj in self.objs: >            t = obj.intersect(ray) >            if (t != None): >                tlist.append((obj

Newbie: list comprehension troubles..

2009-08-23 Thread mm
Hi, I'm trying to replace this... # this works but there must be a more pythonic way, right? tlist = [] for obj in self.objs: t = obj.intersect(ray) if (t != None): tlist.append((obj,t)) with a list comprehension- can it be done? Wh

Re: Python/Fortran interoperability

2009-08-23 Thread sturlamolden
On 23 Aug, 20:42, n...@cam.ac.uk wrote: > That is precisely what I am investigating.  TR 29113 falls a LONG > way before it gets to any of the OOP data - indeed, you can't even > pass OOP derived types as pure data (without even the functionality) > in its model.  Nor most of what else Python woul

Re: IOError: [Errno 22] invalid mode ('wb') or filename: in windows xp while making tarfile

2009-08-23 Thread John Machin
Erik Max Francis alcyone.com> writes: > > Ryniek90 wrote: > > Is its the '|\U' literal fault in path '|C:\\Users\\Ryniek's > > WinSe7en\\MyNewGGBackup(2009-08-23 14:59:02).tar.bz2|' ? What is "the '|\U' literal fault" ??? > > It's probably a misleading error from the OS; I would guess the p

Re: Numeric literals in other than base 10 - was Annoying octal notation

2009-08-23 Thread bartc
"Scott David Daniels" wrote in message news:kn2dnszr5b0bwazxnz2dnuvz_s-dn...@pdx.net... James Harris wrote:... Another option: 0.(2:1011), 0.(8:7621), 0.(16:c26b) where the three characters "0.(" begin the sequence. Comments? Improvements? I did a little interpreter where non-base 10 n

Re: What is the recommended library for xml parsing?

2009-08-23 Thread Chris Rebert
On Sun, Aug 23, 2009 at 3:07 PM, Raimond Garcia wrote: > Is there a good build in library or should I use a third party one? xml.etree.ElementTree: http://docs.python.org/library/xml.etree.elementtree.html Cheers, Chris -- http://blog.rebertia.com -- http://mail.python.org/mailman/listinfo/pytho

Re: logging SMTPhandler Error

2009-08-23 Thread Aahz
In article , Dennis Lee Bieber wrote: >On 23 Aug 2009 06:14:00 -0700, a...@pythoncraft.com (Aahz) declaimed the >following in gmane.comp.python.general: >> >> Slightly expanded: most mail servers accept connections from any other >> mail server for addresses that are hosted by them. The MX addre

Re: Numeric literals in other than base 10 - was Annoying octal notation

2009-08-23 Thread Scott David Daniels
James Harris wrote:... Another option: 0.(2:1011), 0.(8:7621), 0.(16:c26b) where the three characters "0.(" begin the sequence. Comments? Improvements? I did a little interpreter where non-base 10 numbers (up to base 36) were: .7.100 == 64 (octal) .9.100 == 100 (decimal)

Re: Numeric literals in other than base 10 - was Annoying octal notation

2009-08-23 Thread MRAB
James Harris wrote: On 23 Aug, 00:16, Mel wrote: James Harris wrote: I have no idea why Ada which uses the # also apparently uses it to end a number 2#1011#, 8#7621#, 16#c26b# Interesting. They do it because of this example from

Re: conditional for-statement

2009-08-23 Thread Mel
seb wrote: > On Aug 23, 6:18 pm, John Posner wrote: [ ... ] >> How about using a generator expression instead of a list? >> >> for i in (x for x in range(10) if x > 5): >> print i >> >> -John > > Indeed, but we could have the same syntax than for generators but > directly in the for statement as

What is the recommended library for xml parsing?

2009-08-23 Thread Raimond Garcia
Is there a good build in library or should I use a third party one? Cheers, Peter -- http://mail.python.org/mailman/listinfo/python-list

__import__(x) VS __import__(x, {}, {}, [''])

2009-08-23 Thread Phil
I am trying to understand the difference between __import__(x) and __import__(x, {}, {}, ['']). The documentations wording was a bit weird for me to understand: "The standard implementation does not use its locals argument at all, and uses its globals only to determine the package context of the i

Re: Numeric literals in other than base 10 - was Annoying octal notation

2009-08-23 Thread James Harris
On 23 Aug, 21:55, James Harris wrote: ... > >  However for floating point you > > need at least three letters because a floating point number has > > three parts: the fixed point point, the exponent base, and the > > exponent.  Now we can represent the radices of the individual > > parts with th

Re: Numeric literals in other than base 10 - was Annoying octal notation

2009-08-23 Thread James Harris
On 23 Aug, 00:16, Mel wrote: > James Harris wrote: > > I have no idea why Ada which uses the # also apparently uses it to end > > a number > > >   2#1011#, 8#7621#, 16#c26b# > > Interesting.  They do it because of this example from >

Re: conditional for-statement

2009-08-23 Thread Chris Rebert
On Sun, Aug 23, 2009 at 1:36 PM, seb wrote: > On Aug 23, 6:18 pm, John Posner wrote: >> >> Hi, >> >> >> i was wondering if there is a syntax alike: >> >> >> for i in range(10) if i > 5: >> >>     print i >> >> > You can write >> >> > for i in filter(lambda i: i > 5, range(10)): >> >     print i >>

Re: conditional for-statement

2009-08-23 Thread seb
On Aug 23, 10:36 pm, seb wrote: > On Aug 23, 6:18 pm, John Posner wrote: > > > > > > > >> Hi, > > > >> i was wondering if there is a syntax alike: > > > >> for i in range(10) if i > 5: > > >>     print i > > > > You can write > > > > for i in filter(lambda i: i > 5, range(10)): > > >     print i

Re: Numeric literals in other than base 10 - was Annoying octal notation

2009-08-23 Thread James Harris
On 23 Aug, 04:38, c...@tiac.net (Richard Harter) wrote: > On Sat, 22 Aug 2009 14:54:41 -0700 (PDT), James Harris > > > > > > wrote: > >On 22 Aug, 10:27, David <71da...@libero.it> wrote: > > >... (snipped a discussion on languages and other systems interpreting > >numbers with a leading zero as oct

Re: Is python faster than java?

2009-08-23 Thread Raimond Garcia
Makes sense. +1 Cheers Peter On Sun, Aug 23, 2009 at 9:59 PM, Emile van Sebille wrote: > On 8/23/2009 12:47 PM Raimond Garcia said... > >> I'm building a large application, >> > > What kind of application? > > kind of fancy python but I'm concerned about speed. >> > > Speed of what? Develop

Re: can python make web applications?

2009-08-23 Thread Goke Aruna
A lot check this fantastic open source application, http://www.openerp.com, all done is python. On 8/23/09, Stefaan Himpe wrote: > Deep_Feelings wrote: >> can python make powerfull database web applications that can replace >> desktop database applications? e.g: entrprise accounting >> programs,e

Re: web frameworks that support Python 3

2009-08-23 Thread Stefan Behnel
David Prager Branner wrote: > I use Chinese and therefore Unicode very heavily, and so Python 3 is > an unavoidable choice for me. As others noted before, this statement is not true by itself. > But I'm frustrated by the fact that > Django, Pylons, and TurboGears do not support Python 3 yet and

Re: conditional for-statement

2009-08-23 Thread seb
On Aug 23, 6:18 pm, John Posner wrote: > >> Hi, > > >> i was wondering if there is a syntax alike: > > >> for i in range(10) if i > 5: > >>     print i > > > You can write > > > for i in filter(lambda i: i > 5, range(10)): > >     print i > > > but > > > for i in range(10): > >     if i > 5: > >  

Re: Combining python and perl

2009-08-23 Thread Albert Hopkins
On Sun, 2009-08-23 at 12:54 -0700, Peng Yu wrote: > I understand that the sames things can be done with both language. > > But I do think that certain applications can be done faster (in term > of the coding & debugging time, I don't care runtime here) with one > language than with another. Yes

Re: web frameworks that support Python 3

2009-08-23 Thread Sebastian Wiesner
At Sunday 23 August 2009 22:13:16 you wrote: > I use Chinese and therefore Unicode very heavily, and so Python 3 is > an unavoidable choice for me. Python 2.x supports Unicode just as well as Python 3. Every common web framework works perfectly with unicode. In any case, there is bottle [1], whi

Re: web frameworks that support Python 3

2009-08-23 Thread Albert Hopkins
On Sun, 2009-08-23 at 13:13 -0700, David Prager Branner wrote: > I use Chinese and therefore Unicode very heavily, and so Python 3 is > an unavoidable choice for me. But I'm frustrated by the fact that > Django, Pylons, and TurboGears do not support Python 3 yet and > (according to their developmen

Re: IOError: [Errno 22] invalid mode ('wb') or filename: in windows xp while making tarfile

2009-08-23 Thread Erik Max Francis
Ryniek90 wrote: I've got my backup script which opens tarfile for add chosen file to it. But while setting it up, i've got Traceback: here's the url: -->http://paste.ubuntu.com/258081/<-- I have searched among google's result but didn't found anything useful. Only found info that it may be the

web frameworks that support Python 3

2009-08-23 Thread David Prager Branner
I use Chinese and therefore Unicode very heavily, and so Python 3 is an unavoidable choice for me. But I'm frustrated by the fact that Django, Pylons, and TurboGears do not support Python 3 yet and (according to their development websites) will not for a very long time to come. So I am asking for

Re: Is python faster than java?

2009-08-23 Thread Emile van Sebille
On 8/23/2009 12:47 PM Raimond Garcia said... I'm building a large application, What kind of application? kind of fancy python but I'm concerned about speed. Speed of what? Development? User interaction? Responsiveness to queries? Mostly, you should worry about speed later. Writing it in p

Re: Combining python and perl

2009-08-23 Thread Peng Yu
On Aug 23, 8:00 am, Albert Hopkins wrote: > On Sun, 2009-08-23 at 05:37 -0700, Peng Yu wrote: > > Hi, > > > According tohttp://www.python.org/doc/essays/comparisons.html, it > > says > > > "Python and Perl come from a similar background (Unix scripting, which > > both have long outgrown), and spor

Is python faster than java?

2009-08-23 Thread Raimond Garcia
I'm building a large application, kind of fancy python but I'm concerned about speed. Cheers Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: Need cleanup advice for multiline string

2009-08-23 Thread Stefan Behnel
Mensanator wrote: > asking how many Jews you can fit into a Volswagen. None, because it's already full. (or "voll" as those who design Volkswagens would put it...) Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Need cleanup advice for multiline string

2009-08-23 Thread Stefan Behnel
Jean-Michel Pichavant wrote: > Grant Edwards wrote: >> On 2009-08-18, Simon Forman wrote: >>> Sexism, racism, homophobia, religious intolerance, etc., all >>> stem from a fundamental forgetfulness of our Unity in God (as >>> I would put it) and this is perhaps the single greatest cause >>> of huma

Re: Need cleanup advice for multiline string

2009-08-23 Thread Stefan Behnel
Simon Brunning wrote: > 2009/8/11 Robert Dailey: >> On Aug 11, 3:40 pm, Bearophile wrote: >>> There are gals too here. >> It's a figure of speech. And besides, why would I want programming >> advice from a woman? lol. Thanks for the help. > > Give the attitudes still prevalent in our industry (cf

Re: Questions on XML

2009-08-23 Thread Rami Chowdhury
My problem is with IDLE on Windows. When I try to type Bangla directly into the IDLE window I only get '?' characters, and repr() fails with a UnicodeDecodeError. I expect, though, that that's because of my specific installation / Windows issues, as it works fine on Fedora 10... > I do not get

Re: Python/Fortran interoperability

2009-08-23 Thread nmm1
In article , JB wrote: >["Followup-To:" header set to comp.lang.fortran.] Sorry - set back again, because you don't provide an Email address, and there's a significant issue. Thanks for the response. >> 1) Do you want to use character strings of arbitrary length? > >As in, a signed C int (

Re: can python make web applications?

2009-08-23 Thread Stefaan Himpe
Deep_Feelings wrote: can python make powerfull database web applications that can replace desktop database applications? e.g: entrprise accounting programs,enterprise human resource management programs ...etc In addition to the recommendations by other people, I'd like to recommend the very eas

Re: Polling a net address

2009-08-23 Thread Aahz
In article <99ddf4e1-d327-4fb1-aee4-aa881de3b...@d23g2000vbm.googlegroups.com>, Iain wrote: > >I'm writing a system tray application for windows, and the app needs >to poll a remote site at a pre-defined interval, and then process any >data returned. > >The GUI needs to remain responsive as this

Re: Annoying octal notation

2009-08-23 Thread James Harris
On 21 Aug, 00:59, James Harris wrote: ... > > Is there some magic to make the 2.x CPython interpreter to ignore the > > annoying octal notation? > > I'd really like 012 to be "12" and not "10". > > This is (IMHO) a sad hangover from C (which took it from B ... This seemed worth writing up so I'

Re: Most "active" coroutine library project?

2009-08-23 Thread Matthew Woodcraft
Phillip B Oldham writes: > I've been taking a look at the multitude of coroutine libraries > available for Python, but from the looks of the projects they all seem > to be rather "quiet". I'd like to pick one up to use on a current > project but can't deduce which is the most popular/has the larg

Re: Python/Fortran interoperability

2009-08-23 Thread JB
["Followup-To:" header set to comp.lang.fortran.] On 2009-08-23, n...@cam.ac.uk wrote: > > I am interested in surveying people who want to interoperate between > Fortran and Python to find out what they would like to be able to do > more conveniently, especially with regard to types not supported

[ANN] pyxser-1.2r --- Python-Object to XML serialization module

2009-08-23 Thread Daniel Molina Wegener
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 Hello, I'm pleased to announce pyxser-1.2r, a Python-Object to XML serializer and deserializer. This module package it's completely written in C and licensed under LGPLv3. The tested Python versions are 2.5.X and 2.7.X. * home page:   http://coder

Re: can python make web applications?

2009-08-23 Thread koranthala
On Aug 23, 8:12 pm, Deep_Feelings wrote: > can python make powerfull database web applications that can replace > desktop database applications? e.g: entrprise accounting > programs,enterprise human resource management programs ...etc Very much so. The web frameworks, Django & TurboGears are quit

Re: Trying To Catch Invalid User Input

2009-08-23 Thread Victor Subervi
Really slick! Thanks! V On Sun, Aug 23, 2009 at 11:08 AM, Albert Hopkins wrote: > On Sun, 2009-08-23 at 16:36 +0100, MRAB wrote: > > Victor Subervi wrote: > > > Hi; > > > I have the following: > > > > > > style = raw_input('What style is this? (1 = short, 2 = long): ') > > > flag = 0 > > > while

Re: conditional for-statement

2009-08-23 Thread John Posner
Hi, i was wondering if there is a syntax alike: for i in range(10) if i > 5: print i You can write for i in filter(lambda i: i > 5, range(10)): print i but for i in range(10): if i > 5: print i it' better readable, and for i in range(6,10): print i it's e

Re: [Diversity] Language note

2009-08-23 Thread Cameron Laird
In article , Rami Chowdhury wrote: > >> Most indian languages have a different >> grammer (compared to English). So i'm curious to see how that would be >> implemented in a parser > >+1 -- I'd be interested in seeing this too, although we have drifted >OT here and perhaps this conversation woul

Python-URL! - weekly Python news and links (Aug 23)

2009-08-23 Thread Gabriel Genellina
QOTW: "... [O]nce you accept that text is best handled in Unicode, there's little sense in making an exception for the limited subset that happens to be representable in ASCII." - Ben Finney http://groups.google.com/group/comp.lang.python/msg/accc8c2ae9d7ed15 Python 3.1.1 released:

Re: Trying To Catch Invalid User Input

2009-08-23 Thread Albert Hopkins
On Sun, 2009-08-23 at 16:36 +0100, MRAB wrote: > Victor Subervi wrote: > > Hi; > > I have the following: > > > > style = raw_input('What style is this? (1 = short, 2 = long): ') > > flag = 0 > > while flag == 0: > > if (style != 1) or (style != 2): > > style = raw_input('There was a mistake.

Re: generate keyboard/mouse event under windows

2009-08-23 Thread Scott David Daniels
Ray wrote: On Aug 19, 2:07 pm, yaka wrote: Read this and see if it helps: http://kvance.livejournal.com/985732.html is there a way to generate a 'true' keyboard event? (works like user pressed a key on keyboard) not send the 'send keyboard event to application' ? If there is such a spot, i

Re: Numeric literals in other than base 10 - was Annoying octal notation

2009-08-23 Thread bartc
wrote in message news:h6r4fb$18...@aioe.org... In comp.lang.python James Harris wrote: On 22 Aug, 10:27, David <71da...@libero.it> wrote: ... What about 2_1011, 8_7621, 16_c26h or 2;1011, 8;7621, 16;c26h ? They look good - which is important. The trouble (for me) is that I want the not

Re: Is Python what I need?

2009-08-23 Thread Tomasz Rola
On Sun, 23 Aug 2009, newbie wrote: > Hi all > I'm interested in developing computer based, interactive programs for > students in a special school who have an aversion to pen and paper. > I've searched the net to find ready made software that will meet my > needs but it is either written to a leve

Re: Trying To Catch Invalid User Input

2009-08-23 Thread Gary Herron
Victor Subervi wrote: Hi; I have the following: style = raw_input('What style is this? (1 = short, 2 = long): ') flag = 0 while flag == 0: if (style != 1) or (style != 2): style = raw_input('There was a mistake. What style is this? (1 = short, 2 = long): ') else: flag = 1 I would

Re: Trying To Catch Invalid User Input

2009-08-23 Thread MRAB
Victor Subervi wrote: Hi; I have the following: style = raw_input('What style is this? (1 = short, 2 = long): ') flag = 0 while flag == 0: if (style != 1) or (style != 2): style = raw_input('There was a mistake. What style is this? (1 = short, 2 = long): ') else: flag = 1 I would

Re: Is Python what I need?

2009-08-23 Thread Peter Otten
newbie wrote: > I'm interested in developing computer based, interactive programs for > students in a special school who have an aversion to pen and paper. > I've searched the net to find ready made software that will meet my > needs but it is either written to a level much higher than these > stu

Re: Python/Fortran interoperability

2009-08-23 Thread sturlamolden
On 23 Aug, 12:35, n...@cam.ac.uk wrote: > I am interested in surveying people who want to interoperate between > Fortran and Python to find out what they would like to be able to do > more conveniently, especially with regard to types not supported for C > interoperability by the current Fortran s

can python make web applications?

2009-08-23 Thread Deep_Feelings
can python make powerfull database web applications that can replace desktop database applications? e.g: entrprise accounting programs,enterprise human resource management programs ...etc -- http://mail.python.org/mailman/listinfo/python-list

Most "active" coroutine library project?

2009-08-23 Thread Phillip B Oldham
I've been taking a look at the multitude of coroutine libraries available for Python, but from the looks of the projects they all seem to be rather "quiet". I'd like to pick one up to use on a current project but can't deduce which is the most popular/has the largest community. Libraries I looked

Trying To Catch Invalid User Input

2009-08-23 Thread Victor Subervi
Hi; I have the following: style = raw_input('What style is this? (1 = short, 2 = long): ') flag = 0 while flag == 0: if (style != 1) or (style != 2): style = raw_input('There was a mistake. What style is this? (1 = short, 2 = long): ') else: flag = 1 I would think this would catch err

IOError: [Errno 22] invalid mode ('wb') or filename: in windows xp while making tarfile

2009-08-23 Thread Ryniek90
Hi I've got my backup script which opens tarfile for add chosen file to it. But while setting it up, i've got Traceback: here's the url: -->http://paste.ubuntu.com/258081/<-- I have searched among google's result but didn't found anything useful. Only found info that it may be the backslashes

Re: Numeric literals in other than base 10 - was Annoying octal notation

2009-08-23 Thread J. Cliff Dyer
I had an objection to using spaces in numeric literals last time around and it still stands, and it still stands in the new one. What happens if you use a literal like 0x10f 304? Is 304 treated as decimal or hexadecimal? It's not clear how you would begin to combine it The way string concatena

Re: Python/Fortran interoperability

2009-08-23 Thread Stefan Behnel
n...@cam.ac.uk wrote: > I am interested in surveying people who want to interoperate between > Fortran and Python to find out what they would like to be able to do > more conveniently, especially with regard to types not supported for C > interoperability by the current Fortran standard. Any sugge

Re: Numeric literals in other than base 10 - was Annoying octal notation

2009-08-23 Thread Ben Finney
garabik-news-2005...@kassiopeia.juls.savba.sk writes: > Why not just use the space? 123 000 looks better than 123_000, and is > not syntactically ambiguous (at least in python). And as it already > works for string literals, it could be applied to numbers, too… +1 to all this. I think this discus

Re: logging SMTPhandler Error

2009-08-23 Thread Aahz
In article <60de8d40-61f4-4ffd-bcef-749bf0667...@k19g2000yqn.googlegroups.com>, Bev in TX wrote: >On Aug 23, 12:48=A0am, a...@pythoncraft.com (Aahz) wrote: >> >> It's also not too difficult to do the moral equivalent with dnspython and >> find the MX host for the domain you're trying to send e-ma

Re: Annoying octal notation

2009-08-23 Thread Matthew Woodcraft
Dennis Lee Bieber writes: > About the only place one commonly sees leading zeros on decimal > numbers, in my experience, is zero-filled COBOL data decks (and since > classic COBOL stores in BCD anyway... binary (usage is > computational/comp-1) was a later add-on to the data specification mo

Re: Dictionary from a list

2009-08-23 Thread Aahz
In article , EK wrote: >On Aug 20, 2:10=A0pm, Peter Otten <__pete...@web.de> wrote: >> >> >>> from itertools import izip >> >>> it =3D iter([1,2,3,4,5,6]) >> >>> dict(izip(it, it)) >> >> {1: 2, 3: 4, 5: 6} > >dict(zip(*[iter(l)]*2)) No, that's not a good solution. For starters, it's less reada

Re: Python/Fortran interoperability

2009-08-23 Thread viper-2
On Aug 23, 6:35 am, n...@cam.ac.uk wrote: > I am interested in surveying people who want to interoperate between > Fortran and Python to find out what they would like to be able to do > more conveniently, especially with regard to types not supported for C > interoperability by the current Fortran

How to distribute an application

2009-08-23 Thread Steven Woody
Hi, My application contains a main python source file as well as a set of modules (also .py files). Now, I am considering distribute my application to others. But the distutils seems made for distributing packages not for main applications. Am I right? Thanks. -- Life is the only flaw in an o

Re: Blank Line at Program Exit

2009-08-23 Thread Steven Woody
On Sat, Aug 22, 2009 at 11:25 PM, Nitebirdz wrote: > On Thu, Aug 20, 2009 at 01:31:14PM +0800, Steven Woody wrote: > > Hi, > > Any python program, even that does absolutely nothing in the code, will > > cause a blank line printed out when the program exit. What's the reason? > > Thanks. > > > >

Re: Combining python and perl

2009-08-23 Thread Albert Hopkins
On Sun, 2009-08-23 at 05:37 -0700, Peng Yu wrote: > Hi, > > According to http://www.python.org/doc/essays/comparisons.html, it > says > > "Python and Perl come from a similar background (Unix scripting, which > both have long outgrown), and sport many similar features, but have a > different phil

Combining python and perl

2009-08-23 Thread Peng Yu
Hi, According to http://www.python.org/doc/essays/comparisons.html, it says "Python and Perl come from a similar background (Unix scripting, which both have long outgrown), and sport many similar features, but have a different philosophy. Perl emphasizes support for common application- oriented t

  1   2   >