Re: mod_python Unable to create file

2008-03-01 Thread Marc 'BlackJack' Rintsch
On Sat, 01 Mar 2008 22:47:02 -0800, kaush wrote: > I am using Apache and mod_python to service POST/GET requests on MAC > OS. My script tries to create a file > > file = open(file_path, 'w') > > This fails with the following error > > EACCES > Permission denied > > What is missing? To state t

Re: How about adding rational fraction to Python?

2008-03-01 Thread Paul Rubin
Steven D'Aprano <[EMAIL PROTECTED]> writes: > def mean(data): return sum(data)/len(data) > > That does the right thing for data, no matter of what it consists of: > floats, ints, Decimals, rationals, complex numbers, or a mix of all of > the above. One of those types is not like the others: for

Re: Book Recomendations

2008-03-01 Thread js
I wonder why nobody mension Python Cookbook yet. http://www.oreilly.com/catalog/pythoncook2/ Web version: http://aspn.activestate.com/ASPN/Cookbook/Python/ and Python Standard Library http://www.oreilly.com/catalog/pythonsl/ http://effbot.org/zone/librarybook-index.htm On Sun, Mar 2, 2008 at 4:09

Re: Book Recomendations

2008-03-01 Thread Paddy
On Mar 2, 12:56 am, Ira Solomon <[EMAIL PROTECTED]> wrote: > I am an experienced programmer (40 years). I've done Algol (if you've > heard of that you must be old too), PL/1, VB,VBA, a little C, and a > few other odd languages (e.g. Taskmate). > I'm interested in learning Python and have downloade

Re: How about adding rational fraction to Python?

2008-03-01 Thread Paul Rubin
Lie <[EMAIL PROTECTED]> writes: > So basically they refused to satisfy everything that is still possible > individually but would conflict if done together. I can't understand that. > x = 1 > a = x + 1<< decides it's an int No, so far a and x are both Num (indeterminate) > b = x + 1.0 <<

mod_python Unable to create file

2008-03-01 Thread kaush
Hi, I am using Apache and mod_python to service POST/GET requests on MAC OS. My script tries to create a file file = open(file_path, 'w') This fails with the following error EACCES Permission denied What is missing? Thanks, Kaushik -- http://mail.python.org/mailman/listinfo/python-list

Re: Question about lambda and variable bindings

2008-03-01 Thread Terry Reedy
"Michael Torrie" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] |I need to use a lambda expression Lambda expressions are a convenience, not a necessity. When having a problem, it sometimes helps to revert to the unabbreviated def statement. tjr -- http://mail.python.org/mail

Re: How about adding rational fraction to Python?

2008-03-01 Thread Lie
On Feb 29, 5:33 am, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > > > And rightly rejected by many other programming languages, including > > > modern Python, not to mention calculators, real mathematics and > > > common sense. > > > Lost me again.  I was not aware that calculator

Re: How about adding rational fraction to Python?

2008-03-01 Thread Lie
On Mar 2, 2:32 am, Paul Rubin wrote: > Lie <[EMAIL PROTECTED]> writes: > > I see, but the same arguments still holds true: the second line have > > an implicit side-effect of redefining x's type into Fractional type. > > If I were the designer of the language, I'd leave x

Re: RELEASED Python 2.6a1 and 3.0a3

2008-03-01 Thread Terry Reedy
"Kay Schluehr" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | On 1 Mrz., 19:51, Barry Warsaw <[EMAIL PROTECTED]> wrote: | | > Python 2.6 is not only the next advancement in the Python 2 series, it | > is also a transitionary release, helping developers begin to prepare | > their co

Re: RELEASED Python 2.6a1 and 3.0a3

2008-03-01 Thread Ben Finney
Kay Schluehr <[EMAIL PROTECTED]> writes: > On 1 Mrz., 19:51, Barry Warsaw <[EMAIL PROTECTED]> wrote: > > > Python 2.6 is not only the next advancement in the Python 2 series, it > > is also a transitionary release, helping developers begin to prepare > > their code for Python 3.0. > > Isn't this

Re: Book Recomendations

2008-03-01 Thread subeen
On Mar 2, 6:56 am, Ira Solomon <[EMAIL PROTECTED]> wrote: > I am an experienced programmer (40 years). I've done Algol (if you've > heard of that you must be old too), PL/1, VB,VBA, a little C, and a > few other odd languages (e.g. Taskmate). > I'm interested in learning Python and have downloaded

Re: RELEASED Python 2.6a1 and 3.0a3

