ANN: AsciiDoc 8.3.1 released

2008-12-15 Thread Stuart Rackham
This release fixes a couple of regression bugs in the initial version 8.3 release along with some minor additions. 8.3 release summary here: http://www.methods.co.nz/asciidoc/version83.html All additions and changes are detailed in the changelog: http://www.methods.co.nz/asciidoc/CHANGELOG.html

ANN: pycairo release 1.8.0 now available

2008-12-15 Thread Steve
Pycairo is a set of Python bindings for the multi-platform 2D graphics library cairo. http://cairographics.org http://cairographics.org/pycairo A new pycairo release 1.8.0 is now available from: http://cairographics.org/releases/pycairo-1.8.0.tar.gz

Re: alt.possessive.its.has.no.apostrophe

2008-12-15 Thread Ben Finney
James Stroud jstr...@mbi.ucla.edu writes: Ben Finney wrote: James Stroud jstr...@mbi.ucla.edu writes: Yes. I think it was the British who decided that the apostrophe rule for it would be reversed from normal usage relative to just about every other noun. It also seems an indefensible

Re: Looking for the best way to translate an idiom

2008-12-15 Thread Bruno Desthuilliers
Aahz a écrit : In article gi4834$la...@zinnia.noc.ucla.edu, James Stroud jstr...@mbi.ucla.edu wrote: In case its not obvious: Ah, so that's where Bruno's extra apostrophe came from! ;-) Err... Which one exactly ? (Sorry about the spelling flame, but seeing three posts in quick

Re: Python is slow

2008-12-15 Thread Steven D'Aprano
On Sun, 14 Dec 2008 20:38:58 -0800, cm_gui wrote: By the way... I know of a very slow Python site called YouTube.com. In fact, it is so slow that nobody ever uses it. hahaha, do you know how much money they are spending on hardware to make youtube.com fast??? Oooh, I know! ONE MILLION

Re: Python is slow

2008-12-15 Thread James Mills
On Mon, Dec 15, 2008 at 5:26 PM, Andreas Kostyrka andr...@kostyrka.org wrote: So to summarize, Python is fast enough for even demanding stuff, and when done correctly even number crunching or binary parsing huge files or possible in competitive speeds. But you sometime need a developer that

Re: Guido's new method definition idea

2008-12-15 Thread Ken Seehart
-*ε* Admittedly a tough call. I see the attraction of the proposed syntax. Maybe somewhat more readable since the declaration syntax matches the usage syntax, which is nice. I think it would have been superior to the current syntax if it had been done that way in the first place. However,

Re: alt.possessive.its.has.no.apostrophe

2008-12-15 Thread James Stroud
Ben Finney wrote: James Stroud jstr...@mbi.ucla.edu writes: Ben Finney wrote: James Stroud jstr...@mbi.ucla.edu writes: Yes. I think it was the British who decided that the apostrophe rule for it would be reversed from normal usage relative to just about every other noun. It also seems an

Re: stable algorithm with complexity O(n)

2008-12-15 Thread Steven D'Aprano
On Sun, 14 Dec 2008 21:12:13 -0800, Aaron Brady wrote: On Dec 14, 8:18 pm, Roy Smith r...@panix.com wrote: Steven D'Aprano st...@remove-this-cybersource.com.au wrote: All the positive thinking in the world won't help you: * make a four-sided triangle; * split a magnet into two

Re: Removing None objects from a sequence

2008-12-15 Thread Steven D'Aprano
On Mon, 15 Dec 2008 05:39:45 +, Lie Ryan wrote: I was just expressing the preference that operators should be composed of a single word, especially since none of the other operators are multi-words Then you should have said so, instead of introducing red-herrings about tired programmers.

Re: Need help improving number guessing game

2008-12-15 Thread feba
Seems ok. You may want to use arguments with default values for a and b (and possibly to use more meaningfull names): I changed it to minr and maxr. Mini is fine, but I can't name a variable maxi unless I have a good feminine hygiene joke to use with it. I don't see the aim of your changes to

كيف تخفي رقمك عن الذي تتصل به

2008-12-15 Thread بنت السعوديه
ما هي: عندما تتصل على رقم لا يظهر لي المتصــل (أي رقم فآي دولة) طريقة الخدمة: أرسل رسالة نصية اكتب في الرسالة TRA ZDOD أرسل إلى الرقم التالية البحرين الرمز (77127 )متوفر فقط لشركة زين البحرين الرمز (95312) متوفر فقط لشركة باتلكو مصر الرمز (95206) لبنان الرمز (1081) السعوديه الرمز

Re: Py_GetPath() C API in python 3

2008-12-15 Thread stalex
On 12月13日, 上午9�r55分, Gabriel Genellina gagsl-...@yahoo.com.ar wrote: En Fri, 12 Dec 2008 04:50:06 -0200, stalex shao...@gmail.com escribió: I want to build a new, requires total control, python interpreter. So I implement my own version of Py_GetPath(), Py_GetPrefix(), Py_GetExecPrefix()

Re: %s place holder does not let me insert ' in an sql query with python.

2008-12-15 Thread Lamonte Harris
sorry about that queryString = insert into venders values('{0}','{1}','{2}').format(field1,field2,field3) On Mon, Dec 15, 2008 at 7:21 AM, Lamonte Harris pyth0nc0...@gmail.comwrote: I had this problem too. If you've upgraded to python 2.6 you need to use the new sytnax format queryString =

UnicodeEncodeError

2008-12-15 Thread Ali art
Hello! I am using Windows XP professional version 2002 Service pack 3. AMD Athlon(TM)XP 2400+ 2.00GHz 992MB RAM. I have downloaded Windows x86 MSI Instaler Python 3.0 (sig) (r30:67507, Dec 3 2008, 20:14:27) [MSC v.1500 32 bit (Intel)] on win32 Control Panel - System - Advanced - Environment

Re: 1 or 1/0 doesn't raise an exception

2008-12-15 Thread Tim Rowe
Unfortunately, bool('Ruby totally pwn3s Python!') True Using Python is not total protection against buggy programs ;-) -- Tim Rowe -- http://mail.python.org/mailman/listinfo/python-list

