Re: Block Structure Parsing

2006-10-06 Thread hanumizzle
On 10/4/06, Blacktiger <[EMAIL PROTECTED]> wrote: > Hi all, I'm new to this list because I had a question about parsing > python block structure. I am taking a programming languages course > this semester and for our final project we are writing an interperator > in scheme(awful language) for whate

Re: Strange sorting error message

2006-10-06 Thread Fredrik Lundh
Steve Holden wrote: > Even when it smacks you in the face, apparently. Anyway, I'm sorry if > you thought I was getting at you in any way. Just trying to amuse the > group ... time to reinstate mandatory use of the tag ? -- http://mail.python.org/mailman/listinfo/python-list

Re: Strange sorting error message

2006-10-06 Thread hanumizzle
On 10/5/06, Neil Cerutti <[EMAIL PROTECTED]> wrote: > It was a joke, based on you hiding what you are doing, he decided > to hide the solution to your problem. Get it? What if it was for a proprietary software of some kind? -- Theerasak -- http://mail.python.org/mailman/listinfo/python-list

RE: CGI Tutorial

2006-10-06 Thread Sells, Fred
content is great, my comments are editorial. I prefer PDF with bookmarks rather than HTML. 1. easy to print the whole thing and read offline. 2. easy to find a secion from bookmarks, rather that chasing links 3. easy to save on my local "doc" folder so I can be sure It will always be there. (i.e

Re: What value should be passed to make a function use the default argument value?

2006-10-06 Thread Antoon Pardon
On 2006-10-04, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Georg Brandl wrote: > >> This is an issue in most Python documentation: you're not told >> if the described function is implemented in C, and if it is >> keyword arg-enabled. The arguments must be given names though, >> to be able to documen

Re: Why do this?

2006-10-06 Thread hanumizzle
On 10/6/06, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On Thu, 5 Oct 2006 11:28:08 +0100, "Matthew Warren" > <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: > > > > > Now, I started programming when I was 8 with BBC Basic. > > > Remember what the acronym BASIC stands fo

Re: OT Request

2006-10-06 Thread Steve Holden
Dennis Lee Bieber wrote: > On Thu, 5 Oct 2006 14:40:23 +0100, "Matthew Warren" > <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: > > >>This email is confidential and may be privileged. If you are not the intended >>recipient please notify the sender immediately and delete the em

Re: CGI Tutorial

2006-10-06 Thread hanumizzle
On 10/5/06, Sells, Fred <[EMAIL PROTECTED]> wrote: > content is great, my comments are editorial. wrt what document? > I prefer PDF with bookmarks rather than HTML. > 1. easy to print the whole thing and read offline. > 2. easy to find a secion from bookmarks, rather that chasing links > 3. easy

Package to handle table text render (handle space or tab between the columns) ?

2006-10-06 Thread KLEIN Stéphane
Hi, I would like print tabular values on terminal (stdout). Are there package to handle table text render ? Thanks for your help, Stephane -- http://mail.python.org/mailman/listinfo/python-list

Re: HOST - Assembla Inc. Breakout - Copyright Violation by Mr. Andy Singleton

2006-10-06 Thread Steve Holden
Ilias Lazaridis wrote: > Ben Finney wrote: > >>"Ilias Lazaridis" <[EMAIL PROTECTED]> writes: >> >> >>>I admit it is difficult to detect that this post is in-topic. >>>But it is. >> >>Really, it's not. If you want a voice, you already have your >>website. Mailing lists and other discussion forums h

Re: Package to handle table text render (handle space or tab between the columns) ?

2006-10-06 Thread hanumizzle
On 10/6/06, KLEIN Stéphane <[EMAIL PROTECTED]> wrote: > Hi, > > I would like print tabular values on terminal (stdout). Are there > package to handle table text render ? Have a look at: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/267662 -- Theerasak -- http://mail.python.org/mailman

Re: Access to static members from inside a method decorator?

2006-10-06 Thread Peter Otten
[EMAIL PROTECTED] wrote: > Thanks for all the help guys ... in almost every way using a metaclass > seems to be the right solution for what I'm trying to do here. I say > almost because there is one thing that is still confusing me: what is > the most elegant way to provide base-class implementat

Re: Metaprogramming question

2006-10-06 Thread Georg Brandl
Steve Menard wrote: > I have a need to create class instance without invokking the class' __init__ > method. > > Were I using old-style classes, I'd use new.instance() function. However, I > am using new-style classes and new.instance() complain "TypeError: > instance() argument 1 must be clas

Re: Package to handle table text render (handle space or tab between the columns) ?

2006-10-06 Thread KLEIN Stéphane
hanumizzle a écrit : > On 10/6/06, KLEIN Stéphane <[EMAIL PROTECTED]> wrote: >> Hi, >> >> I would like print tabular values on terminal (stdout). Are there >> package to handle table text render ? > > Have a look at: > > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/267662 Thanks, this

Re: Python to use a non open source bug tracker?

2006-10-06 Thread Giovanni Bajo
Martin v. Löwis wrote: > That, in principle, could happen to any other free software as well. > What is critical here is that SF *hosted* the installation. If we > would use a tracker that is free software, yet hosted it elsewhere, > the same thing could happen: the hoster could make modifications

Re: Python to use a non open source bug tracker?

2006-10-06 Thread Giovanni Bajo
[EMAIL PROTECTED] wrote: > Martin> The regular admin tasks likely include stuff like this: > Martin> - the system is unavailable, bring it back to work > Martin> This is really the worst case, and a short response time > Martin> is the major factor in how users perceive the ser

Re: Python to use a non open source bug tracker?

2006-10-06 Thread Paul Rubin
"Giovanni Bajo" <[EMAIL PROTECTED]> writes: > Are bug-tracker configuration issues so critical that having to wait > 48-72hrs to have them fixed is absolutely unacceptable for Python > development? It looks like an overexaggeration. People easily cope > with 2-3 days of SVN freezing, when they are

Re: help on pickle tool

2006-10-06 Thread virg
Hi, The data is simple dictionary with one or more keys. If i use YAML at the client (webui) do i have to change serialisation method to YAML at server also. Without changing serialisation method at server, can i use any of the deserialisation methods at the client. We cannot change the serialisat

Re: Package to handle table text render (handle space or tab between the columns) ?

2006-10-06 Thread hanumizzle
On 10/6/06, KLEIN Stéphane <[EMAIL PROTECTED]> wrote: > hanumizzle a écrit : > > On 10/6/06, KLEIN Stéphane <[EMAIL PROTECTED]> wrote: > >> Hi, > >> > >> I would like print tabular values on terminal (stdout). Are there > >> package to handle table text render ? > > > > Have a look at: > > > > http

Re: help on pickle tool

2006-10-06 Thread hanumizzle
On 6 Oct 2006 01:41:48 -0700, virg <[EMAIL PROTECTED]> wrote: > Hi, > The data is simple dictionary with one or more keys. If i use YAML at > the client (webui) do i have to change serialisation method to YAML at > server also. Without changing serialisation method at server, can i use > any of th

Re: tkinter newsgroup or mailing list

2006-10-06 Thread Hendrik van Rooyen
"Franz Steinhaeusler" <[EMAIL PROTECTED]> wrote: > Hello NG, > > I'm asking this, (although I know a mailing list on gmane > gmane.comp.python.tkinter and there is so little traffic > compared to the mailing list of wxPython also mirrored > on gmane gmane.comp.python.wxpython. > > I cannot imagin

Re: Python/Tkinter crash.

2006-10-06 Thread Hendrik van Rooyen
"Steve Holden" <[EMAIL PROTECTED]> wrote: > Hendrik van Rooyen wrote: > > "Fredrik Lundh" <[EMAIL PROTECTED]> wrote: > > > >>Eric Brunel wrote: > >> > >> > >>>AFAIK, Tkinter is not thread safe. Using some kind of lock to serialize > >>>the calls from different threads may seem to work (I never test

Re: What value should be passed to make a function use the default argument value?

2006-10-06 Thread Fredrik Lundh
Antoon Pardon wrote: > Is this general rules documeted somewhere? My impression is that readers > of the documentation will treat arguments as keyword arguments unless > this is explicitly contradicted. Sorry, I missed that this was comp.lang.python.alternate.reality. My mistake. -- http://

Re: help on pickle tool

2006-10-06 Thread Steve Holden
Fredrik Lundh wrote: > MonkeeSage wrote: > > > >>YAML is a little more complex > > > a little? when did you last look at the spec? > > >>and a little more mature. > > > than JavaScript's expression syntax? are you sure you're not confusing > libraries with standards here? (has anyone e

Re: help on pickle tool

2006-10-06 Thread virg
At the server, based on client request it does some computations , it sends the result as dictionary (serialized) to the client. hanumizzle wrote: > On 6 Oct 2006 01:41:48 -0700, virg <[EMAIL PROTECTED]> wrote: > > Hi, > > The data is simple dictionary with one or more keys. If i use YAML at > >

Re: help on pickle tool

2006-10-06 Thread hanumizzle
On 10/6/06, Steve Holden <[EMAIL PROTECTED]> wrote: > I have to agree that YAML, having started out with simplicity in mind, > has become a monster that threatens to collapse under its own weight. > The very existence of JSON is a good indicator that YAML has failed to > meet its design goals for

Re: help on pickle tool

2006-10-06 Thread hanumizzle
On 6 Oct 2006 02:03:07 -0700, virg <[EMAIL PROTECTED]> wrote: > At the server, based on client request it does some computations , it > sends the result as dictionary (serialized) to the client. If I interpret your message correctly, you are receiving a Python dictionary object from the server. Ye

groupby and itemgetter

2006-10-06 Thread Roman Bertle
Hello, there is an example how to use groupby in the itertools documentation (http://docs.python.org/lib/itertools-example.html): # Show a dictionary sorted and grouped by value >>> from operator import itemgetter >>> d = dict(a=1, b=2, c=1, d=2, e=1, f=2, g=3) >>> di = sorted(d.iteritems(), key=

Re: Why do this?

2006-10-06 Thread Hendrik van Rooyen
"Dennis Lee Bieber" <[EMAIL PROTECTED]> wrote: > On Thu, 5 Oct 2006 11:28:08 +0100, "Matthew Warren" > <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: > > > > > Now, I started programming when I was 8 with BBC Basic. > > > Remember what the acronym BASIC stands for? 8<-

Re: How do I read Excel file in Python?

2006-10-06 Thread Simon Brunning
On 5 Oct 2006 12:49:53 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Actually was about to post same solution and got same results. (BTW > Simon, the OP date is Aug 9th, 2006). Scratched head and googled for > excel date calculations... found this bug where it treats 1900 as leap > year in

Re: printing variables

2006-10-06 Thread Gerrit Holl
On 2006-10-06 04:50:33 +0200, [EMAIL PROTECTED] wrote: > say i have variables like these > > var1 = "blah" > var2 = "blahblah" > var3 = "blahblahblah" > var4 = "" > var5 = "...".. > > bcos all the variable names start with "var", is there a way to > conveniently print those variables out... >

Re: What value should be passed to make a function use the default argument value?

2006-10-06 Thread Antoon Pardon
On 2006-10-06, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Antoon Pardon wrote: > >> Is this general rules documeted somewhere? My impression is that readers >> of the documentation will treat arguments as keyword arguments unless >> this is explicitly contradicted. > > Sorry, I missed that this was

Re: help on pickle tool

2006-10-06 Thread virg
Yes your are right. I will send a dictionary object from the server to the client. I already have client which is written in python. But we are migrating the python client which is a command line tool to Web UI client (java). If it is possible to call python function from java, i need to read mor

Re: Why do this?

2006-10-06 Thread [EMAIL PROTECTED]
Nobody's mentioned the ability to save a formatted string and then substitute the variables later... string = "There are %s ways to skin a %s" print string % (3, "furry animal") print string % (166, "beast") ~half.italian Matthew Warren wrote: > Ok, not really python focused, but it feels like

Re: Request for recommendations: shared database without a server

2006-10-06 Thread Paul Boddie
EP wrote: > [Client-only application with shared storage and concurrent access] > Can I get there with MySQL? Or do I need to pair a pure python > approach (including the database) with py2exe? Has anyone achieved > this with a db framework like Dabo? Or is there another, entirely > different

extract certain values from file with re

2006-10-06 Thread Fabian Braennstroem
Hi, I would like to remove certain lines from a log files. I had some sed/awk scripts for this, but now, I want to use python with its re module for this task. Actually, I have two different log files. The first file looks like: ... 'some text' ... ITER I- GL

Re: HOST - Assembla Inc. Breakout - Copyright Violation by Mr. Andy Singleton

2006-10-06 Thread Diez B. Roggisch
>> No, you should have found a forum where you know that the topic is >> appropriate -- even if that restricts it to your own website. > > ??? my website is not a forum (and I'm currently reducing it to the > minimum necessary information.) You obviously lack the skill to comprehend that a forum

Re: What value should be passed to make a function use the default argument value?

2006-10-06 Thread hanumizzle
On 6 Oct 2006 09:21:11 GMT, Antoon Pardon <[EMAIL PROTECTED]> wrote: > On 2006-10-06, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > > Antoon Pardon wrote: > > > >> Is this general rules documeted somewhere? My impression is that readers > >> of the documentation will treat arguments as keyword argumen

Re: printing variables

2006-10-06 Thread hanumizzle
On 10/6/06, Gerrit Holl <[EMAIL PROTECTED]> wrote: > >>> import fnmatch > >>> var1, var2, var3 = "foo", "bar", "baz" > >>> for k in fnmatch.filter(locals(), "var*"): > ... print locals()[k] > ... > foo > baz > bar > > This is evil. > It's unpythonic. It's so evil, Perl 4 would look upon it in sc

Re: Subclassing built-in classes

2006-10-06 Thread Maric Michaud
Le jeudi 05 octobre 2006 20:24, Steve Holden a écrit : >   >>> class mystr(oldstr): >   ...   def __new__(*a, **kw): >   ...     print "called:", a, kw >   ... you don't return the string here... >   >>> import __builtin__ >   >>> __builtin__.str = mystr >   >>> > Readline internal error > Traceb

Re: Why do this?

2006-10-06 Thread Corrado Gioannini
On Thu, Oct 05, 2006 at 10:48:36AM +, Duncan Booth wrote: > The other main reason for preferring format strings is that they make it > easier to refactor the code. If you ever want to move the message away from > where the formatting is done then it's a lot easier to extract a single > strin

Re: help on pickle tool

2006-10-06 Thread hanumizzle
On 6 Oct 2006 02:29:59 -0700, virg <[EMAIL PROTECTED]> wrote: > Yes your are right. I will send a dictionary object from the server to > the client. > I already have client which is written in python. But we are migrating > the python client which is a command line tool to Web UI client > (java).

Using twisted, not telnetlib for interactive telnet (WAS: RE: Improving telnetlib)

2006-10-06 Thread Matthew Warren
> >The trouble is, I havent got a clue where to start and would > appreciate > >a couple of pointers to get me going... > > > > I'd suggest taking a look at Twisted, which contains a more complete > telnet implementation (not as important for being able to launch vi), > an ssh implementation (

Re: HOST - Assembla Inc. Breakout - Copyright Violation by Mr. Andy Singleton

2006-10-06 Thread Steve Holden
Diez B. Roggisch wrote: [...] > >>really very important (if you don't look to much at the subject but the >>message contents). > > > All that I have seen were some accusations + a few ridiculously small > subversion entries that showed default parameters changed and the like. > > This is on th

Re: Python to use a non open source bug tracker?

2006-10-06 Thread Paul Boddie
Ian Bicking wrote: > > It handles some other kinds of repositories now (bzr, I think?). From > what I understand fully abstracting out the repository format seems to > still be a work in progress, but it is in progress and you can write > repository plugins right now. That covers Trac, but other

Re: HOST - Assembla Inc. Breakout - Copyright Violation by Mr. Andy Singleton

2006-10-06 Thread Richard Brodie
"Diez B. Roggisch" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > This is on the same level of interest to the communities of python, ruby & > java as the > color of my socks this morning - a deep black with cute little skulls > imprinted. I did find Andy's claim that he expec

Re: Why do this?

2006-10-06 Thread Duncan Booth
Corrado Gioannini <[EMAIL PROTECTED]> wrote: > I often do things like this: > > sql = a_complex_select_sql % (id_foo, value_bar, ...) > cursor.execute(sql) > > inside the body of a function (or a class method), where > a_complex_select_sql is a string, containing several %s, %d ecc., > that

Re: HOST - Assembla Inc. Breakout - Copyright Violation by Mr. Andy Singleton

2006-10-06 Thread hanumizzle
On 10/6/06, Diez B. Roggisch <[EMAIL PROTECTED]> wrote: > This is on the same level of interest to the communities of python, ruby > & java as the color of my socks this morning - a deep black with cute > little skulls imprinted. Where did you get these? -- Theerasak -- http://mail.python.org/m

Re: What value should be passed to make a function use the default argument value?

2006-10-06 Thread Fredrik Lundh
hanumizzle wrote: > Not sure exactly what is going on / being argued about in this > thread I'm describing best practices based on long experience of using and developing and teaching and writing about Python stuff. Others have other priorities, it seems. > This doesn't say anything positiv

Re: HOST - Assembla Inc. Breakout - Copyright Violation by Mr. Andy Singleton

2006-10-06 Thread Erik Max Francis
Steve Holden wrote: > I have to say I find the colour of your socks *much* more interesting. Especially what with the skulls and all. -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/ San Jose, CA, USA && 37 20 N 121 53 W && AIM, Y!M erikmaxfrancis Can I lay with you

Re: HOST - Assembla Inc. Breakout - Copyright Violation by Mr. Andy Singleton

2006-10-06 Thread Fredrik Lundh
Diez B. Roggisch wrote: > This is on the same level of interest to the communities of python, ruby > & java as the color of my socks this morning - a deep black with cute > little skulls imprinted. are they perhaps red or green? and look something like the skulls on this: http://www.rust

Re: What value should be passed to make a function use the default argument value?

2006-10-06 Thread Antoon Pardon
On 2006-10-06, hanumizzle <[EMAIL PROTECTED]> wrote: > On 6 Oct 2006 09:21:11 GMT, Antoon Pardon <[EMAIL PROTECTED]> wrote: >> On 2006-10-06, Fredrik Lundh <[EMAIL PROTECTED]> wrote: >> > Antoon Pardon wrote: >> > >> >> Is this general rules documeted somewhere? My impression is that readers >> >>

Re: How do I read Excel file in Python?

2006-10-06 Thread Giles Brown
John Machin wrote: > [EMAIL PROTECTED] wrote: > > > > >>> excel_date = 38938.0 > > > > >>> python_date = datetime.date(1900, 1, 1) + > > > > >>> datetime.timedelta(days=excel_date) > > > > >>> python_date > > > > datetime.date(2006, 8, 11) > > > > > > Err, that's the wrong answer, isn't it? Perhap

Re: Automatic import PEP

2006-10-06 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Robert Kern wrote: > Lawrence D'Oliveiro wrote: >> In message <[EMAIL PROTECTED]>, >> Connelly Barnes wrote: >> >>> The main point of autoimp is to make usage of the interactive Python >>> prompt more productive by including "from autoimp import *" in the >>> PYTHO

Re: What value should be passed to make a function use the default argument value?

2006-10-06 Thread Antoon Pardon
On 2006-10-06, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > hanumizzle wrote: > >> Not sure exactly what is going on / being argued about in this > > thread > > I'm describing best practices based on long experience of using and > developing and teaching and writing about Python stuff. Others have

Re: Makin search on the other site and getting data and writing in xml

2006-10-06 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Paul Boddie wrote: > Various sites forbid wget and friends as a rule, understandably ... No, that is not understandable. -- http://mail.python.org/mailman/listinfo/python-list

Re: Recursive descent algorithm able to parse Python?

2006-10-06 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Diez B. Roggisch wrote: > I have to admit that I have difficulties to compare LR(k) to recursive > descent, but the fact that the latter contains backtracking makes it at > least more powerful than LL(k) LR(k) is more powerful than LL(k). -- http://mail.python.org

Re: How do I read Excel file in Python?

2006-10-06 Thread kath
John Machin wrote: > [EMAIL PROTECTED] wrote: > > > > >>> excel_date = 38938.0 > > > > >>> python_date = datetime.date(1900, 1, 1) + > > > > >>> datetime.timedelta(days=excel_date) > > > > >>> python_date > > > > datetime.date(2006, 8, 11) > > > > > > Err, that's the wrong answer, isn't it? Perhap

Re: What value should be passed to make a function use the default argument value?

2006-10-06 Thread Fredrik Lundh
Antoon Pardon wrote: > IMO this is a very natural thought process for a python programmer. > So a python programmer seeing the first will tend to expect that > last call to work. on the other hand, if a Python programmer *writes* some code instead; say, a trivial function like: def calc

RE: OT Request

2006-10-06 Thread MatthewWarren
> This email is confidential and may be privileged. If you are not the intended > recipient please notify the sender immediately and delete the email from your > computer. > > You should not copy the email, use it for any purpose or disclose its > contents to any other person. > Please note that

Re: OT Request

2006-10-06 Thread Fredrik Lundh
Matthew Warren wrote: > No problem, and thanks for pointing it out. It gets silently added on > its way through, and i just hadnt noticed it in my posts. oh, no need to apologize. and it did make a certain sense in some of your posts: > Okok, I'm silly. > > This email is confidential and may

how to convert UNICODE to integer in Python?

2006-10-06 Thread kath
Hi, >>> import xlrd >>> book = xlrd.open_workbook("testbook1.xls") >>> sh = book.sheet_by_index(0) >>> sh.cell_value(rowx=1,colx=0) 38938.0 >>> type(sh.cell_value(rowx=1,colx=0)) >>> xlrd.xldate_as_tuple( sh.cell_value( rowx = 1,colx= 0 ), 0 ) Traceback (most recent call last): File "D:\Python

Re: OT Request

2006-10-06 Thread MatthewWarren
Funniest bit of my day so far :) Fredrik Lundh wrote: > Matthew Warren wrote: > > > No problem, and thanks for pointing it out. It gets silently added on > > its way through, and i just hadnt noticed it in my posts. > > oh, no need to apologize. and it did make a certain sense in some of > your

Re: HOST - Assembla Inc. Breakout - Copyright Violation by Mr. Andy Singleton

2006-10-06 Thread Diez B. Roggisch
hanumizzle schrieb: > On 10/6/06, Diez B. Roggisch <[EMAIL PROTECTED]> wrote: > >> This is on the same level of interest to the communities of python, ruby >> & java as the color of my socks this morning - a deep black with cute >> little skulls imprinted. > > Where did you get these? You can bu

Re: how to convert UNICODE to integer in Python?

2006-10-06 Thread Fredrik Lundh
kath wrote: > xldays = int(xldate) > ValueError: invalid literal for int(): Date > > because xlrd.xldate_as_tuple() function expects first argument to be an > integer. How do I convert an unicode character to integer, so that I > could get the date using xlrd.xldate_as_tuple() function. the

Re: What value should be passed to make a function use the default argument value?

2006-10-06 Thread Antoon Pardon
On 2006-10-06, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Antoon Pardon wrote: > >> IMO this is a very natural thought process for a python programmer. >> So a python programmer seeing the first will tend to expect that >> last call to work. > > on the other hand, if a Python programmer *writes* so

Re: Python to use a non open source bug tracker?

2006-10-06 Thread Martin v. Löwis
Paul Rubin schrieb: > How often should a tracker freeze anyway? People with no technical > knowledge at all run BBS systems that almost never freeze. Is a > tracker somehow more failure-prone? It's just a special purpose BBS, > I'd have thought. For whatever reason, the SF bug tracker is often

Re: Why do this?

2006-10-06 Thread Corrado Gioannini
On Fri, Oct 06, 2006 at 10:09:14AM +, Duncan Booth wrote: > I hope you have a good reason why you don't do: > > cursor.execute(a_complex_select_sql, (id_foo, value_bar, ...)) > > instead. hehe. i was just trying to be didactic, simplifying the actual situation. (anyway, sometimes i had to

Skullsocks to the rescue - was [irrelevant squabble of IL]

2006-10-06 Thread Diez B. Roggisch
Fredrik Lundh schrieb: > Diez B. Roggisch wrote: > >> This is on the same level of interest to the communities of python, >> ruby & java as the color of my socks this morning - a deep black with >> cute little skulls imprinted. > > are they perhaps red or green? and look something like the sku

Re: help on pickle tool

2006-10-06 Thread virg
Hi, Yes, using python client we are able deserialize data using r = pickle.loads(result). where result is a response from the server and r is a dictionary after deserialization. For serialisation at the server written in python using pickle.dumps(result, 2) Now we are developing web based Clien

Copying file descriptors

2006-10-06 Thread Didier Trosset
I am using the following code. It is used to spawn a new process (using popen) and to change the file handles so that subsequent writes to standard output with printf goes into this child process standard input. import os child_stdin = os.popen("cat -", "w") old_stdout = os.dup(1)

Re: how to convert UNICODE to integer in Python?

2006-10-06 Thread kath
Fredrik Lundh wrote: > kath wrote: > > > xldays = int(xldate) > > ValueError: invalid literal for int(): Date > > > > because xlrd.xldate_as_tuple() function expects first argument to be an > > integer. How do I convert an unicode character to integer, so that I > > could get the date using xl

Re: HOST - Assembla Inc. Breakout - Copyright Violation by Mr. Andy Singleton

2006-10-06 Thread Diez B. Roggisch
Richard Brodie schrieb: > "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > >> This is on the same level of interest to the communities of python, ruby & >> java as the >> color of my socks this morning - a deep black with cute little skulls >> imprinted. > >

Re: Python to use a non open source bug tracker?

2006-10-06 Thread Paul Boddie
Martin v. Löwis wrote: > > For whatever reason, the SF bug tracker is often down, or not > responding. I'm uncertain why that is, but it's a matter of > fact that this was one of the driving forces in moving away > from SF (so it is a real problem). As I asked before, did anyone look into asking l

Re: Skullsocks to the rescue - was [irrelevant squabble of IL]

2006-10-06 Thread Fredrik Lundh
Diez B. Roggisch wrote: > Due to the unexpected interest in my foot-garments, I here present > an image of my current collection of skullsocks(tm) > > http://www.roggisch.de/img/skullsocks.jpg ah, pretty close, and the green color is absolutely the right one, but my socks has the skulls drawn

Re: [Linux] Detect a key press

2006-10-06 Thread Sergei Organov
"Jia,Lu" <[EMAIL PROTECTED]> writes: > Hi all > I write a program to detect key press,but , why there is a *space* > before the character I typed.?? There is none. The output I see when I type 1 2 q is: ->1 ->2 ->q If that is what you see, the problem is in your print "->%s"%ch

Re: CGI Tutorial

2006-10-06 Thread Jim
Sells, Fred wrote: > content is great, my comments are editorial. > > I prefer PDF with bookmarks rather than HTML. > > If you choose to go the PDF route, I've found OpenOffice 2.0 pretty good at > generating PDF with bookmarks. Just don't get too complex or OO may hose > you. Since you replied

TypeError: unsupported type for timedelta days component: unicode

2006-10-06 Thread kath
Hi, the following shows the contents of "datebook.xls" Date 8/9/2006 8/9/2006 8/9/2006 8/9/2006 8/9/2006 # read_date.py import xlrd book = xlrd.open_workbook("datebook.xls") sh = book.sheet_by_index(0) ex_qdate=sh.cell_value(rowx=1,colx=0) pyd=datetime.date(1900,1,1)+datetime.timedelta(days=sh.

Re: Access to static members from inside a method decorator?

2006-10-06 Thread urielka
no need for all that,i wrote a basic Ajax framework for cherrypy that features a Ajax.Net feature,exposing functions to JavaScript via attributes(or in python via decorators),here is a decorator that run one time(i.e. before running the actual code) and get the name of the class [code] def AddFunct

Re: How to run in background?

2006-10-06 Thread billie
I'm sorry. I tried with "windows=myscript.py" but it doesn't seem to work. I really don't know where find this information that's extremely important for me. I googled a lot but I didn't found a solution for my problem. :-\ -- http://mail.python.org/mailman/listinfo/python-list

Re: Python to use a non open source bug tracker?

2006-10-06 Thread Martin v. Löwis
Paul Boddie schrieb: > As I asked before, did anyone look into asking large-scale users of the > various considered products about their experiences with regard to > reliability, scalability, and so on? I didn't ask anyone, primarily because of lack of time. Regards, Martin -- http://mail.pytho

Re: How to run in background?

2006-10-06 Thread Fredrik Lundh
billie wrote: > I'm sorry. I tried with "windows=myscript.py" but it doesn't seem to > work. it does work, so you've probably made some simple mistake. figuring out what that is is a bit hard if you don't provide more information, though. can you perhaps post (the relevant portions of) your se

Re: extract certain values from file with re

2006-10-06 Thread Bernard
Hi Fabian, I'm still a youngster in Python but I think I can help with the "extracting data from the log file" part. As I'm seeing it right now, the only character separating the numbers below is the space character. You could try splitting all the lines by that character starting from the NO Colum

Re: TypeError: unsupported type for timedelta days component: unicode

2006-10-06 Thread John Machin
kath wrote: > Hi, > > the following shows the contents of "datebook.xls" > > Date > 8/9/2006 > 8/9/2006 > 8/9/2006 > 8/9/2006 > 8/9/2006 > > # read_date.py > import xlrd > > book = xlrd.open_workbook("datebook.xls") > sh = book.sheet_by_index(0) > ex_qdate=sh.cell_value(rowx=1,colx=0) > pyd=datetim

Re: TypeError: unsupported type for timedelta days component: unicode

2006-10-06 Thread Fredrik Lundh
John Machin wrote: > Why are you keeping your own files in a subdirectory of your Python > installation? IDLE defaults to the installation directory, so that's an easy thing to do. and as long as you put it in a subdirectory, it's not much of a problem either. (at least not until you want to u

Google breaks Usenet (was Re: How can I correct an error in an old post?)

2006-10-06 Thread Aahz
In article <[EMAIL PROTECTED]>, Bryan Olson <[EMAIL PROTECTED]> wrote: >Blair P. Houghton wrote: >> >> But they do about 10 things totally wrong with Google groups that >> I'd've fixed in my spare time in my first week if they'd hired me back >> when I was interviewing with them. >> >> So if they

Re: Graph Theory

2006-10-06 Thread diffuser78
Thanks for all your responses. -- http://mail.python.org/mailman/listinfo/python-list

Re: HOST - Assembla Inc. Breakout - Copyright Violation by Mr. Andy Singleton

2006-10-06 Thread Lawrence Oluyede
Ilias Lazaridis <[EMAIL PROTECTED]> wrote: > and once more: this topic _is_ appropriate for a python / ruby / java > crosspost. > > really very important (if you don't look to much at the subject but the > message contents). I really don't understand why your public announcement should be in topi

Re: Python to use a non open source bug tracker?

2006-10-06 Thread skip
Paul> How often should a tracker freeze anyway? People with no Paul> technical knowledge at all run BBS systems that almost never Paul> freeze. Is a tracker somehow more failure-prone? It's just a Paul> special purpose BBS, I'd have thought. And when those BBS systems get hacke

testing machine responsiveness

2006-10-06 Thread Tim Arnold
I have a bunch of processes that I farm out over several HPux machines on the network. There are 60 machines to choose from and I want to (1) find out which ones are alive (the 'ping' method below) and (2) sort them by their current load (the 'get' method below, using the rup command) I'm no exp

Re: HOST - Assembla Inc. Breakout - Copyright Violation by Mr. Andy Singleton

2006-10-06 Thread Paul McGuire
"Erik Max Francis" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Steve Holden wrote: > >> I have to say I find the colour of your socks *much* more interesting. > > Especially what with the skulls and all. > Yeah, where'd you get those socks? (Halloweens a-comin') :) -- Paul

Re: Scientific computing and data visualization.

2006-10-06 Thread Carl Friedrich Bolz
[EMAIL PROTECTED] wrote: > A commonly used data analysis framework is root (http://root.cern.ch). > It offers a object oriented C++ framework with all kind of things one > needs for plotting and data visualization. It comes along with PyRoot, > an interface making the root objects available to Pyth

Re: Automatic import PEP

2006-10-06 Thread Robert Kern
Lawrence D'Oliveiro wrote: > In message <[EMAIL PROTECTED]>, Robert > Kern wrote: > >> Lawrence D'Oliveiro wrote: >>> In message <[EMAIL PROTECTED]>, >>> Connelly Barnes wrote: >>> The main point of autoimp is to make usage of the interactive Python prompt more productive by including "f

Re: switching to numpy and failing, a user story

2006-10-06 Thread sturlamolden
[EMAIL PROTECTED] wrote: > Given the quality of python's (free) documentation and how good it's > been for a very long time, it's bit ironic to be using the phrase > "normal open-source documentation" on this mailing list. Numeric > python, which numpy aspires to be a replacement for, has perfect

Re: profiling memory usage

2006-10-06 Thread MrJean1
The latest Python release 2.5 includes improvements to the memory manager and *may* work better for you, it all depends on the root cause of the problem. For more details, see the 5th bullet on this page . /Jean Brouwers Eddie wrote: > Hi, > > I am lo

Re: MIMEMultipart() and CRLF vs RFC 2046

2006-10-06 Thread alf
Gabriel Genellina wrote: > At Thursday 5/10/2006 18:52, alf wrote: > >> according to rfc2046, line breaks in MIME are CRLF. However python just >> uses LF like in the following example: > > > The comments inside generator.py say CRLF everywhere, but the code > simply uses print >>f they also d

Re: HOST - Assembla Inc. Breakout - Copyright Violation by Mr. Andy Singleton

2006-10-06 Thread Ilias Lazaridis
Richard Brodie wrote: > "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > > This is on the same level of interest to the communities of python, ruby & > > java as the > > color of my socks this morning - a deep black with cute little skulls > > imprinted. > > I

Re: How do I read Excel file in Python?

2006-10-06 Thread John Machin
Giles Brown wrote: > John Machin wrote: > > [EMAIL PROTECTED] wrote: > > > > > >>> excel_date = 38938.0 > > > > > >>> python_date = datetime.date(1900, 1, 1) + > > > > > >>> datetime.timedelta(days=excel_date) > > > > > >>> python_date > > > > > datetime.date(2006, 8, 11) > > > > > > > > Err, tha

Re: How do I put % in a format sting?

2006-10-06 Thread John Salerno
Carsten Haese wrote: > While I wholeheartedly agree with the sentiment, calling the "?" a > formatter only blurs the already blurred distinction between string > formatting and parameter passing. The "?" is a parameter placeholder. Yeah, you're right. I was actually raising an eyebrow as I typed

Re: groupby and itemgetter

2006-10-06 Thread Steven Bethard
Roman Bertle wrote: > Hello, > > there is an example how to use groupby in the itertools documentation > (http://docs.python.org/lib/itertools-example.html): > > # Show a dictionary sorted and grouped by value from operator import itemgetter d = dict(a=1, b=2, c=1, d=2, e=1, f=2, g=3) >

  1   2   3   >