Re: Popen Question

2010-11-08 Thread Lawrence D'Oliveiro
In message , Chris Torek wrote: > ['/bin/sh', '-c', 'echo', '$MYVAR'] > > (with arguments expressed as a Python list). /bin/sh takes the > string after '-c' as a command, and the remaining argument(s) if > any are assigned to positional parameters ($0, $1, etc). Doesn’t work. I don’t know w

Re: functions, list, default parameters

2010-11-08 Thread John Ladasky
On Nov 1, 7:30 pm, Lawrence D'Oliveiro wrote: > In message <20101021235138.609fe...@geekmail.invalid>, Andreas Waldenburger > wrote: > > > While not very commonly needed, why should a shared default argument be > > forbidden? > > Because it’s safer to disallow it than to allow it. That's why Java

Re: Why "flat is better than nested"?

2010-11-08 Thread Lawrence D'Oliveiro
In message , rustom wrote: > If you take zen seriously you dont get it > If you dont take zen seriously you dont get it > That -- seriously -- is zen I don’t get it. -- http://mail.python.org/mailman/listinfo/python-list

Re: Cross compiling (i386 from amd64) with distutils

2010-11-08 Thread Martin v. Loewis
>> You can solve some of the >> problems by editing the Makefile which it uses to learn the compiler >> options from. > > I don't understand this - do you mean I should edit the Makefile in > the actual distutils package, and somehow use that in my project > instead of setup.py? No. A python *ins

Re: Why "flat is better than nested"?

2010-11-08 Thread Rustom Mody
On Oct 26, 12:11 am, kj wrote: > In Steve Holden > writes: > > > > >And everyone taking the Zen too seriously should remember that it was > >written by Tim Peters one night during the commercial breaks between > >rounds of wrestling on television. So while it can give useful guidance, > >it's n

Re: Deditor 0.2.2

2010-11-08 Thread Trevor J. Christensen
I really like that editor! Great work!! Great ideas!! On Sat, 2010-11-06 at 06:06 -0700, Kruptein wrote: > Hey, > > I released version 0.2.2 of my pythonic text-editor Deditor. > It adds the use of projects, a project is a set of files which you can > open all at once to make development much

suds: how to set proxy?

2010-11-08 Thread Johann Spies
According to the suds documentation I can set the proxy setting like this: d = dict(http='host:80', https='host:443', ...) client.set_options(proxy=d) My problem is that you can only do that after 'client' was initiated like this: client = Client(url) And I need the proxy to reach the url. I h

Re: Cross compiling (i386 from amd64) with distutils

2010-11-08 Thread Jason
On Nov 8, 4:16 pm, "Martin v. Loewis" wrote: > No. A python *installation* has a Makefile, in config/Makefile. If > you want distutils to use different options, you could edit this > Makefile. Oh, I see what you mean. But then it would affect *everything* I build on that machine, so I'll stick wi

Re: Popen Question

2010-11-08 Thread Mark Wooding
Lawrence D'Oliveiro writes: > In message , Chris Torek wrote: > > > ['/bin/sh', '-c', 'echo', '$MYVAR'] > > > > (with arguments expressed as a Python list). /bin/sh takes the > > string after '-c' as a command, and the remaining argument(s) if > > any are assigned to positional parameters (

YAMI4 v. 1.2.0 released

2010-11-08 Thread Maciej Sobczak
Hello, I am pleased to announce that the new version of YAMI4, 1.2.0, has been just released and is available for download: http://www.inspirel.com/yami4/ The most important addition for Python programmers is the Python 2.5+ module that complements the already existing Python 3.x library. Thanks

Python 2.7

2010-11-08 Thread Antonio de Haro Millan
I can not install "*Python Imaging Library 1.1.7 for Python 2.6* (Windows only)" because I have the *Python 2.7. *A solution please... ___ Antonio de Haro Millan www.de-haro.es Tf.34.639.972.872 -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 2.7

2010-11-08 Thread Felipe Bastos Nunes
Install the python 2.6.x :-) 2010/11/8, Antonio de Haro Millan : > I can not install "*Python Imaging Library 1.1.7 for Python 2.6* (Windows > only)" > because I have the *Python 2.7. *A solution please... > > ___ > Antonio de Haro Millan > www.de-haro.es > Tf.34.639.972.872 > --