Re: Having Issues with CMD and the 'python' command

2008-12-15 Thread James Mills
cmd has _nothing_ to do with Python. --JamesMills -- -- Problems are solved by method On Mon, Dec 15, 2008 at 10:51 PM, Lamonte Harris pyth0nc0...@gmail.com wrote: Every time I start cmd on windows it requires me to set path=%path%;C:\python26 why? I'm getting annoyed... --

Re: cx_Oracle issues

2008-12-15 Thread ron.re...@gmail.com
On Dec 15, 2:44 am, huw_at1 huwdjo...@gmail.com wrote: On Dec 11, 5:34 pm, ron.re...@gmail.com ron.re...@gmail.com wrote: On Dec 10, 9:48 am, huw_at1 huwdjo...@gmail.com wrote: Hey all. When usingcx_Oracleto run a procedure like: cursor.execute(select (obj.function(value)) from

Re: Having Issues with CMD and the 'python' command

2008-12-15 Thread Tim Chase
James Mills wrote: cmd has _nothing_ to do with Python. well, not quite nothing... http://docs.python.org/lib/module-cmd.html [grins, ducks and runs] (every time I see this module it makes me want to go write a small interactive-fiction game in the style of Zork/Adventure :) -tkc

Re: %s place holder does not let me insert ' in an sql query with python.

2008-12-15 Thread Lamonte Harris
I had this problem too. If you've upgraded to python 2.6 you need to use the new sytnax format queryString = insert into venders values('{0}','{1}','{2}'.format(field1,field2,field3) On Mon, Dec 15, 2008 at 6:46 AM, Krishnakant hackin...@gmail.com wrote: hello all hackers. This is some kind

Re: Thread Locking issue - Can't allocate lock (sem_init fail)

2008-12-15 Thread Philip Semanchuk
On Dec 15, 2008, at 4:56 AM, jams...@googlemail.com wrote: Hi all, I have a peculiar problem with a multithreaded program of mine (actually I've sort of inherited it). Before i show you the error, here's a litle background. Its a program to check email addresses are valid, and its main task

Problem Python 2.6.1 vs 2.6 pyWin32

2008-12-15 Thread Michel Claveau - NoSpam SVP ; merci
Hi, all! I have several softwares using Python+PyWin32, often as COMèserver. Ok with Python 2.5.x. I want migrate to Python 2.6. But when I install python-2.6.1.msi + pywin32-212.win32-py2.6, my softs don't run. Tried on five machines (two XP three Vista). But... if I install

Managing timing in Python calls

2008-12-15 Thread Ross
I'm porting some ugly javascript managed stuff to have an equivalent behaviour in a standalone app. It uses events that arrive from a server, and various small images. In this standalone version, the data is local in a file and the images in a local directory. My AJAX code managed a timely

Re: [Tutor] Having Issues with CMD and the 'python' command

2008-12-15 Thread Alan Gauld
bob gailer bgai...@gmail.com wrote Try this: Start-Settings-Control Panel-System-Advanced-Environment Variables Highlight PATH under System Variables Click Edit. Add ;C:\python26 And notice that Bob said ADD - DO NOT REPLACE the existing setting or you will likely break stuff and its not

Re: Need help improving number guessing game

2008-12-15 Thread James Stroud
feba wrote: I don't see the aim of your changes to setup(). I can kinda understand checking to make sure that you didn't make the minimum higher than the maximum, but I think where you put minr/maxr would make it use the same minr/maxr as the end of the previous game, wouldn't it? No. Each

Re: %s place holder does not let me insert ' in an sql query with python.

2008-12-15 Thread Joe Strout
On Dec 15, 2008, at 6:46 AM, Krishnakant wrote: in this case, I get a problem when there is ' in any of the values during insert or update. That's because ' is the SQL string literal delimiter. But any SQL- compliant database allows you to escape an apostrophe within a string literal by

Re: regex problem ..

2008-12-15 Thread Tino Wildenhain
Analog Kid wrote: Hi All: I am new to regular expressions in general, and not just re in python. So, apologies if you find my question stupid :) I need some help with forming a regex. Here is my scenario ... I have strings coming in from a list, each of which I want to check against a regular

Re: cx_Oracle issues

2008-12-15 Thread huw_at1
On Dec 11, 5:34 pm, ron.re...@gmail.com ron.re...@gmail.com wrote: On Dec 10, 9:48 am, huw_at1 huwdjo...@gmail.com wrote: Hey all. When using cx_Oracle to run a procedure like: cursor.execute(select (obj.function(value)) from table where id=blah) I am getting the following error:

Re: cx_Oracle issues

2008-12-15 Thread Hrvoje Niksic
huw_at1 huwdjo...@gmail.com writes: ORA-06502: PL/SQL: numeric or value error: character string buffer too small ORA-06512: at line 1 This error is a problem with the PL/SQL, not cx_Oracle.  You need to debug obj.function to see what kind of data is being accessed and then a data analysis

Re: Python is slow

2008-12-15 Thread George Sakkis
On Dec 15, 8:15 am, Luis M. González luis...@gmail.com wrote: On Dec 15, 1:38 am, cm_gui cmg...@gmail.com wrote: hahaha, do you know how much money they are spending on hardware to make youtube.com fast??? By the way... I know of a very slow Python site called YouTube.com. In fact,

Re: %s place holder does not let me insert ' in an sql query with python.

2008-12-15 Thread Paul Boddie
On 15 Des, 14:46, Krishnakant hackin...@gmail.com wrote: hello all, thanks for all of your very quick responses. The problem is that I am using python 2.5 so the 2.6 syntax does not apply in my case. The parameter syntax for database operations is defined by the DB-API, and this is a very

Re: %s place holder does not let me insert ' in an sql query with python.

2008-12-15 Thread Jean-Paul Calderone
On Mon, 15 Dec 2008 18:16:18 +0530, Krishnakant hackin...@gmail.com wrote: hello all hackers. This is some kind of an interesting situation although many of you must have already gone through it. I am facing a situation where I have to use psycopg2 and insert rows in a postgresql table. That's

Re: Thread Locking issue - Can't allocate lock (sem_init fail)

2008-12-15 Thread MRAB
Philip Semanchuk wrote: On Dec 15, 2008, at 4:56 AM, jams...@googlemail.com wrote: Hi all, I have a peculiar problem with a multithreaded program of mine (actually I've sort of inherited it). Before i show you the error, here's a litle background. Its a program to check email addresses are

Re: Looking for the best way to translate an idiom

2008-12-15 Thread Aahz
In article 494611c2$0$21934$426a3...@news.free.fr, Bruno Desthuilliers bruno.42.desthuilli...@websiteburo.invalid wrote: Aahz a écrit : In article gi4834$la...@zinnia.noc.ucla.edu, James Stroud jstr...@mbi.ucla.edu wrote: In case its not obvious: Ah, so that's where Bruno's extra

Re: Looking for the best way to translate an idiom

2008-12-15 Thread Steve Holden
James Stroud wrote: Aahz wrote: In article gi4834$la...@zinnia.noc.ucla.edu, James Stroud jstr...@mbi.ucla.edu wrote: In case its not obvious: Ah, so that's where Bruno's extra apostrophe came from! ;-) (Sorry about the spelling flame, but seeing three posts in quick succession with

Re: alt.possessive.its.has.no.apostrophe

2008-12-15 Thread Steve Holden
Ben Finney wrote: James Stroud jstr...@mbi.ucla.edu writes: Ben Finney wrote: James Stroud jstr...@mbi.ucla.edu writes: Yes. I think it was the British who decided that the apostrophe rule for it would be reversed from normal usage relative to just about every other noun. It also seems

Re: Having Issues with CMD and the 'python' command

2008-12-15 Thread rdmurray
On Mon, 15 Dec 2008 at 23:01, James Mills wrote: On Mon, Dec 15, 2008 at 10:51 PM, Lamonte Harris pyth0nc0...@gmail.com wrote: Every time I start cmd on windows it requires me to set path=%path%;C:\python26 why? I'm getting annoyed... cmd has _nothing_ to do with Python. (Top posting

Re: %s place holder does not let me insert ' in an sql query with python.

2008-12-15 Thread rdmurray
On Mon, 15 Dec 2008 at 18:16, Krishnakant wrote: how do you let the ' go as a part of the string? I have used %s as placeholder as in queryString = insert into venders values ('%s,%s,%s % (field1,field2,field3 ) ... This is not working for the ' values. This is untested, but I think what you

Re: [Tutor] Having Issues with CMD and the 'python' command

2008-12-15 Thread bob gailer
Lamonte Harris wrote: Every time I start cmd on windows it requires me to "set path=%path%;C:\python26" why? I'm getting annoyed... I have never started cmd and have it require anything. I guess what you are really asking is "how to permanenly set an environment variable". In this case so

%s place holder does not let me insert ' in an sql query with python.

2008-12-15 Thread Krishnakant
hello all hackers. This is some kind of an interesting situation although many of you must have already gone through it. I am facing a situation where I have to use psycopg2 and insert rows in a postgresql table. That's pritty easy and no need to say that it works well. But there are some entries

Re: stable algorithm with complexity O(n)

2008-12-15 Thread pruebauno
Non-comparison sorts are a useful technique, but it's changing the problem, and they are only useful in very limited circumstances. There's a good reason that most sort routines are based on O(n*log n) comparison sorts instead of O(n) bucket sorts or radix sorts. This is an assumption that I

Re: 1 or 1/0 doesn't raise an exception

2008-12-15 Thread Grant Edwards
On 2008-12-14, Peter Otten __pete...@web.de wrote: Grant Edwards wrote: Short circuit evaluation of booleans is very common (and has been for decades), so I don't know why people would expect something else. Visual Basic ;) I should have known... -- Grant Edwards

Re: stable algorithm with complexity O(n)

2008-12-15 Thread pruebauno
On Dec 15, 11:05 am, prueba...@latinmail.com wrote: Non-comparison sorts are a useful technique, but it's changing the problem, and they are only useful in very limited circumstances. There's a good reason that most sort routines are based on O(n*log n) comparison sorts instead of O(n)

Re: alt.possessive.its.has.no.apostrophe

2008-12-15 Thread Tim Chase
Steve Holden wrote: This led to a schism between the British and the newly-independent Americans, who responded by taking the u out of colour, valour, and aluminium. Darn Americans and their alminim ;-) Next thing you know, they'll be putting an I in TEAM.[1] gdr -tkc [1]

Re: alt.possessive.its.has.no.apostrophe

2008-12-15 Thread MRAB
Steve Holden wrote: Ben Finney wrote: James Stroud jstr...@mbi.ucla.edu writes: Ben Finney wrote: James Stroud jstr...@mbi.ucla.edu writes: Yes. I think it was the British who decided that the apostrophe rule for it would be reversed from normal usage relative to just about every other

Re: Managing timing in Python calls

2008-12-15 Thread bieffe62
On 15 Dic, 16:21, Ross nos...@forme.thks wrote: I'm porting some ugly javascript managed stuff to have an equivalent behaviour in a standalone app. It uses events that arrive from a server, and various small images.  In this standalone version, the data is local in a file and the images in a

Re: alt.possessive.its.has.no.apostrophe

2008-12-15 Thread MRAB
Tim Chase wrote: Steve Holden wrote: This led to a schism between the British and the newly-independent Americans, who responded by taking the u out of colour, valour, and aluminium. Darn Americans and their alminim ;-) Next thing you know, they'll be putting an I in TEAM.[1] gdr -tkc