2008-03-01 Thread Kay Schluehr
On 1 Mrz., 19:51, Barry Warsaw <[EMAIL PROTECTED]> wrote: > Python 2.6 is not only the next advancement in the Python 2 series, it > is also a transitionary release, helping developers begin to prepare > their code for Python 3.0. Isn't this a silly idea? People have to migrate from 2.5 or lower

Re: Book Recomendations

2008-03-01 Thread Jeff Schwab
Ira Solomon wrote: > I am an experienced programmer (40 years). I've done Algol (if you've > heard of that you must be old too), PL/1, VB,VBA, a little C, and a > few other odd languages (e.g. Taskmate). > I'm interested in learning Python and have downloaded a slew of books. > Too many. > I'd lik

Re: SV: Where's GUI for Python?

2008-03-01 Thread Grant Edwards
On 2008-03-02, K Viltersten <[EMAIL PROTECTED]> wrote: >>>import tkininter >>> >> When that fails, try without the stutter >> >> import tkinter > > > I must be doing something wrong because > neither tkinter nor tkininter works. You probably don't have tkinter installed. It's not installed

Re: invert or not ?

2008-03-01 Thread Grant Edwards
On 2008-03-01, Stef Mientki <[EMAIL PROTECTED]> wrote: > from the manual I read that a bitwise inversion should be done > by invert. But from some experiments I see that not works > equally well. What experiments are those? >>> print ~0xaa, not 0xaa -171 False >>> print ~0x55, not 0x55 -86 False

Re: Telnet versus telnetlib

2008-03-01 Thread Grant Edwards
On 2008-03-01, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > En Fri, 29 Feb 2008 20:34:41 -0200, Sean Davis <[EMAIL PROTECTED]> > escribió: > >> When I do an analogous process using telnetlib, I get no debug output, >> and most importantly, when I send the XML file to the host, I get no >> print

Re: Where's GUI for Python?

2008-03-01 Thread Bill
Peter Decker wrote, On 3/1/2008 9:58 PM: > On Sat, Mar 1, 2008 at 3:35 PM, K Viltersten <[EMAIL PROTECTED]> wrote: >> I'm certain there is an API for creating >> GUI's but as far i can find it in the >> http://docs.python.org/tut/tut.html >> the only "gui" is in "Guido". > > Check out Dabo: htt

Re: Question about lambda and variable bindings

2008-03-01 Thread castironpi
On Mar 1, 8:50 pm, Michael Torrie <[EMAIL PROTECTED]> wrote: > I need to use a lambda expression to bind some extra contextual data > (should be constant after it's computed) to a call to a function.  I had > originally thought I could use something like this demo (but useless) code: > > funcs=[] >

Re: Question about lambda and variable bindings

2008-03-01 Thread Michael Torrie
poof65 wrote: > An idea, i don't know if it will work in your case. > > for x in xrange(10): > funcs.append(lambda p,z=x: testfunc(z+2,p)) Good idea. I will try it. I also figured out a way to architecture my program differently to avoid this problem. But this idiom might be handy in certain

Re: How to subclass a built-in int type and prevent comparisons

2008-03-01 Thread castironpi
On Mar 1, 2:58 pm, Michael Torrie <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > Tell Wall. But why not [ 2, 3 ]>= 2? Back to your question, another > > option is to not subclass. > > Umm, no. You need to actually read the posts before you respond to > them. His question was whether

Re: Question about lambda and variable bindings

2008-03-01 Thread poof65
An idea, i don't know if it will work in your case. for x in xrange(10): funcs.append(lambda p,z=x: testfunc(z+2,p)) On Sun, Mar 2, 2008 at 3:50 AM, Michael Torrie <[EMAIL PROTECTED]> wrote: > I need to use a lambda expression to bind some extra contextual data > (should be constant after it's

class object interface document

2008-03-01 Thread Neil.Fang.CN
Hello Where can I find the Python class object interface document, such as struct PyClassObject, PyClass_New()? Thanks! -- Neil -- http://mail.python.org/mailman/listinfo/python-list

Re: Where's GUI for Python?

2008-03-01 Thread Peter Decker
On Sat, Mar 1, 2008 at 3:35 PM, K Viltersten <[EMAIL PROTECTED]> wrote: > I'm certain there is an API for creating > GUI's but as far i can find it in the > http://docs.python.org/tut/tut.html > the only "gui" is in "Guido". Check out Dabo: http://dabodev.com It uses the wxPython UI toolkit, b

Question about lambda and variable bindings

2008-03-01 Thread Michael Torrie
I need to use a lambda expression to bind some extra contextual data (should be constant after it's computed) to a call to a function. I had originally thought I could use something like this demo (but useless) code: funcs=[] def testfunc(a,b): print "%d, %d" % (a,b) for x in xrange(10):

Re: Book Recomendations

2008-03-01 Thread Micah Cowan
Ira Solomon <[EMAIL PROTECTED]> writes: > I am an experienced programmer (40 years). I've done Algol (if you've > heard of that you must be old too), PL/1, VB,VBA, a little C, and a > few other odd languages (e.g. Taskmate). > I'm interested in learning Python and have downloaded a slew of books.

Re: Where's GUI for Python?

2008-03-01 Thread castironpi
On Mar 1, 6:49 pm, "K Viltersten" <[EMAIL PROTECTED]> wrote: > >> When that fails, try without the stutter > > >> import tkinter > > > I must be doing something wrong because > > neither tkinter nor tkininter works. > > I tried both with and without stuttering. > > I even asked my wife to stutter

Re: Book Recomendations

2008-03-01 Thread Ryan M.
On Mar 1, 7:56 pm, Ira Solomon <[EMAIL PROTECTED]> wrote: > I am an experienced programmer (40 years).  I've done Algol (if you've > heard of that you must be old too), PL/1, VB,VBA, a little C, and a > few other odd languages (e.g. Taskmate). > I'm interested in learning Python and have downloaded

