The Python Tutorial, in Spanish

2009-09-20 Thread Facundo Batista
Hi all! We finally translated to Spanish the very last version of the Python Tutorial! You can grab it here in PDF [0], or see it online here [1]. Furthermore, we printed it [2]! It was a giveaway in PyCon Argentina 2009, :D Regards, [0] http://python.org.ar/pyar/Tutorial [1]

ANN: Hypy 0.8.4

2009-09-20 Thread Cory Dodt
Hypy is a fulltext search interface for Python applications. Use it to index and search your documents from Python code. Hypy is based on the estraiernative bindings by Yusuke Yoshida. * Fast, scalable * Perfect recall ratio by N-gram method * High precision by hybrid mechanism of N-gram and

Re: pyjamas pyv8run converts python to javascript, executes under command-line

2009-09-20 Thread Robert Kern
John Nagle wrote: Daniel Fetchinson wrote: Barring the unimplemented libraries and bugs, yes. If you read the original post in this thread, you will see that on the roadmap is running the entire Python regression suite. No, it's getting close to running the entire Pyjamas regression

Re: Can print() be reloaded for a user defined class?

2009-09-20 Thread Mark Tolonen
r rt8...@gmail.com wrote in message news:c87c1742-e185-4377-a3ae-b32b912bc...@33g2000vbe.googlegroups.com... On Sep 19, 9:53 pm, Peng Yu pengyu...@gmail.com wrote: (snip) I want to understand the exact meaning of the last line ('__repr__ = __str__'). Would you please point me to the

Compile kinterbasdb with mingw32 and python 2.6 - DLL load failed

2009-09-20 Thread Laszlo Nagy
This is what I did so far: #1. Install Python 2.6, Firebird 1.5 server (with libs and headers), egenix mx base and mingw C compiler #2. put c:\MinGW\bin on the PATH (or wherever it is) #3. extract kinterbasdb source to a temp folder #4. hack setup.cfg. Change the build section: [build]

Re: How to change string or number passed as argument?

2009-09-20 Thread Hendrik van Rooyen
On Sunday 20 September 2009 03:59:21 Peng Yu wrote: I know that strings or numbers are immutable when they passed as arguments to functions. But there are cases that I may want to change them in a function and propagate the effects outside the function. I could wrap them in a class, which I

Re: Can print() be reloaded for a user defined class?