Re: Deditor 0.2.2

2010-11-08 Thread TheSeeker
On Nov 6, 7:06 am, Kruptein wrote: > Hey, > > I released version 0.2.2 of my pythonic text-editor  Deditor. > It adds the use of projects, a project is a set of files which you can > open all at once to make development much faster and easier. > > For more information visit launchpad:http://launch

Re: Python 2.7

2010-11-08 Thread brf256
use python 2.6 :] - Braden Faulkner -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 2.7

2010-11-08 Thread David Robinow
On Mon, Nov 8, 2010 at 6:22 AM, Antonio de Haro Millan wrote: > I can not install "Python Imaging Library 1.1.7 for Python 2.6 (Windows > only)" > because I have the Python 2.7. A solution please... download http://effbot.org/media/downloads/PIL-1.1.7/win32-py2.7.exe -- http://mail.python.org/mai

Re: functions, list, default parameters

2010-11-08 Thread Roy Smith
In article , Lawrence D'Oliveiro wrote: > In message <20101021235138.609fe...@geekmail.invalid>, Andreas Waldenburger > wrote: > > > While not very commonly needed, why should a shared default argument be > > forbidden? > > Because it’s safer to disallow it than to allow it. The best way t

Re: A question about yield

2010-11-08 Thread Simon Brunning
On 7 November 2010 18:14, Chris Rebert wrote: > On Sun, Nov 7, 2010 at 9:56 AM, chad wrote: >> But what happens if the input file is say 250MB? Will all 250MB be >> loaded into memory at once? > > No. As I said, the file will be read from 1 line at a time, on an > as-needed basis; which is to say

Re: Allowing comments after the line continuation backslash

2010-11-08 Thread Neil Cerutti
On 2010-11-06, Steven D'Aprano wrote: >>> styles = [ >>> ("normal", "image", MainWindow.ColorsNormalList), >>> ("highlighted", "highlight", MainWindow.ColorsHighlightedList), >>> ("selected","select",MainWindow.ColorsSelectedList)] >> >> Code should be

Re: Compare source code

2010-11-08 Thread Neil Cerutti
On 2010-11-07, Lawrence D'Oliveiro wrote: > In message <8jftftfel...@mid.individual.net>, Neil Cerutti wrote: > >> The handsome ':' terminator of if/elif/if statements allows us to >> omit a newline, conserving vertical space. This improves the >> readability of certain constructs. >> >> if x: pr

Re: Deditor 0.2.2

2010-11-08 Thread Jean-Michel Pichavant
TheSeeker wrote: On Nov 6, 7:06 am, Kruptein wrote: Hey, I released version 0.2.2 of my pythonic text-editor Deditor. It adds the use of projects, a project is a set of files which you can open all at once to make development much faster and easier. For more information visit launchpad:ht

Re: Compare source code

2010-11-08 Thread Grant Edwards
On 2010-11-08, Roy Smith wrote: > In article , > Grant Edwards wrote: > >> It's getting really hard to find high-DPI displays on laptops any >> more. 1600x1200 used to be available on 16" laptop displays, and that >> looked great. Even my old 15" thinkpad at 1400x1050 wasn't bad. > > My 15" Ma

Re: Compare source code

2010-11-08 Thread Steve Holden
On 11/8/2010 8:50 AM, Neil Cerutti wrote: [...] > Interesting. I find conserving vertical space to be a big win. I > understand why you'd enforce braces for virtually all code bodies > in C. In C, I'm giving up the most obvious form of expression for > something obviously more robust. In Python, th

Question about expression evaluation

2010-11-08 Thread Scott Gould
Hi folks, This is a head-scratcher to me. I occasionally get this error: --- File "/var/www/myproj/account/views.py", line 54, in account if request.account.is_instructor and request.account.contact and request.account.contact.relationship.institution_party_number: AttributeError: 'NoneTyp

Re: Question about expression evaluation

2010-11-08 Thread nn
On Nov 8, 11:17 am, Scott Gould wrote: > Hi folks, > > This is a head-scratcher to me. I occasionally get this error: > > --- >   File "/var/www/myproj/account/views.py", line 54, in account >     if request.account.is_instructor and request.account.contact and > request.account.contact.relationsh

Re: Question about expression evaluation