Re: Book Recomendations

2008-03-01 Thread Tro
On Saturday 01 March 2008, Ira Solomon wrote: > I am an experienced programmer (40 years). I've done Algol (if you've > heard of that you must be old too), PL/1, VB,VBA, a little C, and a > few other odd languages (e.g. Taskmate). > I'm interested in learning Python and have downloaded a slew of b

Re: SV: Where's GUI for Python?

2008-03-01 Thread Ricardo Aráoz
K Viltersten wrote: >>>import tkininter >>> >> When that fails, try without the stutter >> >> import tkinter > > > I must be doing something wrong because > neither tkinter nor tkininter works. > I tried both with and without stuttering. > I even asked my wife to stutter some but, > sadly, t

Book Recomendations

2008-03-01 Thread Ira Solomon
I am an experienced programmer (40 years). I've done Algol (if you've heard of that you must be old too), PL/1, VB,VBA, a little C, and a few other odd languages (e.g. Taskmate). I'm interested in learning Python and have downloaded a slew of books. Too many. I'd like a recommendation as to which

Python Telnet formatting?

2008-03-01 Thread mentaltruckdriver
Hi everyone: I posted here a couple days ago looking for some help creating a Telnet-based chat server. You guys pointed me to Twisted, which has solved most of my issues. However, what I want to do is analyze strings received for keywords such as 'listcmds' and have the server return something t

SV: Where's GUI for Python?

2008-03-01 Thread K Viltersten
>> When that fails, try without the stutter >> >> import tkinter > > I must be doing something wrong because > neither tkinter nor tkininter works. > I tried both with and without stuttering. > I even asked my wife to stutter some but, > sadly, to no avail. > > When Tim Chase mentioned "battery

SV: Where's GUI for Python?

2008-03-01 Thread K Viltersten
>>import tkininter >> > When that fails, try without the stutter > > import tkinter I must be doing something wrong because neither tkinter nor tkininter works. I tried both with and without stuttering. I even asked my wife to stutter some but, sadly, to no avail. When Tim Chase mentioned

SV: Surprised by the command "del"

2008-03-01 Thread K Viltersten
>>I'm reading the docs and at 5.2 the del >>statement is discussed. At first, i thought >>i've found a typo but as i tried that >>myself, it turns it actually does work so. >> >> a = ["alpha", "beta", "gamma"] >> del a[2:2] >> a >> >>Now, i expected the result to be that the >>"beta" element ha

Altering imported modules

2008-03-01 Thread Tro
Hi, list. I've got a simple asyncore-based server. However, I've modified the asyncore module to allow me to watch functions as well as sockets. The modified asyncore module is in a specific location in my project and is imported as usual from my classes. Now I'd like to use the tlslite librar

Re: sqlite3 adaptors mystery

2008-03-01 Thread Mel
Matej Cepl wrote: [ ... ] > However, when running this program it seems converter doesn’t seem to work, > because I get: > > [EMAIL PROTECTED] dumpBugzilla]$ rm test.db ; python testAdaptors.py > [(u'False',), (u'True',)] > [EMAIL PROTECTED] dumpBugzilla]$ > > There is probably something quite ob