Re: stable algorithm with complexity O(n)

2008-12-15 Thread Dan Upton
On Mon, Dec 15, 2008 at 11:05 AM, prueba...@latinmail.com wrote: Non-comparison sorts are a useful technique, but it's changing the problem, and they are only useful in very limited circumstances. There's a good reason that most sort routines are based on O(n*log n) comparison sorts instead

Structure using whitespace vs logical whitespace

2008-12-15 Thread cmdrrickhun...@yaho.com
I've been trying to search through the years of Python talk to find an answer to this, but my Googlefu is weak. In most languages, I'll do something like this xmlWriter.BeginElement(parent); xmlWriter.BeginElement(child); --xml.Writer.Characters(subtext); xmlWriter.EndElement();

Re: Need help improving number guessing game

2008-12-15 Thread Steven D'Aprano
On Mon, 15 Dec 2008 01:06:51 -0800, feba wrote: I don't really understand dicts yet; actually, the tutorial I'm following (http://www.briggs.net.nz/log/writing/snake-wrangling-for- kids/ , designed for tweens, but other than the pointless anecdote and joke here and there, I've found it a very

Thread Locking issue - Can't allocate lock (sem_init fail)

2008-12-15 Thread jamskip
Hi all, I have a peculiar problem with a multithreaded program of mine (actually I've sort of inherited it). Before i show you the error, here's a litle background. Its a program to check email addresses are valid, and its main task is to verify the domain names. Here's the basic functionality:

Re: Managing timing in Python calls

2008-12-15 Thread Ross
bieff...@gmail.com wrote: Python has in its standard library a timer class which actually is implemented as a thread (I think) ... however, when using a GUI package, I think it is better to use gui- specific functions for event-driven programming, to make sure that your code do not mess with

pylab.ylabel: put label on the other side

2008-12-15 Thread Antoine De Groote
Hey everybody, I'm plotting graphs with 2 y-axes, which I created using ax_left = pylab.subplot(111) ax_right = pylab.twinx() Then I switch the sides of the ticks: ax_left.yaxis.tick_right() ax_right.yaxis.tick_left() This works, the ticks are on the opposite sides (left axis ticks are on the

Re: Looking for the best way to translate an idiom

2008-12-15 Thread MRAB
James Stroud wrote: Aahz wrote: In article gi4834$la...@zinnia.noc.ucla.edu, James Stroud jstr...@mbi.ucla.edu wrote: In case its not obvious: Ah, so that's where Bruno's extra apostrophe came from! ;-) (Sorry about the spelling flame, but seeing three posts in quick succession with

Re: Python is slow

2008-12-15 Thread Luis M . González
On Dec 15, 1:38 am, cm_gui cmg...@gmail.com wrote: hahaha, do you know how much money they are spending on hardware to make youtube.com fast??? By the way... I know of a very slow Python site called YouTube.com. In fact, it is so slow that nobody ever uses it. Buddy, just stop whining

Re: Limit traceback from most recent call

2008-12-15 Thread Ethan Furman
Brian Allen Vanderburg II wrote: I've looked at traceback module but I can't find how to limit traceback from the most recent call if it is possible. I see that extract_tb has a limit parameter, but it limits from the start and not the end. Currently I've made my own traceback code to do

Re: XMPP xmpppy - User Authorization

2008-12-15 Thread Henson
On Dec 14, 4:23 am, James Mills prolo...@shortcircuit.net.au wrote: On Sun, Dec 14, 2008 at 3:47 PM, Henson mrn...@gmail.com wrote: In my own bot, using the latestxmpppy, I've been printing everything going to the message handler to the screen.  I've yet to see a 'subscribe' string.  Has

Re: alt.possessive.its.has.no.apostrophe

2008-12-15 Thread Ben Finney
James Stroud jstr...@mbi.ucla.edu writes: Ben Finney wrote: Or, more generally: Pronouns, which are different in just about every other way from other nouns, are different in this way also. Is that about right? Can we start talking about python again? Not with this thread subject :-)

Re: alt.possessive.its.has.no.apostrophe

2008-12-15 Thread Steve Holden
Tim Chase wrote: Steve Holden wrote: This led to a schism between the British and the newly-independent Americans, who responded by taking the u out of colour, valour, and aluminium. Darn Americans and their alminim ;-) Next thing you know, they'll be putting an I in TEAM.[1] It's

