New home for adns-python

2006-12-02 Thread Andy Dustman
I had been falling behind in patches for adns-python, so I thought it would be a good idea to have a public site where it was easier for people to contribute and report bugs. The new project page is: http://code.google.com/p/adns-python Eventually I will probably add an announcements group, but

Re: Python25.zip

2006-12-02 Thread Georg Brandl
Colin J. Williams wrote: Dennis Lee Bieber wrote: On Thu, 30 Nov 2006 18:14:11 -0500, Colin J. Williams [EMAIL PROTECTED] declaimed the following in comp.lang.python: As part of the Python initialization, C:\Windows\System32\Python25.zip is set up in the path. I haven't seen any

Re: strange problems with code generation

2006-12-02 Thread [EMAIL PROTECTED]
It is left over from the example I stold it from, I remove it and see if that helps. Dennis Lee Bieber wrote: On 1 Dec 2006 17:24:18 -0800, [EMAIL PROTECTED] [EMAIL PROTECTED] declaimed the following in comp.lang.python: data = sys2.stdin.readlines() And what do you expect to

Re: What are python closures realy like?

2006-12-02 Thread Karl Kofnarson
Karl, Usually when using this idiom, fun_basket would return a tuple of all of the defined functions, rather than one vs. the other. So in place of: if f == 1: return f1 if f == 2: return f2 Just do return f1, f2 (For that matter, the argument f is no longer

Re: Printing Barcodes from webapp?

2006-12-02 Thread Leo Kislov
Burhan wrote: Hello Group: I am in the planning stages of an application that will be accessed over the web, and one of the ideas is to print a barcode that is generated when the user creates a record. The application is to track paperwork/items and uses barcodes to easily identify which

Video feature

2006-12-02 Thread Lad
I would like to add on my website a possibility for visitors to upload video and watch other user's video. How much difficult would it be with Python? Thank you any for idea. L. -- http://mail.python.org/mailman/listinfo/python-list

Re: os.mkdir and mode

2006-12-02 Thread Peter Otten
vj wrote: How do I do the following unix command: mkdir -m770 test with the os.mkdir command. Using os.mkdir(mode=0770) ends with the incorrect permissions. mkdir() works just like its C equivalent, see http://docs.python.org/dev/lib/os-file-dir.html: Where it is used, the current umask

Re: strange problems with code generation

2006-12-02 Thread [EMAIL PROTECTED]
I changed that and the writelines and I am very close now. thanks. Dennis Lee Bieber wrote: On 1 Dec 2006 17:24:18 -0800, [EMAIL PROTECTED] [EMAIL PROTECTED] declaimed the following in comp.lang.python: data = sys2.stdin.readlines() And what do you expect to read from stdin? Do

evaluating gui modules, any experience on tkinter?

2006-12-02 Thread krishnakant Mane
hello all, I seam to have noticed this a bit late but it appears to me that tkinter is being used very widely for gui development on all platform? is that right? since fredric lundh has written a very good introduction to tkinter (was that just an intro?), I have got keen interest to know the

Fw: Is there a reason not to do this?

2006-12-02 Thread Hendrik van Rooyen
Hendrik van Rooyen [EMAIL PROTECTED] wrote: Ron Garret [EMAIL PROTECTED] wrote: I don't want to get into a philosophical debate. Actually, I changed my mind. Consider: so did I - I think the chair analogy is not quite clear, so let me elucidate: def g(): print 'G' def h():

Re: best way to align words?

2006-12-02 Thread Robert R.
Hello, thanks for all your replies, i'm now looking to dynamic programming... sorry for forgetting to say that i wanted the words to be ordered, thus : s1 = hello there dudes s2 = dudes hello there s3 = there dudes hello will not return anything while sharing all three words. Bearophile your

Re: type(foo) == function ?

2006-12-02 Thread Fredrik Lundh
Mathias Panzenboeck wrote: This builtin will be removed in python 3.0! that's far from clear (since the replacement approach, just call it, simply doesn't work). and if you track the Py3K discussions, you'll notice current threads about *more* support for interface testing, not less

Re: Python25.zip

2006-12-02 Thread Martin v. Löwis
Colin J. Williams schrieb: The role of Python25.zip is not clear. Is it required in the path just to enable the import X.zip capability? To rephrase Georg's explanation: it allows Python distributors (e.g. Linux distributors, or ActiveState) to put all of the Python library (including site.py)