Re: cx_Freeze : LookupError: unknown encoding: ascii

2008-03-01 Thread Martin v. Löwis
> Can somebody point to some clues about options that need to be passed > to FreezePython API to get the right executable. You need to tell it to include the encodings.ascii module. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Problems building 2.5.1 on AIX

2008-03-01 Thread Martin v. Löwis
> hasty:Python-2.5.1$ CC=/usr/vacpp/bin/cc_r ./configure --without-gcc > checking MACHDEP... aix5 > checking EXTRAPLATDIR... > checking for --without-gcc... yes > checking for gcc... cc > checking for C compiler default output file name... configure: error: C > compiler cannot create executables

sqlite3 adaptors mystery

2008-03-01 Thread Matej Cepl
Hi, I am in the process of creating a small script for filling the sqlite3 database with data from rather large XML-RPC query (list of many bugs from the Red Hat Bugzilla) and I would love to use adaptors and converters for some data types which I am missing. I have this test script (made hope

Re: PIL transparency gradient

2008-03-01 Thread Allard Warrink
Thanks for the inspiration! This what I did (Using your Python Editor (SPE), I really like to work with SPE, keep up the good work!!): # import Image, os p = # path to image file im = Image.open(p) # check if im has Alpha band... if im.mode != 'RGBA':

Re: Python COM automation - Controlling Microsoft Agent

2008-03-01 Thread Fuzzyman
On Mar 1, 12:47 am, Kamilche <[EMAIL PROTECTED]> wrote: > Here's a snippet of code for pythoners to enjoy. > Make the Microsoft genie speak text and dance about! Code (with pretty pictures!) to do similar things from IronPython: http://www.ironpython.info/index.php/AgentServerObjects Michael F

Re: [Python-Dev] [Python-3000] RELEASED Python 2.6a1 and 3.0a3

2008-03-01 Thread Martin v. Löwis
> The 2.6a1 x86 MSI is there, but the 3.0a3 x86 MSI is still giving a 404. Please try again - *those* files weren't actually there when I sent my last message; I just built them. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Surprised by the command "del"

2008-03-01 Thread From
On Sat, 1 Mar 2008 21:05:41 +0100, "K Viltersten" <[EMAIL PROTECTED]> wrote: >I'm reading the docs and at 5.2 the del >statement is discussed. At first, i thought >i've found a typo but as i tried that >myself, it turns it actually does work so. > > a = ["alpha", "beta", "gamma"] > del a[2:2] >

cx_Freeze : LookupError: unknown encoding: ascii

2008-03-01 Thread Rakesh Kumar
Hi - I created a binary using the cx_Freeze utility on Linux (wxWidgets 2.8 / Python 2.5/ Mandriva 2008 ). When I tried to run the binary - this is the error that I got on the console. File "gdataapi.py", line 44, in __init__ self.service.ProgrammaticLogin() File "/opt/software/gdata

Re: [Python-Dev] [Python-3000] RELEASED Python 2.6a1 and 3.0a3

2008-03-01 Thread Paul Moore
On 01/03/2008, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > > As of 4:50 PM EST, the links to Windows installers give 404 File Not > > Found. > > > > I gather that they are still in process, > > and notice that there is no public c.l.p. announcement. > > > I just fixed that. The files were t

Re: [Python-3000] RELEASED Python 2.6a1 and 3.0a3

2008-03-01 Thread Barry Warsaw
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Mar 1, 2008, at 5:26 PM, Martin v. Löwis wrote: >> As of 4:50 PM EST, the links to Windows installers give 404 File Not >> Found. >> >> I gather that they are still in process, >> and notice that there is no public c.l.p. announcement. > > I just

Re: Where's GUI for Python?

2008-03-01 Thread Roy H. Han
Konrad, I use wxPython with wxGlade. I love wxGlade! wxGlade http://wxglade.sourceforge.net/ You need to look at this documentation to code event handling. wxWidgets http://www.wxwidgets.org/manuals/stable/wx_classesbycat.html You can also try coding the GUI manually, but it is much easier to us

Re: [Python-3000] RELEASED Python 2.6a1 and 3.0a3

2008-03-01 Thread Martin v. Löwis
> As of 4:50 PM EST, the links to Windows installers give 404 File Not > Found. > > I gather that they are still in process, > and notice that there is no public c.l.p. announcement. I just fixed that. The files were there; just the links were wrong. Regards, Martin -- http://mail.python.org

Re: Pb with 2.5.2 & PyScripter

2008-03-01 Thread M�ta-MCI (MVP)
Hi! Problem solved, after reset layouts. Thanks, all! Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list

Re: A python STUN client is ready on Google Code.

2008-03-01 Thread Tim Chase
> |I upload a new version. Add more print log into my code to help people > | understand my program > > Announcements should include a short paragraph explaining what the > announcement is about for those of us not in the know. IE, what is > STUN? -- and therefore, what is a STUN client? I be

Re: Where's GUI for Python?

2008-03-01 Thread Tim Chase
> I'm certain there is an API for creating > GUI's but as far i can find it in the > http://docs.python.org/tut/tut.html > the only "gui" is in "Guido". > > What do i miss? The batteries-included GUI: import tkininter Add-on solutions include wxPython, PythonCard and many others. GIYF:

Please test Phatch on Windows (was Re: ANN: Phatch = PHoto bATCH processor and renamer based on PIL)

2008-03-01 Thread SPE - Stani's Python Editor
I have been working the last couple of days purely on bug fixing and to port the code of Phatch fully to Windows as there were many issues. This has improved: - Phatch can now create droplets on Windows (win32 extensions required) - Installed fonts are retrieved from the Windows registry - Image fi

Re: Pb with 2.5.2 & PyScripter

2008-03-01 Thread Colin J. Williams
Méta-MCI (MVP) wrote: > Re! > > An exemple. With this script: >a=123 >b=456 >d=a+b+c > (note than 'c' is not defined). > > When I run, inside Pyscripter, the error-dialog is showed, and, one > second after, PyScripter is closed. > This problem is present since Python 2.5.2. > > I s

Re: PIL transparency gradient

2008-03-01 Thread SPE - Stani's Python Editor
On 1 mrt, 22:04, Allard Warrink <[EMAIL PROTECTED]> wrote: > I would like to create a transparency gradient over an image using > PIL. But I don't have a clue how to do this... > Is there anyone out here who could give me some advise? Phatch (PHoto & bATCH) is an application based on PIL. Its acti

Re: A python STUN client is ready on Google Code.

2008-03-01 Thread Terry Reedy
"hawk gao" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] |I upload a new version. Add more print log into my code to help people | understand my program Announcements should include a short paragraph explaining what the announcement is about for those of us not in the know. IE, w

