Re: mod_python Unable to create file

2008-03-02 Thread kaush
On Mar 1, 11:24 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > 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 fo

FW: Escaping a triple quoted string' newbie question

2008-03-02 Thread Jules Stevenson
Hello, Apologies if the terminology in this email is a little incorrect, I'm still finding my feet. I'm using python to generate some script for another language (MEL, in maya, specifically expressions). Maya runs python too, but unfortunately its expression language still has to use the maya sy

Re: sqlite3 adaptors mystery

2008-03-02 Thread Matej Cepl
On 2008-03-01, 23:41 GMT, Mel wrote: > There's nothing much wrong. cur.fetchall is returning a list > of all the selected rows, and each row is a tuple of fields. > Each tuple is being converted for display by repr, so the > strings are shown as unicode, which is what they are > internally.

Re: Telnet versus telnetlib

2008-03-02 Thread Gabriel Genellina
En Sun, 02 Mar 2008 02:09:14 -0200, Grant Edwards <[EMAIL PROTECTED]> escribi�: > 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 o

Re: RELEASED Python 2.6a1 and 3.0a3

2008-03-02 Thread Kay Schluehr
On 2 Mrz., 06:53, Ben Finney <[EMAIL PROTECTED]> wrote: > One of the stated goals of the migration is that the '2to3' program > will only migrate Python 2.6 code -> Python 3.0 code. Yes, I know. Why? "The master said so" isn't an entirely satisfying answer. What are the *technical reasons* that

Re: sqlite3 adaptors mystery

2008-03-02 Thread Matej Cepl
On 2008-03-02, 08:16 GMT, Matej Cepl wrote: > Thanks for your help, but plain-text strings is not what > I wanted. The boolean variables was what I was after. See this > modified version of the script: OK, I got it -- I was missing detect_types parameter of the connect method. Matěj -- http:/

Re: Python Telnet formatting?

2008-03-02 Thread Gabriel Genellina
En Sat, 01 Mar 2008 22:51:08 -0200, <[EMAIL PROTECTED]> escribi�: > 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

Re: class object interface document

2008-03-02 Thread Gabriel Genellina
En Sun, 02 Mar 2008 00:55:23 -0200, Neil.Fang.CN <[EMAIL PROTECTED]> escribió: > Where can I find the Python class object interface document, such as > struct PyClassObject, PyClass_New()? Thanks! PyClass_* and PyInstance_* are for old-style classes and instances respectively, and will disapp

RE: Escaping a triple quoted string' newbie question

2008-03-02 Thread Jules Stevenson
Sorry, original post got a bit mangled, which didn't help the explanation at all, reposted stuff: Apologies if the terminology in this email is a little incorrect, I'm still finding my feet. I'm using python to generate some script for another language (MEL, in maya, specifically expressions). Ma

Re: Beginner's assignment question

2008-03-02 Thread Schizoid Man
Lorenzo Gatti 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 >> >> In the first line a is assigned 0 and b

Re: Beginner's assignment question

2008-03-02 Thread Gabriel Genellina
En Sun, 02 Mar 2008 08:25:49 -0200, Schizoid Man <[EMAIL PROTECTED]> escribi�: > Lorenzo Gatti 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 cod

Re: RELEASED Python 2.6a1 and 3.0a3

2008-03-02 Thread Carl Banks
On Mar 2, 4:02 am, Kay Schluehr <[EMAIL PROTECTED]> wrote: > On 2 Mrz., 06:53, Ben Finney <[EMAIL PROTECTED]> > wrote: > > > One of the stated goals of the migration is that the '2to3' program > > will only migrate Python 2.6 code -> Python 3.0 code. > > Yes, I know. Why? > > "The master said so" i

Re: Escaping a triple quoted string' newbie question

2008-03-02 Thread Gabriel Genellina
En Sun, 02 Mar 2008 08:33:51 -0200, Jules Stevenson <[EMAIL PROTECTED]> escribi�: > Sorry, original post got a bit mangled, which didn't help the > explanation at > all, reposted stuff: > > Apologies if the terminology in this email is a little incorrect, I'm > still > finding my feet. > > I

Re: FW: Escaping a triple quoted string' newbie question