Re: Getting in to metaprogramming

2008-12-15 Thread eric_dex...@msn.com
On Nov 27, 9:56 pm, Hendrik van Rooyen m...@microcorp.co.za wrote:  Steven D'Aprano ste...@rem.com.au GUI designer. You write a program to let the user create code by clicking buttons, dragging objects, drawing lines, etc. The GUI designer may use classes, but the purpose of those classes is

Having Issues with CMD and the 'python' command

2008-12-15 Thread Lamonte Harris
Every time I start cmd on windows it requires me to set path=%path%;C:\python26 why? I'm getting annoyed... -- http://mail.python.org/mailman/listinfo/python-list

Re: Having Issues with CMD and the 'python' command

2008-12-15 Thread Lamonte Harris
It was python3 messing me up. I forgot I had python 3 on my box uninstalled it, redid it and wallah. On Mon, Dec 15, 2008 at 7:33 AM, rdmur...@bitdance.com wrote: On Mon, 15 Dec 2008 at 07:16, Lamonte Harris wrote: Yeah I tried doing it from the environment variables yet it still fails to

Re: Structure using whitespace vs logical whitespace

2008-12-15 Thread MRAB
cmdrrickhun...@yaho.com wrote: I've been trying to search through the years of Python talk to find an answer to this, but my Googlefu is weak. In most languages, I'll do something like this xmlWriter.BeginElement(parent); xmlWriter.BeginElement(child);