Where's GUI for Python?

2008-03-01 Thread K Viltersten
I'm certain there is an API for creating GUI's but as far i can find it in the http://docs.python.org/tut/tut.html the only "gui" is in "Guido". What do i miss? -- Regards Konrad Viltersten sleep- a substitute for coffee for the poor ambition - lack of sense t

SV: Surprised by the command "del"

2008-03-01 Thread K Viltersten
>> I'm reading the docs and at 5.2 the del >> statement is discussed. At first, i thought >> i've found a typo but as i tried that >> myself, it turns it actually does work so. >> >> a = ["alpha", "beta", "gamma"] >> del a[2:2] >> a >> >> Now, i expected the result to be that the >> "beta"

PIL transparency gradient

2008-03-01 Thread Allard Warrink
I would like to create a transparency gradient over an image using PIL. But I don't have a clue how to do this... Is there anyone out here who could give me some advise? -- http://mail.python.org/mailman/listinfo/python-list

Re: How to subclass a built-in int type and prevent comparisons

2008-03-01 Thread Michael Torrie
[EMAIL PROTECTED] wrote: > Tell Wall. But why not [ 2, 3 ]>= 2? Back to your question, another > option is to not subclass. Umm, no. You need to actually read the posts before you respond to them. His question was whether or not to throw an exception in this case. He's *already* subclassed th

Re: Pb with 2.5.2 & PyScripter

2008-03-01 Thread M�ta-MCI (MVP)
Hi! Thank you for return. I will uninstall+reinstall Pyscripter. @-salutations -- Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list

rpc shortcut

2008-03-01 Thread castironpi
RPC might be -really- easy. Mixin class: getattribute returns a remoting callable if ('name') is callable, or in a special list. On call, pack the parameters, execute locally, and broadcast. You'd need two mixins, BroadcasterMixin and ReceiverMixin, but the same code can still run-- how can beh

Re: Surprised by the command "del"

2008-03-01 Thread Steve Holden
K Viltersten wrote: > I'm reading the docs and at 5.2 the del > statement is discussed. At first, i thought > i've found a typo but as i tried that > myself, it turns it actually does work so. > > a = ["alpha", "beta", "gamma"] > del a[2:2] > a > > Now, i expected the result to be that the