2010-11-08 Thread Jerry Hill
On Mon, Nov 8, 2010 at 11:17 AM, Scott Gould wrote: > --- >  File "/var/www/myproj/account/views.py", line 54, in account >    if request.account.is_instructor and request.account.contact and > request.account.contact.relationship.institution_party_number: > > AttributeError: 'NoneType' object has

Re: How to get dynamically-created fxn's source?

2010-11-08 Thread gb345
In Peter Otten <__pete...@web.de> writes: >gb345 wrote: >> For a project I'm working on I need a way to retrieve the source >> code of dynamically generated Python functions. (These functions >> are implemented dynamically in order to simulate "partial application" >> in Python.[1]) >Are you a

Re: Question about expression evaluation

2010-11-08 Thread Peter Otten
Scott Gould wrote: > Hi folks, > > This is a head-scratcher to me. I occasionally get this error: > > --- > File "/var/www/myproj/account/views.py", line 54, in account > if request.account.is_instructor and request.account.contact and > request.account.contact.relationship.institution_par

Re: Question about expression evaluation

2010-11-08 Thread Scott Gould
Thanks for the ideas, everyone. It's probably obvious that this is in a Django context, and while I do have WSGI configured to multi-thread its processes, there is nothing explicitly shared -- via threading, a multi-user situation, or otherwise -- about this data. It is entirely local to the reques

Re: Python 2.7

2010-11-08 Thread Jeff Hobbs
On Nov 8, 3:50 am, Felipe Bastos Nunes wrote: > Install the python 2.6.x :-) > > 2010/11/8, Antonio de Haro Millan : > > > I can not install "*Python Imaging Library 1.1.7 for Python 2.6* (Windows > > only)" > > because I have the *Python 2.7. *A solution please... If you need Python 2.7, PIL is

Re: Popen Question

2010-11-08 Thread Ian
On Nov 8, 2:43 am, m...@distorted.org.uk (Mark Wooding) wrote: > > I don’t know what happens to the extra arguments, but they just seem > > to be ignored if -c is specified. > > The argument to -c is taken as a shell script; the remaining arguments > are made available as positional parameters to t

Re: Question about expression evaluation

2010-11-08 Thread Peter Otten
Scott Gould wrote: > Thanks for the ideas, everyone. It's probably obvious that this is in > a Django context, and while I do have WSGI configured to multi-thread > its processes, there is nothing explicitly shared -- via threading, a > multi-user situation, or otherwise -- about this data. It is

Re: Question about expression evaluation

2010-11-08 Thread Peter Otten
Scott Gould wrote: > Thanks for the ideas, everyone. It's probably obvious that this is in > a Django context, and while I do have WSGI configured to multi-thread > its processes, there is nothing explicitly shared -- via threading, a > multi-user situation, or otherwise -- about this data. It is

Re: Making ActivePython and Python co-exist on Windows

2010-11-08 Thread Sridhar Ratnakumar
On 2010-11-07, at 12:34 PM, Benjamin Kaplan wrote: > On Sun, Nov 7, 2010 at 2:25 PM, CWC wrote: >> I'm new to Python. Is it possible to make ActivePython 3.12 and >> Python 3.12 co-exist on Windows? I've got an app which requires the >> former, but I want to stay with the latter, since I'm int

python dpx module

2010-11-08 Thread Brian Krusic
Hi all, Kind of at a loss here. trying to debug some old code belonging to some one else and I keep seeing an error; import dpx no module named dpx Would any one happen to know how I can get a hold if this elusive dpx Python module? -- http://mail.python.org/mailman/listinfo/python-list

Intel C Compiler

2010-11-08 Thread Drake
Hello, I'm an engineer who has access to the Intel C/C++ compiler (icc), and for the heck of it I compiled Python2.7 with it. Unsurprisingly, it compiled fine and functions correctly as far as I know. However, I was interested to discover that the icc compile printed literally thousands of variou

Re: Intel C Compiler

2010-11-08 Thread Stefan Krah
Drake wrote: > I'm an engineer who has access to the Intel C/C++ compiler (icc), and > for the heck of it I compiled Python2.7 with it. > > Unsurprisingly, it compiled fine and functions correctly as far as I > know. However, I was interested to discover that the icc compile > printed literally t

Re: python dpx module