2008-03-02 Thread Duncan Booth
"Jules Stevenson" <[EMAIL PROTECTED]> wrote: > Hello, > > Apologies if the terminology in this email is a little incorrect, I'm > still finding my feet. > > I'm using python to generate some script for another language (MEL, in > maya, specifically expressions). Maya runs python too, but > unfo

Re: Beginner's assignment question

2008-03-02 Thread castironpi
On Mar 2, 4:49 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Sun, 02 Mar 2008 08:25:49 -0200, Schizoid Man <[EMAIL PROTECTED]> escribi�: > > > > > > > Lorenzo Gatti wrote: > >> On Mar 1, 3:39 pm, Schizoid Man <[EMAIL PROTECTED]> wrote: > >>> As in variable assignment, not homework assignm

Re: Question about lambda and variable bindings

2008-03-02 Thread Duncan Booth
Michael Torrie <[EMAIL PROTECTED]> wrote: > 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

Re: Book Recomendations

2008-03-02 Thread David Cook
On 2008-03-02, Jeff Schwab <[EMAIL PROTECTED]> wrote: > Python In A Nutshell: > http://www.oreilly.com/catalog/pythonian2/ Another vote for the Nutshell book, which I find a very useful and practical book. I never found the "Dive in" book useful. Dave Cook -- http://mail.python.org/mailman/l

Re: Python app at startup!

2008-03-02 Thread SMALLp
Program: import os import wx app = wx.App() frame = wx.Frame(None, -1, "MyFrame") frame.Show() app.MainLoop() python.exe setup.py py2exe from distutils.core import setup import py2exe setup(windows=['prog.py']) <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Feb 29, 7:21

Re: sqlite3 adaptors mystery

2008-03-02 Thread Mel
Matej Cepl wrote: > Thanks for your help, but plain-text strings is not what > I wanted. The boolean variables was what I was after. See this > modified version of the script: > > #!/usr/bin/python > import sqlite3 > def adapt_boolean(bol): > if bol: > return "True" > else

Re: Python Telnet formatting?

2008-03-02 Thread Bjoern Schliessmann
Gabriel Genellina wrote: > They are part of the telnet protocol; 0xFF (IAC=Interpret as > Command) starts a two or three byte command sequence. > Weren't you using telnetlib? It's supposed to handle this > transparently. With Twisted you don't need Telnetlib, twisted.conch.telnet does the job. I

Re: How about adding rational fraction to Python?

2008-03-02 Thread Lie
On Mar 2, 2:02 pm, Paul Rubin wrote: > 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'

tcp

2008-03-02 Thread Gif
i have this small script which after some router configurations works. ## #! /usr/bin/python import socket HOST = '' PORT = 1515 s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.bind((HOST, PORT)) s.listen(1) conn, addr = s.accept()

Re: tcp

2008-03-02 Thread 7stud
On Mar 2, 6:09 am, Gif <[EMAIL PROTECTED]> wrote: > i have this small script which after some router configurations works. > > ## > > #! /usr/bin/python > import socket > > HOST = '' > PORT = 1515 > s = socket.socket(socket.AF_INET, socket.SOC

Sparta api

2008-03-02 Thread Noorhan Abbas
Hello, I wonder if anybody has used the sparta api for linking RDF to Python. I was trying to run the example supplied by sparta and I got this error message Traceback (most recent call last): File "C:/Python25/TestSpartaApi.py", line 10, in store = Graph() File "C:\Python25\lib\rdflib\Gr

Can one get "for x in y" to work for non builtin classes?