Re: Surprised by the command "del"

2008-03-01 Thread castironpi
On Mar 1, 2:05 pm, "K Viltersten" <[EMAIL PROTECTED]> wrote: > I'm reading the docs and at 5.2 the del > statement is discussed. At first, i thought > i've found a typo but as i tried that > myself, it turns it actually does work so. > >   a = ["alpha", "beta", "gamma"] >   del a[2:2] >   a > > Now

Surprised by the command "del"

2008-03-01 Thread K Viltersten
I'm reading the docs and at 5.2 the del statement is discussed. At first, i thought i've found a typo but as i tried that myself, it turns it actually does work so. a = ["alpha", "beta", "gamma"] del a[2:2] a Now, i expected the result to be that the "beta" element has been removed. Obviou

Re: pySQLite Insert speed

2008-03-01 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: > I hav read on this forum that SQL coding (A) below is preferred over > (B), but I find (B) is much faster (20-40% faster) > > (A) > > sqla= 'INSERT INTO DTABLE1 VALUES (%d, %d, %d, %f)' % values > curs.execute(sqla) > > (B) > pf= '?, ?, ?, ?' > sql

Re: why not bisect options?

2008-03-01 Thread Paul Rubin
Raymond Hettinger <[EMAIL PROTECTED]> writes: > The sort() function guarantees that it calls the key function exactly > once for each member of the list. That is a time-space tradeoff though, and it presupposes that it's possible to write a key function. Depending on the objects involved, it cou

Re: How about adding rational fraction to Python?

2008-03-01 Thread Paul Rubin
Lie <[EMAIL PROTECTED]> writes: > I see, but the same arguments still holds true: the second line have > an implicit side-effect of redefining x's type into Fractional type. > If I were the designer of the language, I'd leave x's type as it is > (as Num) and coerce x for current calculation only.

Re: Import, how to change sys.path on Windows, and module naming?

2008-03-01 Thread Steve Holden
Jeremy Nicoll - news posts wrote: > Jeremy Nicoll - news posts <[EMAIL PROTECTED]> wrote: > >> If I understand correctly, when I import something under Windows, Python >> searches the directory that the executing script was loaded from, then >> other directories as specified in "sys.path". > > So

RELEASED Python 2.6a1 and 3.0a3

2008-03-01 Thread Barry Warsaw
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On behalf of the Python development team and the Python community, I'm happy to announce the first alpha release of Python 2.6, and the third alpha release of Python 3.0. Python 2.6 is not only the next advancement in the Python 2 series, it is

Re: Import, how to change sys.path on Windows, and module naming?

2008-03-01 Thread Jeremy Nicoll - news posts
Jeremy Nicoll - news posts <[EMAIL PROTECTED]> wrote: > If I understand correctly, when I import something under Windows, Python > searches the directory that the executing script was loaded from, then > other directories as specified in "sys.path". Sorry to followup my own question, but I ran

Re: How about adding rational fraction to Python?

2008-03-01 Thread Anand Patil
Not sure if this is common knowledge yet but Sympy, http://code.google.com/p/sympy, has a rational type. In [2]: from sympy import * In [3]: Rational(21,4) Out[3]: 21/4 In [4]: Rational(21,4)+Rational(3,4) Out[4]: 6 -- http://mail.python.org/mailman/listinfo/python-list

Re: Import, how to change sys.path on Windows, and module naming?

2008-03-01 Thread Steve Holden
Jeremy Nicoll - news posts wrote: > If I understand correctly, when I import something under Windows, Python > searches the directory that the executing script was loaded from, then other > directories as specified in "sys.path". > Technically, I believe it just puts the script's directory at the

Re: Beginner's assignment question

2008-03-01 Thread castironpi
On Mar 1, 10:07 am, Lorenzo Gatti <[EMAIL PROTECTED]> wrote: > On Mar 1, 3:39 pm, Schizoid Man <[EMAIL PROTECTED]> wrote: > > > As in variable assignment, not homework assignment! :) > > > I understand the first line but not the second of the following code: > > > a, b = 0, 1 > > a, b = b, a + b >

Re: Pb with 2.5.2 & PyScripter

2008-03-01 Thread Ricardo Aráoz
Méta-MCI (MVP) wrote: > Re! > > An exemple. With this script: > a=123 > b=456 > d=a+b+c > (note than 'c' is not defined). > > When I run, inside Pyscripter, the error-dialog is showed, and, one > second after, PyScripter is closed. > This problem is present since Python 2.5.2. > >