2010-11-08 Thread Robert Kern
On 11/8/10 12:42 PM, Brian Krusic wrote: Hi all, Kind of at a loss here. trying to debug some old code belonging to some one else and I keep seeing an error; import dpx no module named dpx Would any one happen to know how I can get a hold if this elusive dpx Python module? You'll have to

populating a doubly-subscripted array

2010-11-08 Thread ghw
What am I missing? I am using Python 3.1.2. ff = [[0.0]*5]*5 ff#(lists 5x5 array of 0.0) for i in range(5): for j in range(3): ff[i][j] = i*10+j print (i,j,ff[i][j]) # correctly prints ff array values ff# try this and see what happens!

Re: populating a doubly-subscripted array

2010-11-08 Thread Robert Kern
On 11/8/10 3:56 PM, g...@accutrol.com wrote: What am I missing? I am using Python 3.1.2. ff = [[0.0]*5]*5 http://docs.python.org/faq/programming.html#how-do-i-create-a-multidimensional-list -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is

Re: Popen Question

2010-11-08 Thread Hans Mulder
Ian wrote: On Nov 8, 2:43 am, m...@distorted.org.uk (Mark Wooding) wrote: I don’t know what happens to the extra arguments, but they just seem to be ignored if -c is specified. The argument to -c is taken as a shell script; the remaining arguments are made available as positional parameters to

Re: Compare source code

2010-11-08 Thread Michael Torrie
On 11/06/2010 02:27 AM, Seebs wrote: > On 2010-11-06, Steve Holden wrote: >> If someone were to use a text editor which had always historically >> mangled whitespace I would find myself wondering why they found it >> necessary to restrict themselves to such stone-age tools. > > I have yet to find

Re: functions, list, default parameters

2010-11-08 Thread Lawrence D'Oliveiro
In message , Robert Kern wrote: > On 11/4/10 2:07 AM, Lawrence D'Oliveiro wrote: > >> In message, Robert >> Kern wrote: >> >>> On 11/2/10 2:12 AM, Lawrence D'Oliveiro wrote: >>> In message, Robert Kern wrote: > "Immutable objects" are just those without an obvious API for >

Re: populating a doubly-subscripted array

2010-11-08 Thread Ben Finney
g...@accutrol.com writes: > What am I missing? You're missing the fact that Python doesn't have a built-in “array” type, nor really “subscripts” for them. > ff = [[0.0]*5]*5 This creates a float object, ‘0.0’. It then creates a list containing five references to that same object. It then create

Re: Allowing comments after the line continuation backslash

2010-11-08 Thread Lawrence D'Oliveiro
In message <87fwvdb69k.fsf@metalzone.distorted.org.uk>, Mark Wooding wrote: > Lawrence D'Oliveiro writes: > >> for \ >> Description, Attr, ColorList \ >> in \ >> ( >> ("normal", "image", MainWindow.ColorsNormalList), >> ("highlighted", "highlig

Re: populating a doubly-subscripted array

2010-11-08 Thread Mark Wooding
g...@accutrol.com writes: > What am I missing? I am using Python 3.1.2. > > ff = [[0.0]*5]*5 > ff#(lists 5x5 array of 0.0) > for i in range(5): > for j in range(3): > ff[i][j] = i*10+j > print (i,j,ff[i][j]) # correctly prints ff array values > > ff

Re: Popen Question

2010-11-08 Thread Lawrence D'Oliveiro
In message <4cd87b24$0$81481$e4fe5...@news.xs4all.nl>, Hans Mulder wrote: > But in this case the first positional argument is in $0. That’s what confused me. -- http://mail.python.org/mailman/listinfo/python-list

Re: Compare source code

2010-11-08 Thread Lawrence D'Oliveiro
In message <87oca1b8ba.fsf@metalzone.distorted.org.uk>, Mark Wooding wrote: > Vertical space is a limiting factor on how much code one can see at a > time. One thing that helps me is that Emacs has commands for quickly jumping between matching brackets. Of course, this only works for langu

Re: Compare source code

2010-11-08 Thread Lawrence D'Oliveiro
In message , Grant Edwards wrote: > IOW, editing a loop or other control structure where you couldn't see both > ends was problematic. Conserving vertical space avoids that problem. No it doesn’t. It just moves it to a different, arbitrary, point a few percent away—not enough to be worth botheri

Pythonic/idiomatic?