regex problem ..

2008-12-15 Thread Analog Kid
Hi All: I am new to regular expressions in general, and not just re in python. So, apologies if you find my question stupid :) I need some help with forming a regex. Here is my scenario ... I have strings coming in from a list, each of which I want to check against a regular expression and see

Re: Limit traceback from most recent call

2008-12-15 Thread Yinon Ehrlich
On Dec 14, 8:07 pm, Brian Allen Vanderburg II brianvanderbu...@aim.com wrote: I've looked at traceback module but I can't find how to limit traceback from the most recent call if it is possible.  I see that extract_tb has a limit parameter, but it limits from the start and not the end.  

Re: Having Issues with CMD and the 'python' command

2008-12-15 Thread Benjamin Kaplan
On Mon, Dec 15, 2008 at 8:13 AM, rdmur...@bitdance.com wrote: On Mon, 15 Dec 2008 at 23:01, James Mills wrote: On Mon, Dec 15, 2008 at 10:51 PM, Lamonte Harris pyth0nc0...@gmail.com wrote: Every time I start cmd on windows it requires me to set path=%path%;C:\python26 why? I'm getting

Re: %s place holder does not let me insert ' in an sql query with python.

2008-12-15 Thread Krishnakant
hello all, thanks for all of your very quick responses. The problem is that I am using python 2.5 so the 2.6 syntax does not apply in my case. secondly, My problem is very unique. I have created a function called executeProcedure in python which calls stored procedures in postgresql. The fun part