Re: SQLLITE

2008-03-01 Thread castironpi
On Mar 1, 11:54 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > nexes schrieb: > > > Hello All, > >    I am having a minor problem when I try and do this: > >       c.execute("insert into [tblTranscripts] (MovieID,Transcript) > > Values(" + movieID + ",'" + formatText + "');")   (don't even bot

Re: SQLLITE

2008-03-01 Thread Diez B. Roggisch
nexes schrieb: > Hello All, >I am having a minor problem when I try and do this: > c.execute("insert into [tblTranscripts] (MovieID,Transcript) > Values(" + movieID + ",'" + formatText + "');") (don't even bother > commenting of the sql style I know its bad form but this is a simple > s

Re: tcp functions

2008-03-01 Thread Diez B. Roggisch
Gif schrieb: > is there a module for tcp functions or any other quick way to connect, > listen, send and recieve from tcp? > thanks in advance Reading the docs helps - hint: module "socket". Diez -- http://mail.python.org/mailman/listinfo/python-list

Re: pySQLite Insert speed

2008-03-01 Thread Steve Holden
[EMAIL PROTECTED] wrote: > Steve, I want to make sure I understand. My test code is below, where > ph serves as a placeholder. I am preparing for a case where the number > of ? will be driven by the length of the insert record (dx) > > dtable= 'DTABLE3' > print 'Insert data into table %s, versio

tcp functions

2008-03-01 Thread Gif
is there a module for tcp functions or any other quick way to connect, listen, send and recieve from tcp? thanks in advance -- http://mail.python.org/mailman/listinfo/python-list

Import, how to change sys.path on Windows, and module naming?

2008-03-01 Thread Jeremy Nicoll - news posts
If I understand correctly, when I import something under Windows, Python searches the directory that the executing script was loaded from, then other directories as specified in "sys.path". I assume there are standard locations inside my installed Python - in my case inside: C:\Program Files\~P-f

Re: Pb with 2.5.2 & PyScripter

2008-03-01 Thread M�ta-MCI (MVP)
Re! An exemple. With this script: a=123 b=456 d=a+b+c (note than 'c' is not defined). When I run, inside Pyscripter, the error-dialog is showed, and, one second after, PyScripter is closed. This problem is present since Python 2.5.2. I search, for know if it's a problem only on my c

Re: at-exit-thread

2008-03-01 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: > On Feb 29, 1:55 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: >> [EMAIL PROTECTED] schrieb: >> >>> The Python main interpreter has an at-exit list of callables, which >>> are called when the interpreter exits. Can threads have one? What's >>> involved, or is the b

Re: How about adding rational fraction to Python?

2008-03-01 Thread Lie
On Mar 1, 11:23 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: (snip) > But the type of `x` must be specialized somehow.  `x` doesn't start as > `Int` or `Integer` but the very generic and AFAIK abstract type class `Num`. > > After seeing the second line the compiler finds an implementatio

SQLLITE

2008-03-01 Thread nexes
Hello All, I am having a minor problem when I try and do this: c.execute("insert into [tblTranscripts] (MovieID,Transcript) Values(" + movieID + ",'" + formatText + "');") (don't even bother commenting of the sql style I know its bad form but this is a simple script). Whenever I try and

Re: How about adding rational fraction to Python?

2008-03-01 Thread Marc 'BlackJack' Rintsch
On Fri, 29 Feb 2008 17:29:32 -0800, Lie wrote: > On Feb 28, 10:00 am, Paul Rubin wrote: >> More examples: >> >>x = 1 >>y = len(s) + x >> >> => ok, decides that x is an int >> >>x = 1 >>y = x + 3.0 >> >> => ok, decides that x is a float >> >>x = 1 >>

Re: Beginner's assignment question

2008-03-01 Thread Lorenzo Gatti
On Mar 1, 3:39 pm, Schizoid Man <[EMAIL PROTECTED]> wrote: > As in variable assignment, not homework assignment! :) > > I understand the first line but not the second of the following code: > > a, b = 0, 1 > a, b = b, a + b > > In the first line a is assigned 0 and b is assigned 1 simultaneously. >

Re: Beginner's assignment question

2008-03-01 Thread Colin J. Williams
Schizoid Man wrote: > As in variable assignment, not homework assignment! :) > > I understand the first line but not the second of the following code: > > a, b = 0, 1 > a, b = b, a + b > > In the first line a is assigned 0 and b is assigned 1 simultaneously. > > However what is the sequence of

Re: Pb with 2.5.2 & PyScripter

2008-03-01 Thread Colin J. Williams
Méta-MCI (MVP) wrote: > Hi, all! > > Since the install of Python 2.5.2, Pyscripter (1.9.9.1) close for each > error. > Is it only me? Or another guys have the same thing? > > @-salutations > > Michel Claveau > > > > Could you be more explicit please? I use PyScripter and do not have this

Re: pySQLite Insert speed

2008-03-01 Thread mdboldin
Steve, I want to make sure I understand. My test code is below, where ph serves as a placeholder. I am preparing for a case where the number of ? will be driven by the length of the insert record (dx) dtable= 'DTABLE3' print 'Insert data into table %s, version #3' % dtable ph= '?, ?, ?, ?' sqlx=

Beginner's assignment question

2008-03-01 Thread Schizoid Man
As in variable assignment, not homework assignment! :) I understand the first line but not the second of the following code: a, b = 0, 1 a, b = b, a + b In the first line a is assigned 0 and b is assigned 1 simultaneously. However what is the sequence of operation in the second statement? I;m

