Re: Usage of main()

2009-09-03 Thread Simon Brunning
2009/9/4 Manuel Graune : > How come the main()-idiom is not "the standard way" of writing a > python-program (like e.g. in C)? Speaking for myself, it *is* the standard way to structure a script. I find it more readable, since I can put my main function at the very top where it's visible, with the

Re: Usage of main()

2009-09-03 Thread r
On Sep 4, 12:55 am, Manuel Graune wrote: (snip) > How come the main()-idiom is not "the standard way" of writing a > python-program (like e.g. in C)? Why use a nested function when you already *in* main? thats like declaring variables when your compiler could just use some simple logic... '2.7'

Re: Usage of main()

2009-09-03 Thread Sean DiZazzo
On Sep 3, 10:55 pm, Manuel Graune wrote: > Hello everyone, > > the standard structure of a python-program which is taught in all of > the books I on python I read by now is simply something like: > > #!/usr/bin/python > print "Hello, world!" > ^D > > While reading about structuring a larger code-b

Usage of main()

2009-09-03 Thread Manuel Graune
Hello everyone, the standard structure of a python-program which is taught in all of the books I on python I read by now is simply something like: #!/usr/bin/python print "Hello, world!" ^D While reading about structuring a larger code-base, unit-testing, etc I stumbled on the idiom #!/usr/bin

Re: Problem with multiprocessing

2009-09-03 Thread Tennessee
> Yes, to use the multiprocessing module, you must make your script > importable, so runtime statements should go into a __main__ > conditional. This way, when multiprocessing imports the module for each > of its threads, the actual runtime code only gets executed once in the > parent thread, whic

Re: The future of Python immutability

2009-09-03 Thread John Nagle
Gabriel Genellina wrote: En Thu, 03 Sep 2009 15:03:13 -0300, John Nagle escribió: Python's concept of immutability is useful, but it could be more general. Immutability is interesting for threaded programs, because immutable objects can be shared without risk. Consider a programmi

Re: how to edit .wsgi file extebtions with IDLE on windows

2009-09-03 Thread Gabriel Genellina
En Sat, 29 Aug 2009 20:29:43 -0300, gert escribió: On Aug 29, 11:16 pm, "Gabriel Genellina" wrote: En Sat, 29 Aug 2009 17:14:14 -0300, gert escribió: > On Aug 29, 9:31 pm, Chris Rebert wrote: >> On Sat, Aug 29, 2009 at 5:40 AM, gert wrote: >> > On Aug 29, 6:43 am, "Gabriel Genellina" >> >

Re: using queue

2009-09-03 Thread Tim Arnold
"Jan Kaliszewski" wrote in message news:mailman.895.1251958800.2854.python-l...@python.org... > 06:49:13 Scott David Daniels wrote: > >> Tim Arnold wrote: > >>> (1) what's wrong with having each chapter in a separate thread? Too >>> much going on for a single processor? > >> Many more threads t

REMINDER: PyCon 2010: Call for Proposals

2009-09-03 Thread Aahz
Call for proposals -- PyCon 2010 -- === Due date: October 1st, 2009 Want to showcase your skills as a Python Hacker? Want to have hundreds of people see your talk on the subject of your choice? Have some hot b

Re: Why does this group have so much spam?

2009-09-03 Thread r
*ahem*! You guy's do remember this thread (?at one time in history?) was about spam on this list, right? Not internet connection fees. ;-) -- http://mail.python.org/mailman/listinfo/python-list

Re: Why does this group have so much spam?

2009-09-03 Thread Terry Reedy
Steven D'Aprano wrote: According to the theory "increased usage leads to higher prices", we should be paying more for Internet access now than we were in 1999, and hugely more that from the early 90s when there were hardly any Internet users. You are confusing historical changed with contem

Re: Try Except Problem

2009-09-03 Thread Albert Hopkins
On Tue, 2009-09-01 at 13:45 -0500, Victor Subervi wrote: > Hi: I have this code: [blah] It's hard to tell because: 1. You posted code in HTML format, which is really hard to read 2. Even when viewed as plain text, you use non-standard indentation which is really hard to read

Pydev 1.5.0 (Pydev Extensions open sourced)