Re: python 2.5 install from source problem

2006-12-02 Thread Martin v. Löwis
Fabian Braennstroem schrieb: I just tried to install python 2.5 from source on my ScienticLinux (Redhat Clone) machine. It seems to work without any problem, at least I am able to run some of my old scripts. I installed it with './configure --prefix=/opt/python make make altinstall', but now

rdf, xmp

2006-12-02 Thread Imbaud Pierre
I have to add access to some XMP data to an existing python application. XMP is built on RDF, RDF is built on XML. I try to reuse as much of possible of existing code. btw, dont mistake XMP (http://www.adobe.com/products/xmp/) with XMPP (http://www.faqs.org/rfcs/rfc3920.html), backed by PyXMPP

Re: os.mkdir and mode

2006-12-02 Thread Nick Craig-Wood
Peter Otten [EMAIL PROTECTED] wrote: vj wrote: How do I do the following unix command: mkdir -m770 test with the os.mkdir command. Using os.mkdir(mode=0770) ends with the incorrect permissions. mkdir() works just like its C equivalent, see

Re: os.mkdir and mode

2006-12-02 Thread Nick Craig-Wood
vj [EMAIL PROTECTED] wrote: How do I do the following unix command: mkdir -m770 test with the os.mkdir command. Using os.mkdir(mode=0770) ends with the incorrect permissions. You mean :- $ python -c 'import os; os.mkdir(test, 0770)' $ stat test/ File: `test/' Size: 4096

Re: os.mkdir and mode

2006-12-02 Thread Peter Otten
Nick Craig-Wood wrote: Peter Otten [EMAIL PROTECTED] wrote: vj wrote: How do I do the following unix command: mkdir -m770 test with the os.mkdir command. Using os.mkdir(mode=0770) ends with the incorrect permissions. mkdir() works just like its C equivalent, see

Re: client/server design and advice

2006-12-02 Thread Irmen de Jong
John Henry wrote: On the subject of passing things around, is there a no brainer way of sending files back and forth over Pyro? I am currently using a shared drive to do that. May be I missed that feature? Sending files around is just a special case of passing large amounts of data to

Re: Python, PostgreSQL, What next?

2006-12-02 Thread Armin
I've studied Python and studied PostgreSQL. Good. What is the absolute next best step to take to merge these two finely together? I've heard of Just download psycopg2. Python and PostgreSQL are a match made in heavan. Make your connection, do querys, get data, earn profits.

ftputil upload error

2006-12-02 Thread Croteam
Hello, I have one problem about ftputil file upload.Here is my short example: from ftputil import FTPHost import tkFileDialog import os from Tkinter import Tk ftp=FTPHost('myserver','username','password') forupload=tkFileDialog.askopenfile(parent=root) file=forupload.name ## I was choose

Python 2.5 bindings for Subversion 1.4.2 on Win32 binary

2006-12-02 Thread patkinson
Hello, I am one of those guys trying with no chance to get a working copy of TRAC for python 2.5 http://trac.edgewall.org/ is a superb Project managment tool with a wiki, control version (SVN), and a tracking bug/task system. This is a suposed place to go for a windows user:

Re: Python, PostgreSQL, What next?

2006-12-02 Thread patkinson
Hi, Look at DJANGO;-) http://www.djangoproject.com/ http://www.djangobook.com/ Regards Peter Atkinson vbgunz ha escrito: Hello all, I've studied Python and studied PostgreSQL. What is the absolute next best step to take to merge these two finely together? I've heard of SQLAlchemy and

Re: Printing Barcodes from webapp?

2006-12-02 Thread Fredrik Lundh
Burhan wrote: Is there an easy way to generate barcodes using Python -- considering the application will be printing to a printer at the client's machine? here are some barcode generators for Python: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/426069

Re: Python 2.5 bindings for Subversion 1.4.2 on Win32 binary

2006-12-02 Thread Martin v. Löwis
patkinson schrieb: Great python Projects like TRAC or DJANGO are the keys to a wide acceptance of python. Making this easy to the final users is (in my opinion) a survival question for the future of Python. Please note that threatening is useless most of the time in free software. Very few

Re: rdf, xmp

2006-12-02 Thread Andy Dingley
Imbaud Pierre wrote: I have to add access to some XMP data to an existing python application. XMP is built on RDF, RDF is built on XML. RDF is _NOT_ built on top of XML. Thinking that it is causes a lot of trouble in the architecture of big RDF projects. RDF is a data model, not a

Re: Printing Barcodes from webapp?

2006-12-02 Thread Andy Dingley
Burhan wrote: Is there an easy way to generate barcodes using Python Easy way for any application or language to generate barcodes is to install a barcode font on the client machine, then just generate a suitable text string for it. This is _very_ easy, if you can get the font deployed. I

Re: Python 2.5 bindings for Subversion 1.4.2 on Win32 binary

2006-12-02 Thread Fredrik Lundh
patkinson wrote: Great python Projects like TRAC or DJANGO are the keys to a wide acceptance of python. Making this easy to the final users is (in my opinion) a survival question for the future of Python. any special reason why you cannot use the *recommended* releases in- stead of playing

Re: Python 2.5 bindings for Subversion 1.4.2 on Win32 binary

2006-12-02 Thread patkinson
Yes Martin, You are right. I'm not trying to threat any one. My excuses to you with that (infortunated) paragraph. Thanks anyway for your suggestion. My intention was to motivate other people with the same interests, or to find another way or patch, to keep Trac working. Regards P. Atkinson

Re: Thread help

2006-12-02 Thread Bjoern Schliessmann
John Henry wrote: Why stop there? Stop where, after one thread? Different question: Why use many threads? It adds complexity and overhead and forces you to think about thread safety and reentrance. Regards, Björn -- BOFH excuse #134: because of network lag due to too many people playing

Re: Python, PostgreSQL, What next?

2006-12-02 Thread Fredrik Lundh
vbgunz wrote: I've studied Python and studied PostgreSQL. What is the absolute next best step to take to merge these two finely together? the db-api interface: http://www.python.org/dev/peps/pep-0249/ db-api compliant postgresql adapters: http://www.pygresql.org/

Re: best way to align words?

2006-12-02 Thread Oleg Batrashev
thanks for all your replies, i'm now looking to dynamic programming... Id better warn you before you go further. Notice that LCS is often defined to be finding all common subsequences of a maximum length. This problem inherently has higher complexity, as the number of such subsequences is

Re: Error handling. Python embedded into a C++ app.

2006-12-02 Thread Wolfram
Maybe of interest to people loking for a solution: I solved my issue by changing the program retroactively from a pure MFC app to a console one using this procedure: http://homepage3.nifty.com/ysflight/mfcconsole/mfcconsole.html I am still not sure why all of my other attempts failed, but most

Re: Printing Barcodes from webapp?

2006-12-02 Thread Burhan
Andy Dingley wrote: Burhan wrote: Is there an easy way to generate barcodes using Python Easy way for any application or language to generate barcodes is to install a barcode font on the client machine, then just generate a suitable text string for it. This is _very_ easy, if you can

Re: evaluating gui modules, any experience on tkinter?

2006-12-02 Thread Norm
krishnakant Mane wrote: hello all, I seam to have noticed this a bit late but it appears to me that tkinter is being used very widely for gui development on all platform? is that right? since fredric lundh has written a very good introduction to tkinter (was that just an intro?), I have got

Re: evaluating gui modules, any experience on tkinter?

2006-12-02 Thread Norm
For wxPython, there is a book wxPython in Action published by Manning Cheers Norm wrote: krishnakant Mane wrote: hello all, I seam to have noticed this a bit late but it appears to me that tkinter is being used very widely for gui development on all platform? is that right? since

Re: PythonTidy

2006-12-02 Thread Chuck Rhode
Thomas Heller wrote this on Fri, Dec 01, 2006 at 10:12:38PM +0100. My reply is below. Here is part of a diff before and after running PythonTidy on it: start -def comptr_setitem(self, index, value): -# We override the __setitem__ method of the -#

How to realize the interactive python in Eclipse?

2006-12-02 Thread purple
I have installed the Eclipse and the plug-in Pydev. Also, I have add an python program in the external tools. When I run the python program in the external tools, i can type python command just like in the python shell.But when I finished running a python file, in the console, I could not type any

Re: Is there a reason not to do this?

2006-12-02 Thread Michele Simionato
Since we are in a hackish mood, another alternative - interesting if you want the freedom to update your instances selectively - is to change their class at runtime. In this way you can specify which instances must use the new version of the class and which ones must keep the old one. It may be

Re: Is there a reason not to do this?

2006-12-02 Thread Michele Simionato
Ron Garret wrote: Doesn't work for me: c2 __main__.C2 instance at 0x51e850 c2.m1() G class C2: ... __metaclass__ = modify_in_place ... def m1(self): print 'Q' ... c2.m1() G C2().m1() Q I assume your original C2 class was defined in a different module, not in the current

Re: os.mkdir and mode

2006-12-02 Thread vj
To fix your problem, reset your umask thus :- Thanks for the detailed reply. Your fix works like a charm. VJ -- http://mail.python.org/mailman/listinfo/python-list

Re: converting dict to object

2006-12-02 Thread Neil Cerutti
On 2006-12-02, Michel Claveau [EMAIL PROTECTED] wrote: Hi! Yes. But... Try:d = {'a': 1, 'b': 2, 'def': 123} Ok, I go out... How to convert a list of strings into a list of integers: a = ['82', '4', '16'] ai = [int(i) for i in a] Yes. But... Try: a = ['82', '4', '16', 'foo']

Re: python vs java eclipse

2006-12-02 Thread Philippe Martin
Amir Michail wrote: Hi, It seems to me that measuring productivity in a programming language must take into account available tools and libraries. Eclipse for example provides such an amazing IDE for java that it is no longer obvious to me that one would be much more productive in

Re: a -very- case sensitive search

2006-12-02 Thread Ola K
Thank you! This was really helpful. Also the data bit about .istitle() was the missinng piece of the puzzle for me... So now my script is nice and working :) And as beside the point, yes I am from Israel, and no, we don't have uper case and lower case letters. Hebrew has only one set of letters.

Re: Python, PostgreSQL, What next?

2006-12-02 Thread Thomas Bartkus
On Fri, 01 Dec 2006 23:04:37 -0800, vbgunz wrote: Hello all, I've studied Python and studied PostgreSQL. What is the absolute next best step to take to merge these two finely together? I've heard of SQLAlchemy and some others but before I dive in, I would really like the opinion of those

Re: Python, PostgreSQL, What next?

2006-12-02 Thread jim-on-linux
Before commiting to a RDBMS take a look at Gadfly. Depending on what you need a RDB for, (light duty), or (heavy duty) take a look at gadfly. Gadfly is made from all python code. Use stardard SQL statements like Select, Create and Drop Tables, etc. Newest version GadflyB5

Re: About alternatives to Matlab

2006-12-02 Thread Carl Banks
Jon Harrop wrote: I don't know Python but this benchmark caught my eye. def D4_Transform(x, s1=None, d1=None, d2=None): D4 Wavelet transform in NumPy (C) Sturla Molden C1 = 1.7320508075688772 C2 = 0.4330127018922193 C3 = -0.066987298107780702 C4 =

Re: Detecting recursion loops

2006-12-02 Thread Kay Schluehr
Instead of threading a counter ( or an accumulator as for tail-recursive functions ) you can monitor the behaviour of the mutual recusive function call using an external stack and wrap the contributing functions using a decorator s.t. pushing and popping to and from the stack are pre- and

text adventure question

2006-12-02 Thread Ara Kooser
I am working on a text adventure game for python to get back into python programming. My version 0.1 used only functions so I could get familiar with how those work. I want to move beyond that. I am not sure what would be a good Python way of handling this. I was wondering if classes would

Re: About alternatives to Matlab

2006-12-02 Thread Carl Banks
Carl Banks wrote: Matlab has a few *cough* limitations when it comes to hand-optimizing. When writing naive code, Matlab often is faster than Python with numpy because it has many commerical man-year of optimizing behind it. However, Matlab helps v That should say: However, Matlab helps

Re: converting dict to object

2006-12-02 Thread Carl D. Roth
On Fri, 01 Dec 2006 17:48:40 -0800, rieh25 wrote: If I have a dictionary such as: d = {'a' : 1, 'b' : 2} is there a way to convert it into an object o, such as: o.a = 1 o.b = 2 Rather, the question could be asked the other way around: how can you convert that object into a dict? The

Re: evaluating gui modules, any experience on tkinter?

2006-12-02 Thread David Boddie
krishnakant Mane wrote: I seam to have noticed this a bit late but it appears to me that tkinter is being used very widely for gui development on all platform? is that right? Tkinter is bundled with Python on all platforms that support Tcl/Tk. As a result there's a low barrier to entry to

Re: os.mkdir and mode

2006-12-02 Thread Martin v. Löwis
Nick Craig-Wood schrieb: So it looks like python mkdir() is applying the umask where as /bin/mkdir doesn't. From man 2 mkdir Actually, mkdir(1) has no chance to not apply the umask: it also has to use mkdir(2), which is implemented in the OS kernel, and that applies the umask. Try strace

Re: Security Descriptor and CoInitializeSecurity

2006-12-02 Thread Roger Upole
Huayang Xia wrote: I'd like to call pythoncom.CoInitializeSecurity with a PySecurityDescriptor object to set the process-wide security values. But I'm not able to find a way to let the code go through. I have read MSDN and searched web, I've not been able to find answer. I cooked a security

global name 'self' is not defined

2006-12-02 Thread Evan
Hi I have a short script that makes 2 calls to methods in another script as follows: import canPlaces as canp callOne=canp.addMe(3,5) callTwo=canp.estocStn() The 2 methods in the second script are: def addMe(a,b) sumAb=a+b return sumAb def estocStn():

Re: global name 'self' is not defined

2006-12-02 Thread Felipe Almeida Lessa
On 2 Dec 2006 10:42:28 -0800, Evan [EMAIL PROTECTED] wrote: Why is it that the first call works fine, but the second tells me 'global name 'self' is not defined'? What I want is to have the dictionary 'estoc' available in my calling script. Well, you have not posted the code that is causing

Re: global name 'self' is not defined

2006-12-02 Thread George Sakkis
Evan wrote: Hi I have a short script that makes 2 calls to methods in another script as follows: import canPlaces as canp callOne=canp.addMe(3,5) callTwo=canp.estocStn() The 2 methods in the second script are: def addMe(a,b) sumAb=a+b return sumAb def estocStn():

wxpython worked out but can't find api docs for download.

2006-12-02 Thread krishnakant Mane
hello all. finally I got the accessibility issue out from wxpython. actually almost got it out, but that's another story. now my problem is that I can't gind a downloadable version of wxpython api reference for the latest version or the latest api reference at least. I found the on-line version

Re: python 2.5 install from source problem

2006-12-02 Thread Fabian Braennstroem
Hi Martin, * Martin v. Löwis [EMAIL PROTECTED] wrote: Fabian Braennstroem schrieb: I just tried to install python 2.5 from source on my ScienticLinux (Redhat Clone) machine. It seems to work without any problem, at least I am able to run some of my old scripts. I installed it with

Re: PythonTidy

2006-12-02 Thread Chuck Rhode
Thomas Heller wrote this on Fri, Dec 01, 2006 at 10:12:38PM +0100. My reply is below. Chuck Rhode schrieb: o Command-line args: Please give an example of a standard command that I might emulate w.r.t. standard argument use. Well, at least it would be nice if I could call 'PythonTidy.py

Re: wxpython worked out but can't find api docs for download.

2006-12-02 Thread hg
krishnakant Mane wrote: hello all. finally I got the accessibility issue out from wxpython. actually almost got it out, but that's another story. now my problem is that I can't gind a downloadable version of wxpython api reference for the latest version or the latest api reference at

Re: global name 'self' is not defined

2006-12-02 Thread Evan
In answer to the 2 replies, I had no references anywhere to 'self'. In order to post my code I rewrote 2 scripts containing just the relevant parts of the problem; these work. However, they are identical to my original code. So I have deleted the 'old' script2 and renamed the new one, and no

Re: detecting that a SQL db is running

2006-12-02 Thread bill ramsay
On Sat, 02 Dec 2006 07:39:51 GMT, Dennis Lee Bieber [EMAIL PROTECTED] wrote: On Sat, 02 Dec 2006 09:02:43 +1300, bill ramsay [EMAIL PROTECTED] declaimed the following in comp.lang.python: Dennis none of this matters, all i am trying to find out is whether or not the local MSDE is actually

Re: evaluating gui modules, any experience on tkinter?

2006-12-02 Thread hg
krishnakant Mane wrote: hello all, I seam to have noticed this a bit late but it appears to me that tkinter is being used very widely for gui development on all platform? is that right? since fredric lundh has written a very good introduction to tkinter (was that just an intro?), I have got

problem occurs with replaced values using fileinput

2006-12-02 Thread Phoe6
Hi All, I am able to use urlib2 through proxy. I give proxy credentials and use # Set the Proxy Address proxy_ip = 10.0.1.1:80 proxy_user = 'senthil_or' proxy_password_orig='password' proxy_password = urllib.quote(proxy_password_orig,) # Setup the Proxy with urllib2 proxy_url = 'http://' +

Re: converting dict to object

2006-12-02 Thread John Machin
Neil Cerutti wrote: On 2006-12-02, Michel Claveau [EMAIL PROTECTED] wrote: Hi! Yes. But... Try:d = {'a': 1, 'b': 2, 'def': 123} Ok, I go out... How to convert a list of strings into a list of integers: a = ['82', '4', '16'] ai = [int(i) for i in a] Yes. But...

Re: rdf, xmp

2006-12-02 Thread Imbaud Pierre
Andy Dingley a écrit : Imbaud Pierre wrote: I have to add access to some XMP data to an existing python application. XMP is built on RDF, RDF is built on XML. RDF is _NOT_ built on top of XML. Thinking that it is causes a lot of trouble in the architecture of big RDF projects. RDF is a

Re: converting dict to object

2006-12-02 Thread Fredrik Lundh
John Machin wrote: Any experiences of keyword-bite? creating or manipulating CSS-styled (X)HTML using an XML binding that exposes XML attributes as Python attributes. (this could be viewed as an unnecessary restriction in the Python parser; it wouldn't be too hard to allow reserved words for

Re: global name 'self' is not defined

2006-12-02 Thread John Machin
Evan wrote: In answer to the 2 replies, I had no references anywhere to 'self'. In order to post my code I rewrote 2 scripts containing just the relevant parts of the problem; these work. However, they are identical to my original code. This is (putting it mildly) somewhat difficult to

Re: Python, PostgreSQL, What next?

2006-12-02 Thread vbgunz
I need to thank you all for your suggestions and recommendations. I am ultimately aiming to work in Python, PostgreSQL and Django and this link http://www.sqlalchemy.org/news.myt#item_3 sort of made my day :) I really appreciate all of your feedback and will go through Fredrik's links as soon as

** Listen to Professor FETZER, JONES, JUDY WOOD, whose student was murdered by ACTUAL 911 CRIMINALS

2006-12-02 Thread thermate
LISTEN AND LEARN TO THINK CRITICALLY http://mp3.rbnlive.com/Fetzer06.html http://janedoe0911.tripod.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: python vs java eclipse

2006-12-02 Thread Amir Michail
Hi, Here's a blog post that is relevant to this discussion: http://sixthandredriver.typepad.com/river_of_code/2006/01/automated_refac.html Amir -- http://mail.python.org/mailman/listinfo/python-list

Re: evaluating gui modules, any experience on tkinter?

2006-12-02 Thread Gian Mario Tagliaretti
hg wrote: Tkinter is fine under *nix and Windows for a large range of applications. I think it has drawbacks and advantage compared to other toolkits. The major advantage being bundled with python, and the drawbacks include (I think) ... look and feel, printing support, imaging,

Anyone understand this syntax error?

2006-12-02 Thread Sean Hammond
Anyone understand this? Python 2.4.4c1 (#2, Oct 11 2006, 21:51:02) [GCC 4.1.2 20060928 (prerelease) (Ubuntu 4.1.1-13ubuntu5)] on linux2 Type help, copyright, credits or license for more information. def markdown_perl(input): ... Send 'input' (string) to the markdown perl script, and return

Re: Joining data from three different files to be written into three Columns

2006-12-02 Thread Dawn Abbott
On 11/29/06, Dawn Abbott [EMAIL PROTECTED] wrote: I have three files of binary data. I want to write the three binary data files to one file. I want the old files to each have their own column in the new file. This is what I have, f=open('relative_x.INT32','rb') a=array('l')

Re: Anyone understand this syntax error?

2006-12-02 Thread John Machin
Sean Hammond wrote: Anyone understand this? Python 2.4.4c1 (#2, Oct 11 2006, 21:51:02) [GCC 4.1.2 20060928 (prerelease) (Ubuntu 4.1.1-13ubuntu5)] on linux2 Type help, copyright, credits or license for more information. def markdown_perl(input): ... Send 'input' (string) to the

Re: Possible to assure no cyclic/uncollectible memory leaks?

2006-12-02 Thread Klaas
Joe Peterson wrote: I've been doing a lot of searching on the topic of one of Python's more disturbing issues (at least to me): the fact that if a __del__ finalizer is defined and a cyclic (circular) reference is made, the garbage collector cannot clean it up. It is a somewhat fundamental

Re: global name 'self' is not defined

2006-12-02 Thread Bjoern Schliessmann
Evan wrote: So I have deleted the 'old' script2 and renamed the new one, and no problem. Pity. Next time try using diff (or something similar). Regards, Björn -- BOFH excuse #115: your keyboard's space bar is generating spurious keycodes. --

Re: converting dict to object

2006-12-02 Thread Steven D'Aprano
On Sat, 02 Dec 2006 12:16:24 -0800, John Machin wrote: The OP might consider adding code to the __init__ method to check for cases where the dictionary key is not a string containing a valid Python identifier (not a keyword). If the OP is doing something like this: attributes = {length: 15,

Re: converting dict to object

2006-12-02 Thread John Machin
Steven D'Aprano wrote: On Sat, 02 Dec 2006 12:16:24 -0800, John Machin wrote: The OP might consider adding code to the __init__ method to check for cases where the dictionary key is not a string containing a valid Python identifier (not a keyword). [snip] But if he's doing something

Re: converting dict to object

2006-12-02 Thread Steven D'Aprano
On Sat, 02 Dec 2006 17:00:15 -0800, John Machin wrote: Steven D'Aprano wrote: On Sat, 02 Dec 2006 12:16:24 -0800, John Machin wrote: The OP might consider adding code to the __init__ method to check for cases where the dictionary key is not a string containing a valid Python identifier

Re: converting dict to object

2006-12-02 Thread Neil Cerutti
On 2006-12-02, John Machin [EMAIL PROTECTED] wrote: Neil Cerutti wrote: On 2006-12-02, Michel Claveau [EMAIL PROTECTED] wrote: Hi! Yes. But... Try:d = {'a': 1, 'b': 2, 'def': 123} Ok, I go out... How to convert a list of strings into a list of integers: a = ['82', '4',

Re: text adventure question

2006-12-02 Thread Neil Cerutti
On 2006-12-02, Ara Kooser [EMAIL PROTECTED] wrote: I am working on a text adventure game for python to get back into python programming. My version 0.1 used only functions so I could get familiar with how those work. I want to move beyond that. I am not sure what would be a good Python way of

Re: converting dict to object

2006-12-02 Thread John Machin
Neil Cerutti wrote: Thanks for the pointer to keyword module. I hadn't noticed it yet. Bonus: you got an extremely fresh, scarcely used pointer -- I wasn't aware of it myself till today :-) Cheers, John -- http://mail.python.org/mailman/listinfo/python-list

Re: text adventure question

2006-12-02 Thread Steven D'Aprano
On Sat, 02 Dec 2006 10:22:28 -0700, Ara Kooser wrote: I am working on a text adventure game for python to get back into python programming. My version 0.1 used only functions so I could get familiar with how those work. I want to move beyond that. I am not sure what would be a good Python

RE: python vs java eclipse

2006-12-02 Thread Sells, Fred
If you're in the PyDev perspective, F9 runs the current script while ctrl-F11 reruns the last script run. I have found that certain types of operations just plain don't work this way and must be run from a conventional shell window. -Original Message- From: [EMAIL PROTECTED]

Re: text adventure question

2006-12-02 Thread [EMAIL PROTECTED]
When I was playing around with adventure games using oop (in c++) I had all charecters defined as a type, no need to seperate non-player charecters with user defined charecters. Makes it easier to create a party of charecters or monsters. I left it up to the logic of the program to define

Non-exhaustive file reads

2006-12-02 Thread Fredrik Tolf
I just got shocked to find out the hard way that the read() method on Python's file objects will, very much unlike the C read() function, read until the given size is reached, which is quite a problem for me when selecting a couple of pipes and wanting to just read the available data from them.

Re: Non-exhaustive file reads

2006-12-02 Thread Paul Rubin
Fredrik Tolf [EMAIL PROTECTED] writes: mode, but nowhere can I find any information about how to enable non-blocking mode in Python. Can anyone provide me with any information on how to accomplish this? In Linux you'd use fcntl. Some other discussion can be found on the web:

Parsing data from pyserial

2006-12-02 Thread Lone Wolf
I'm trying to get data through my serial port from a CMUcam. This gizmo tracks a color and returns a packet of data. The packet has nine data points (well, really eight since the first point is just a packet header) separated by spaces as follows: M xxx xxx xxx xxx xxx xxx xxx xxx Here is the

Re: Non-exhaustive file reads

2006-12-02 Thread Fredrik Tolf
On Sat, 2006-12-02 at 20:00 -0800, Paul Rubin wrote: Fredrik Tolf [EMAIL PROTECTED] writes: mode, but nowhere can I find any information about how to enable non-blocking mode in Python. Can anyone provide me with any information on how to accomplish this? In Linux you'd use fcntl.

python + database book

2006-12-02 Thread progman
new to python. i work with db heavily. any good book for python + database? -- http://mail.python.org/mailman/listinfo/python-list

Re: About alternatives to Matlab

2006-12-02 Thread Jon Harrop
Carl Banks wrote: No, they're never redefined (even in the recursive version). Slices of them are reassigned. That's a big difference. I see. (Actually, it does create a temporary array to store the intermediate result, but that array does not get bound to odd.) Sure. In particular, I

Re: v2.3, 2.4, and 2.5's GUI is slow for me

2006-12-02 Thread Tim Roberts
g4rlik [EMAIL PROTECTED] wrote: No one can help? This is seriously bugging me to no end. You waited 2 hours before posting this reply. Please note that Usenet is NOT a real-time medium. It can take half a day or more before your posting makes it to all the news servers around the world, and

Re: text adventure question

2006-12-02 Thread Steven D'Aprano
On Sat, 02 Dec 2006 22:19:53 +, Dennis Lee Bieber wrote: Suggest you try to go back and reread some of the responses to such a subject from whenever (Unfortunately, I suspect my responses are no longer available as I run with x-noarchive active). That seems horribly anti-social, not

Re: Parsing data from pyserial

2006-12-02 Thread John Machin
Lone Wolf wrote: I'm trying to get data through my serial port from a CMUcam. This gizmo tracks a color and returns a packet of data. The packet has nine data points (well, really eight since the first point is just a packet header) separated by spaces as follows: M xxx xxx xxx xxx xxx xxx

db.commit() to take effect

2006-12-02 Thread progman
I was testing the python+mysql here are my sample codes: import MySQLdb from pprint import pprint db = MySQLdb.connect(host=localhost, user=root, passwd=password, db=database) cursor = db.cursor() cursor.execute('update promo set date=100) i

Re: db.commit() to take effect

2006-12-02 Thread John Machin
progman wrote: I was testing the python+mysql here are my sample codes: import MySQLdb from pprint import pprint db = MySQLdb.connect(host=localhost, user=root, passwd=password, db=database) cursor = db.cursor() cursor.execute('update promo set date=100)

Re: Tools for Java/Python scripting

2006-12-02 Thread skip
steve http://wiki.python.org/moin/Java_Scripting Renamed to JavaScripting. Skip Rob So nobody around here has heared of that other language called Rob JavaScript then ? Rob Perhaps Scripting_Java might be better. That would be JavaScriptScripting... Skip

Re: Parsing data from pyserial

2006-12-02 Thread Hendrik van Rooyen
Lone Wolf [EMAIL PROTECTED] wrote: I'm trying to get data through my serial port from a CMUcam. This gizmo tracks a color and returns a packet of data. The packet has nine data points (well, really eight since the first point is just a packet header) separated by spaces as follows: M xxx xxx

  1   2   >