2008-03-02 Thread Preben Randhol
Hi I'm making a kind of ordered dictionary class. It is not exactly a dictionary, but it uses a list and dictionary to store the data. Something like: class dbase(list): '''Database class keeping track of the order and data''' def __init__(self): self.__

Re: Can one get "for x in y" to work for non builtin classes?

2008-03-02 Thread Preben Randhol
On Sun, 2 Mar 2008 15:06:17 +0100 Preben Randhol <[EMAIL PROTECTED]> wrote: > class dbase(list): Sorry the definition of the class is: class dbase(object): it doesn't derive from the list class. Preben -- http://mail.python.org/mailman/listinfo/python-list

Python newbie

2008-03-02 Thread t3chn0n3rd
i am a python newbie. My studies have me in many directions -- http://mail.python.org/mailman/listinfo/python-list

Re: First post from a Python newbiw

2008-03-02 Thread Steve Turner
Marc 'BlackJack' Rintsch wrote: : On Sun, 02 Mar 2008 14:15:09 +, Steve Turner wrote: : :: Apart from doing something like :: a=[0,0,0] :: b=[0,0,0] :: c=[0,0,0] :: d=[a,b,c] :: :: is there a better way of creating d?? : : a = [[0] * 3 for dummy in xrange(3)] Thanks, Marc. -- Steve --

Re: tcp

2008-03-02 Thread Gif
you could at least check before posting. as i said i've tried like 1000 ways of doing that, and im so desparate that i'm thinking of quiting python. This damn thing just doesnt work. when i do as you post the server never even replies, as it tends to accept connections all the time. anyone has a b

Re: Where's GUI for Python?

2008-03-02 Thread Peter Decker
On Sat, Mar 1, 2008 at 10:04 PM, Bill <[EMAIL PROTECTED]> wrote: > You should also take a look at wxGlade: > > http://wxglade.sourceforge.net/ > > which sits on top of wxPython: > > http://wxpython.org/ > > which wraps wxWidgets: > > http://www.wxwindows.org/ I have used wxGlade

First post from a Python newbiw

2008-03-02 Thread Steve Turner
I finally decided to have a go with Python and am working through the tutorial. On my old BBC Computer I could do something like this: DIM A(2,2) to create a 3 by 3 array of data. Then I could set any point: A(0,0) = foo A(0,1) = bar etc. In Python I thought I could do this with: >>> a=[0,0,

Hyphenation: PyHyphen 0.4.1 and textwrap2-0.1.1 released

2008-03-02 Thread Dr. leo
This latest version of PyHyphen is only important for Python 2.4 addicts who encountered a missing type when compiling. Further, a few signed/unsigned mismatch warnings coming from MSVC should be fixed. As I have only Python 2.5, I'd be interested in any experiences when compiling it with Python 2.

Re: Book Recomendations

2008-03-02 Thread Tommy Nordgren
On 2 mar 2008, at 01.56, 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

Keeping the console window

2008-03-02 Thread K Viltersten
I've proudly connected Notepad++ to edit and run my fantastic software. When that started to work, i noticed that all the printing disappears as the console window vanishes upon the program completion. How can i trick Python program to keep on running even if the actual statements have been exect

Re: First post from a Python newbiw

2008-03-02 Thread Marc 'BlackJack' Rintsch
On Sun, 02 Mar 2008 14:15:09 +, Steve Turner wrote: > Apart from doing something like > a=[0,0,0] > b=[0,0,0] > c=[0,0,0] > d=[a,b,c] > > is there a better way of creating d?? a = [[0] * 3 for dummy in xrange(3)] Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/list

Re: Can one get "for x in y" to work for non builtin classes?

2008-03-02 Thread Giles Brown
On Mar 2, 2:08 pm, Preben Randhol wrote: > On Sun, 2 Mar 2008 15:06:17 +0100 > > Preben Randhol <[EMAIL PROTECTED]> wrote: > >class dbase(list): > > Sorry the definition of the class is: > > class dbase(object): > > it doesn't derive from the list class. > > Preben http://docs.python.

Re: tcp

2008-03-02 Thread Steve Holden
7stud wrote: > On Mar 2, 6:09 am, Gif <[EMAIL PROTECTED]> wrote: >> i have this small script which after some router configurations works. >> >> ## >> >> #! /usr/bin/python >> import socket >> >> HOST = '' >> PORT = 1515 >> s = socket.socket(s

Python-based regular expression parser that allows patterns to call functions?

2008-03-02 Thread Andrew Warkentin
I am writing a filtering HTTP proxy (the site is http://xuproxy.sourceforge.net/). I want it to be compatible with Proxomitron (http://proxomitron.info/) filters. I need a regular expression parser that allows patterns to call functions (or more likely, class methods), to implement "matching co

Re: tcp

2008-03-02 Thread Diez B. Roggisch
Gif schrieb: > you could at least check before posting. as i said i've tried like > 1000 ways of doing that, and im so desparate that i'm thinking of > quiting python. This damn thing just doesnt work. when i do as you > post the server never even replies, as it tends to accept connections > all th

Re: tcp

2008-03-02 Thread Gif
sorry for acting like a fool but this is just to weirdly easy that i can't get to work. i've written a small web server in another language and this is more like copying code. i already have everything figured out, except this one but noone seems either willing or capable of helping me. again sorry

Re: How about adding rational fraction to Python?

2008-03-02 Thread Paul Rubin
Lie <[EMAIL PROTECTED]> writes: > That's quite complex and restrictive, but probably it's because my > mind is not tuned to Haskell yet. That aspect is pretty straightforward, other parts like only being able to do i/o in functions having a special type are much more confusing. > Anyway, I don't

Re: tcp

2008-03-02 Thread Gif
i would like to apologize once more. i understand that you are saying "what a fool he is waiting for us to solve all his problems", cause i've said that for other posts, when they seemed "immature". It's just that i couldn't find a way out of 20 lines of code and this drove me mad. i end this topi

Re: tcp

2008-03-02 Thread Grant Edwards
On 2008-03-02, Gif <[EMAIL PROTECTED]> wrote: > sorry for acting like a fool but this is just to weirdly easy > that i can't get to work. i've written a small web server in > another language and this is more like copying code. i already > have everything figured out, except this one but noone see

Re: Python Telnet formatting?

2008-03-02 Thread Grant Edwards
On 2008-03-02, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > 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. And we told you that you needed to implement the telnet protocol. > The

Re: Python's BNF

2008-03-02 Thread MartinRinehart
Gabriel Genellina wrote: > About the generated page: I think it would be more useful if each symbol > links to its definition, instead of showing an alert(). This way it's > easier to navigate the tree, specially with complex declarations. That was my first shot. It didn't work. (Every line is it

Network server- / client-side messaging

2008-03-02 Thread castironpi
''' a website wants to show you different arrangements of framed pictures on a wall. you can click, drag, scale, and rotate pictures in place. you can also drag new pictures in to it. spacing is uniform and settable-- if you rotate one, the readout of the total square area changes along with the