2010-11-08 Thread Seebs
I have an existing hunk of Makefile code: CPPFLAGS = "$(filter -D* -I* -i* -U*,$(TARGET_CFLAGS))" For those not familiar with GNU makeisms, this means "assemble a string which consists of all the words in $(TARGET_CFLAGS) which start with one of -D, -I, -i, or -U". So if you give it

Re: Compare source code

2010-11-08 Thread Lawrence D'Oliveiro
In message , Grant Edwards wrote: > ... though I'd still prefer a 4:3. 4:3 still seems to be the best. It gives you a landscape A3-proportional view (or two A4-proportioned portrait pages side by side), and the little bit of space left over at the top or bottom can be used for toolbars, titleb

Re: functions, list, default parameters

2010-11-08 Thread Robert Kern
On 11/8/10 5:24 PM, Lawrence D'Oliveiro wrote: In message, Robert Kern wrote: On 11/4/10 2:07 AM, Lawrence D'Oliveiro wrote: In message, Robert Kern wrote: On 11/2/10 2:12 AM, Lawrence D'Oliveiro wrote: In message, Robert Kern wrote: "Immutable objects" are just those without an obvious

Re: Pythonic/idiomatic?

2010-11-08 Thread geremy condra
On Mon, Nov 8, 2010 at 6:32 PM, Seebs wrote: > I have an existing hunk of Makefile code: >        CPPFLAGS = "$(filter -D* -I* -i* -U*,$(TARGET_CFLAGS))" > For those not familiar with GNU makeisms, this means "assemble a string > which consists of all the words in $(TARGET_CFLAGS) which start with

Commercial or Famous Applicattions.?

