T3 on GAE

2008-12-08 Thread Massimo Di Pierro
http://web2py.appspot.com/t3/default/wiki/main(there is a video tutorial) T3 version 0.2 is out. Now you can develop for GAE on GAE and it could not get any easier. T3 is a development platform (built on web2py) that works like a WIKI and it lets you embed python code and

[ANN] Leipzig Python User Group - Meeting, December 9, 2008, 08:00pm

2008-12-08 Thread Mike Müller
=== Leipzig Python User Group === We will meet on Tuesday, December 9 at 8:00 pm at the training center of Python Academy in Leipzig, Germany ( http://www.python-academy.com/center/find.html ). The topic is Generators in Python as unix-like pipelines. Food and soft drinks are provided. Please

ANN: PyBindGen 0.10 released

2008-12-08 Thread Gustavo Carneiro
PyBindGen is a Python module that is geared to generating C/C++ code that binds a C/C++ library for Python. It does so without extensive use of either C++ templates or C pre-processor macros. It has modular handling of C/C++ types, and can be easily extended with Python plugins. The generated code

SQLObject 0.9.9

2008-12-08 Thread Oleg Broytmann
Hello! I'm pleased to announce version 0.9.10, a minor bugfix release of 0.9 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

SQLObject 0.10.4

2008-12-08 Thread Oleg Broytmann
Hello! I'm pleased to announce version 0.10.4, 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

dBase III files and Visual Foxpro 6 files

2008-12-08 Thread Ethan Furman
Greetings All! I nearly have support complete for dBase III dbf/dbt files -- just wrapping up support for dates. The null value has been a hindrance for awhile but I nearly have that solved as well. For any who know of a cool dbf module already in existence for dBase III and Visual Foxpro

Re: Rich Comparisons Gotcha

2008-12-08 Thread James Stroud
Robert Kern wrote: James Stroud wrote: I think it skips straight to __eq__ if the element is not the first in the list. No, it doesn't skip straight to __eq__(). y is 1 returns False, so (y==1) is checked. When y is a numpy array, this returns an array of bools. list.__contains__() tries to

gzip.GzipFile (was Re: Don't you just love writing this sort of thing :))

2008-12-08 Thread Jorgen Grahn
On Sat, 06 Dec 2008 10:01:10 +, Arnaud Delobelle [EMAIL PROTECTED] wrote: ... Why use (open, gzp.GzipFile)[Entry.endswith(.gz)] when we have had contitional expressions for a few years now? Instead, you can write (gzip.GzipFile if entry.endswidth(.gz) else open). I think it will be

Re: EBCDIC -- ASCII

2008-12-08 Thread martinjamesevans
On Dec 5, 2:13 pm, Michael Ströder [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: On Dec 4, 4:45 pm, Michael Ströder [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: I'm having a problem trying to use the codecs package to aid me in converting some bytes from EBCDIC into ASCII.

Re: var or inout parm?

2008-12-08 Thread Bruno Desthuilliers
Colin J. Williams a écrit : [EMAIL PROTECTED] wrote: How can I make a var parm, where the called function can modify the value of the parameter in the caller? def f(x): x = x + 1 n = 1 f(n) # n should now be 2 Many TIA!! Mark Why not run it and see? Your function returns None. The

Re: Don't you just love writing this sort of thing :)

2008-12-08 Thread Gabriel Genellina
En Sun, 07 Dec 2008 05:34:39 -0200, Lawrence D'Oliveiro [EMAIL PROTECTED] escribió: In message [EMAIL PROTECTED], Arnaud Delobelle wrote: * you give the impression of being arrogant; Oddly enough, I wasn't the one who started by criticizing other people's code. I have no ego about my

Re: Strengths and weaknesses of Pygame vs. pyglet vs. PyOpenGL?

2008-12-08 Thread alex23
On Dec 8, 2:26 pm, illume [EMAIL PROTECTED] wrote: pygame is simpler to learn, since it doesn't require you to know how to create classes or functions. I'm not sure if I'd be quick to tout that as an advantage... :) -- http://mail.python.org/mailman/listinfo/python-list

Re: how to get a beep, OS independent ?

2008-12-08 Thread Gabriel Genellina
En Sun, 07 Dec 2008 23:34:17 -0200, Joe Strout [EMAIL PROTECTED] escribió: On Dec 7, 2008, at 4:43 PM, Steven D'Aprano wrote: Of course, if you're volunteering to write such a standard system beep for Python, I for one would be grateful. I am. But where should I put it? Assuming we don't

Re: ftp retrlines with re...

2008-12-08 Thread Gabriel Genellina
En Fri, 05 Dec 2008 12:51:58 -0200, [EMAIL PROTECTED] [EMAIL PROTECTED] escribió: Ive been working on an application quite some time now and i wanted to include something to let the user load a new version. i therefore tried to include this here: Too much code, unclear question... please post

Re: mod_python and files directory

2008-12-08 Thread Gabriel Genellina
En Sat, 06 Dec 2008 09:26:40 -0200, mete [EMAIL PROTECTED] escribió: but i want to take it somewhere else...i want to it work some other path in other system. os.path.dirname(os.path.abspath(__file__)) returns the directory where the current file resides. Execute it early in your code. --

Re: var or inout parm?

2008-12-08 Thread Chris Rebert
On Mon, Dec 8, 2008 at 12:26 AM, Bruno Desthuilliers [EMAIL PROTECTED] wrote: Colin J. Williams a écrit : [EMAIL PROTECTED] wrote: How can I make a var parm, where the called function can modify the value of the parameter in the caller? def f(x): x = x + 1 n = 1 f(n) # n should now

Re: Strengths and weaknesses of Pygame vs. pyglet vs. PyOpenGL?

2008-12-08 Thread James Mills
On Mon, Dec 8, 2008 at 6:31 PM, alex23 [EMAIL PROTECTED] wrote: On Dec 8, 2:26 pm, illume [EMAIL PROTECTED] wrote: pygame is simpler to learn, since it doesn't require you to know how to create classes or functions. I'm not sure if I'd be quick to tout that as an advantage... :) Neither

Re: how to get a beep, OS independent ?

2008-12-08 Thread Duncan Booth
Joe Strout [EMAIL PROTECTED] wrote: But invoking the standard system beep is such a basic function that it ought to be easier than this. I'm pretty sure it's a single OS call on all platforms. On OS X, for example, it's void NSBeep(void); declared in NSGraphics.h. I'm sure it's

Re: Strengths and weaknesses of Pygame vs. pyglet vs. PyOpenGL?

2008-12-08 Thread illume
On Dec 8, 7:31 pm, alex23 [EMAIL PROTECTED] wrote: On Dec 8, 2:26 pm, illume [EMAIL PROTECTED] wrote: pygame is simpler to learn, since it doesn't require you to know how to create classes or functions. I'm not sure if I'd be quick to tout that as an advantage... :) Hi, It's easier to

Re: gzip.GzipFile (was Re: Don't you just love writing this sort of thing :))

2008-12-08 Thread Bruno Desthuilliers
Jorgen Grahn a écrit : (snip) Also, making a decision based on the .gz part of the name isn't always correct -- you miss files named foo.Z and similar. .tgz anyone ? /Jorgen -- http://mail.python.org/mailman/listinfo/python-list

Re: Strengths and weaknesses of Pygame vs. pyglet vs. PyOpenGL?

2008-12-08 Thread alex23
On Dec 8, 7:18 pm, illume [EMAIL PROTECTED] wrote: It's easier to teach only requiring *using* classes, and functions than *creating* them.  This is important if it's being used to teach programming - as you don't need to teach people two fairly large concepts before you can do anything. I'm

Re: Learning Python now coming from Perl

2008-12-08 Thread Nick Craig-Wood
Bertilo Wennergren [EMAIL PROTECTED] wrote: I'm planning to start learning Python now, using Python 3000. I have no previous Python skills, but I now Perl pretty well. I'm also well experienced with JavaScript. Any pointers and tips how I should go about getting into Python? Read Dive

Re: infering the number of args a function takes at runtime

2008-12-08 Thread sniffer
On Dec 8, 9:39 am, sniffer [EMAIL PROTECTED] wrote: hi all, i am a python newbie, in a project currently doing i need to find out the number of arguments that a function takes at runtime.? Is this possible ,if so how do i do this,i ve looked through the python documentation but couldnt find

Re: ftp retrlines with re...

2008-12-08 Thread Peter Otten
[EMAIL PROTECTED] wrote: filelist=server.retrlines('LIST') This does not do what you think it does. help(ftplib.FTP.retrlines) gives Help on method retrlines in module ftplib: retrlines(self, cmd, callback=None) unbound ftplib.FTP method Retrieve data in line mode. The argument is

Determining whether a variable is less/greater than a range.

2008-12-08 Thread [EMAIL PROTECTED]
Hi. I'm having another go at learning Python so I'll probably be asking a few basic questions. Here is the first one. a = list(range(10, 21) b = 9 c = 21 How can I find out if b and c have values less or more than the values in list a? Thanks. --

built-in functions as class attributes

2008-12-08 Thread Mark Dickinson
Here's a curiosity: after def my_hex(x): return hex(x) one might expect hex and my_hex to be interchangeable in most situations. But (with both Python 2.x and 3.x) I get: def my_hex(x): return hex(x) ... class T(object): f = hex ... class T2(object): f = my_hex ... T().f(12345)

Re: Guido's new method definition idea

2008-12-08 Thread Lie Ryan
On Sun, 07 Dec 2008 18:27:21 +0100, Andreas Waldenburger wrote: On Sat, 6 Dec 2008 23:21:04 -0800 (PST) Lie [EMAIL PROTECTED] wrote: I think we have to test this on newbies. [snip] Now that's talking like a programmer! Ideas on how such a survey could be conducted? Anyone? If this

Re: Determining whether a variable is less/greater than a range.

2008-12-08 Thread [EMAIL PROTECTED]
On Dec 8, 11:12 am, Tim Chase [EMAIL PROTECTED] wrote: a = list(range(10, 21)) b = 9 c = 21 How can I find out if b and c have values less or more than the values in list a? Sounds like a good use for 2.5's addition of the any() and all() functions -- you don't mention whether you

Re: Mathematica 7 compares to other languages

2008-12-08 Thread Jon Harrop
Xah Lee wrote: The result and speed up of my code can be verified by anyone who has Mathematica. You changed the scene that is being rendered = your speedup is bogus! Trace the scene I originally gave and you will see that your program is no faster than mine was. -- Dr Jon D Harrop, Flying

Re: how to get a beep, OS independent ?

2008-12-08 Thread malkarouri
On 6 Dec, 23:40, Stef Mientki [EMAIL PROTECTED] wrote: hello, I want to give a small beep, Just to add to the options here. Where ncurses work you can use: python -c 'from curses import *;wrapper(lambda s:beep())' To try it just enter the whole line above in the command line.. Regards,

Re: Mathematica 7 compares to other languages

2008-12-08 Thread Jon Harrop
Xah Lee wrote: For those interested in this Mathematica problem, i've now cleaned up the essay with additional comments here: • A Mathematica Optimization Problem http://xahlee.org/UnixResource_dir/writ/Mathematica_optimization.html In that article you say: Further, if Intersect is made

Re: A question about reference in Python.

2008-12-08 Thread James Mills
In case the OP is interested here is a more complete implementation (others are welcome to comment): http://codepad.org/drIhqb7Z Enjoy :) cheers James -- -- -- Problems are solved by method -- http://mail.python.org/mailman/listinfo/python-list

Re: pytz and timezone specialists

2008-12-08 Thread manatlan
On 5 déc, 20:46, Ned Deily [EMAIL PROTECTED] wrote: In article [EMAIL PROTECTED],  manatlan [EMAIL PROTECTED] wrote: Here is a really simple code : --- from datetime import datetime frompytzimport timezone

Re: Public imports

2008-12-08 Thread Bruno Desthuilliers
Márcio Faustino a écrit : Hi, Does Python support public imports instead of the default private? Python has no notion of public or private !-) Something like D's public import (see http://www.digitalmars.com/d/ 2.0/module.html) Python imports don't work as D imports (as far as I can tell

Re: Guido's new method definition idea

2008-12-08 Thread Bruno Desthuilliers
Philip Slate a écrit : On Dec 7, 1:13 pm, Bruno Desthuilliers [EMAIL PROTECTED] wrote: and friendlier to newbies. I'd rather say more acceptable to java-brainwashed developpers. And I'd rather say you're trolling, Almost, indeed. But not as much as you !-) --

Re: newbie - merging xls files using xldt and xlwt

2008-12-08 Thread J Sutar
Hi, I have been provided with the program below. Which sets out to merge singlesheet excel files into one multisheet excel workbook. Though it manages to merge multiple files into one workbook many of the formats are not preserved. For example, what was originally 22.92% is converted to

Re: Determining whether a variable is less/greater than a range.

2008-12-08 Thread [EMAIL PROTECTED]
Wow. Thanks Eric and Peter. Very helpful indeed. -- http://mail.python.org/mailman/listinfo/python-list

Python and audio frequency analysis

2008-12-08 Thread manatlan
I'd like to make a kind of spectrum analyzer ... Which should display bars according bands of frequencies ... in real time... Is anybody know an audio processing lib in python for that ? -- http://mail.python.org/mailman/listinfo/python-list

Re: Determining whether a variable is less/greater than a range.

2008-12-08 Thread Tim Chase
a = list(range(10, 21)) b = 9 c = 21 How can I find out if b and c have values less or more than the values in list a? Sounds like a good use for 2.5's addition of the any() and all() functions -- you don't mention whether you want your variable compared against *any* of the list items or

Re: Shutdown Mac OSX computer using python

2008-12-08 Thread Wolfgang Draxinger
Håkan Hagenrud wrote: Hello, i'm a python noob! But I would like to shutdown a 10.5.x mac computer using python (2.5.1) this is my code: #!/usr/bin/python import SystemEvents down = SystemEvents.Power_Suite.Power_Suite_Events() down.shut_down() the last call needs an additional

Beginner trying to understand functions.

2008-12-08 Thread simonh
In my attempt to learn Python I'm writing a small (useless) program to help me understand the various concepts. I'm going to add to this as I learn to serve as a single place to see how something works, hopefully. Here is the first approach: name = input('Please enter your name: ')

Re: Strengths and weaknesses of Pygame vs. pyglet vs. PyOpenGL?

2008-12-08 Thread Pierre-Alain Dorange
illume [EMAIL PROTECTED] wrote: pygame is also much more portable, has more people using it, has more developers, and a stable API. Code you wrote 5 years ago will most likely still work. Code you wrote for older versions of pyglet will not work without changes. I'm a new python and pygame

Re: getting error...... Traceback (most recent call last): File stdin, line 1, in module File C:\Python25\Lib\site-packages\xlrd\__init__.py, line 370, in open_workbook biff_version = bk.getb

2008-12-08 Thread John Machin
On Dec 8, 6:48 pm, Gabriel Genellina [EMAIL PROTECTED] wrote: En Fri, 05 Dec 2008 02:31:01 -0200, pk sahoo [EMAIL PROTECTED]   escribió: hallo everybody, when i am running the following command import xlrd book=xlrd.open_workbook(C:\\a.xls) i am getting the following error..

Re: Mathematica 7 compares to other languages

2008-12-08 Thread Jon Harrop
[EMAIL PROTECTED] wrote: Well, its past 'tonight' and 6 hours to go till past 'tomorrow'. Where the hell is it Zah Zah? Note that this program takes several days to compute in Mathematica (even though it takes under four seconds in other languages) so don't expect to see a genuinely optimized

Re: built-in functions as class attributes

2008-12-08 Thread Peter Otten
Mark Dickinson wrote: Here's a curiosity: after def my_hex(x): return hex(x) one might expect hex and my_hex to be interchangeable in most situations. But (with both Python 2.x and 3.x) I get: def my_hex(x): return hex(x) ... class T(object): f = hex ... class T2(object): f

Shutdown Mac OSX computer using python

2008-12-08 Thread Håkan Hagenrud
Hello, i'm a python noob! But I would like to shutdown a 10.5.x mac computer using python (2.5.1) this is my code: #!/usr/bin/python import SystemEvents down = SystemEvents.Power_Suite.Power_Suite_Events() down.shut_down() the last call needs an additional argument, I cant find any

Re: Strengths and weaknesses of Pygame vs. pyglet vs. PyOpenGL?

2008-12-08 Thread illume
On Dec 8, 8:59 pm, alex23 [EMAIL PROTECTED] wrote: On Dec 8, 7:18 pm, illume [EMAIL PROTECTED] wrote: It's easier to teach only requiring *using* classes, and functions than *creating* them.  This is important if it's being used to teach programming - as you don't need to teach people two

Public imports

2008-12-08 Thread Márcio Faustino
Hi, Does Python support public imports instead of the default private? Something like D's public import (see http://www.digitalmars.com/d/ 2.0/module.html) or even Perl's export_to_level. Thanks, -- http://mail.python.org/mailman/listinfo/python-list

Re: Determining whether a variable is less/greater than a range.

2008-12-08 Thread [EMAIL PROTECTED]
Found it. min and max functions. I thought that this would be implemented as a list method: a.min a.max I can see that the built in functions make sense. -- http://mail.python.org/mailman/listinfo/python-list

Re: built-in functions as class attributes

2008-12-08 Thread Mark Dickinson
On Dec 8, 11:23 am, Peter Otten [EMAIL PROTECTED] wrote: I don't know if there is something official, I google for http://users.rcn.com/python/download/Descriptor.htm or descrintro every time I need a refresher. Thank you! I'd read this before, but apparently I'd either not taken it in

Re: Determining whether a variable is less/greater than a range.

2008-12-08 Thread Peter Otten
[EMAIL PROTECTED] wrote: Hi. I'm having another go at learning Python so I'll probably be asking a few basic questions. Here is the first one. a = list(range(10, 21) b = 9 c = 21 How can I find out if b and c have values less or more than the values in list a? a = range(10, 21)

Re: Beginner trying to understand functions.

2008-12-08 Thread James Mills
On Mon, Dec 8, 2008 at 11:32 PM, simonh [EMAIL PROTECTED] wrote: That works fine. Then I've tried to use functions instead. The first two work fine, the third fails: [ ... snip ... ] Try this: def getName(): name = input('Please enter your name: ') print('Hello', name) return name

Re: infering the number of args a function takes at runtime

2008-12-08 Thread Lie Ryan
On Mon, 08 Dec 2008 02:40:03 -0800, sniffer wrote: On Dec 8, 9:39 am, sniffer [EMAIL PROTECTED] wrote: hi all, i am a python newbie, in a project currently doing i need to find out the number of arguments that a function takes at runtime.? Is this possible ,if so how do i do this,i ve looked

Re: Beginner trying to understand functions.

2008-12-08 Thread Pierre-Alain Dorange
simonh [EMAIL PROTECTED] wrote: def getName(): name = input('Please enter your name: ') print('Hello', name) def getAge(): while True: try: age = int(input('Please enter your age: ')) break except ValueError: print('That

Re: Determining whether a variable is less/greater than a range.

2008-12-08 Thread eric
On Dec 8, 11:44 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi. I'm having another go at learning Python so I'll probably be asking a few basic questions. Here is the first one. a = list(range(10, 21) b = 9 c = 21 How can I find out if b and c have values less or more than the values

Re: Python and audio frequency analysis

2008-12-08 Thread Pierre-Alain Dorange
manatlan [EMAIL PROTECTED] wrote: I'd like to make a kind of spectrum analyzer ... Which should display bars according bands of frequencies ... in real time... Is anybody know an audio processing lib in python for that ? For the display module you can use pygame, pyglet or pyOpenGL, there

Re: Beginner trying to understand functions.

2008-12-08 Thread Peter Otten
simonh wrote: In my attempt to learn Python I'm writing a small (useless) program to help me understand the various concepts. I'm going to add to this as I learn to serve as a single place to see how something works, hopefully. Here is the first approach: That works fine. Then I've tried to

Beginner trying to understand functions.

2008-12-08 Thread acerimusdux
simonh write: In my attempt to learn Python I'm writing a small (useless) program to help me understand the various concepts. I'm going to add to this as I learn to serve as a single place to see how something works, hopefully. Here is the first approach: name = input('Please enter your name:

Re: Guido's new method definition idea

2008-12-08 Thread Almar Klein
I like the transparancy and clearity of python, and the explicit self fits beautifully. Allowing a second way of defining your methods would only confuse newbies more I would think. I was a newby only half a year ago (or maybe I still am). The explicit self seems weird the very first time you see

Re: gzip.GzipFile (was Re: Don't you just love writing this sort of thing :))

2008-12-08 Thread MRAB
Jorgen Grahn wrote: On Sat, 06 Dec 2008 10:01:10 +, Arnaud Delobelle [EMAIL PROTECTED] wrote: ... Why use (open, gzp.GzipFile)[Entry.endswith(.gz)] when we have had contitional expressions for a few years now? Instead, you can write (gzip.GzipFile if entry.endswidth(.gz) else open).

Re: Rich Comparisons Gotcha

2008-12-08 Thread Rasmus Fogh
Rober Kern wrote: James Stroud wrote: Steven D'Aprano wrote: On Sun, 07 Dec 2008 13:57:54 -0800, James Stroud wrote: Rasmus Fogh wrote: ll1 = [y,1] y in ll1 True ll2 = [1,y] y in ll2 Traceback (most recent call last): File stdin, line 1, in module ValueError: The truth value of an

Re: dBase III files and Visual Foxpro 6 files

2008-12-08 Thread sniffer
On Dec 8, 12:53 pm, Ethan Furman [EMAIL PROTECTED] wrote: Greetings All! I nearly have support complete for dBase III dbf/dbt files -- just wrapping up support for dates.  The null value has been a hindrance for awhile but I nearly have that solved as well. For any who know of a cool dbf

Re: Public imports

2008-12-08 Thread bearophileHUGS
Márcio Faustino: Does Python support public imports instead of the default private? Something like D's public import (see http://www.digitalmars.com/d/ 2.0/module.html) or even Perl's export_to_level. D type system has several big holes, and I am trying to push Walter to fix some of those, to

Re: Python and audio frequency analysis

2008-12-08 Thread David Cournapeau
On Mon, Dec 8, 2008 at 10:20 PM, manatlan [EMAIL PROTECTED] wrote: I'd like to make a kind of spectrum analyzer ... Which should display bars according bands of frequencies ... in real time... Is anybody know an audio processing lib in python for that ? Hi, It is possible to use python for

Re: Beginner trying to understand functions.

2008-12-08 Thread cadmuxe
i think we should use raw_input('Please enter your name: ') instead of input('Please enter your name: ') 2008/12/8 Peter Otten [EMAIL PROTECTED] simonh wrote: In my attempt to learn Python I'm writing a small (useless) program to help me understand the various concepts. I'm going to add to

[Python 2.x] Pickling a datetime.tzinfo subclass instance?

2008-12-08 Thread Cong Ma
Hello, I'm writing a program that pickles an instance of a custom subclass of datetime.tzinfo. I followed the guides given in the Library Reference (version 2.5.2, chapter 5.1.6), which contain the note: Special requirement for pickling: A tzinfo subclass must have an __init__ method that can be

Re: Beginner trying to understand functions.

2008-12-08 Thread James Mills
On Tue, Dec 9, 2008 at 12:24 AM, cadmuxe [EMAIL PROTECTED] wrote: i think we should use raw_input('Please enter your name: ') instead of input('Please enter your name: ') Good point :) OP: Please take notes :) cheers James -- -- -- Problems are solved by method --

Re: Public imports

2008-12-08 Thread bearophileHUGS
D type system has several big holes, I meant D module system, of course. Sorry. Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list

Re: Beginner trying to understand functions.

2008-12-08 Thread Benjamin Kaplan
On Mon, Dec 8, 2008 at 9:24 AM, cadmuxe [EMAIL PROTECTED] wrote: i think we should use raw_input('Please enter your name: ') instead of input('Please enter your name: ') Print is a function in this code and range returns an iterator (or else list(range(18,31)) is redundant). I think the OP is

datetime and the rich-companison operators

2008-12-08 Thread Ethan Furman
Greetings All! I am implementing a NullDate class in order to mirror dates and datetimes that have no value (yes, this is for my dbf module :) I'm still a bit fuzzy about class methods, hashing, and __new__, but my question of the moment is this: it seems to me that with two dates or

Re: Beginner trying to understand functions.

2008-12-08 Thread Peter Otten
James Mills wrote: On Tue, Dec 9, 2008 at 12:24 AM, cadmuxe [EMAIL PROTECTED] wrote: i think we should use raw_input('Please enter your name: ') instead of input('Please enter your name: ') Good point :) OP: Please take notes :) I think the OP is using Python 3.0. What used to cause

Re: [Py2exe-users] py2exe 0.6.9 released

2008-12-08 Thread Pascal
On Mon, 17 Nov 2008 12:39:36 +, Pascal wrote: On Sun, 16 Nov 2008 21:23:59 -0500, Chris Spencer wrote: After I compile my program with py2exe 0.6.9 with Python 2.6, I'm still getting the Application Did Not Initialize Properly error dialog whenever I run my code. What am I doing wrong?

Re: dBase III files and Visual Foxpro 6 files

2008-12-08 Thread Ethan Furman
sniffer wrote: On Dec 8, 12:53 pm, Ethan Furman [EMAIL PROTECTED] wrote: Greetings All! I nearly have support complete for dBase III dbf/dbt files -- just wrapping up support for dates. The null value has been a hindrance for awhile but I nearly have that solved as well. For any who know of

Re: Beginner trying to understand functions.

2008-12-08 Thread James Mills
On Tue, Dec 9, 2008 at 12:46 AM, Peter Otten [EMAIL PROTECTED] wrote: I think the OP is using Python 3.0. What used to cause trouble Well of course he/she/it is! I'm too blind to have noticed that! :) --JamesMills -- -- -- Problems are solved by method --

Re: Beginner trying to understand functions.

2008-12-08 Thread cadmuxe
On 12月8日, 下午10时53分, James Mills [EMAIL PROTECTED] wrote: On Tue, Dec 9, 2008 at 12:46 AM, Peter Otten [EMAIL PROTECTED] wrote: I think the OP is using Python 3.0. What used to cause trouble Well of course he/she/it is! I'm too blind to have noticed that! :) --JamesMills -- -- --

appending values into array instead of a list

2008-12-08 Thread trias
Hi, I have this little script: import csv import numpy signal=[] ref=[] for x in csv.reader(open('reffile.csv').readlines()): ref.append(x) for x in csv.reader(open('signalfile.csv').readlines()): signal.append(x) signalarray=numpy.array(signal, dtype=float) signaldict={}

Re: Best way to run multiple Python processes without overloading CPU or disk i/o

2008-12-08 Thread Philip Semanchuk
On Dec 8, 2008, at 2:48 AM, Gabriel Genellina wrote: En Wed, 03 Dec 2008 02:29:32 -0200, Philip Semanchuk [EMAIL PROTECTED] escribió: On Dec 2, 2008, at 11:21 PM, [EMAIL PROTECTED] wrote: Is there a cross-platform way to launch multiple Python processes and monitor CPU usage

Re: A question about reference in Python.

2008-12-08 Thread Joe Strout
On Dec 7, 2008, at 10:26 PM, Group wrote: Now, I want to write a Red-Black Tree, and a List structure. In C/C+ +, I can use pointers to refer to children notes (or next notes). But, in Python, how can I do it? Except the sequence, I know not any way. Any variable in Python is a

Re: Learning Python now coming from Perl

2008-12-08 Thread Roy Smith
In article [EMAIL PROTECTED], Nick Craig-Wood [EMAIL PROTECTED] wrote: My favourite mistake when I made the transition was calling methods without parentheses. In perl it is common to call methods without parentheses - in python this does absolutely nothing! pychecker does warn about it

Equivalent of 'wget' for python?

2008-12-08 Thread Robert Dailey
Hi, I'm looking for a portable way to download ZIP files on the internet through Python. I don't want to do os.system() to invoke 'wget', since this isn't portable on Windows. I'm hoping the core python library has a library for this. Note that I'll be using Python 3.0. Thanks. --

Re: Guido's new method definition idea

2008-12-08 Thread Christopher
I'd like this new way of defining methods, what do you guys think? Anyone ready for writing a PEP? I don't really see any advantage. IMHO, it is not clearer, it is not more concise, it makes the definition of class shared variables look really out of place. It also makes the new programmer

Re: Equivalent of 'wget' for python?

2008-12-08 Thread Diez B. Roggisch
Robert Dailey wrote: Hi, I'm looking for a portable way to download ZIP files on the internet through Python. I don't want to do os.system() to invoke 'wget', since this isn't portable on Windows. I'm hoping the core python library has a library for this. Note that I'll be using Python

Re: Equivalent of 'wget' for python?

2008-12-08 Thread Jean-Paul Calderone
On Mon, 08 Dec 2008 17:29:35 +0100, Diez B. Roggisch [EMAIL PROTECTED] wrote: Robert Dailey wrote: Hi, I'm looking for a portable way to download ZIP files on the internet through Python. I don't want to do os.system() to invoke 'wget', since this isn't portable on Windows. I'm hoping the

Re: Equivalent of 'wget' for python?

2008-12-08 Thread r0g
Robert Dailey wrote: Hi, I'm looking for a portable way to download ZIP files on the internet through Python. I don't want to do os.system() to invoke 'wget', since this isn't portable on Windows. I'm hoping the core python library has a library for this. Note that I'll be using Python 3.0.

Calling C# COM (.NET) from python

2008-12-08 Thread Andrew Falanga
Hi, I've never programmed in python and only have a small understanding of what is wrapped up in the terms COM and .NET. Is there a way of using python to get a hold of objects written in C# as COM objects using python? I'm looking for ways to avoid VBScript (which, after a couple of weeks,

Re: Guido's new method definition idea

2008-12-08 Thread anthony . tolle
On Dec 6, 4:15 pm, Carl Banks [EMAIL PROTECTED] wrote: On Dec 6, 12:47 am, Patrick Mullen [EMAIL PROTECTED] wrote: Could I do something like this: def a.add(b): return a+b Outside of a class?  Of course then that makes you think you could do 5.add(6) or something crzy like that.  

Re: Guido's new method definition idea

2008-12-08 Thread anthony . tolle
On Dec 6, 4:15 pm, Carl Banks [EMAIL PROTECTED] wrote: On Dec 6, 12:47 am, Patrick Mullen [EMAIL PROTECTED] wrote: Could I do something like this: def a.add(b): return a+b Outside of a class?  Of course then that makes you think you could do 5.add(6) or something crzy like that.  

SQLObject 0.9.9

2008-12-08 Thread Oleg Broytmann
Hello! I'm pleased to announce version 0.9.10, a minor bugfix release of 0.9 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

SQLObject 0.10.4

2008-12-08 Thread Oleg Broytmann
Hello! I'm pleased to announce version 0.10.4, 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

Python-URL! - weekly Python news and links (Dec 8)

2008-12-08 Thread Gabriel Genellina
QOTW: To the pure, everything, properly described, is pure ;-) - Bengt Richter The final version of Python 3.0 was released last Wednesday, jointly with 2.6.1 - congratulations! http://groups.google.com/group/comp.lang.python/t/f92e7e2db667d903/ Implementing lazy

Re: Guido's new method definition idea

2008-12-08 Thread anthony . tolle
On Dec 8, 12:01 pm, [EMAIL PROTECTED] wrote: It would be nice to be able to do the following instead: class C:     def createfunc(self):         def self.func(arg):             return arg + 1 The above example should have read as follows: class C: def createfunc(self, arg):

Re: Calling C# COM (.NET) from python

2008-12-08 Thread Ben Kaplan
On Dec 8, 2008, at 11:53 AM, Andrew Falanga [EMAIL PROTECTED] wrote: Hi, I've never programmed in python and only have a small understanding of what is wrapped up in the terms COM and .NET. Is there a way of using python to get a hold of objects written in C# as COM objects using python?

Re: [Py2exe-users] py2exe 0.6.9 released

2008-12-08 Thread Pascal
On Mon, 08 Dec 2008 14:47:13 +, Pascal wrote: On Mon, 17 Nov 2008 12:39:36 +, Pascal wrote: On Sun, 16 Nov 2008 21:23:59 -0500, Chris Spencer wrote: After I compile my program with py2exe 0.6.9 with Python 2.6, I'm still getting the Application Did Not Initialize Properly error

Re: Calling C# COM (.NET) from python

2008-12-08 Thread Mike Driscoll
On Dec 8, 10:53 am, Andrew Falanga [EMAIL PROTECTED] wrote: Hi, I've never programmed in python and only have a small understanding of what is wrapped up in the terms COM and .NET.  Is there a way of using python to get a hold of objects written in C# as COM objects using python?  I'm

Re: Guido's new method definition idea

2008-12-08 Thread Ben Kaplan
On Dec 8, 2008, at 11:59 AM, [EMAIL PROTECTED] wrote: On Dec 6, 4:15 pm, Carl Banks [EMAIL PROTECTED] wrote: On Dec 6, 12:47 am, Patrick Mullen [EMAIL PROTECTED] wrote: Could I do something like this: def a.add(b): return a+b Outside of a class? Of course then that makes you think

Re: Mathematica 7 compares to other languages

2008-12-08 Thread Xah Lee
On Dec 8, 5:10 am, Jon Harrop [EMAIL PROTECTED] wrote: Xah Lee wrote: For those interested in this Mathematica problem, i've now cleaned up the essay with additional comments here: • A Mathematica Optimization Problem http://xahlee.org/UnixResource_dir/writ/Mathematica_optimization.html

Re: How to Write to csv file to create bulk address book

2008-12-08 Thread r0g
k.i.n.g. wrote: Hi , I am new to scripting, I am working on script which would create 'n' number address book entries into a csv file which would be used to import into a address book. I need suggestions for the same The fileds for csv file are as follows Title,First Name,Middle

Re: datetime and the rich-companison operators

2008-12-08 Thread Chris Rebert
On Sun, Dec 7, 2008 at 11:41 PM, Ethan Furman [EMAIL PROTECTED] wrote: Greetings All! I am implementing a NullDate class in order to mirror dates and datetimes that have no value (yes, this is for my dbf module :) I'm still a bit fuzzy about class methods, hashing, and __new__, but my

Re: Equivalent of 'wget' for python?

2008-12-08 Thread Jerry Hill
On Mon, Dec 8, 2008 at 11:53 AM, r0g [EMAIL PROTECTED] wrote: urllib.urlretrieve(url_of_zip_file, destination_on_local_filesystem). In python 3.0, that appears to be: import urllib.request urllib.request.urlretrieve(url, local_file_name) -- Jerry --

Re: Equivalent of 'wget' for python?

2008-12-08 Thread Diez B. Roggisch
Jean-Paul Calderone wrote: On Mon, 08 Dec 2008 17:29:35 +0100, Diez B. Roggisch [EMAIL PROTECTED] wrote: Robert Dailey wrote: Hi, I'm looking for a portable way to download ZIP files on the internet through Python. I don't want to do os.system() to invoke 'wget', since this isn't portable

  1   2   3   4   >