Re: regex problem ..

2008-12-15 Thread Steve Holden
Analog Kid wrote: Hi All: I am new to regular expressions in general, and not just re in python. So, apologies if you find my question stupid :) I need some help with forming a regex. Here is my scenario ... I have strings coming in from a list, each of which I want to check against a

Re: %s place holder does not let me insert ' in an sql query with python.

2008-12-15 Thread Steve Holden
Lamonte Harris wrote: I had this problem too. If you've upgraded to python 2.6 you need to use the new sytnax format queryString = insert into venders values('{0}','{1}','{2}'.format(field1,field2,field3) Will all readers of this thread kindly regard this as an example of how *not* to

Re: Structure using whitespace vs logical whitespace

2008-12-15 Thread Marek_SP
On 15 Gru, 18:14, MRAB goo...@mrabarnett.plus.com wrote: cmdrrickhun...@yaho.com wrote: I've been trying to search through the years of Python talk to find an answer to this, but my Googlefu is weak. In most languages, I'll do something like this xmlWriter.BeginElement(parent);

Wing IDE 3.1.6 released

2008-12-15 Thread Wingware
Hi, Wingware has released version 3.1.6 of Wing IDE, a bugfix release for all three product levels of Wing IDE. *Release Highlights* This release includes the following: * Added previously missing support for x64 Python on Windows * Avoid auto-starting batch searches when a project is opened

Re: %s place holder does not let me insert ' in an sql query with python.

2008-12-15 Thread Krishnakant
Hi steve. you are right. Thanks for all you who helped to understand how to and *not* to pass queries through psycopg2 which is a module based on python dbapi. the following query worked. cursor.execute(insert into vendors values(%s,%s), lstParams) lstParams contained all the values and yes one

pexpect and inconsistent exit values

2008-12-15 Thread Heikki Toivonen
I don't seem to be able to figure out how to get the exit values of commands executed with pexpect reliably. Here's first with regular shell: hei...@ubuntu:~$ true; echo $? 0 Let's try with pexpect. Below is the program: ---CLIP--- import sys, pexpect cmd = true print 'cmd=', cmd child =

Re: Structure using whitespace vs logical whitespace

2008-12-15 Thread Terry Reedy
cmdrrickhun...@yaho.com wrote: I've been trying to search through the years of Python talk to find an answer to this, but my Googlefu is weak. In most languages, I'll do something like this xmlWriter.BeginElement(parent); xmlWriter.BeginElement(child);