2010-11-08 Thread Jorge Biquez
Hello all. Newbie question. Sorry. Can you mention applications/systems/solutions made with Python that are well known and used by public in general? ANd that maybe we do not know they are done with Python? I had a talk with a friend, "PHP-Only-Fan", and he said (you know the schema of thos

Re: python test frameworks

2010-11-08 Thread Kev Dwyer
On Sun, 07 Nov 2010 09:01:42 -0800, rustom wrote: > On Nov 7, 7:09 pm, Kev Dwyer wrote: >> On Sun, 07 Nov 2010 10:56:46 +0530, Rustom Mody wrote: >> > There are a large number of test frameworks in/for python.  Apart >> > from what comes builtin with python there seems to be nose, staf, >> > qmte

Re: Pythonic/idiomatic?

2010-11-08 Thread Ben Finney
Seebs writes: > I have a similar situation in a Python context, and I am wondering > whether this is an idiomatic spelling: > > ' '.join([x for x in target_cflags.split() if re.match('^-[DIiU]', x)]) > > This appears to do the same thing, but is it an idiomatic use of list > comprehensions,

Re: Commercial or Famous Applicattions.?

2010-11-08 Thread alex23
Jorge Biquez wrote: > Can you mention applications/systems/solutions made with Python that > are well known and used by public in general? ANd that maybe we do > not know they are done with Python? http://python.org/about/success/ This comes up semi-regularly so you might be able to find more ex

Re: Commercial or Famous Applicattions.?

2010-11-08 Thread rantingrick
Commenting on which language is better than "this one" or which language boasts the most achievements is nothing more than time very poorly spent. Some people will find Python to be the best thing since sliced bread (and i am one of them!), however others will find Python to be the worst language

Re: Compare source code

2010-11-08 Thread Seebs
On 2010-11-08, Michael Torrie wrote: > On 11/06/2010 02:27 AM, Seebs wrote: >> I have yet to find an editor that allows me to, well, *edit*, more >> comfortably than vi. > Indeed vi (or in my case, vim) works wonderfully well with python. I > always use the following vim settings on python files

Re: Compare source code

2010-11-08 Thread Seebs
On 2010-11-08, Lawrence D'Oliveiro wrote: > In message <87oca1b8ba.fsf@metalzone.distorted.org.uk>, Mark Wooding > wrote: >> Vertical space is a limiting factor on how much code one can see at a >> time. > One thing that helps me is that Emacs has commands for quickly jumping > between matc

Re: Pythonic/idiomatic?

2010-11-08 Thread Seebs
On 2010-11-09, Ben Finney wrote: > For this purpose, there is a generator expression syntax >http://docs.python.org/reference/expressions.html#generator-expressions>, > almost identical to a list comprehension except without the enclosing > brackets. > > ' '.join(x for x in target_cflags.split

Re: Commercial or Famous Applicattions.?

2010-11-08 Thread brf256
Mailman is of course. As well as redhats anaconda installer and google uses python internally for many of there "medium sized" projects. Also, calibre, gwibber, portage pms, ubuntu software center, YUM pms and many others including YouTube. Moral is many big companies do both for products and in

Re: Commercial or Famous Applicattions.?

2010-11-08 Thread Seebs
On 2010-11-09, rantingrick wrote: > Commenting on which language is better than "this one" or which > language boasts the most achievements is nothing more than time very > poorly spent. This is mostly true, but I don't think it's entirely true. It is certainly possible for someone else's langua

Re: Popen Question

2010-11-08 Thread Ian
On Nov 8, 3:35 pm, Hans Mulder wrote: > > Perhaps this example better demonstrates what is going on: > > p = subprocess.Popen(['echo one $0 three $1 five', 'two', 'four'], > > ...                      shell=True) > > one two three four five > > Maybe I'm thick, but I still don't understand.  

Re: Commercial or Famous Applicattions.?

2010-11-08 Thread John Nagle
On 11/8/2010 4:47 PM, brf...@gmail.com wrote: Mailman is of course. As well as redhats anaconda installer and google uses python internally for many of there "medium sized" projects. Also, calibre, gwibber, portage pms, ubuntu software center, YUM pms and many others including YouTube. Moral is m

Re: Pythonic/idiomatic?

2010-11-08 Thread Ben Finney
Seebs writes: > On 2010-11-09, Ben Finney wrote: > > The regex is less clear for the purpose than I'd prefer. For a > > simple ???is it a member of this small set???, I'd find it more > > readable to use a simple list of the actual strings:: > > > ' '.join( > > x for x in target_cfla

Re: Commercial or Famous Applicattions.?

2010-11-08 Thread Alan Gauld
"Jorge Biquez" wrote Can you mention applications/systems/solutions made with Python that are well known and used by public in general? ANd that maybe we do not know they are done with Python? The Python web site has an advocacy section, you will find several success stories there. HTH,

Re: Pythonic/idiomatic?

2010-11-08 Thread Tim Chase
On 11/08/10 18:34, Seebs wrote: On 2010-11-09, Ben Finney wrote: ' '.join(x for x in target_cflags.split() if re.match('^-[DIiU]', x)) Ahh, handy. ... The latter works only in Python with set literals (Python 2.7 or later). I think we're stuck with backwards compatibility at least as

Re: Commercial or Famous Applicattions.?

2010-11-08 Thread rantingrick
On Nov 8, 6:43 pm, Seebs wrote: > On 2010-11-09, rantingrick wrote: > It is certainly possible for someone else's language choices to > affect me (if I get called in to fix their code).  And as a result, I do > try to do at least a little language advocacy.  Specifically, I try to > steer people

Re: [Tutor] Commercial or Famous Applicattions.?

2010-11-08 Thread Luke Paireepinart
just off the top of my head... NASA uses it. Lots of games use Python as their game logic/scripting language (how many use PHP? probably approaching 0. LUA is more popular than Python but Python is much more popular than PHP). The first ever bittorrent client (the official one) was written in P

Define macro when invoking setup.py

2010-11-08 Thread Jason
I'd like to be able switch between building my C extension with a certain preprocessor macro defined or not defined. I'm using the rudimentary distutils setup.py example given here: http://docs.python.org/extending/building.html Is there a command line option that distutils.core.setup() will inte

Re: http error 301 for urlopen

2010-11-08 Thread Lawrence D'Oliveiro
In message <4cd7987e$0$1674$742ec...@news.sonic.net>, John Nagle wrote: >It's the New York Times' paywall. They're trying to set a cookie, > and will redirect the URL until you store and return the cookie. And if they find out you’re acessing them from a script, they’ll probably try to find

Re: Silly newbie question - Carrot character (^)

2010-11-08 Thread Lawrence D'Oliveiro
In message , Dennis Lee Bieber wrote: > On Sat, 6 Nov 2010 10:22:47 -0400, Philip Semanchuk > declaimed the following in > gmane.comp.python.general: > >> Some people might think the language ref> is a fine place to direct >> newcomers to Python. I don't. It's not awful, but it's dense and >>

Re: subclassing str

2010-11-08 Thread Lawrence D'Oliveiro
In message <5dlbo.1024$w8@twister2.libero.it>, not1xor1 (Alessandro) wrote: > I'm already using plain functions, but thought that wrapping most of > them in a str subclass would let me save some time and yield cleaner > and more manageable code How exactly does a.f(b, c) save time over

Re: Pythonic/idiomatic?

2010-11-08 Thread Seebs
On 2010-11-09, Ben Finney wrote: > Seebs writes: >> I think we're stuck with backwards compatibility at least as far as >> 2.4. > Then you don't yet have the ???any??? and ???all??? built-in functions, or the > tuple-of-prefixes feature of ???str.startswith??? either. Bummer. Eww. > At which p

Re: Silly newbie question - Carrot character (^)

2010-11-08 Thread Seebs
On 2010-11-09, Lawrence D'Oliveiro wrote: > In message , Dennis Lee > Bieber wrote: >> Have you ever looked at the reference manual for Ada? > Or even worse, the annotated reference. I thought annotations were supposed > to clarify things; in this case they seemed to have the opposite effect...

Re: Define macro when invoking setup.py

2010-11-08 Thread Christian Heimes
Am 09.11.2010 03:09, schrieb Jason: > I'd like to be able switch between building my C extension with a > certain preprocessor macro defined or not defined. I'm using the > rudimentary distutils setup.py example given here: > > http://docs.python.org/extending/building.html > > Is there a command

Re: subclassing str

2010-11-08 Thread rantingrick
On Nov 8, 8:18 pm, Lawrence D'Oliveiro wrote: > In message <5dlbo.1024$w8@twister2.libero.it>, not1xor1 (Alessandro) > wrote: > > > I'm already using plain functions, but thought that wrapping most of > > them in a str subclass would let me save some time and yield cleaner > > and more managea

Re: Define macro when invoking setup.py

2010-11-08 Thread Jason
On Nov 9, 10:48 am, Christian Heimes wrote: > You were looking at the wrong manual. > Readhttp://docs.python.org/distutils/setupscript.html#preprocessor-options > > Extension(..., >           define_macros=[('NDEBUG', '1'), >                          ('HAVE_STRFTIME', None)], >           undef_ma

Re: Define macro when invoking setup.py

2010-11-08 Thread Jason
On Nov 9, 10:56 am, Jason wrote: > But can they be selected or set from the command line, so I can do, > say, "setup.py build -DDEBUG=1"? Just answered my own question: there's an option for "build_ext" (NOT "build") that allows this. Thanks, Jason -- http://mail.python.org/mailman/listinfo/pyt

Re: Is there a way to pring a list object in Python?

2010-11-08 Thread Zeynel
On Oct 31, 2:44 pm, Benjamin Kaplan wrote: > Rep() = Rep object > Rep.all() = Query object > list(Rep.all()) = List of Rep objects. > list(Rep.all())[0] = A single Rep object > list(Rep.all())[0].replist = A list > Thanks! This was very helpful. -- http://mail.python.org/mailman/listinfo/python

Re: Commercial or Famous Applicattions.?

2010-11-08 Thread John Bond
On 9/11/2010 12:18 AM, Jorge Biquez wrote: Hello all. Newbie question. Sorry. Can you mention applications/systems/solutions made with Python that are well known and used by public in general? ANd that maybe we do not know they are done with Python? ... Jorge Biquez Keep in mind that Pyt

Re: Commercial or Famous Applicattions.?

2010-11-08 Thread Lawrence D'Oliveiro
In message , John Bond wrote: > I once got asked to write a list things that I'd make different in the > technology world if I could, to make it better for everyone. Number 3 > was "everywhere you now see Javascript or PHP, you'd see Python > instead". If only... PHP yes, JavaScript no. -- http

Re: Commercial or Famous Applicattions.?

2010-11-08 Thread Lawrence D'Oliveiro
In message , Jorge Biquez wrote: > ... there are not too many applications done with Python > than the ones done with PHP ... PHP is only used for server-side Web applications, nothing else. Python is used for lots of things, on and off the Web. -- http://mail.python.org/mailman/listinfo/pytho

Re: Silly newbie question - Caret character (^)

2010-11-08 Thread Lawrence D'Oliveiro
In message , Seebs wrote: > On 2010-11-09, Lawrence D'Oliveiro > wrote: > >> In message , Dennis >> Lee Bieber wrote: >>> >>> Have you ever looked at the reference manual for Ada? > >> Or even worse, the annotated reference. I thought annotations were >> supposed to clarify things; in this case

Re: Commercial or Famous Applicattions.?

2010-11-08 Thread John Bond
On 9/11/2010 5:54 AM, Lawrence D'Oliveiro wrote: In message, John Bond wrote: I once got asked to write a list things that I'd make different in the technology world if I could, to make it better for everyone. Number 3 was "everywhere you now see Javascript or PHP, you'd see Python instead". If

Re: JavaScript vs Python (was Re: Commercial or Famous Applicattions.?)

2010-11-08 Thread Lawrence D'Oliveiro
In message , John Bond wrote: > On 9/11/2010 5:54 AM, Lawrence D'Oliveiro wrote: > >> In message, John Bond >> wrote: >> >>> I once got asked to write a list things that I'd make different in the >>> technology world if I could, to make it better for everyone. Number 3 >>> was "everywhere you now

Re: Silly newbie question - Caret character (^)

2010-11-08 Thread Seebs
On 2010-11-09, Lawrence D'Oliveiro wrote: > In message , Seebs wrote: >> On 2010-11-09, Lawrence D'Oliveiro >> wrote: >>> Or even worse, the annotated reference. I thought annotations were >>> supposed to clarify things; in this case they seemed to have the opposite >>> effect... >> Clearly, you

Re: Compare source code

2010-11-08 Thread Arnaud Delobelle
Lawrence D'Oliveiro writes: > In message <87oca1b8ba.fsf@metalzone.distorted.org.uk>, Mark Wooding > wrote: > >> Vertical space is a limiting factor on how much code one can see at a >> time. > > One thing that helps me is that Emacs has commands for quickly jumping > between matching brack

How to Write a Winning Dissertation

2010-11-08 Thread Karis Lee
Writing a Dissertation requires mastery of research methods for valid and reliable data collection, availability of all the resources and perfection of dissertation format, structure and citation styles. This article offers some guiltiness about how to write a winning dissertation. Dissertation Wr

Re: JavaScript vs Python (was Re: Commercial or Famous Applicattions.?)

2010-11-08 Thread Chris Rebert
On Mon, Nov 8, 2010 at 10:52 PM, Lawrence D'Oliveiro wrote: > In message , John Bond > wrote: > >> On 9/11/2010 5:54 AM, Lawrence D'Oliveiro wrote: >>> In message, John Bond >>> wrote: >>> I once got asked to write a list things that I'd make different in the technology world if I could,

Re: Silly newbie question - Caret character (^)

2010-11-08 Thread Lawrence D'Oliveiro
In message , Seebs wrote: > Not so much turgidity as being WRONG. Consistently and often. Wow. And the guy’s written so many books; how does he get away with it? > (I know too little about C++ to criticize is writings about it, but people > have told me they're comparable.) I suppose seeing th

Re: Pythonic/idiomatic?

2010-11-08 Thread Arnaud Delobelle
Seebs writes: > I have an existing hunk of Makefile code: > CPPFLAGS = "$(filter -D* -I* -i* -U*,$(TARGET_CFLAGS))" > For those not familiar with GNU makeisms, this means "assemble a string > which consists of all the words in $(TARGET_CFLAGS) which start with one > of -D, -I, -i, or -U".

Re: How to test if a module exists?

2010-11-08 Thread Lawrence D'Oliveiro
In message , Roy Smith wrote: > On the other hand, if your module's bug is that it in turn imports some > other module, which doesn't exist, you'll also get an ImportError. Does it really matter? Either way, the module is unusable. -- http://mail.python.org/mailman/listinfo/python-list

Re: JavaScript vs Python (was Re: Commercial or Famous Applicattions.?)

2010-11-08 Thread Ian Kelly
On Tue, Nov 9, 2010 at 12:30 AM, Chris Rebert wrote: > "The Good Parts" of it anyway. > > All hail William Goldman! Wait, what were talking about? Ian -- http://mail.python.org/mailman/listinfo/python-list