2009-09-20 Thread Dave Angel
Peng Yu wrote: snip def __str__(self): return 'Bin(%s, %s)' %(self.x, self.y) __repr__ =_str__ Please use an initial capital letter when defining a class, this is the accepted way in many languages!!! I want to understand the exact meaning of the last line ('__repr__

Re: An assessment of the Unicode standard

2009-09-20 Thread Greg Ewing
Hendrik van Rooyen wrote: Yikes! If I follow you, it is a bit like having a hollow dumb-bell with a hollow handle of zero length, and wanting a word for that opening between the knobs. That's pretty much it, yes. Although opening doesn't quite cut it, because there can be two of them

Re: control CPU usage

2009-09-20 Thread Dave Angel
Jiang Fung Wong wrote: Dear All, Thank you for the information. I think I've some idea what the problem is about after seeing the replies. More information about my system and my script PIII 1Ghz, 512MB RAM, Windows XP SP3 The script monitors global input using PyHook, and calculates on the

Re: What are the naming convention for private member variable, and private and public member function?

2009-09-20 Thread Dave Angel
Peng Yu wrote: Hi, It says in http://www.python.org/dev/peps/pep-0008/ Method Names and Instance Variables Use the function naming rules: lowercase with words separated by underscores as necessary to improve readability. Use one leading underscore only for non-public

Re: Comparison of parsers in python?

2009-09-20 Thread andrew cooke
On Sep 19, 9:34 pm, Peng Yu pengyu...@gmail.com wrote: On Sep 19, 6:05 pm, Robert Kern robert.k...@gmail.com wrote: http://nedbatchelder.com/text/python-parsers.html This is more a less just a list of parsers. I would like some detailed guidelines on which one to choose for various parsing

Pickle Encoding Errors

2009-09-20 Thread Dan
To demonstrate the problem I have written the following program: ___ Code Start import pickle destruct=1 class PickleTest: library={} def __init__(self): self.unpickle() def __del__(self):

Re: Can print() be reloaded for a user defined class?

2009-09-20 Thread Peng Yu
On Sun, Sep 20, 2009 at 4:42 AM, Dave Angel da...@ieee.org wrote: Peng Yu wrote: snip    def __str__(self):        return 'Bin(%s, %s)' %(self.x, self.y)    __repr__ =_str__ Please use an initial capital letter when defining a class, this is the accepted way in many languages!!! I

Re: Comparison of parsers in python?

2009-09-20 Thread Peng Yu
On Sun, Sep 20, 2009 at 6:50 AM, andrew cooke and...@acooke.org wrote: On Sep 19, 9:34 pm, Peng Yu pengyu...@gmail.com wrote: On Sep 19, 6:05 pm, Robert Kern robert.k...@gmail.com wrote: http://nedbatchelder.com/text/python-parsers.html This is more a less just a list of parsers. I would like

Re: Can print() be reloaded for a user defined class?

2009-09-20 Thread alex23
Peng Yu pengyu...@gmail.com wrote: Is __repr__ = __str__ copy by reference or by value? If I change __str__ later on, will __repr__ be changed automatically? What would you expect the outcome to be if these were functions rather than class methods? (Or any type of object, really...) Wouldn't

Re: How to get the minimum number that can be represented?

2009-09-20 Thread Peng Yu
On Sun, Sep 20, 2009 at 12:46 AM, Daniel Fetchinson fetchin...@googlemail.com wrote: Suppose I want to define a function that return the minimum number that can be represented. def f(x):   #body That it, if I call f(10), f will return the minimum integer that can be represented in the

Re: Comparison of parsers in python?

2009-09-20 Thread andrew cooke
On Sep 20, 8:11 am, Peng Yu pengyu...@gmail.com wrote: On Sun, Sep 20, 2009 at 6:50 AM, andrew cooke and...@acooke.org wrote: On Sep 19, 9:34 pm, Peng Yu pengyu...@gmail.com wrote: On Sep 19, 6:05 pm, Robert Kern robert.k...@gmail.com wrote: http://nedbatchelder.com/text/python-parsers.html

Re: Pickle Encoding Errors

2009-09-20 Thread Laszlo Nagy
I'm running Python 2.5.4 on Debian Sid. If anybody understands the error please enlighten me. Very interesting! Here is a minimalist version: import pickle class PickleTest: def __init__(self): self.library={uA: 1,uB: 2,uC: 3} def __del__(self): self.pickle() def

Re: Comparison of parsers in python?

2009-09-20 Thread andrew cooke
On Sep 19, 11:39 pm, TerryP bigboss1...@gmail.com wrote: [...] For flat data, simple unix style rc or dos style ini file will often suffice, and writing a parser is fairly trivial; in fact writing a [...] python already includes parsers for .ini configuration files. [...] The best way to

Re: Pickle Encoding Errors

2009-09-20 Thread Christian Heimes
Dan wrote: Error unpickling Pickling from destructor... Exception exceptions.LookupError: 'unknown encoding: raw-unicode- escape' in bound method PickleTest.__del__ of __main__.PickleTest instance at 0xb7d3decc ignored If I now change destruct to 0 the output is: Error unpickling

Re: pygame and py2app : big package

2009-09-20 Thread Pierre-Alain Dorange
TerryP bigboss1...@gmail.com wrote: I used py2app on Mac to build a package of my game (using pygame). It works fine (better than py2exe, i can'tmake work at tht time). But the package is very big. The biggest thing is numpy lib : 19 MB ! numpy is very big and i doubt all is reallly

Re: Pickle Encoding Errors

2009-09-20 Thread Dan
On 20 Sep, 13:29, Christian Heimes li...@cheimes.de wrote: Dan wrote: Error unpickling Pickling from destructor... Exception exceptions.LookupError: 'unknown encoding: raw-unicode- escape' in bound method PickleTest.__del__ of __main__.PickleTest instance at 0xb7d3decc ignored If I

Re: Comparison of parsers in python?

2009-09-20 Thread andrew cooke
One word of warning - the documentation for that format says at the beginning that it is compressed in some way. I am not sure if that means within some program, or on disk. But most parsers will not be much use with a compressed file - you will need to uncompress it first. --

Re: Comparison of parsers in python?

2009-09-20 Thread Peng Yu
On Sun, Sep 20, 2009 at 7:20 AM, andrew cooke and...@acooke.org wrote: On Sep 20, 8:11 am, Peng Yu pengyu...@gmail.com wrote: On Sun, Sep 20, 2009 at 6:50 AM, andrew cooke and...@acooke.org wrote: On Sep 19, 9:34 pm, Peng Yu pengyu...@gmail.com wrote: On Sep 19, 6:05 pm, Robert Kern

Re: How to get the minimum number that can be represented?

2009-09-20 Thread Radu Grigore
On Sep 20, 1:15 pm, Peng Yu pengyu...@gmail.com wrote: The problem is how to know what type of the argument and call the corresponding function. type(1) type 'int' type(1.2) type 'float' -- http://mail.python.org/mailman/listinfo/python-list

Re: control CPU usage

2009-09-20 Thread kakarukeys
On Sep 20, 6:24 pm, Dave Angel da...@ieee.org wrote: Jiang Fung Wong wrote: Dear All, Thank you for the information. I think I've some idea what the problem is about after seeing the replies. More information about my system and my script PIII 1Ghz, 512MB RAM, Windows XP SP3 The

Re: Comparison of parsers in python?

2009-09-20 Thread andrew cooke
The file size of a wig file can be very large (GB). Most tasks on this file format does not need the parser to save all the lines read from the file in the memory to produce the parsing result. I'm wondering if pyparsing is capable of parsing large wig files by keeping only minimum required

Re: Comparison of parsers in python?

2009-09-20 Thread andrew cooke
also, parsing large files may be slow. in which case you may be better with a non-python solution (even if you call it from python). your file format is so simple that you may find a lexer is enough for what you want, and they should be stream oriented. have a look at the shlex package that is

Re: Compile kinterbasdb with mingw32 and python 2.6 - DLL load failed

2009-09-20 Thread David Robinow
On Mon, Sep 21, 2009 at 12:23 AM, Laszlo Nagy gand...@shopzeus.com wrote: This is what I did so far: #1. Install Python 2.6, Firebird 1.5 server (with libs and headers), egenix mx base and mingw C compiler #2. put c:\MinGW\bin  on the PATH (or wherever it is) #3. extract kinterbasdb source

List comprehension vs generator expression memory allocation

2009-09-20 Thread candide
Let's code a function allowing access to the multiples of a given integer (say m) in the range from a to b where a and b are two given integers. For instance, with data input a,b,m=17, 42, 5 the function allows access to : 20 25 30 35 40 Each of the following two functions mult1() and mult2()

Re: Comparison of parsers in python?

2009-09-20 Thread Peng Yu
On Sun, Sep 20, 2009 at 8:19 AM, andrew cooke and...@acooke.org wrote: also, parsing large files may be slow.  in which case you may be better with a non-python solution (even if you call it from python). your file format is so simple that you may find a lexer is enough for what you want,

Re: Comparison of parsers in python?

2009-09-20 Thread andrew cooke
I don't quite understand this point.  If I don't use a parser, since python can read numbers line by line, why I need a lexer package? for the lines of numbers it would make no difference; for the track definition lines it would save you some work. as you said, this is a simple format, so the

Re: List comprehension vs generator expression memory allocation

2009-09-20 Thread Jon Clements
On 20 Sep, 14:35, candide cand...@free.invalid wrote: Let's code a function allowing access to the multiples of a given integer (say m) in the range from a to b where a and b are two given integers. For instance, with data input a,b,m=17, 42, 5 the function allows access to : 20 25 30 35

Re: Comparison of parsers in python?

2009-09-20 Thread Peng Yu
On Sun, Sep 20, 2009 at 8:49 AM, andrew cooke and...@acooke.org wrote: I don't quite understand this point.  If I don't use a parser, since python can read numbers line by line, why I need a lexer package? for the lines of numbers it would make no difference; for the track definition lines it

Re: Re: Can print() be reloaded for a user defined class?

2009-09-20 Thread Dave Angel
Peng Yu wrote: snip you might use: Is __repr__ =_str__ copy by reference or by value? If I change __str__ later on, will __repr__ be changed automatically? Regards, Peng Reference or value? Neither one. This assignment is no different than any other attribute assignment in

Re: Comparison of parsers in python?

2009-09-20 Thread andrew cooke
So for the track definition, using a lexer package would be better than using regex in python, right? they are similar. a lexer is really just a library that packages regular expressions in a certain way. so you could write your own code and you would really be writing a simple lexer. the

Re: How to get the minimum number that can be represented?

2009-09-20 Thread Grant Edwards
On 2009-09-20, Peng Yu pengyu...@gmail.com wrote: Suppose I want to define a function that return the minimum number that can be represented. def f(x): #body That it, if I call f(10), f will return the minimum integer that can be represented in the machine; if I cal f(10.5), f will

Re: control CPU usage

2009-09-20 Thread Dave Angel
kakarukeys wrote: On Sep 20, 6:24 pm, Dave Angel da...@ieee.org wrote: Jiang Fung Wong wrote: Dear All, Thank you for the information. I think I've some idea what the problem is about after seeing the replies. More information about my system and my script PIII

Re: Re: Can print() be reloaded for a user defined class?

2009-09-20 Thread Peng Yu
On Sun, Sep 20, 2009 at 9:19 AM, Dave Angel da...@ieee.org wrote: Peng Yu wrote: snip you might use: Is __repr__ =_str__ copy by reference or by value? If I change __str__ later on, will __repr__ be changed automatically? Regards, Peng Reference or value?  Neither one.  This

How python source code in large projects are organized?

2009-09-20 Thread Peng Yu
Hi, I am wondering what is the best way of organizing python source code in a large projects. There are package code, testing code. I'm wondering if there has been any summary on previous practices. Regards, Peng -- http://mail.python.org/mailman/listinfo/python-list

Re: How to get the minimum number that can be represented?

2009-09-20 Thread Peng Yu
On Sun, Sep 20, 2009 at 9:37 AM, Grant Edwards inva...@invalid.invalid wrote: On 2009-09-20, Peng Yu pengyu...@gmail.com wrote: Suppose I want to define a function that return the minimum number that can be represented. def f(x):   #body That it, if I call f(10), f will return the minimum

Re: List comprehension vs generator expression memory allocation

2009-09-20 Thread Dave Angel
Jon Clements wrote: On 20 Sep, 14:35, candide cand...@free.invalid wrote: Let's code a function allowing access to the multiples of a given integer (say m) in the range from a to b where a and b are two given integers. For instance, with data input a,b,m, 42, 5 the function allows access

How to refer to class name and function name in a python program?

2009-09-20 Thread Peng Yu
Hi, I have the following code. I want to change the function body of __repr__ to something like return 'In %s::%s' % ($class_name, $function_name) I'm wondering what I should write for $class_name and $function_name in python. Regards, Peng class A: def __init__(self): pass def

Re: Can print() be reloaded for a user defined class?

2009-09-20 Thread r
On Sep 20, 10:16 am, Peng Yu pengyu...@gmail.com wrote: (snip) I am more familiar with C++ than python. So I need to connect python concept to C++ concept so that I can understand it better. name1 and name are all references (in the C++ sense), right? __repr__  and __str__ are references (in

Re: pygame and py2app : big package

2009-09-20 Thread TerryP
Pierre-Alain Dorange wrote: Sorry, it was not clear. But i want to know if i can make the package smaller, because the total package weight 59.4 MB just for a small arcade game. You would need to skip or strip out any unneeded components that are being packed. Either by playing with how

Re: An assessment of the Unicode standard

2009-09-20 Thread Tim Rowe
2009/9/19 r rt8...@gmail.com: Snap (sort of). Does anybody know where the concept of the purple people eater comes from? I mean is there a children's book or something? - Hendrik I've always assumed it to go back to the 1958 Sheb Wooley song. Which I remember, although I was only 3 when it

Re: How to refer to class name and function name in a python program?

2009-09-20 Thread r
On Sep 20, 10:38 am, Peng Yu pengyu...@gmail.com wrote: Hi, I have the following code. I want to change the function body of __repr__ to something like     return 'In %s::%s' % ($class_name, $function_name) I'm wondering what I should write for $class_name and $function_name in python.

Re: How to refer to class name and function name in a python program?

2009-09-20 Thread Duncan Booth
Peng Yu pengyu...@gmail.com wrote: Hi, I have the following code. I want to change the function body of __repr__ to something like return 'In %s::%s' % ($class_name, $function_name) I'm wondering what I should write for $class_name and $function_name in python. Regards, Peng

I look for proxy cache like apt-pro xy (for Debian Package) but for python eggs package…

2009-09-20 Thread Klein Stéphane
Hi, I look for a tools to do proxy cache like apt-proxy (for Debian Package) but for python eggs package. Can a easy-install option perform this feature ? Thanks for your help, Stephane -- http://mail.python.org/mailman/listinfo/python-list

Re: control CPU usage

2009-09-20 Thread kakarukeys
On Sep 20, 10:57 pm, Dave Angel da...@ieee.org wrote: kakarukeys wrote: On Sep 20, 6:24 pm, Dave Angel da...@ieee.org wrote: Jiang Fung Wong wrote: Dear All, Thank you for the information. I think I've some idea what the problem is about after seeing the replies. More information

Re: How to refer to class name and function name in a python program?

2009-09-20 Thread Vijayendra Bapte
On Sep 20, 8:38 pm, Peng Yu pengyu...@gmail.com wrote: Hi, I have the following code. I want to change the function body of __repr__ to something like     return 'In %s::%s' % ($class_name, $function_name) I'm wondering what I should write for $class_name and $function_name in python.

Re: How to refer to class name and function name in a python program?

2009-09-20 Thread Peng Yu
On Sun, Sep 20, 2009 at 11:32 AM, Vijayendra Bapte vijayendra.ba...@gmail.com wrote: On Sep 20, 8:38 pm, Peng Yu pengyu...@gmail.com wrote: Hi, I have the following code. I want to change the function body of __repr__ to something like     return 'In %s::%s' % ($class_name, $function_name)

Re: How to refer to class name and function name in a python program?

2009-09-20 Thread r
On Sep 20, 10:38 am, Peng Yu pengyu...@gmail.com wrote: Hi, I have the following code. I want to change the function body of __repr__ to something like PS: Methods get angry when you refer to them as functions . You see, methods feel that they are more than a mere lowly function, and have

Re: Re: Can print() be reloaded for a user defined class?

2009-09-20 Thread Benjamin Kaplan
On Sun, Sep 20, 2009 at 11:16 AM, Peng Yu pengyu...@gmail.com wrote: On Sun, Sep 20, 2009 at 9:19 AM, Dave Angel da...@ieee.org wrote: Peng Yu wrote: snip you might use: Is __repr__ =_str__ copy by reference or by value? If I change __str__ later on, will __repr__ be changed

Re: How to refer to class name and function name in a python program?

2009-09-20 Thread Benjamin Kaplan
On Sun, Sep 20, 2009 at 12:43 PM, Peng Yu pengyu...@gmail.com wrote: On Sun, Sep 20, 2009 at 11:32 AM, Vijayendra Bapte vijayendra.ba...@gmail.com wrote: On Sep 20, 8:38 pm, Peng Yu pengyu...@gmail.com wrote: Hi, I have the following code. I want to change the function body of __repr__ to

Re: How to get the minimum number that can be represented?

2009-09-20 Thread Grant Edwards
On 2009-09-20, Peng Yu pengyu...@gmail.com wrote: You might also want to read up on the type() builtin I want avoid using any 'if' statement. Why? In C++, I can use template. If you want to write C++ code, then you should use a C++ compiler. How to do not use 'if' statement in python?

Re: How python source code in large projects are organized?

2009-09-20 Thread Daniel Fetchinson
I am wondering what is the best way of organizing python source code in a large projects. There are package code, testing code. I'm wondering if there has been any summary on previous practices. I suggest looking at the source code of large projects like twisted, PIL, django, turbogears, etc.

Re: Comparison of parsers in python?

2009-09-20 Thread Robert Kern
Peng Yu wrote: The file size of a wig file can be very large (GB). Most tasks on this file format does not need the parser to save all the lines read from the file in the memory to produce the parsing result. I'm wondering if pyparsing is capable of parsing large wig files by keeping only

Python/MySQL Frustration

2009-09-20 Thread Victor Subervi
Hi; I have the following code: while i num: cat = 'cat' + str(i) cat = form.getfirst(cat, '') item = 'item' + str(i) item = form.getfirst(item, '') descr = 'descr' + str(i) descr = form.getfirst(descr, '') uom = 'uom' + str(i) uom =

Re: I look for proxy cache like apt-proxy (for Debian Package) but for python eggs package…

2009-09-20 Thread Diez B. Roggisch
Klein Stéphane schrieb: Hi, I look for a tools to do proxy cache like apt-proxy (for Debian Package) but for python eggs package. Can a easy-install option perform this feature ? No. But you might install EggBasket, which is a PyPI-like server.

Re: Python/MySQL Frustration

2009-09-20 Thread Philip Semanchuk
On Sep 20, 2009, at 2:25 PM, Victor Subervi wrote: Hi; I have the following code: while i num: cat = 'cat' + str(i) cat = form.getfirst(cat, '') item = 'item' + str(i) item = form.getfirst(item, '') descr = 'descr' + str(i) descr = form.getfirst(descr, '')

Re: Comparison of parsers in python?

2009-09-20 Thread andrew cooke
On Sep 20, 9:12 am, andrew cooke and...@acooke.org wrote: ps is there somewhere can download example files?  this would be useful for my own testing.  thanks. i replied to a lot of your questions here; any chance you could reply to this one of mine? the wig format looks like it could be a good

Re: How python source code in large projects are organized?

2009-09-20 Thread Peng Yu
On Sun, Sep 20, 2009 at 11:31 AM, Daniel Fetchinson fetchin...@googlemail.com wrote: I am wondering what is the best way of organizing python source code in a large projects. There are package code, testing code. I'm wondering if there has been any summary on previous practices. I suggest

Re: Am I doing this wrong? Why does this seem so clumsy (time, datetime vs. DateTime)

2009-09-20 Thread AggieDan04
On Sep 19, 9:22 pm, Schif Schaf schifsc...@gmail.com wrote: The other day I needed to convert a date like August 2009 into a seconds-since-epoch value (this would be for the first day of that month, at the first second of that day). In Python, I came up with this: #!/usr/bin/env

Re: Comparison of parsers in python?

2009-09-20 Thread Peng Yu
On Sun, Sep 20, 2009 at 1:35 PM, andrew cooke and...@acooke.org wrote: On Sep 20, 9:12 am, andrew cooke and...@acooke.org wrote: ps is there somewhere can download example files?  this would be useful for my own testing.  thanks. i replied to a lot of your questions here; any chance you could

Re: Python/MySQL Frustration

2009-09-20 Thread Victor Subervi
Yeah, that was the problem...num was a string ;) Just caught it myself, too. Thanks, V On Sun, Sep 20, 2009 at 2:37 PM, Philip Semanchuk phi...@semanchuk.comwrote: On Sep 20, 2009, at 2:25 PM, Victor Subervi wrote: Hi; I have the following code: while i num: cat = 'cat' + str(i)

SQLObject 0.10.7

2009-09-20 Thread Oleg Broytmann
Hello! I'm pleased to announce version 0.10.7, a minor bugfix release of 0.10 branch of SQLObject. What is SQLObject = SQLObject is an object-relational mapper. Your database tables are described as classes, and rows are instances of those classes. SQLObject is meant to be

Re: How python source code in large projects are organized?

2009-09-20 Thread exarkun
On 07:10 pm, pengyu...@gmail.com wrote: On Sun, Sep 20, 2009 at 11:31 AM, Daniel Fetchinson fetchin...@googlemail.com wrote: I am wondering what is the best way of organizing python source code in a large projects. There are package code, testing code. I'm wondering if there has been any

easy question, how to double a variable

2009-09-20 Thread daggerdvm
Write the definition of a function twice , that receives an int parameter and returns an int that is twice the value of the parameter. how can i do this -- http://mail.python.org/mailman/listinfo/python-list

Re: Granularity of OSError

2009-09-20 Thread ryles
On Sep 19, 9:22 pm, MRAB pyt...@mrabarnett.plus.com wrote: The point is that it's sometimes a good idea to do a cheap check first before attempting an operation that's 'expensive' even when it fails. Strongly agree. Furthermore, with LBYL it's often easier to give a user clearer error messages

Name 'NewAxis' is not defined

2009-09-20 Thread mo
I found such a script - a gas model. http://des.memphis.edu/lurbano/vpython/gas/Temp_KE_07.py Can anybody help and find a mistake. There is a message: Name 'NewAxis' is not defined. I tried Python 25 with numpy 121 and Python 26 with scipy 071. (Win Vista). -- mo (not proffessional programmer ;)

Re: Name 'NewAxis' is not defined

2009-09-20 Thread Robert Kern
mo wrote: I found such a script - a gas model. http://des.memphis.edu/lurbano/vpython/gas/Temp_KE_07.py Can anybody help and find a mistake. There is a message: Name 'NewAxis' is not defined. I tried Python 25 with numpy 121 and Python 26 with scipy 071. (Win Vista). This file was written

Re: easy question, how to double a variable

2009-09-20 Thread MRAB
daggerdvm wrote: Write the definition of a function twice , that receives an int parameter and returns an int that is twice the value of the parameter. how can i do this That's a very basic question. Try a tutorial. -- http://mail.python.org/mailman/listinfo/python-list

Re: easy question, how to double a variable

2009-09-20 Thread Tim Chase
daggerdvm wrote: Write the definition of a function twice , that receives an int parameter and returns an int that is twice the value of the parameter. how can i do this Read over your textbook and the notes you took in class -- I'm sure therein you'll find how to define functions, how

Re: Name 'NewAxis' is not defined

2009-09-20 Thread MRAB
mo wrote: I found such a script - a gas model. http://des.memphis.edu/lurbano/vpython/gas/Temp_KE_07.py Can anybody help and find a mistake. There is a message: Name 'NewAxis' is not defined. I tried Python 25 with numpy 121 and Python 26 with scipy 071. (Win Vista). I can't see a definition

Re: on package import, have it conditionally import a subpackage

2009-09-20 Thread ryles
On Sep 19, 4:06 pm, Gabriel Rossetti gabriel.rosse...@arimaz.com wrote: Hello everyone, I'd like to ba able to import a package and have it's __init__ conditionally import a subpackage. Suppose that you have this structure : mybase/ mybase/__init__.py mybase/mypkg mybase/mypkg/__init__.py

Re: pyjamas pyv8run converts python to javascript, executes under command-line

2009-09-20 Thread lkcl
On Sep 19, 8:36 pm, Daniel Fetchinson fetchin...@googlemail.com wrote: the pyjamas project is taking a slightly different approach to achieve this same goal: beat the stuffing out of the pyjamas compiler, rather than hand-write such large sections of code in pure javascript, and double-run

Re: pyjamas pyv8run converts python to javascript, executes under command-line

2009-09-20 Thread lkcl
On Sep 20, 12:05 am, exar...@twistedmatrix.com wrote: Does pyjamas convert any Python program into a JavaScript program with the same behavior? that's one of the sub-goals of the pyjamas project, yes. I don't intend to imply that it doesn't - I haven't been keeping up with pyjamas

Re: Comparison of parsers in python?

2009-09-20 Thread andrew cooke
On Sep 20, 3:16 pm, Peng Yu pengyu...@gmail.com wrote: On Sun, Sep 20, 2009 at 1:35 PM, andrew cooke and...@acooke.org wrote: On Sep 20, 9:12 am, andrew cooke and...@acooke.org wrote: ps is there somewhere can download example files?  this would be useful for my own testing.  thanks. i

Re: How to refer to class name and function name in a python program?

2009-09-20 Thread alex23
Peng Yu pengyu...@gmail.com wrote: What does @echo mean? Have you read _any_ of the documentation? Or is this all an exercise in seeing if you can convince a group of disparate strangers to teach you Python for free? -- http://mail.python.org/mailman/listinfo/python-list

Re: Python/MySQL Frustration

2009-09-20 Thread John Nagle
Dennis Lee Bieber wrote: On Sun, 20 Sep 2009 14:25:53 -0400, Victor Subervi victorsube...@gmail.com declaimed the following in gmane.comp.python.general: Hi; I have the following code: while i num: cat = 'cat' + str(i) cat = form.getfirst(cat, '') item = 'item' +

Re: control CPU usage

2009-09-20 Thread Dave Angel
kakarukeys wrote: On Sep 20, 10:57 pm, Dave Angel da...@ieee.org wrote: kakarukeys wrote: On Sep 20, 6:24 pm, Dave Angel da...@ieee.org wrote: Jiang Fung Wong wrote: Dear All, Thank you for the information. I think I've some idea what the problem is about

Is there a concerted effort afoot to improve the Python Wiki?

2009-09-20 Thread skip
I've noticed over the past few weeks a huge increase in the frequency of edits in the Python wiki. Many of those are due to Carl Trachte's work on non-English pages about Python. There are plenty of other pages going under the knife as well though. Is there some community movement people are

Re: Can print() be reloaded for a user defined class?

2009-09-20 Thread Dave Angel
Peng Yu wrote: On Sun, Sep 20, 2009 at 9:19 AM, Dave Angel da...@ieee.org wrote: Peng Yu wrote: snip you might use: Is __repr__ =tr__ copy by reference or by value? If I change __str__ later on, will __repr__ be changed automatically? Regards, Peng

Re: Where are python module installed?

2009-09-20 Thread Chris Rebert
On Sun, Sep 20, 2009 at 6:30 PM, Peng Yu pengyu...@gmail.com wrote: Hi, I configured python-2.6.2 with my own --prefix, then 'make' and 'make install'. I only find the following dirs and I don't find any python modules in the directory. Do python modules come with python-2.6.2? $ ls bin  

Re: Where are python module installed?

2009-09-20 Thread Wolodja Wentland
On Sun, Sep 20, 2009 at 20:30 -0500, Peng Yu wrote: I configured python-2.6.2 with my own --prefix, then 'make' and 'make install'. I only find the following dirs and I don't find any python modules in the directory. Do python modules come with python-2.6.2? Yes. $ ls bin include lib

Re: Where are python module installed?

2009-09-20 Thread Daniel Fetchinson
I configured python-2.6.2 with my own --prefix, then 'make' and 'make install'. I only find the following dirs and I don't find any python modules in the directory. Do python modules come with python-2.6.2? $ ls bin include lib share Try 'ls lib/python*' and also 'ls

Re: Is there a concerted effort afoot to improve the Python Wiki?

2009-09-20 Thread Rami Chowdhury
Hi Skip, I've noticed over the past few weeks a huge increase in the frequency of edits in the Python wiki. Many of those are due to Carl Trachte's work on non-English pages about Python. There are plenty of other pages going under the knife as well though. Is there some community

Re: Where are python module installed?

2009-09-20 Thread Peng Yu
On Sun, Sep 20, 2009 at 8:37 PM, Daniel Fetchinson fetchin...@googlemail.com wrote: I configured python-2.6.2 with my own --prefix, then 'make' and 'make install'. I only find the following dirs and I don't find any python modules in the directory. Do python modules come with python-2.6.2? $

testing code in python source package

2009-09-20 Thread Peng Yu
Hi, I'm wondering if the development of python is test driven. If it is, where in the Python-2.6.2 source directory is the test code for the modules in ./Lib? Regards, Peng -- http://mail.python.org/mailman/listinfo/python-list

Re: Re: How to get the minimum number that can be represented?

2009-09-20 Thread Dave Angel
Peng Yu wrote: On Sun, Sep 20, 2009 at 9:37 AM, Grant Edwards inva...@invalid.invalid wrote: On 2009-09-20, Peng Yu pengyu...@gmail.com wrote: Suppose I want to define a function that return the minimum number that can be represented. def f(x): #body That it, if I call f(10), f

Where are python module installed?

2009-09-20 Thread Peng Yu
Hi, I configured python-2.6.2 with my own --prefix, then 'make' and 'make install'. I only find the following dirs and I don't find any python modules in the directory. Do python modules come with python-2.6.2? $ ls bin include lib share Regards, Peng --

Re: pyjamas pyv8run converts python to javascript, executes under command-line

2009-09-20 Thread Daniel Fetchinson
the pyjamas project is taking a slightly different approach to achieve this same goal: beat the stuffing out of the pyjamas compiler, rather than hand-write such large sections of code in pure javascript, and double-run regression tests (once as python, second time converted to

Re: Is there a concerted effort afoot to improve the Python Wiki?

2009-09-20 Thread kirby
On Sep 20, 5:52 pm, s...@pobox.com wrote: I've noticed over the past few weeks a huge increase in the frequency of edits in the Python wiki.  Many of those are due to Carl Trachte's work on non-English pages about Python.  There are plenty of other pages going under the knife as well though.  

Re: testing code in python source package

2009-09-20 Thread alex23
Peng Yu pengyu...@gmail.com wrote: I'm wondering if the development of python is test driven. If it is, where in the Python-2.6.2 source directory is the test code for the modules in ./Lib? Unsurprisingly, they're located in Lib/test. Is it _really_ that difficult to find? --

Re: Am I doing this wrong? Why does this seem so clumsy (time, datetime vs. DateTime)

2009-09-20 Thread Carl Banks
On Sep 19, 11:02 pm, Ben Morrow b...@morrow.me.uk wrote: [This is not a Perl question. F'ups set to c.l.python.] Heh, I didn't notice the cross-post. Glad I decided against following up with minor philosophical rant. Carl Banks -- http://mail.python.org/mailman/listinfo/python-list

Re: Where are python module installed?

2009-09-20 Thread Diez B. Roggisch
Peng Yu schrieb: On Sun, Sep 20, 2009 at 8:37 PM, Daniel Fetchinson fetchin...@googlemail.com wrote: I configured python-2.6.2 with my own --prefix, then 'make' and 'make install'. I only find the following dirs and I don't find any python modules in the directory. Do python modules come with

Re: Where are python module installed?

2009-09-20 Thread Peng Yu
On Sun, Sep 20, 2009 at 10:25 PM, Diez B. Roggisch de...@nospam.web.de wrote: Peng Yu schrieb: On Sun, Sep 20, 2009 at 8:37 PM, Daniel Fetchinson fetchin...@googlemail.com wrote: I configured python-2.6.2 with my own --prefix, then 'make' and 'make install'. I only find the following dirs

Re: Programming ideas?

2009-09-20 Thread Alan G Isaac
You could learn a lot of Python contributing to docutils or bibstuff, and if you write papers or presentations, it may pay off directly. Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: easy question, how to double a variable

2009-09-20 Thread Steven D'Aprano
On Sun, 20 Sep 2009 13:27:07 -0700, daggerdvm wrote: Write the definition of a function twice , that receives an int parameter and returns an int that is twice the value of the parameter. how can i do this Yes, that certainly is an easy question. Here's my solution: class

  1   2   >