Re: Need help improving number guessing game

2008-12-15 Thread feba
Alright! This is feeling more like it. #!/usr/bin/python #Py3k, UTF-8 import random def setup(game, minr=1, maxr=99): #minr, maxr make minimum and maximum. Can be adjusted. game['minr'], game['maxr'] = minr, maxr game['gcount'] = 0 #Reset guess count game['target'] =

Re: stable algorithm with complexity O(n)

2008-12-15 Thread Terry Reedy
Dan Upton wrote: And if n is small and sparse (ie, k n) , O(k*n) for radix sort could be worse than O(n^2). You could also ask why people make such a big deal about quicksort over mergesort, since mergesort has a guaranteed O(n log n) time whereas quicksort can be O(n^2) on pathological

os.environ.get('SSH_ORIGINAL_COMMAND') returns None

2008-12-15 Thread Tzury Bar Yochay
Trying to follow a technique found at bzr I did the following added to ~/.ssh/authorized_keys the command=my_parder parameter which point to a python script file named 'my_parser' and located in / usr/local/bin (file was chmoded as 777) in that script file '/usr/local/bin/my_parser' I got the

Re: Rename of .mdb file -- lock

2008-12-15 Thread Scott David Daniels
noydb wrote: I have the code below, which unzips a zipfile containing only one file. Once it is unzipped, I want to rename the file based on a user provided name. But I get this (WindowsError: [Error 32] The process cannot access the file because it is being used by another process) error,

tricky nested list unpacking problem

2008-12-15 Thread Reckoner
Hi, I have lists of the following type: [1,2,3,[5,6]] and I want to produce the following strings from this as '0-1-2-3-5' '0-1-2-3-6' That was easy enough. The problem is that these can be nested. For example: [1,2,3,[5,6],[7,8,9]] which should produce '0-1-2-3-5-7' '0-1-2-3-5-8'

Re: Rename of .mdb file -- lock

2008-12-15 Thread MRAB
Scott David Daniels wrote: noydb wrote: I have the code below, which unzips a zipfile containing only one file. Once it is unzipped, I want to rename the file based on a user provided name. But I get this (WindowsError: [Error 32] The process cannot access the file because it is being used by

Re: Removing None objects from a sequence

2008-12-15 Thread Scott David Daniels
Steven D'Aprano wrote: On Fri, 12 Dec 2008 19:02:24 -0500, Terry Reedy wrote: ... Tim Chase wrote: If you want to literally remove None objects from a list(or mutable sequence) def deNone(alist): n=len(alist) i=j=0 while i n: if alist[i] is not None: alist[j] =

Re: alt.possessive.its.has.no.apostrophe

2008-12-15 Thread Carl Banks
On Dec 15, 1:55 am, Ben Finney bignose+hates-s...@benfinney.id.au wrote: James Stroud jstr...@mbi.ucla.edu writes: Ben Finney wrote: James Stroud jstr...@mbi.ucla.edu writes: Yes. I think it was the British who decided that the apostrophe rule for it would be reversed from normal

Problem accessing a web page

2008-12-15 Thread Antoni Mont
Hi all, My apologises if this is not the appropriate group. I'd like to access a web site from a python script. That page, in fact, is a form of main page. With a browser (Firefox, for instance) I can do it without problem: I open the main web whose url is:

Re: tricky nested list unpacking problem

2008-12-15 Thread Chris Rebert
On Mon, Dec 15, 2008 at 11:06 AM, Reckoner recko...@gmail.com wrote: Hi, I have lists of the following type: [1,2,3,[5,6]] and I want to produce the following strings from this as '0-1-2-3-5' '0-1-2-3-6' That was easy enough. The problem is that these can be nested. For example:

Simple multithreaded profiler using decorators fails on some built-in methods

2008-12-15 Thread k3xji
Hi all, I have written a simple multithreaded profiler using decorators. Below is how it works: 1) Iterate all modules in sys.modules and iterate each function/ class methods inside them, means all of them including built-in methods. 2) Decorate the methods and functions to a global function. 3)

Re: Problem accessing a web page

2008-12-15 Thread Chris Rebert
On Mon, Dec 15, 2008 at 11:55 AM, Antoni Mont amont...@yahoo.es wrote: Hi all, My apologises if this is not the appropriate group. I'd like to access a web site from a python script. That page, in fact, is a form of main page. With a browser (Firefox, for instance) I can do it without

Re: tricky nested list unpacking problem

2008-12-15 Thread Kirk Strauser
At 2008-12-15T19:06:16Z, Reckoner recko...@gmail.com writes: The problem is that I don't know ahead of time how many lists there are or how deep they go. In other words, you could have: Recursion is your friend. Write a function to unpack one sublist and call itself again with the new list.

