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

2008-12-15 Thread Ben Finney
James Stroud writes: > Ben Finney wrote: > > James Stroud 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 claim to say that anyone

Re: Looking for the best way to translate an idiom

2008-12-15 Thread Bruno Desthuilliers
Aahz a écrit : In article , James Stroud 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 succession with incorrect spelling of its/it's pushed me into

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 MILLIO

Re: Python is slow

2008-12-15 Thread James Mills
On Mon, Dec 15, 2008 at 5:26 PM, Andreas Kostyrka 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 can wield the tool

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, sin

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

2008-12-15 Thread James Stroud
Ben Finney wrote: James Stroud writes: Ben Finney wrote: James Stroud 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 claim to say that anyone

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 wrote: >> Steven D'Aprano wrote: >> > All the positive thinking in the world won't help you: >> >> > * make a four-sided triangle; >> >> > * split a magnet into two individual poles; >> >> These two are fundam

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 programmer

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 s

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

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

Re: Py_GetPath() C API in python 3

2008-12-15 Thread stalex
On 12月13日, 上午9�r55分, "Gabriel Genellina" wrote: > En Fri, 12 Dec 2008 04:50:06 -0200, stalex 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() and Py_GetProgramFullPath().

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 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 v

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 wrote: > 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/m

Re: cx_Oracle issues

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

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 wrote: > hello all hackers. > This is some kind of an interesti

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 is

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 python-2.6.

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" 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 easy to fi

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 fun

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" wrote: > On Dec 10, 9:48 am, huw_at1 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: > > > ORA-06502: PL/SQL:

Re: cx_Oracle issues

2008-12-15 Thread Hrvoje Niksic
huw_at1 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 of th

Re: Python is slow

2008-12-15 Thread George Sakkis
On Dec 15, 8:15 am, Luis M. González wrote: > On Dec 15, 1:38 am, cm_gui 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

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 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 different matter to

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 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 pritty easy and no ne

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 va

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 wrote: >Aahz a écrit : >> In article , >> James Stroud wrote: >>> >>> In case its not obvious: >> >> Ah, so that's where Bruno's extra apostrophe came from! ;-) > >Err... Which one exactly ? Don't remember, it was a pos

Re: Looking for the best way to translate an idiom

2008-12-15 Thread Steve Holden
James Stroud wrote: > Aahz wrote: >> In article , >> James Stroud 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 incorrect spelling of its/it's push

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

2008-12-15 Thread Steve Holden
Ben Finney wrote: > James Stroud writes: > >> Ben Finney wrote: >>> James Stroud 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 indefensibl

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 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 corrected.) But the an

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 y

%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 tha

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

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] -tkc [1] http://www.quo

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

2008-12-15 Thread MRAB
Steve Holden wrote: Ben Finney wrote: James Stroud writes: Ben Finney wrote: James Stroud 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 claim

Re: Managing timing in Python calls

2008-12-15 Thread bieffe62
On 15 Dic, 16:21, Ross 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 local directory

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] -tkc

Re: stable algorithm with complexity O(n)

2008-12-15 Thread Dan Upton
On Mon, Dec 15, 2008 at 11:05 AM, 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) bucket so

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.EndElemen

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 v

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 GUI

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 , James Stroud 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 incorrect spelling of its/it's pushed me into making a pu

Re: Python is slow

2008-12-15 Thread Luis M . González
On Dec 15, 1:38 am, cm_gui 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 and go w

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 this

Re: XMPP xmpppy - User Authorization

2008-12-15 Thread Henson
On Dec 14, 4:23 am, "James Mills" wrote: > On Sun, Dec 14, 2008 at 3:47 PM, Henson 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 this changed? > > No this hasn't chang

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

2008-12-15 Thread Ben Finney
James Stroud 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

Re: Getting in to metaprogramming

2008-12-15 Thread eric_dex...@msn.com
On Nov 27, 9:56 pm, "Hendrik van Rooyen" wrote: >  "Steven D'Aprano" > > >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 to generate source code. >

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, 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 >> work. >> > > Well

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"); --xml.Writer.Characters("s

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 whet

Re: Limit traceback from most recent call

2008-12-15 Thread Yinon Ehrlich
On Dec 14, 8:07 pm, 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

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

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

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 o

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 r

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

Re: Structure using whitespace vs logical whitespace

2008-12-15 Thread Marek_SP
On 15 Gru, 18:14, MRAB 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"); > > xmlWriter.Begi

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 h

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 = pe

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"); --xml.Writer.Characters("s

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'] = random.randin

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 cases

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, whic

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' '0-1-2-3-

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] = alist

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

2008-12-15 Thread Carl Banks
On Dec 15, 1:55 am, Ben Finney wrote: > James Stroud writes: > > Ben Finney wrote: > > > James Stroud 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 a

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: 'http://www.mcu.es/webISBN/tituloSimpl

Re: tricky nested list unpacking problem

2008-12-15 Thread Chris Rebert
On Mon, Dec 15, 2008 at 11:06 AM, Reckoner 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: > > [1,2,3,

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 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 problem: I open

Re: tricky nested list unpacking problem

2008-12-15 Thread Kirk Strauser
At 2008-12-15T19:06:16Z, Reckoner 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. For instance, s

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 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 example of a case

Re: tricky nested list unpacking problem

2008-12-15 Thread Kirk Strauser
At 2008-12-15T20:03:14Z, "Chris Rebert" 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] '-'.jo

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 im

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, ther

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 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 should

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

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

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 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

Re: Problem Python 2.6.1 vs 2.6 & pyWin32

2008-12-15 Thread Martin v. Löwis
> I am very disappointed. Help me, please. Try installing Python 2.6.1 "for all users". Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Limit traceback from most recent call

2008-12-15 Thread Brian Allen Vanderburg II
yinon...@gmail.com wrote: On Dec 14, 8:07 pm, Brian Allen Vanderburg II wrote: Hi, The interface of extract_tb is: traceback.extract_tb(tb, limit=None) try to play with the 'limit' argument Good luck, Yinon -- http://mail.python.org/mailman/listinfo/python-list I have, but the limit

  1   2   >