2009-09-03 Thread Fabio Zadrozny
Hi All, Today, Aptana is proud to announce that Pydev and Pydev Extensions have become a single plugin, with all the available contents open source (and freely available for anyone) in the 1.5.0 release (it's the same as 1.4.8 but with all the code open source). With that, Aptana believes in prov

Re: Logging contents of IRC channel

2009-09-03 Thread devaru
On Sep 1, 9:56 am, alex23 wrote: > On Sep 1, 3:23 am, devaru wrote: > > > I am new to Python. I want to log the activities in an IRC channel. > > Any pointers regarding this would be of great help. > > It would help us if you could explain why the answers weren't suitable > that you were given wh

Re: An assessment of the Unicode standard

2009-09-03 Thread r
On Sep 1, 9:48 am, steve wrote: (snip) > I think you are confusing simplicity with uniformity. > > Uniformity is not always good. Sure standardizing on units of measure and > airline codes is good, but expecting everyone to speak one language is akin to > expecting everyone to wear one type of clo

Adjacency lists with sqlalchemy...

2009-09-03 Thread Just Another Victim of the Ambient Morality
I'm desperately trying to declare an adjacency list table with declarative_base() but I can't figure it out. Strangely, all the documentation avoids declarative_base() like the plague and does everything the hard way. What the hell is this thing for if we're not supposed to use it? If

Re: An assessment of the Unicode standard

2009-09-03 Thread Chris Jones
On Tue, Sep 01, 2009 at 03:16:03PM EDT, r wrote: [..] > Bring on the metric system Terry, i have been waiting all my life!! > > Now, if we can only convince those 800 million Mandarin Chinese > speakers... *ahem* Do we have a Chinese translator in the house? > > :-) "Between the idea And the

Re: Python community buildbot page still 503

2009-09-03 Thread exarkun
On 06:23 pm, mar...@v.loewis.de wrote: If I am not mistaken http://python.org/dev/buildbot/community/all/ has been down since python.org had its harddrive issues. Anyone know a time line on getting it back up and running. This service is, unfortunately, unmaintained. It broke when I upgraded t

Try Except Problem