Python plugin for Netbeans

2008-12-15 Thread a
Netbeans added a python plugin to its plugin repository. Do you tried it? What do you think about this plugin? -- http://mail.python.org/mailman/listinfo/python-list

Re: Structure using whitespace vs logical whitespace

2008-12-15 Thread cmdrrickhun...@yaho.com
On Dec 15, 11:10 am, Terry Reedy tjre...@udel.edu wrote: In general, I'm using indentation to show logical flow through code. That, of course, is what Python does. Python does NOT use indentation to show logical flow. It uses it to show syntactical flow. The XML writer is the perfect

Re: tricky nested list unpacking problem

2008-12-15 Thread Kirk Strauser
At 2008-12-15T20:03:14Z, Chris Rebert c...@rebertia.com writes: You just need a recursive list-flattening function. There are many recipes for these. Here's mine: flattened = flatten([1,2,3,[5,6,[10, 11]],7,[9,[1, 2, 3, 4, 5 ]]]) flattened [1, 2, 3, 5, 6, 10, 11, 7, 9, 1, 2, 3, 4, 5]

Re: Managing timing in Python calls

2008-12-15 Thread cmdrrickhun...@yaho.com
I believe WxTimerEvent is handled using the event queue, which isn't going to do what you want. An event which goes through the queue does not get processed until you return to the queue. What you want to do is actually a rather difficult task to do generically. Should the task be interrupted

Re: Problem accessing a web page

2008-12-15 Thread Tim Chase
I'm able to grab the problem webpage via Python just fine, albeit with a bit of a delay. So, don't know what your exact problem is, maybe your connection? When you get the second page, are you getting the same content back that you get if you do a search in your favorite browser? Using just

Re: stable algorithm with complexity O(n)

2008-12-15 Thread cmdrrickhun...@yaho.com
Just because its such an interesting problem, I'll take a stab at it. It can be proven that you cannot sort an arbitrarily large set of numbers, given no extra information, faster than O(n log n). It is provable using information theory. However, if your teacher is giving you evil problems,

How can I return a non-zero status result from a python script?

2008-12-15 Thread silverburgh.me...@gmail.com
Hi How can I return a non-zero status result from the script? Just do a return 1? at the end? -- http://mail.python.org/mailman/listinfo/python-list

Re: Need help improving number guessing game

2008-12-15 Thread feba
I added the ability to select your own range. It takes two new modules: def customrange(game, lowunsafe=True): game['defrang'] = False #Keeps setup from changing range to defaults while lowunsafe: #makes sure that the low number is positive picklow = int(input(PLEASE PICK THE LOW

Re: tricky nested list unpacking problem

2008-12-15 Thread Arnaud Delobelle
Reckoner recko...@gmail.com writes: Hi, I have lists of the following type: [1,2,3,[5,6]] and I want to produce the following strings from this as '0-1-2-3-5' '0-1-2-3-6' That was easy enough. The problem is that these can be nested. For example: [1,2,3,[5,6],[7,8,9]] which

Re: Problem accessing a web page

2008-12-15 Thread Antoni Mont
Tim Chase wrote: When you get the second page, are you getting the same content back that you get if you do a search in your favorite browser? Using just content = urllib.urlopen(url2).read() 'Error' in content # True 'Friedrich' in content # False However, when you browse

Re: How can I return a non-zero status result from a python script?

2008-12-15 Thread Marc 'BlackJack' Rintsch
On Mon, 15 Dec 2008 13:12:08 -0800, silverburgh.me...@gmail.com wrote: How can I return a non-zero status result from the script? Just do a return 1? at the end? ``sys.exit(42)`` Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: How can I return a non-zero status result from a python script?

2008-12-15 Thread Rob Williscroft
silverburgh.me...@gmail.com wrote in news:74b53da4-bf07-431b-898b- 49977f7a6...@r36g2000prf.googlegroups.com in comp.lang.python: Hi How can I return a non-zero status result from the script? Just do a return 1? at the end? import sys help( sys.exit ) Help on built-in function exit in

Re: Structure using whitespace vs logical whitespace

2008-12-15 Thread Marc 'BlackJack' Rintsch
On Mon, 15 Dec 2008 12:27:12 -0800, cmdrrickhun...@yaho.com wrote: On Dec 15, 11:10 am, Terry Reedy tjre...@udel.edu wrote: In general, I'm using indentation to show logical flow through code. That, of course, is what Python does. Python does NOT use indentation to show logical flow. It

  1   2   3   >