Re: Book Recomendations

2008-03-02 Thread Ken Dere
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 li

Re: Keeping the console window

2008-03-02 Thread Sam
You may use python in interactive mode: $ python -i yourScript.py Or use a blocking readline: $ cat yourScript.py import sys sys.stdin.readline() ++ Sam -- http://mail.python.org/mailman/listinfo/python-list

Re: tcp

2008-03-02 Thread Diez B. Roggisch
Gif schrieb: > sorry for acting like a fool but this is just to weirdly easy that i > can't get to work. i've written a small web server in another language > and this is more like copying code. > i already have everything figured out, except this one but noone seems > either willing or capable of

Re: Can one get "for x in y" to work for non builtin classes?

2008-03-02 Thread castironpi
On Mar 2, 8:15 am, Giles Brown <[EMAIL PROTECTED]> wrote: > On Mar 2, 2:08 pm, Preben Randhol > [EMAIL PROTECTED]> wrote: > > On Sun, 2 Mar 2008 15:06:17 +0100 > > > Preben Randhol <[EMAIL PROTECTED]> wrote: > > >    class dbase(list): > > > Sorry the definition of the class is: > > >         clas

Question on importing and function defs

2008-03-02 Thread TC
I have a problem. Here's a simplified version of what I'm doing: I have functions a() and b() in a module called 'mod'. b() calls a(). So now, I have this program: from mod import * def a(): blahblah b() The problem being, b() is calling the a() that's in mod, not the new a() that I wa

Beautiful Code in Python?

2008-03-02 Thread js
Hi, Have you ever seen Beautiful Python code? Zope? Django? Python standard lib? or else? Please tell me what code you think it's stunning. -- http://mail.python.org/mailman/listinfo/python-list

Re: Keeping the console window

2008-03-02 Thread castironpi
On Mar 2, 9:55 am, Sam <[EMAIL PROTECTED]> wrote: > You may use python in interactive mode: > > $ python -i yourScript.py > > Or use a blocking readline: > > $ cat yourScript.py > import sys > sys.stdin.readline() > > ++ > > Sam FWIW, for what it's worth, you can invoke the interpreter from a batc

Re: Book Recomendations