2009-09-03 Thread Victor Subervi
Hi: I have this code: try: cursor.execute('select salesperson, office, cell, fax, home, email, assistant from general where salesperson="%s";' % (catch)) stuff = cursor.fetchone() test = raw_input('You have selected salesperson %s. Is that correct? (hit \'enter\' for affirmative, enter anyt

Re: possible attribute-oriented class

2009-09-03 Thread Ken Newton
On Thu, Sep 3, 2009 at 4:30 PM, Steven D'Aprano < st...@remove-this-cybersource.com.au> wrote: > On Thu, 03 Sep 2009 15:46:01 -0700, Ken Newton wrote: > > > I have created the following class definition with the idea of making a > > clean syntax for non-programmers to created structured data withi

Re: Question about apply

2009-09-03 Thread MRAB
jorma kala wrote: Hi, I'm using apply to pass keyword arguments as a dictionary to a funcion at runtime (which keyword arguments to pass is only known at runtime) apply is very handy for this, because it takes a dictionary of keyword arguments directly def f1(a=None,b=None,c=None): pass

Re: Annoying octal notation

2009-09-03 Thread MRAB
Albert van der Horst wrote: In article <6b5ea596-d1e3-483d-ba79-7b139d3c7...@z24g2000yqb.googlegroups.com>, Bearophile wrote: MRAB: '_': what if in the future we want to allow them in numbers for clarity? Hettinger says it's hard (= requires too many changes) to do that and Python programs

Re: Why does this group have so much spam?

2009-09-03 Thread Steven D'Aprano
On Thu, 03 Sep 2009 16:01:26 -0700, Ethan Furman wrote: > Steven D'Aprano wrote: >> On Thu, 03 Sep 2009 12:19:48 -0700, Ethan Furman wrote: >> >> >>>Steven D'Aprano wrote: >>> On Thu, 03 Sep 2009 04:01:54 -0400, Terry Reedy wrote: >ISP's price residential service based on

Re: python daemon - compress data and load data into MySQL by pyodbc

2009-09-03 Thread Ben Finney
MacRules writes: > What I am looking for is this. > > Oracle DB in data center 1 (LA, west coast) > MSSQL DB in data center 2 (DC, east coast) > So network bandwidth is an issue Okay, that's a brief description but is clearer than we had before. > I prefer to have gzip fist and > deliver the da

Re: possible attribute-oriented class

2009-09-03 Thread Steven D'Aprano
On Thu, 03 Sep 2009 15:46:01 -0700, Ken Newton wrote: > I have created the following class definition with the idea of making a > clean syntax for non-programmers to created structured data within a > python environment. What do you expect non-programmers to do with this class, without programmi

Re: Video?

2009-09-03 Thread Che M
On Sep 3, 4:11 pm, David C Ullrich wrote: > Not at all important, just for fun (at least for me): > > It seems to me, looking at various docs, that wxWidgets > includes a "media control" that can play video files, but > it's not included in wxPython. (There's something in > wxPython with a promisi

Re: Why does this group have so much spam?

2009-09-03 Thread Ethan Furman
Steven D'Aprano wrote: On Thu, 03 Sep 2009 12:19:48 -0700, Ethan Furman wrote: Steven D'Aprano wrote: On Thu, 03 Sep 2009 04:01:54 -0400, Terry Reedy wrote: ISP's price residential service based on average fixed cost and average usage. Multiple homes using one connection push those avera

Re: Why does this group have so much spam?

2009-09-03 Thread Steven D'Aprano
On Thu, 03 Sep 2009 12:19:48 -0700, Ethan Furman wrote: > Steven D'Aprano wrote: >> On Thu, 03 Sep 2009 04:01:54 -0400, Terry Reedy wrote: >> >> >>>ISP's price residential service based on average fixed cost and average >>>usage. Multiple homes using one connection push those averages up. >> >>

The Python: Rag September issue available

2009-09-03 Thread Bernie
The September issue of The Python: Rag is available at: http://www.pythonrag.org A monthly, free, community run, Python magazine - issues are in pdf format, intended for anyone interested in Python, without being particularly serious. If you have anything you would like to say about Python, p

possible attribute-oriented class

2009-09-03 Thread Ken Newton
I have created the following class definition with the idea of making a clean syntax for non-programmers to created structured data within a python environment. I would appreciate comments on this code. First, is something like this already done? Second, are there reasons for not doing this? If t

Re: The future of Python immutability

2009-09-03 Thread Gabriel Genellina
En Thu, 03 Sep 2009 15:03:13 -0300, John Nagle escribió: Python's concept of immutability is useful, but it could be more general. Immutability is interesting for threaded programs, because immutable objects can be shared without risk. Consider a programming model where objects sh

Re: issue with grep command

2009-09-03 Thread Rhodri James
On Thu, 03 Sep 2009 19:51:20 +0100, Jul wrote: in tcsh terminal i have the following line of code cat fileName.txt | grep "a" which extracts all the instances of "a" from the file in the terminal.. however when i am trying to create a txt while, i am unable to do so for some reason..this is

Re: The future of Python immutability

2009-09-03 Thread Paul Rubin
Stefan Behnel writes: > Read again what he wrote. In a language with only immutable data types > (which doesn't mean that you can't efficiently create modified versions of > a data container), avoiding race conditions is trivial. The most well known > example is clearly Erlang. Adding "synchronise

Different results for request() vs putrequest()

2009-09-03 Thread John Gordon
According to the documentation, these two sections of code should be equivalent: conn = httplib.HTTPSConnection(host) conn.putrequest("POST", url) conn.putheader("Proxy-Authorization", myProxy) conn.putheader("Content-Length", "%d" % len(body)) conn.endheaders() conn.send(body) vs

Re: First release of pyfsevents

2009-09-03 Thread Nicolas Dumazet
On Sep 3, 10:33 pm, a...@pythoncraft.com (Aahz) wrote: > I'm curious why you went with FSEvents rather than kqueue.  My company > discovered that FSEvents is rather coarse-grained: it only tells you that > there has been an event within a directory, it does *not* tell you > anything about the chang

Re: Video?

2009-09-03 Thread Avell Diroll
David C Ullrich wrote: ... Is that correct? If so is there some other standard Python windowing kit that does include some sort of video functionality? (Talking Ubuntu Linux if it matters.) I don't know about video and wxpython, but gstreamer has some python bindings (python-gst0.10 on jaunty

Re: Subclassing list and splicing

2009-09-03 Thread Kreso
Kreso wrote: [...] > I would prefer that resulting object m belonged to myclist class. I forgot to add that mylist instances in my case have some attributes (that's why I need special container class in the first place) which should be preserved after splicing. In my simple understaning of pyth

Re: First release of pyfsevents

2009-09-03 Thread Aahz
[posted to c.l.py with cc in e-mail, reply to group preferred] In article , Nicolas Dumazet wrote: > >I am proud to announce the first release of pyfsevents, a C extension >providing a Python interface to the FSEvents API. >FSEvents is an Apple framework for Mac OS X >=3D 10.5 allowing >monitori

Re: issue with grep command

2009-09-03 Thread Albert Hopkins
On Thu, 2009-09-03 at 11:51 -0700, Jul wrote: [Stuff about tcsh and grep deleted] What on earth does this have to do with Python? -a -- http://mail.python.org/mailman/listinfo/python-list

Re: Python for 64bit Linux version

2009-09-03 Thread Albert Hopkins
On Thu, 2009-09-03 at 13:30 -0500, Bhanu Srinivas Mangipudi wrote: > > I just want to that s there a 64 bit Linux version for python ? if yes > can you provide me any links for it.I could find a 64bit windows > version but could not find Linuux version If you are using a 64bit Linux distribution

Re: Qstrings to Strings

2009-09-03 Thread David Boddie
On Thursday 03 September 2009 21:01, Stefan Behnel wrote: > Helvin wrote: >> Just wanted to say, to convert qstrings (or integers for that matter) >> to strings, use the str() function. >> >> http://learnwithhelvin.blogspot.com/2009/09/qstrings-and-strings.html > > Hmmm, will that return a Unico

Video?

2009-09-03 Thread David C Ullrich
Not at all important, just for fun (at least for me): It seems to me, looking at various docs, that wxWidgets includes a "media control" that can play video files, but it's not included in wxPython. (There's something in wxPython with a promising name but it seems to be just audio.) Is that corre

Re: Python for 64bit Linux version

2009-09-03 Thread Grant Edwards
On 2009-09-03, Jochen Schulz wrote: > Bhanu Srinivas Mangipudi: >> >> I just want to that s there a 64 bit Linux version for python >> ? > > Yes. > >> if yes can you provide me any links for it.I could find a >> 64bit windows version but could not find Linuux version > > I am currently too lazy to

Re: The future of Python immutability

2009-09-03 Thread Stefan Behnel
John Nagle wrote: > With this mechanism, multi-thread programs with shared data > structures can be written with little or no explicit locking by > the programmer. If the restrictions are made a bit stricter, > strict enough that threads cannot share mutable unsynchronized data, > removal of t

Re: obscure problem using elementtree to make xhtml website

2009-09-03 Thread Rami Chowdhury
basically any tag that can have content in html you had better close the html way (), or IE will see it as unclosed and will not display the rest of the page after the tag (or do something else unexpected). Not a bug in IE (this time), which is correctly parsing the file as html. ... which is ob

Re: The future of Python immutability

2009-09-03 Thread Stefan Behnel
Nigel Rantor wrote: > My comment you quoted was talking about Java and the use of > synchronized. I fthat was unclear I apologise. Well, it was clear. But it was also unrelated to what the OP wrote. He was talking about the semantics of "synchronized" in Java, not the use. Stefan -- http://mail.

Re: python daemon - compress data and load data into MySQL by pyodbc

2009-09-03 Thread MacRules
Martin P. Hellwig wrote: MacRules wrote: What I am looking for is this. Oracle DB in data center 1 (LA, west coast) MSSQL DB in data center 2 (DC, east coast) So network bandwidth is an issue, I prefer to have gzip fist and deliver the data. If bandwidth is really an issue, you should send

Re: The future of Python immutability

2009-09-03 Thread Nigel Rantor
Stefan Behnel wrote: Nigel Rantor wrote: John Nagle wrote: Immutability is interesting for threaded programs, because immutable objects can be shared without risk. Consider a programming model where objects shared between threads must be either immutable or "synchronized" in the sense that

Re: The future of Python immutability

2009-09-03 Thread Stefan Behnel
Nigel Rantor wrote: > > John Nagle wrote: >> Immutability is interesting for threaded programs, because >> immutable objects can be shared without risk. Consider a programming >> model where objects shared between threads must be either immutable or >> "synchronized" in the sense that Java us

Re: Why does this group have so much spam?

2009-09-03 Thread Ethan Furman
Steven D'Aprano wrote: On Thu, 03 Sep 2009 04:01:54 -0400, Terry Reedy wrote: ISP's price residential service based on average fixed cost and average usage. Multiple homes using one connection push those averages up. Is that meant to be a problem? When people buy more, the unit price they

Re: python daemon - compress data and load data into MySQL by pyodbc

2009-09-03 Thread Martin P. Hellwig
MacRules wrote: What I am looking for is this. Oracle DB in data center 1 (LA, west coast) MSSQL DB in data center 2 (DC, east coast) So network bandwidth is an issue, I prefer to have gzip fist and deliver the data. If bandwidth is really an issue, you should send compressed delta's. I n

Re: obscure problem using elementtree to make xhtml website

2009-09-03 Thread Stefan Behnel
Lee wrote: > basically any tag that can > have content in html you had better close the html way (), > or IE will see it as unclosed and will not display the rest of the > page after the tag (or do something else unexpected). Not a bug in IE > (this time), which is correctly parsing the file as htm

Re: The future of Python immutability

2009-09-03 Thread Nigel Rantor
John Nagle wrote: Python's concept of immutability is useful, but it could be more general. In the beginning, strings, tuples, and numbers were immutable, and everything else was mutable. That was simple enough. But over time, Python has acquired more immutable types - immutable sets

Re: Qstrings to Strings

2009-09-03 Thread Stefan Behnel
Helvin wrote: > Just wanted to say, to convert qstrings (or integers for that matter) > to strings, use the str() function. > > http://learnwithhelvin.blogspot.com/2009/09/qstrings-and-strings.html Hmmm, will that return a Unicode string? A byte string would be rather inappropriate in most cases.

issue with grep command

2009-09-03 Thread Jul
in tcsh terminal i have the following line of code cat fileName.txt | grep "a" which extracts all the instances of "a" from the file in the terminal.. however when i am trying to create a txt while, i am unable to do so for some reason..this is the syntaxt i am using -- cat fileName.txt | frep

Re: Python for 64bit Linux version

2009-09-03 Thread Jochen Schulz
Bhanu Srinivas Mangipudi: > > I just want to that s there a 64 bit Linux version for python ? Yes. > if yes can you provide me any links for it.I could find a 64bit > windows version but could not find Linuux version I am currently too lazy to look it up for you on python.org (if it is there), b

Re: python daemon - compress data and load data into MySQL by pyodbc

2009-09-03 Thread MacRules
Ben Finney wrote: MacRules writes: Are you a Python expert? This group has many Python experts, and even more people who can no doubt help you if you are able to articulate what you need help with. To help dispel a possible misunderstanding: Don't expect to have a one-on-one conversation wi

Re: Entry Level Python Jobs

2009-09-03 Thread Zaphod
On Thu, 03 Sep 2009 06:36:24 -0700, koranthala wrote: > > Also, I think topcoder.com is a good place for him. I have not used them > much, but their business plan -- of asking medium to difficult questions > every week, and contacting people who solves them with jobs -- is quite > sound. > Try th

Python for 64bit Linux version

2009-09-03 Thread Bhanu Srinivas Mangipudi
Hello Every one, I just want to that s there a 64 bit Linux version for python ? if yes can you provide me any links for it.I could find a 64bit windows version but could not find Linuux version Your help is appriciated. Thanks Bhanu -- http://mail.python.org/mailman/listinfo/python-list

The future of Python immutability

2009-09-03 Thread John Nagle
Python's concept of immutability is useful, but it could be more general. In the beginning, strings, tuples, and numbers were immutable, and everything else was mutable. That was simple enough. But over time, Python has acquired more immutable types - immutable sets and immutable byte a

Re: Subclassing list and splicing

2009-09-03 Thread Emile van Sebille
On 9/3/2009 10:10 AM Kreso said... I am subclassing list class and it basically works, but I don't understand why after splicing these mylist objects I don't get returned mylist objects. What I get are list objects: I would prefer that resulting object m belonged to myclist class. How to obtai

Re: match braces?

2009-09-03 Thread John Nagle
lallous wrote: Hello In C/C++ you use the braces where as in Python you use the indentation levels. Most editors offer a Ctrl+[ to match the braces so that you can easily identify the scopes (more correctly "statements blocks"). I am finding it difficult to see blocks and/or jump from end to st

Re: Algorithms as objects?

2009-09-03 Thread Kreso
Bearophile wrote: > Please, can't you just use a bit of functional-style programming? Like > creating nested functions on the fly, etc. I thought about it but I believe that in the future some parts of the code will be reimplemented in C/C++, so I try to keep it simple. In the end the hint to le

Subclassing list and splicing

2009-09-03 Thread Kreso
I am subclassing list class and it basically works, but I don't understand why after splicing these mylist objects I don't get returned mylist objects. What I get are list objects: class mylist(list): def __init__(self): list.__init__(self) k = mylist() k.append(1) k.append(2) k.a

Re: print syntax

2009-09-03 Thread Robert Kern
On 2009-09-03 11:50 AM, Benjamin Kaplan wrote: On Thu, Sep 3, 2009 at 12:22 PM, wrote: I am new to python, working by way through 'Core Python Programming'. I can find no description of using print with the built-in type for formatting. I think I have got some [most?] of it from Chun, google, a

Re: print syntax

2009-09-03 Thread Benjamin Kaplan
On Thu, Sep 3, 2009 at 12:22 PM, wrote: > I am new to python, working by way through 'Core Python Programming'. I can > find no description of using print with the built-in type for formatting. I > think I have got some [most?] of it from Chun, google, and python.org. My > comment is - it should n

Re: recursive decorator

2009-09-03 Thread Ethan Furman
Michele Simionato wrote: On Sep 3, 12:19 am, Ethan Furman wrote: Greetings, List! The recent thread about a recursive function in a class definition led me back to a post about bindfunc from Arnaud, and from there I found Michele Simionato's decorator module (many thanks! :-), and from there

print syntax

2009-09-03 Thread doug
I am new to python, working by way through 'Core Python Programming'. I can find no description of using print with the built-in type for formatting. I think I have got some [most?] of it from Chun, google, and python.org. My comment is - it should not be that hard to find. I would suggest a lin

Re: Creating slice notation from string

2009-09-03 Thread Bob van der Poel
On Sep 2, 8:52 pm, Steven D'Aprano wrote: > On Wed, 02 Sep 2009 17:32:09 -0700, Bob van der Poel wrote: > > > Actually, nither this or Jan's latest is working properly. I don't know > > if it's the slice() function or what (I'm using python 2.5). But: > > > x = [1,2,3,4,5] > > slice_string="2" > >

Re: win32pipe

2009-09-03 Thread Tim Golden
Hans Müller wrote: Hello, I'd like to play a little with named pipes on windows. For this purpose google told me there is a win32pipe module. My python2.6 on windows doesn't know it - so where can I get ? Does it belong to the std. python for windows or is it a separate package ? It's part of

win32pipe

2009-09-03 Thread Hans Müller
Hello, I'd like to play a little with named pipes on windows. For this purpose google told me there is a win32pipe module. My python2.6 on windows doesn't know it - so where can I get ? Does it belong to the std. python for windows or is it a separate package ? Thank a lot, Hans -- http://mail

Re: match braces?

2009-09-03 Thread Joshua Judson Rosen
Grant Edwards writes: > > On 2009-09-03, Ben Finney wrote: > > Tim Chase writes: > > > > > > Any editor worth its salt will offer indentation-based folding (I know > > > vim does, and I would be astonished if emacs didn't. > > > > Emacs calls that ???hide/show???, and the ???hs-minor-mode??? can

Re: obscure problem using elementtree to make xhtml website

2009-09-03 Thread Lee
I went with a space, but a comment is a better idea. I only mention the

Re: Question about apply

2009-09-03 Thread jorma kala
Many thanks!! On Thu, Sep 3, 2009 at 4:21 PM, Gary Herron wrote: > jorma kala wrote: > >> >> Hi, >> I'm using apply to pass keyword arguments as a dictionary to a funcion at >> runtime (which keyword arguments to pass is only known at runtime) >> apply is very handy for this, because it takes

Re: Question about apply

2009-09-03 Thread Gary Herron
jorma kala wrote: Hi, I'm using apply to pass keyword arguments as a dictionary to a funcion at runtime (which keyword arguments to pass is only known at runtime) apply is very handy for this, because it takes a dictionary of keyword arguments directly def f1(a=None,b=None,c=None): pas

Re: Annoying octal notation

2009-09-03 Thread James Harris
On 3 Sep, 15:54, Albert van der Horst wrote: > In article , > Derek Martin   wrote: > > > > > > >--W1uEbMXJ1Mj4g6TI > >Content-Type: text/plain; charset=iso-8859-1 > >Content-Disposition: inline > > >On Mon, Aug 24, 2009 at 05:03:28PM +, Steven D'Aprano wrote: > >> On Mon, 24 Aug 2009 11:21:46

Re: Annoying octal notation

2009-09-03 Thread James Harris
On 3 Sep, 15:35, Grant Edwards wrote: ... > >>> Obviously I can't speak for Ken Thompson's motivation in creating this > >>> feature, but I'm pretty sure it wasn't to save typing or space on > >>> punchcards. Even in 1969, hex was more common than octal, and yet hex > >>> values are written with

Re: Annoying octal notation

2009-09-03 Thread James Harris
On 3 Sep, 14:26, Albert van der Horst wrote: > In article <6031ba08-08c8-416b-91db-ce8ff57ae...@w6g2000yqw.googlegroups.com>, > James Harris   wrote: > > > > > >So you are saying that Smalltalk has r where > >r is presumably for radix? That's maybe best of all. It preserves the > >syntactic requi

Re: python daemon - compress data and load data into MySQL by pyodbc

2009-09-03 Thread Ben Finney
MacRules writes: > Are you a Python expert? This group has many Python experts, and even more people who can no doubt help you if you are able to articulate what you need help with. To help dispel a possible misunderstanding: Don't expect to have a one-on-one conversation with a single devoted

Question about apply

2009-09-03 Thread jorma kala
Hi, I'm using apply to pass keyword arguments as a dictionary to a funcion at runtime (which keyword arguments to pass is only known at runtime) apply is very handy for this, because it takes a dictionary of keyword arguments directly def f1(a=None,b=None,c=None): pass kw={'a':1} apply(f1,

Re: Creating slice notation from string

2009-09-03 Thread Falcolas
On Sep 2, 3:55 pm, bvdp wrote: > I'm trying to NOT create a parser to do this and I'm sure that > it's easy if I could only see the light! > > Is it possible to take an arbitrary string in the form "1:2", "1", > ":-1", etc. and feed it to slice() and then apply the result to an > existing lis

Re: Python on the Web

2009-09-03 Thread Bruno Desthuilliers
John Nagle a écrit : (snip) MySQLdb is available only up to Python 2.5. Huh ??? Python 2.6.2 (release26-maint, Apr 19 2009, 01:56:41) [GCC 4.3.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import MySQLdb /var/lib/python-support/python2.6/MySQLdb/__in

Re: Annoying octal notation

2009-09-03 Thread Grant Edwards
On 2009-09-03, Albert van der Horst wrote: > In article , > MRAB wrote: >>Steven D'Aprano wrote: > >>> Obviously I can't speak for Ken Thompson's motivation in creating this >>> feature, but I'm pretty sure it wasn't to save typing or space on >>> punchcards. Even in 1969, hex was more common th

Re: obscure problem using elementtree to make xhtml website

2009-09-03 Thread Lee
I went with a space, but a comment is a better idea. I only mention the

Re: match braces?

2009-09-03 Thread Grant Edwards
On 2009-09-03, Ben Finney wrote: > Tim Chase writes: > >> Any editor worth its salt will offer indentation-based folding (I know >> vim does, and I would be astonished if emacs didn't. > > Emacs calls that ???hide/show???, and the ???hs-minor-mode??? can be enabled > for > any buffer (and can th

Re: Python on the Web

2009-09-03 Thread Bruno Desthuilliers
Ed Singleton a écrit : On Aug 26, 4:17 am, alex23 wrote: Frameworks created for the sake of creating a framework, as opposed to those written to meet a defined need, tend to be the worst examples of masturbatory coding. Indeed, but masturbation is perfectly healthy and acceptable, and we all

Re: python daemon - compress data and load data into MySQL by pyodbc

2009-09-03 Thread David Smith
MacRules wrote: > Sean DiZazzo wrote: >> On Sep 2, 8:36 pm, MacRules wrote: >>> Hi, >>> >>> I installed Python daemon, pyodbc module to access the back-end DB >>> server. >>> >>> My setup is like this >>> >>> load data job -> Python Daemon A, port 6000 -> Python Daemon B, port >>> 7000 -> MySQL >>

Re: Modifying a textfile

2009-09-03 Thread konstantin
On Sep 3, 2:21 pm, Olli Virta wrote: > Hi! > > So I got this big textfile. It's full of data from a database. About > 150 or > more rows or lines in a textfile. > There's three first rows that belong to the same subject. And then > next > three rows belong to another subject and so on, to the end

Re: obscure problem using elementtree to make xhtml website

2009-09-03 Thread David Smith
Lee wrote: > Elementtree (python xml parser) will transform markup like > > > > into > > > > which is a reasonable thing to do for xml (called minimization, I > think). > > But this caused an obscure problem when I used it to create the xhtml > parts of my website, > causing Internet Explore

Re: Annoying octal notation

2009-09-03 Thread Albert van der Horst
In article , Derek Martin wrote: > >--W1uEbMXJ1Mj4g6TI >Content-Type: text/plain; charset=iso-8859-1 >Content-Disposition: inline > >On Mon, Aug 24, 2009 at 05:03:28PM +, Steven D'Aprano wrote: >> On Mon, 24 Aug 2009 11:21:46 -0500, Derek Martin wrote: >> > since the old syntax is prevalent b

Re: Annoying octal notation

2009-09-03 Thread Albert van der Horst
In article <6b5ea596-d1e3-483d-ba79-7b139d3c7...@z24g2000yqb.googlegroups.com>, Bearophile wrote: >MRAB: > >>'_': what if in the future we want to allow them in numbers for clarity? > >Hettinger says it's hard (= requires too many changes) to do that and >Python programs don't have big integer co

Re: python daemon - compress data and load data into MySQL by pyodbc

2009-09-03 Thread MacRules
Sean DiZazzo wrote: On Sep 2, 8:36 pm, MacRules wrote: Hi, I installed Python daemon, pyodbc module to access the back-end DB server. My setup is like this load data job -> Python Daemon A, port 6000 -> Python Daemon B, port 7000 -> MySQL Daemon A will perform data compression, such as GZIP

Re: match braces?

2009-09-03 Thread Ben Finney
Tim Chase writes: > Any editor worth its salt will offer indentation-based folding (I know > vim does, and I would be astonished if emacs didn't. Emacs calls that “hide/show”, and the ‘hs-minor-mode’ can be enabled for any buffer (and can thus of course be automatically enabled on defined condit

Re: Annoying octal notation

2009-09-03 Thread sjm
On Aug 21, 2:45 pm, John Nagle wrote: >      In 2009, Unisys finally exited the mainframe hardware business, and the > last of the 36-bit machines, the ClearPath servers, are being phased out. > That line of machines goes back to the UNIVAC 2200 series, and the UNIVAC > 1100 series, all the way b

obscure problem using elementtree to make xhtml website

2009-09-03 Thread Lee
Elementtree (python xml parser) will transform markup like into which is a reasonable thing to do for xml (called minimization, I think). But this caused an obscure problem when I used it to create the xhtml parts of my website, causing Internet Explorer to display nearly blank pages. I expl

Re: Entry Level Python Jobs

2009-09-03 Thread koranthala
On Sep 3, 9:19 am, steve wrote: > On 09/03/2009 09:36 AM, steve wrote: > > > Hi Jonathan, > > [...snip...] > > I feel stupid replying to my own post but just one more thing i thought about > mentioning but forgot to add: > - Look at your Liberal Arts major as an advantage. Every field has a > 'co

Re: Annoying octal notation

2009-09-03 Thread Albert van der Horst
In article , MRAB wrote: >Steven D'Aprano wrote: >> Obviously I can't speak for Ken Thompson's motivation in creating this >> feature, but I'm pretty sure it wasn't to save typing or space on >> punchcards. Even in 1969, hex was more common than octal, and yet hex >> values are written with 0x.

Re: recursive decorator

2009-09-03 Thread Michele Simionato
On Sep 3, 12:19 am, Ethan Furman wrote: > Greetings, List! > > The recent thread about a recursive function in a class definition led > me back to a post about bindfunc from Arnaud, and from there I found > Michele Simionato's decorator module (many thanks! :-), and from there I > began to wonder.

Re: Entry Level Python Jobs

2009-09-03 Thread Michele Simionato
On Sep 2, 5:31 pm, JonathanB wrote: > I am a self-taught Python programmer with a liberal arts degree (Cross- > cultural studies). I have been programming for several years now and > would like to get a job as a python programmer. Unfortunately most of > the job posts I have seen are for CS Majors

Re: string find mystery

2009-09-03 Thread Hendrik van Rooyen
On Thursday 03 September 2009 07:10:37 Helvin wrote: > Hi, > > I have come across this very strange behaviour. Check this code: > > if file_str.find('Geometry'): > #if file_str.endswith('Data_Input_Geometry.txt'): > print 'I found geometry' > elif file_str.find('

  1   2   >