Problems building 2.5.1 on AIX

2008-03-01 Thread Roy Smith
I've got an AIX-5.2 box that I'm trying to build Python 2.5.1 on. Configure dies pretty much immediately: hasty:Python-2.5.1$ CC=/usr/vacpp/bin/cc_r ./configure --without-gcc checking MACHDEP... aix5 checking EXTRAPLATDIR... checking for --without-gcc... yes checking for gcc... cc checking for

UponAcquiring synchro. class

2008-03-01 Thread castironpi
from __future__ import with_statement ''' 3) upon_acquiring( lockA, lockB )( function, *ar, **kwar ) upon_acquiring spawns new thread upon acquiring locks A and B. Locks may be specified in any order, as none is acquired until all are free. The options to spawn a new thread upon call, lock, and

Re: joining strings question

2008-03-01 Thread patrick . waldo
>def category_iterator(source): > source = iter(source) > try: >while True: > item = source.next() This gave me a lot of inspiration. After a couple of days of banging my head against the wall, I finally figured out a code that could attach headers, titles, numbers,

Re: why not bisect options?

2008-03-01 Thread rbossy
Selon Raymond Hettinger <[EMAIL PROTECTED]>: > [Robert Bossy] > > I thought it would be useful if insort and consorts* could accept the > > same options than list.sort, especially key and cmp. > > If you're going to do many insertions or searches, wouldn't it be > *much* more efficient to store yo

Re: invert or not ?

2008-03-01 Thread Steve Holden
Stef Mientki wrote: > hello, > > from the manual I read that a bitwise inversion should be done by invert. > But from some experiments I see that not works equally well. > Is this coincidence ? > > (The disadvantage of invert is that I've to import operators) > Bitwise inversion is performed by

ANN: eric 4.1.1 released

2008-03-01 Thread Detlev Offenbach
Hi, eric4 4.1.1 has been released today. This release fixes a few bugs reported since the last release. As usual it is available via http://www.die-offenbachs.de/eric/index.html. Please note, that the first stable release of the Rope refactoring plugin was released as well. What is eric?

SV: SV: Running test01.py under Windows (basic level)

2008-03-01 Thread K Viltersten
def bloppA (): print "a very advanced piece of code" >>> >>> go to File -> Open, open your saved file, >>> and use the Run menu (or press F5). >> >> When i try that i get this. >> > == RESTART === > >> >> And nothing more. Do i use wrong "print"?! > > You *defined* a

SV: SV: Running test01.py under Windows (basic level)

2008-03-01 Thread K Viltersten
>> There will be poking around with %PATH%, i can >> tell. Never liked to do that under Windows. > > No need to do that... Create an "alias.txt" file containing: > python=c:\path\to\your\python.exe $* > Execute (once, logged as administrator): > reg add "HKLM\SOFTWARE\Microsoft\Command Processor"

Re: Getting a free TCP port & blocking it

2008-03-01 Thread theneb
On Feb 29, 11:11 pm, Tim Roberts <[EMAIL PROTECTED]> wrote: > theneb <[EMAIL PROTECTED]> wrote: > >Hi all, > >I'm attempting to block a TCP port from any other application from > >using it until I free it from python, this is so that: > >1). Generate a random free user-space port > >2). Generate th

  1   2   >