2008-03-02 Thread James Matthews
I liked Core Python Programming 2nd edition! On Sun, Mar 2, 2008 at 4:27 PM, Ken Dere <[EMAIL PROTECTED]> wrote: > 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

Re: Python-based regular expression parser that allows patterns to call functions?

2008-03-02 Thread castironpi
On Mar 2, 8:41 am, Andrew Warkentin <[EMAIL PROTECTED]> wrote: > I am writing a filtering HTTP proxy (the site > ishttp://xuproxy.sourceforge.net/). I want it to be compatible with > Proxomitron (http://proxomitron.info/) filters. I need a regular > expression parser that allows patterns to call f

SV: Where's GUI for Python?

2008-03-02 Thread K Viltersten
>> You should also take a look at wxGlade: >> >> http://wxglade.sourceforge.net/ >> >> which sits on top of wxPython: >> >> http://wxpython.org/ >> >> which wraps wxWidgets: >> >> http://www.wxwindows.org/ > > I have used wxGlade, and while it worked well > enough, it didn't see

Re: Question on importing and function defs

2008-03-02 Thread Gary Herron
TC wrote: > I have a problem. Here's a simplified version of what I'm doing: > > I have functions a() and b() in a module called 'mod'. b() calls a(). > > So now, I have this program: > > from mod import * > > def a(): > blahblah > > b() > > > The problem being, b() is calling the a() that's

Re: Beautiful Code in Python?

2008-03-02 Thread Michele Simionato
On Mar 2, 5:23 pm, js <[EMAIL PROTECTED]> wrote: > Hi, > > Have you ever seen Beautiful Python code? > Zope? Django? Python standard lib? or else? > > Please tell me what code you think it's stunning. The doctest module in the standard library. M.S. -- http://mail.python.org/mailman/listinfo/py

Problem with the strip string method

2008-03-02 Thread Colin J. Williams
The Library Reference has strip( [chars]) Return a copy of the string with the leading and trailing characters removed. The chars argument is a string specifying the set of characters to be removed. If omitted or None, the chars argument defaults to removing whitespace. The chars argument is

Re: How about adding rational fraction to Python?

2008-03-02 Thread Paul Rubin
Lie <[EMAIL PROTECTED]> writes: > You hit the right note, but what I meant is the numeric type > unification would make it _appear_ to consist of a single numeric type > (yeah, I know it isn't actually, but what appears from outside isn't > always what's inside). That is clearly not intended; floa

Re: Can one get "for x in y" to work for non builtin classes?

2008-03-02 Thread Preben Randhol
On Sun, 2 Mar 2008 08:09:24 -0800 (PST) [EMAIL PROTECTED] wrote: > On Mar 2, 8:15 am, Giles Brown <[EMAIL PROTECTED]> wrote: > > http://docs.python.org/lib/typeiter.html > > Be careful on your descision to return an ordered iterator or not-- > that is, whether it iterates over the dictionary or

Re: How about adding rational fraction to Python?

2008-03-02 Thread Lie
On Mar 2, 10:02 pm, Paul Rubin wrote: > Lie <[EMAIL PROTECTED]> writes: > > Anyway, I don't think Python should > > work that way, because Python have a plan for numerical integration > > which would unify all numerical types into an apparent single type, > > which requir

Re: Question on importing and function defs

2008-03-02 Thread Nick Miller
TC wrote: > I have a problem. Here's a simplified version of what I'm doing: > > I have functions a() and b() in a module called 'mod'. b() calls a(). > > So now, I have this program: > > from mod import * > > def a(): > blahblah > > b() > > > The problem being, b() is calling the a() that's

SV: Keeping the console window

2008-03-02 Thread K Viltersten
> You may use python in interactive mode: > > $ python -i yourScript.py > > Or use a blocking readline: > > $ cat yourScript.py > import sys > sys.stdin.readline() Thanks guys! -- Regards Konrad Viltersten sleep- a substitute for coffee for the poor ambiti

Re: Problem with the strip string method

2008-03-02 Thread Jorge Godoy
Colin J. Williams wrote: > Return a copy of the string with the > leading and trailing characters removed. > Only the last two examples below behave > as expected. They all looks OK to me. > [Dbg]>>> 'ab$%\n\rcd'.strip('%') > 'ab$%\n\rcd' No "%" at the beginning or end o

Re: Problem with the strip string method

2008-03-02 Thread Martin Blume
"Colin J. Williams" schrieb > The Library Reference has > strip( [chars]) > > Return a copy of the string with the > leading and trailing characters removed. It's "leading and trailing", not "leading, trailing or embedded". >>> "xxxaaaxxx".strip("x") 'aaa' >>> "xxxaaax

Re: Article of interest: Python pros/cons for the enterprise

2008-03-02 Thread Paul Rubin
Robert Brown <[EMAIL PROTECTED]> writes: > Unfortunately, performance often comes at the cost of safety and > correctness. Optimized C programs can crash when pointers walk off the > end of arrays or they can yield incorrect results when integers overflow > the limits of the hardware. Yes, even u

Re: Python-based regular expression parser that allows patterns to call functions?

2008-03-02 Thread Paul McGuire
On Mar 2, 8:41 am, Andrew Warkentin <[EMAIL PROTECTED]> wrote: > I am writing a filtering HTTP proxy (the site > ishttp://xuproxy.sourceforge.net/). I want it to be compatible with > Proxomitron (http://proxomitron.info/) filters. I need a regular > expression parser that allows patterns to call f

Re: Question on importing and function defs

2008-03-02 Thread TC
On Mar 2, 11:37 am, Gary Herron <[EMAIL PROTECTED]> wrote: > TC wrote: > > I have a problem. Here's a simplified version of what I'm doing: > > > I have functions a() and b() in a module called 'mod'. b() calls a(). > > > So now, I have this program: > > > from mod import * > > > def a(): > >

Re: Question on importing and function defs

2008-03-02 Thread Steve Holden
TC wrote: > On Mar 2, 11:37 am, Gary Herron <[EMAIL PROTECTED]> wrote: >> TC wrote: >>> I have a problem. Here's a simplified version of what I'm doing: >>> I have functions a() and b() in a module called 'mod'. b() calls a(). >>> So now, I have this program: >>> from mod import * >>> def a(): >>

Re: Can one get "for x in y" to work for non builtin classes?

2008-03-02 Thread Preben Randhol
On Sun, 2 Mar 2008 06:15:54 -0800 (PST) Giles Brown <[EMAIL PROTECTED]> wrote: > http://docs.python.org/lib/typeiter.html Thanks! -- http://mail.python.org/mailman/listinfo/python-list

Re: tcp

2008-03-02 Thread Steve Holden
Gif wrote: > i would like to apologize once more. i understand that you are saying > "what a fool he is waiting for us to solve all his problems", cause > i've said that for other posts, when they seemed "immature". It's just > that i couldn't find a way out of 20 lines of code and this drove me >

Re: Problem with the strip string method

2008-03-02 Thread Steve Holden
Colin J. Williams wrote: > The Library Reference has > strip( [chars]) > > Return a copy of the string with the > leading and trailing characters removed. > The chars argument is a string > specifying the set of characters to be > removed. If omitted or None, the chars > argument defaults to

Re: Beautiful Code in Python?

2008-03-02 Thread John DeRosa
On Mon, 3 Mar 2008 01:23:32 +0900, js <[EMAIL PROTECTED]> wrote: >Hi, > >Have you ever seen Beautiful Python code? >Zope? Django? Python standard lib? or else? > >Please tell me what code you think it's stunning. Just about any Python code I look at. -- http://mail.python.org/mailman/listinfo/py

Re: tuples, index method, Python's design

2008-03-02 Thread Alan Isaac
On April 12th, 2007 at 10:05 PM Alan Isaac wrote: > The avoidance of tuples, so carefully defended in other > terms, is often rooted (I claim) in habits formed from > need for list methods like ``index`` and ``count``. > Indeed, I predict that Python tuples will eventually have > these met

Re: Question on importing and function defs

2008-03-02 Thread castironpi
On Mar 2, 11:44 am, Steve Holden <[EMAIL PROTECTED]> wrote: > TC wrote: > > On Mar 2, 11:37 am, Gary Herron <[EMAIL PROTECTED]> wrote: > >> TC wrote: > >>> I have a problem.  Here's a simplified version of what I'm doing: > >>> I have functions a() and b() in a module called 'mod'.  b() calls a().

Re: Problem with the strip string method

2008-03-02 Thread castironpi
On Mar 2, 11:45 am, Steve Holden <[EMAIL PROTECTED]> wrote: > I suspect what you need is the .replace() method. The information's there-- the word 'contiguous' might clear it up a bit. > > Return a copy of the string with the > > leading and trailing characters removed. > > The chars argument is

Re: Beautiful Code in Python?

2008-03-02 Thread castironpi
On Mar 2, 12:01 pm, John DeRosa <[EMAIL PROTECTED]> wrote: > On Mon, 3 Mar 2008 01:23:32 +0900, js <[EMAIL PROTECTED]> wrote: > >Hi, > > >Have you ever seen Beautiful Python code? > >Zope? Django? Python standard lib? or else? > > >Please tell me what code you think it's stunning. > > Just about an

Re: mod_python Unable to create file

2008-03-02 Thread Sean Allen
On Mar 2, 2008, at 3:24 AM, kaush wrote: > On Mar 1, 11:24 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: >> 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 = op

Re: Problem with the strip string method

2008-03-02 Thread Colin J. Williams
[EMAIL PROTECTED] wrote: > On Mar 2, 11:45 am, Steve Holden <[EMAIL PROTECTED]> wrote: >> I suspect what you need is the .replace() method. > > The information's there-- the word 'contiguous' might clear it up a > bit. > >>> Return a copy of the string with the >>> leading and trailing characters

RE: Escaping a triple quoted string' newbie question

2008-03-02 Thread Jules Stevenson
> > float $pos[]=particleShape1.worldPosition; > > > > setAttr ("heartPP_1_"+particleShape1.particleId+".tx") $pos[0]; > > > > setAttr ("heartPP_1_"+particleShape1.particleId+".ty") $pos[1]; > > > > setAttr ("heartPP_1_"+particleShape1.particleId+".tz") $pos[2]; > > """ > > dynExpression (p, s=expR

Re: tcp

2008-03-02 Thread castironpi
On Mar 2, 11:38 am, Steve Holden <[EMAIL PROTECTED]> wrote: > Nobody thinks you are a fool for wanting help with your problems, it's > simply that you have to provide enough information about what' wring for > us to get a handle on the issues. This worked: import socket from time import time for

Re: Beginner's assignment question

2008-03-02 Thread Schizoid Man
Gabriel Genellina wrote: > En Sun, 02 Mar 2008 08:25:49 -0200, Schizoid Man <[EMAIL PROTECTED]> escribi�: > >> Lorenzo Gatti 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 n

Re: cx_Freeze : LookupError: unknown encoding: ascii

2008-03-02 Thread Rakesh Kumar
On Mar 1, 3:41 pm, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > > 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 Thanks Martin. Addin

Re: How about adding rational fraction to Python?

2008-03-02 Thread Jeff Schwab
Paul Rubin wrote: > I can live with int/int=float but > find it sloppy and would be happier if int/int always threw an error > (convert explicitly if you want a particular type result). Better yet, how hard would it be to define an otherwise int-like type that did not define a non-flooring divisi

Re: tuples, index method, Python's design

2008-03-02 Thread Paul Boddie
On 2 Mar, 19:06, Alan Isaac <[EMAIL PROTECTED]> wrote: > On April 12th, 2007 at 10:05 PM Alan Isaac wrote: > > > The avoidance of tuples, so carefully defended in other > > terms, is often rooted (I claim) in habits formed from > > need for list methods like ``index`` and ``count``. > > Indeed, I p

Re: Network server- / client-side messaging

2008-03-02 Thread castironpi
''' Last time, we left off at: ''' class InterfaceClientSide( ClientSide ): message= MessageDec() incremental= message.incremental() settings= AYT( .5, 3 ) user_act= message.out() def __init__( self, image ): self._image= image

Re: First post from a Python newbiw

2008-03-02 Thread Christoph Zwerschke
Marc 'BlackJack' Rintsch schrieb: > On Sun, 02 Mar 2008 14:15:09 +, Steve Turner wrote: > >> Apart from doing something like >> a=[0,0,0] >> b=[0,0,0] >> c=[0,0,0] >> d=[a,b,c] >> >> is there a better way of creating d?? > > a = [[0] * 3 for dummy in xrange(3)] Why not simply [[0]*3]*3 ? --

[ANN] Python 2.3.7 and 2.4.5, release candidate 1

2008-03-02 Thread Martin v. Löwis
On behalf of the Python development team and the Python community, I'm happy to announce the release candidates of Python 2.4.5 and 2.4.5. Both releases include only security fixes. Python 2.5 is the latest version of Python, we're making this release for people who are still running Python 2.3 or

Re: tuples, index method, Python's design

2008-03-02 Thread Alan Isaac
Paul Boddie wrote: > Here's the tracker item that may have made it happen: > http://bugs.python.org/issue1696444 > I think you need to thank Raymond Hettinger for championing the > cause. ;-) Yes indeed! Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: Altering imported modules

2008-03-02 Thread Tro
On Saturday 01 March 2008, Tro wrote: > 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 cl

Re: tcp

2008-03-02 Thread Gif
thanks everybody, i've got this to work. i'm not trying to write an actual web server, i'm just using it for some procedures like URL rewriting. -- http://mail.python.org/mailman/listinfo/python-list

Re: RELEASED Python 2.6a1 and 3.0a3

2008-03-02 Thread Ben Finney
Kay Schluehr <[EMAIL PROTECTED]> writes: > On 2 Mrz., 06:53, Ben Finney <[EMAIL PROTECTED]> > wrote: > > > One of the stated goals of the migration is that the '2to3' > > program will only migrate Python 2.6 code -> Python 3.0 code. > > Yes, I know. Why? > > "The master said so" isn't an entire

Re: First post from a Python newbiw

2008-03-02 Thread Steve Turner
Christoph Zwerschke wrote: : Marc 'BlackJack' Rintsch schrieb: :: On Sun, 02 Mar 2008 14:15:09 +, Steve Turner wrote: :: ::: Apart from doing something like ::: a=[0,0,0] ::: b=[0,0,0] ::: c=[0,0,0] ::: d=[a,b,c] ::: ::: is there a better way of creating d?? :: :: a = [[0] * 3 for dummy in

Run Python app at startup

2008-03-02 Thread SMALLp
Hy. I create simple application. Yust an windows and "compile" it with py2exe. I add registry value reg add HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /v MyApp /t REG_SZ /d C:\myapp.exe /f' And it wont start. When i use console instead od window in py2exe i get console opend

Re: tuples, index method, Python's design

2008-03-02 Thread Christoph Zwerschke
Paul Boddie schrieb: > On 2 Mar, 19:06, Alan Isaac <[EMAIL PROTECTED]> wrote: >> On April 12th, 2007 at 10:05 PM Alan Isaac wrote: >> >>> The avoidance of tuples, so carefully defended in other >>> terms, is often rooted (I claim) in habits formed from >>> need for list methods like ``index`` and `

sympy: nifty, but... (was: How about adding rational fraction to Python?)

2008-03-02 Thread Mensanator
On Mar 1, 12:29 pm, "Anand Patil" <[EMAIL PROTECTED]> wrote: > Not sure if this is common knowledge yet but > Sympy,http://code.google.com/p/sympy, has a rational type. I hadn't heard of this before, thanks for the link. Very nifty, lots of goodies not found in gmpy (although it seems to lack a

Re: Book Recomendations

2008-03-02 Thread Jeff Schwab
> Ira Solomon wrote: >> I am an experienced programmer (40 years) . . . >> I'm interested in learning Python > js wrote: >> I wonder why nobody mension Python Cookbook yet . . . >> and Python Standard Library Because cookbooks are not supposed to be language introductions. They are collec

Re: Altering imported modules

2008-03-02 Thread Terry Reedy
"Tro" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | 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

Re: First post from a Python newbiw

2008-03-02 Thread Marc 'BlackJack' Rintsch
On Sun, 02 Mar 2008 21:58:31 +0100, Christoph Zwerschke wrote: > Marc 'BlackJack' Rintsch schrieb: >> On Sun, 02 Mar 2008 14:15:09 +, Steve Turner wrote: >> >>> Apart from doing something like >>> a=[0,0,0] >>> b=[0,0,0] >>> c=[0,0,0] >>> d=[a,b,c] >>> >>> is there a better way of creating d?

  1   2   >