ANN: Webware 0.9.2 released

2006-09-18 Thread Christoph Zwerschke
Webware 0.9.2 has been released. This release of Webware for Python includes a couple of fixes and improvements of WebKit, MiddleKit, MiscUtils and WebUtils (see the respective release notes). Webware for Python is a suite of Python packages and tools for developing object-oriented, web-based

[ANN] Movable Python 2.0.0 Beta 1

2006-09-18 Thread Fuzzyman
There is a new version of `Movable Python http://www.voidspace.org.uk/python/movpy/`_ available. This is available for **Movable Python** for Python 2.2.3, 2.3.5, 2.4.3 and 2.5rc2 from : `The Movable Python Groups Page http://voidspace.tradebit.com/groups.php`_ What is Movable Python

[ANN] Movable Python Mega-Pack and MovablePython.NET

2006-09-18 Thread Fuzzyman
One of the most important new features of `Movable Python http://www.voidspace.org.uk/python/movpy/`_ is that it can work with multiple interpreters. That can be other distributions of **Movable Python**, an installed version of Python, IronPython, or in fact any executable (or batch file or a

CfP: IEEE Software Special Issue on Rapid Application Development with Dynamically Typed Languages

2006-09-18 Thread Laurence Tratt
IEEE Software Special Issue Rapid Application Development with Dynamically Typed Languages Call for Papers Publication:

PyPy Sprint Announcement, Duesseldorf 30 Oct - 5 Nov

2006-09-18 Thread Carl Friedrich Bolz
Hi all! The next PyPy sprint will be held in the Computer Science department of Heinrich-Heine Universitaet Duesseldorf from the 30th of October to the 5th of November 2006. Topics and goals The topics of the sprints are not fixed yet. We will progress on the subjects that we

[ANN] buzhug-0.5 released

2006-09-18 Thread Pierre Quentel
Buzhug is a fast, portable, pure-Python database engine, with a Pythonic syntax (no SQL) This release introduces a client-server mode, for applications that need thread- or process- safety An optional parameter mode is added to the method create(), in case the base already exists the result can

modules in diff. file

2006-09-18 Thread JyotiC
hi, i have a prog. and i want diving the code in different files. there will be one mail file which will call modules or variables(global) from differnet files how can i do this. code is very big and i it's getting difficult to manage in same file. thanx in advance --

Re: modules in diff. file

2006-09-18 Thread Calvin Spealman
On 18 Sep 2006 00:19:20 -0700, JyotiC [EMAIL PROTECTED] wrote: hi, i have a prog. and i want diving the code in different files. there will be one mail file which will call modules or variables(global) from differnet files how can i do this. code is very big and i it's getting difficult to

incompatible exit values between python 2.4 and 2.5

2006-09-18 Thread Anthon
I have a small C program that restarts a python based server application if the exit value of the system(python -m pythonscript arg1 arg2 ...) is greater than 127 (using WEXITSTATUS on the result of system(..)) If the server really needs to stop I exit with sys.exit(0) but if I just want it

Re: Pythondocs.info : collaborative Python documentation project

2006-09-18 Thread Michael Ströder
[EMAIL PROTECTED] wrote: That's why I have started a collaborative project to make a user contributed Python documentation. The wiki is online here: http://www.pythondocs.info Frankly I'm tired of these yet-another-wiki announcements! Who is supposed to fill them with content? If you have

Re: Python programs always open source?

2006-09-18 Thread GHUM
Guy Fawkes schrieb: I don't want my program to be open-source and so far all the Python programs I've seen included the source code. That's one of the great freedoms of Python and its licence: You are free to chose the licence for your product. No GPLish you must be as free as we, more

Re: incompatible exit values between python 2.4 and 2.5

2006-09-18 Thread Diez B. Roggisch
1) is this change of behaviour documented somewhere and did I miss that, or has this not been documented (yet) 2) Is there a build-in way to set the exit value for Python in case an exception is raised that is uncaught and causes python to terminate? (I have now implemented something using

Re: Cheese Shop Registration error

2006-09-18 Thread alefnula
The Key ID that the kgpg shows. I tried to paste the key returned by the quiery on the keyserver. but it also doesn't work. I tried everything that has any connection with the key, but everything fails. By the way the key is: 6A61E3AD Richard Jones wrote: [EMAIL PROTECTED] wrote: I tried to

Re: Pythondocs.info : collaborative Python documentation project

2006-09-18 Thread Bruno Desthuilliers
[EMAIL PROTECTED] wrote: Wildemar Wildenburger wrote: [EMAIL PROTECTED] wrote: I have read many messages of people complaining about the documentation, it's lack of examples and the use of complicated sentences that you need to read 10 times before understanding what it means. Where have

Re: How to change font direction?

2006-09-18 Thread Frederic Rentsch
theju wrote: Well here are some self explanatory functions that I've written for displaying the text vertically and from right to left. As for rotation gimme some more time and i'll come back to you. Also I don't guarantee that this is the best method(cos I myself am a newbie), but I can

PythonCAD question

2006-09-18 Thread Franz Steinhaeusler
Hello NG, I tried to run PythonCad on window and got follwoing traceback: Traceback (most recent call last): File C:\temp\PythonCAD-DS1-R34\PythonCad.py, line 45, in ? import PythonCAD.Interface.Cocoa.ImageDocument File

Re: PythonCAD question

2006-09-18 Thread Peter Otten
Franz Steinhaeusler wrote: Hello NG, I tried to run PythonCad on window and got follwoing traceback: Traceback (most recent call last): File C:\temp\PythonCAD-DS1-R34\PythonCad.py, line 45, in ? import PythonCAD.Interface.Cocoa.ImageDocument File

Re: PythonCAD question

2006-09-18 Thread Franz Steinhaeusler
Peter Otten wrote: Franz Steinhaeusler wrote: Hello NG, I tried to run PythonCad on window and got follwoing traceback: Traceback (most recent call last): File C:\temp\PythonCAD-DS1-R34\PythonCad.py, line 45, in ? import PythonCAD.Interface.Cocoa.ImageDocument File

Re: incompatible exit values between python 2.4 and 2.5

2006-09-18 Thread John Machin
Diez B. Roggisch wrote: 1) is this change of behaviour documented somewhere and did I miss that, or has this not been documented (yet) 2) Is there a build-in way to set the exit value for Python in case an exception is raised that is uncaught and causes python to terminate? (I have now

Re: PythonCAD question

2006-09-18 Thread Peter Otten
Franz Steinhaeusler wrote: The .../Cocoa/... part in the paths suggests that PythonCAD assumes it is running on a Mac. The missing module is rather a symptom than the cause of the bug. On the homepage, http://www.pythoncad.org/ there is the text: PythonCAD does run on Windows if you

Re: Python programs always open source?

2006-09-18 Thread Ben Finney
GHUM [EMAIL PROTECTED] writes: That's one of the great freedoms of Python and its licence: You are free to chose the licence for your product. No GPLish you must be as free as we, more BSDish: Do what you want, do not come crying This has nothing to do with the license of Python. Whether

Re: Where can i download mod_webkit from?

2006-09-18 Thread Bruno Desthuilliers
[EMAIL PROTECTED] wrote: Hi I am trying to get webware for python running on Apache. I want to get it working with mod_webkit, but for the life of me i can't find a webpage where i can download a source for it or maybe an rpm. If anyone knows the download page, i'd greatly appreciate if

Re: PythonCAD question

2006-09-18 Thread Franz Steinhaeusler
Peter Otten wrote: Franz Steinhaeusler wrote: The .../Cocoa/... part in the paths suggests that PythonCAD assumes it is running on a Mac. The missing module is rather a symptom than the cause of the bug. On the homepage, http://www.pythoncad.org/ there is the text: PythonCAD does

Re: CONSTRUCT - Adding Functionality to the Overall System

2006-09-18 Thread Steve Holden
Ilias Lazaridis wrote: Damjan wrote: I understand that I can use __metaclass__ to create a class which modifies the behaviour of another class. How can I add this metaclass to *all* classes in the system? (In ruby I would alter the Class class) You'd have to set __metaclass__ = whatever at

Re: 911 FORGERY bigger than the Protocols of the Learned Elders of Zion

2006-09-18 Thread schoenfeld . one
malibu wrote: tadchem wrote: Protocols of the Elders of Zion was a fraud http://en.wikipedia.org/wiki/The_Protocols_of_the_Elders_of_Zion http://ddickerson.igc.org/protocols.html http://www.straightdope.com/mailbag/mzionprotocol.html

Re: CONSTRUCT - Adding Functionality to the Overall System

2006-09-18 Thread Paul McGuire
Calvin Spealman [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On 17 Sep 2006 09:22:16 -0700, Ilias Lazaridis [EMAIL PROTECTED] wrote: I understand that I can use __metaclass__ to create a class which modifies the behaviour of another class. How can I add this metaclass to *all*

PIL 2.5 win32 binaries?

2006-09-18 Thread GHUM
On the PIL website I read: The current free version is PIL 1.1.5, which has been tested with Python 1.5.2 and newer, including 2.3 and 2.5. but in downloads I cannot see any binaries for windows and Python 2.5 Are they somewhere available? Best wishes, Harald --

Re: PIL 2.5 win32 binaries?

2006-09-18 Thread Thomas Heller
GHUM schrieb: On the PIL website I read: The current free version is PIL 1.1.5, which has been tested with Python 1.5.2 and newer, including 2.3 and 2.5. but in downloads I cannot see any binaries for windows and Python 2.5 Are they somewhere available? Best wishes, Harald

Automatically installing libraries?

2006-09-18 Thread Chaz Ginger
Here is a problem I am trying to solve; I am sure there must be an easy way to do it and I just don't know how. I have a rather large application that I am writing. To make it easy for the user to run I have them run a startup.py script. This script will try to load each of the third party

Re: Automatically installing libraries?

2006-09-18 Thread John Machin
Chaz Ginger wrote: Here is a problem I am trying to solve; I am sure there must be an easy way to do it and I just don't know how. I have a rather large application that I am writing. To make it easy for the user to run I have them run a startup.py script. This script will try to load each

Re: Automatically installing libraries?

2006-09-18 Thread Bruno Desthuilliers
Chaz Ginger wrote: Here is a problem I am trying to solve; I am sure there must be an easy way to do it and I just don't know how. I have a rather large application that I am writing. To make it easy for the user to run I have them run a startup.py script. This script will try to load each

Interact with system command prompt

2006-09-18 Thread billie
Hi all. I would like to know if there's some python framework able to interact with system command prompt (cmd.exe or /bin/sh, depending on the system) from python. I need something that supports key/path auto completion by pressing TAB button and the possibility to use interactive programs like

Re: Interact with system command prompt

2006-09-18 Thread Diez B. Roggisch
billie wrote: Hi all. I would like to know if there's some python framework able to interact with system command prompt (cmd.exe or /bin/sh, depending on the system) from python. I need something that supports key/path auto completion by pressing TAB button and the possibility to use

Re: Interact with system command prompt

2006-09-18 Thread billie
Diez B. Roggisch ha scritto: billie wrote: Hi all. I would like to know if there's some python framework able to interact with system command prompt (cmd.exe or /bin/sh, depending on the system) from python. I need something that supports key/path auto completion by pressing TAB

Interfacing my chess client with GNU chess using python

2006-09-18 Thread Varun Hiremath
Hello, I have written a chess client using python which is a graphic interface to play chess. It is at present a two player version, players move their peices by clicking two squares on the board as in any other chess clients. Now i want to interface my program with the already

Re: Python programs always open source?

2006-09-18 Thread Leif K-Brooks
Ben Finney wrote: So long as you're not distributing some or all of Python itself, or a derivative work, the license for Python has no legal effect on what license you choose for your own work. How many Python programs use nothing from the standard library? --

Multiping

2006-09-18 Thread Fransiska M Argasetya
dear alli have the following code that keeps on pinging several sites infinitelyi was wondering if anyone could help me out in how to make the results for each set of loops of the pings to be displayed in an excel file? i need to use the maximum and minimum delay for my project.thank

[ANN] Code Golf Challenge : 1,000 Digits Of Pi

2006-09-18 Thread Carl Drinkwater
Hi all, Code Golf's 12th challenge has just been added to the site. It asks you to calculate the first 1,000 digits of Pi - Something I'm sure most of you have thought about, but never done. You can see the challenge at : http://codegolf.com/1000-digits-of-pi For those who haven't heard

Re: Interact with system command prompt

2006-09-18 Thread billie
Uhm... It seems that IPython got some problems: http://ipython.scipy.org/doc/manual/node12.html In details: Note that this does not make IPython a full-fledged system shell. In particular, it has no job control, so if you type Ctrl-Z (under Unix), you'll suspend pysh itself, not the process

Re: Python programs always open source?

2006-09-18 Thread Steve Holden
Leif K-Brooks wrote: Ben Finney wrote: So long as you're not distributing some or all of Python itself, or a derivative work, the license for Python has no legal effect on what license you choose for your own work. How many Python programs use nothing from the standard library? That

Re: Multiping

2006-09-18 Thread Steve Holden
Fransiska M Argasetya wrote: dear all i have the following code that keeps on pinging several sites infinitely i was wondering if anyone could help me out in how to make the results for each set of loops of the pings to be displayed in an excel file? i need to use the maximum and

Re: Python programs always open source?

2006-09-18 Thread Leif K-Brooks
Steve Holden wrote: Leif K-Brooks wrote: Ben Finney wrote: So long as you're not distributing some or all of Python itself, or a derivative work, the license for Python has no legal effect on what license you choose for your own work. How many Python programs use nothing from the standard

How to stop a running embedded interpreter?

2006-09-18 Thread Dirk Runge
Hi! I have embedded Python in an C++ App. The Python-Interpreter is running in its own Thread (I'm using PThreads). I use PyRun_SimpleString to run Python-Code that the user entered in an editorwindow. I want the user to be able to stop the execution of Python-Code (e.g. using a Cancel-Button).

win32com InvokeTypes is None

2006-09-18 Thread SS Hares
Hi, I'm encountering an issue where the InvokeTypes method is returning None and I'm unable to Dispatch a particular COM object from DMCoreAutomation.dll. Everything works fine except for method GetItemFields. Using Python 2.4.2, pywin32 build 209. Here is some example code (I can provide full

Re: Interact with system command prompt

2006-09-18 Thread Diez B. Roggisch
billie wrote: Uhm... It seems that IPython got some problems: http://ipython.scipy.org/doc/manual/node12.html In details: Note that this does not make IPython a full-fledged system shell. In particular, it has no job control, so if you type Ctrl-Z (under Unix), you'll suspend pysh itself,

Creating database structures in a portable way

2006-09-18 Thread Samuel
Hi, I am looking for a library that takes an XML file that specifies a table structure, and generates the CREATE/DROP/ALTER SQL statements to create the tables in the database. In particular, I am trying to port a PHP application that currently uses the AdoDB XML schema:

Re: Creating database structures in a portable way

2006-09-18 Thread Bruno Desthuilliers
Samuel wrote: Hi, I am looking for a library that takes an XML file that specifies a table structure, and generates the CREATE/DROP/ALTER SQL statements to create the tables in the database. In particular, I am trying to port a PHP application that currently uses the AdoDB XML schema:

Re: Pythondocs.info : collaborative Python documentation project

2006-09-18 Thread Bruno Desthuilliers
Rakotomandimby (R12y) wrote: On Sat, 16 Sep 2006 22:43:41 +0200, Daniel Nogradi wrote: Then how about running your site on python and not php? PHP has better documentation... ;-) More seriously, I can provide a CPS hosting to nicolasfr if he wants. Alert ! Unusable undocumented monstruosity

Re: Help me use my Dual Core CPU!

2006-09-18 Thread mystilleef
Paul Rubin wrote: mystilleef [EMAIL PROTECTED] writes: I use D-Bus (Python). I recommend it. I don't know how cross platform it is. However, it supports message passing of most built-in (strings, ints, lists, dictionaries etc) Python objects accross processes. You can mimick clean

Re: Help me use my Dual Core CPU!

2006-09-18 Thread mystilleef
Paul Rubin wrote: mystilleef [EMAIL PROTECTED] writes: I use D-Bus (Python). I recommend it. I don't know how cross platform it is. However, it supports message passing of most built-in (strings, ints, lists, dictionaries etc) Python objects accross processes. You can mimick clean

Re: Help

2006-09-18 Thread Larry Bates
Rrajal wrote: Hi there, I am new in this subject so could you please tell me from where I can get help (or good e-book) of python? Some books that helped me: Python Bible by Dave Brueck and Stephen Tanner Python Cookbook by Alex Martelli, Anna Martelli Revenscroft David Ascher Python

Re: Interfacing my chess client with GNU chess using python

2006-09-18 Thread Will McGugan
Varun Hiremath wrote: Hello, I have written a chess client using python which is a graphic interface to play chess. It is at present a two player version, players move their peices by clicking two squares on the board as in any other chess clients. Now i want to interface my

Re: Pythondocs.info : collaborative Python documentation project

2006-09-18 Thread Laurent Pointal
[EMAIL PROTECTED] wrote: Hi, I am a bit disapointed with the current Python online documentation. I have read many messages of people complaining about the documentation, it's lack of examples and the use of complicated sentences that you need to read 10 times before understanding what it

Re: Code Golf Challenge : 1,000 Digits Of Pi

2006-09-18 Thread [EMAIL PROTECTED]
Carl Drinkwater wrote: Hi all, Code Golf's 12th challenge has just been added to the site. It asks you to calculate the first 1,000 digits of Pi - Something I'm sure most of you have thought about, but never done. You can see the challenge at : http://codegolf.com/1000-digits-of-pi

Re: Help

2006-09-18 Thread Matimus
I have yet to find a language/community with better online documentation. I taught myself with the Python tutorial found at http://docs.python.org/tut/tut.html. I would look there first. If you are new to programming altogether I think Python may still be a good choice, but that may not be the

Could not build MySQLdb on PowerMac (PPC)

2006-09-18 Thread Ted Zeng
Hi, I am new to Python. I am trying to build MySQLdb for my PowerPC PowerMac. I just downloaded the source last week and tried to build it. But I got the error messages as follow. I checked and there is no such files as mysql_config mysql.h my_config.h ... Did I download the wrong source?

Re: Pythondocs.info : collaborative Python documentation project

2006-09-18 Thread Laurent Pointal
[EMAIL PROTECTED] wrote: Hi, I am a bit disapointed with the current Python online documentation. I have read many messages of people complaining about the documentation, it's lack of examples and the use of complicated sentences that you need to read 10 times before understanding what it

Re: Creating database structures in a portable way

2006-09-18 Thread Samuel
FWIW, there's a Python port of adodb: http://phplens.com/lens/adodb/adodb-py-docs.htm and parsing XML in Python is quite easy. So you could as well port the AdoDB XML to Python too. That is exactly what I am trying to avoid. While implementing the parser might be easy, you have to translate

PyPy Sprint Announcement, Duesseldorf 30 Oct - 5 Nov

2006-09-18 Thread Carl Friedrich Bolz
Hi all! The next PyPy sprint will be held in the Computer Science department of Heinrich-Heine Universitaet Duesseldorf from the 30th of October to the 5th of November 2006. Topics and goals The topics of the sprints are not fixed yet. We will progress on the subjects that we

Re: Code Golf Challenge : 1,000 Digits Of Pi

2006-09-18 Thread Paddy
Carl Drinkwater wrote: For those who haven't heard of codegolf.com, it can be described as allowing you to show off your code-fu by trying to solve coding problems using the least number of keystrokes. Is having good 'code-fu' worthwhile? It may be trivial to score but do the results show who

Re: Help

2006-09-18 Thread BartlebyScrivener
Rrajal wrote: Hi there, I am new in this subject so could you please tell me from where I can get help (or good e-book) of python? You don't provide much info about where you are in your learning cycle. New to programming? New to Python? Both? If you do use the Tutorial, use the newest

Re: Help

2006-09-18 Thread Wildemar Wildenburger
Matimus wrote: Hi there, I am new in this subject so could you please tell me from where I can get help (or good e-book) of python? http://www.diveintopython.org/ That did the trick for me. It is, however, a Python book for experienced programmers (quoted from website). Not too tough, but if

Re: Could not build MySQLdb on PowerMac (PPC)

2006-09-18 Thread Diez B. Roggisch
Ted Zeng schrieb: Hi, I am new to Python. I am trying to build MySQLdb for my PowerPC PowerMac. I just downloaded the source last week and tried to build it. But I got the error messages as follow. I checked and there is no such files as mysql_config mysql.h my_config.h ... Did I

newbie division question

2006-09-18 Thread David Isaac
Suppose x and y are ints in moduleA. If I put from __future__ import division in moduleA then x/y will produce the truediv result. If I put from __future__ import division in moduleB and from moduleB import * in module A then x/y will NOT produce the truediv result (in moduleA). Why? And is

Re: Code Golf Challenge : 1,000 Digits Of Pi

2006-09-18 Thread bearophileHUGS
Paddy: Is having good 'code-fu' worthwhile? It may be trivial to score but do the results show who iss the better programmer? With Python you can't win, because Perl and Ruby allow for shorter programs. Beside the language, you win if you can invent more tricks, that you have to avoid in real

python and snmp

2006-09-18 Thread Nicolas Miyasato
Hi all, I was just wondering if someone here had any experience with some of these implementations of the snmp protocol? pysnmp, libsnmp, snmpy. Does anybody know of another implementation? thanks in advance!!! -- miya -- http://mail.python.org/mailman/listinfo/python-list

PIL PSDraw textsize method

2006-09-18 Thread Bauke Veenstra
Running the example from the excellent PIL handbook gives an error, after these two lines: ps.setfont(HelveticaNarrow-Bold, 36) w, h, b = ps.textsize(title) AttributeError: PSDraw instance has no attribute 'textsize' Can someone tell me what's wrong, this error occurred on my Linux and on my

Re: newbie division question

2006-09-18 Thread casevh
David Isaac wrote: Suppose x and y are ints in moduleA. If I put from __future__ import division in moduleA then x/y will produce the truediv result. If I put from __future__ import division in moduleB and from moduleB import * in module A then x/y will NOT produce the truediv result

why a main() function?

2006-09-18 Thread beliavsky
I think I read a suggestion somewhere to wrap the code where a Python script starts in a main() function, so one has def main(): print hi main() instead of print hi What are the advantages of doing this? -- http://mail.python.org/mailman/listinfo/python-list

Cross-process dictionary/hashtable

2006-09-18 Thread Sandra-24
A dictionary that can be shared across processes without being marshaled? Is there such a thing already for python? If not is there one for C maybe? I was just thinking how useful such a thing could be. It's a great way to share things between processes. For example I use a cache that

Re: Code Golf Challenge : 1,000 Digits Of Pi

2006-09-18 Thread Paul McGuire
[EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Paddy: Is having good 'code-fu' worthwhile? It may be trivial to score but do the results show who iss the better programmer? With Python you can't win, because Perl and Ruby allow for shorter programs. Beside the language, you win

Threads blocking on OpenBSD w/ Python 2.4.2

2006-09-18 Thread [EMAIL PROTECTED]
I'm attempting to write a faily simple threaded app that fires off a thread to select() on a FIFO while the main loop handles data read from that pipe and a few other tasks. For some reason, calls to time.sleep() seem to block until the first time data is dumped into the pipe. Clearly, I could

Re: why a main() function?

2006-09-18 Thread [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote: I think I read a suggestion somewhere to wrap the code where a Python script starts in a main() function, so one has def main(): print hi main() instead of print hi What are the advantages of doing this? I'm sure there are other reasons, but for me the

Re: newbie division question

2006-09-18 Thread David Isaac
Alan Isaac wrote: Suppose x and y are ints in moduleA. If I put from __future__ import division in moduleA then x/y will produce the truediv result. If I put from __future__ import division in moduleB and from moduleB import * in module A then x/y will NOT produce the

Re: Cross-process dictionary/hashtable

2006-09-18 Thread Rob Wolfe
Sandra-24 [EMAIL PROTECTED] writes: A dictionary that can be shared across processes without being marshaled? Is there such a thing already for python? Check this out: http://poshmodule.sourceforge.net/ -- HTH, Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: Cross-process dictionary/hashtable

2006-09-18 Thread Calvin Spealman
On 18 Sep 2006 12:44:32 -0700, Sandra-24 [EMAIL PROTECTED] wrote: A dictionary that can be shared across processes without being marshaled? Is there such a thing already for python? If not is there one for C maybe? I was just thinking how useful such a thing could be. It's a great way to

Re: why a main() function?

2006-09-18 Thread Calvin Spealman
On 18 Sep 2006 12:40:00 -0700, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I think I read a suggestion somewhere to wrap the code where a Python script starts in a main() function, so one has def main(): print hi main() instead of print hi What are the advantages of doing this? It

Re: why a main() function?

2006-09-18 Thread Benjamin Niemann
[EMAIL PROTECTED] wrote: I think I read a suggestion somewhere to wrap the code where a Python script starts in a main() function, so one has def main(): print hi main() instead of print hi What are the advantages of doing this? Refine this to: def main(): print hi if

How to find number of characters in a unicode string?

2006-09-18 Thread Preben Randhol
Hi If I use len() on a string containing unicode letters I get the number of bytes the string uses. This means that len() can report size 6 when the unicode string only contains 3 characters (that one would write by hand or see on the screen). Is there a way to calculate in characters and not in

Re: How to find number of characters in a unicode string?

2006-09-18 Thread Marc 'BlackJack' Rintsch
In [EMAIL PROTECTED], Preben Randhol wrote: If I use len() on a string containing unicode letters I get the number of bytes the string uses. This means that len() can report size 6 when the unicode string only contains 3 characters (that one would write by hand or see on the screen). Is there

Re: How to find number of characters in a unicode string?

2006-09-18 Thread faulkner
are you sure you're using unicode objects? len(u'\u') == 1 the encodings module should help you turn '\xff\xff' into u'\u'. Preben Randhol wrote: Hi If I use len() on a string containing unicode letters I get the number of bytes the string uses. This means that len() can report size 6

Re: newbie division question

2006-09-18 Thread casevh
PS Any news on when true division will be the default? Python 3.0 (aka P3K). It is the release that can break backwards compatibility. http://www.python.org/dev/peps/pep-3000/ casevh -- http://mail.python.org/mailman/listinfo/python-list

Re: newbie division question

2006-09-18 Thread Paul McGuire
[EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] PS Any news on when true division will be the default? Python 3.0 (aka P3K). It is the release that can break backwards compatibility. http://www.python.org/dev/peps/pep-3000/ casevh Yes, Break Backwards Compatibility is a Level

Re: why a main() function?

2006-09-18 Thread Steve Holden
[EMAIL PROTECTED] wrote: I think I read a suggestion somewhere to wrap the code where a Python script starts in a main() function, so one has def main(): print hi main() instead of print hi What are the advantages of doing this? Guido van Rossum himself can tell you:

Re: Code Golf Challenge : 1,000 Digits Of Pi

2006-09-18 Thread Paddy
Paul McGuire wrote: Success lies in the journey, not the destination. or in Yoda-speak: In the journey success lies, in the destination not. -- Paul Ah, I always wondered what lemmings thought , before splat!!! :-) - Pad. -- http://mail.python.org/mailman/listinfo/python-list

Re: newbie division question

2006-09-18 Thread Marc 'BlackJack' Rintsch
In [EMAIL PROTECTED], Paul McGuire wrote: [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] PS Any news on when true division will be the default? Python 3.0 (aka P3K). It is the release that can break backwards compatibility. http://www.python.org/dev/peps/pep-3000/ casevh

Re: why a main() function?

2006-09-18 Thread bearophileHUGS
Others have already told you the most important things. There is another secondary advantage: the code inside a function runs faster (something related is true for C programs too). Usually this isn't important, but for certain programs they can go 20%+ faster. Bye, bearophile --

Re: Creating database structures in a portable way

2006-09-18 Thread Bruno Desthuilliers
Samuel a écrit : FWIW, there's a Python port of adodb: http://phplens.com/lens/adodb/adodb-py-docs.htm and parsing XML in Python is quite easy. So you could as well port the AdoDB XML to Python too. That is exactly what I am trying to avoid. While implementing the parser might be easy, you

Re: Code Golf Challenge : 1,000 Digits Of Pi

2006-09-18 Thread Paul Rubin
[EMAIL PROTECTED] writes: With Python you can't win, because Perl and Ruby allow for shorter programs. Python has native bignums, which should simplify a program like this enormously. I don't know if Ruby has them. Perl doesn't, and if you use some CPAN library that simulates them, that

Re: Code Golf Challenge : 1,000 Digits Of Pi

2006-09-18 Thread Paddy
Paul Rubin wrote: [EMAIL PROTECTED] writes: With Python you can't win, because Perl and Ruby allow for shorter programs. Python has native bignums, which should simplify a program like this enormously. I don't know if Ruby has them. Perl doesn't, and if you use some CPAN library that

Which date will it be 'over x days'?

2006-09-18 Thread cyberco
I must be overlooking something since I can't find a simple way to calculate which date it will be over, say, 9 days. I checked the datetime, time and calendar modules, but none of them seem to have a function to calculate the time offset. -- http://mail.python.org/mailman/listinfo/python-list

Re: [ANN] Code Golf Challenge : 1,000 Digits Of Pi

2006-09-18 Thread Calvin Spealman
On 9/18/06, Carl Drinkwater [EMAIL PROTECTED] wrote: Hi all, Code Golf's 12th challenge has just been added to the site. It asks you to calculate the first 1,000 digits of Pi - Something I'm sure most of you have thought about, but never done. You can see the challenge at :

Re: Cheese Shop Registration error

2006-09-18 Thread Richard Jones
[EMAIL PROTECTED] wrote: The Key ID that the kgpg shows. I tried to paste the key returned by the quiery on the keyserver. but it also doesn't work. I tried everything that has any connection with the key, but everything fails. By the way the key is: 6A61E3AD Here is the code that could

Re: Problem with operator overloading and inheritance in Python

2006-09-18 Thread Calvin Spealman
On 9/18/06, Edward Waugh [EMAIL PROTECTED] wrote: I quickly glanced at Guido's paper of new-style classes and I am puzzled because the definition of a new-style class looks exactly the same as that for the classic classes: class name[optional subclasses]: definition of the class. How do I

Zenoss Version 0.22.3 Available

2006-09-18 Thread Drew Bray
09-18-2006 Announcing Zenoss Version 0.22.3 All, Version 0.22.3 of Zenoss is available for download. Version 0.22.3 is a dot release of version 0.22.0, which added several new features, including: * Support for Nagios Plugins (zenagios) * Addition of a GUI for the selection of Alerting

Re: Which date will it be 'over x days'?

2006-09-18 Thread John Machin
cyberco wrote: I must be overlooking something since I can't find a simple way to calculate which date it will be over, say, 9 days. I checked the datetime, time and calendar modules, but none of them seem to have a function to calculate the time offset. I suppose that it depends on your

gnome module

2006-09-18 Thread Jay
Am I correct in assuming that I can use the gnome module to minimize all windows (aka show desktop)? If so, how? -- http://mail.python.org/mailman/listinfo/python-list

Re: Cheese Shop Registration error

2006-09-18 Thread John Machin
Richard Jones wrote: [EMAIL PROTECTED] wrote: The Key ID that the kgpg shows. I tried to paste the key returned by the quiery on the keyserver. but it also doesn't work. I tried everything that has any connection with the key, but everything fails. By the way the key is: 6A61E3AD

How to efficiently proceed addition and subtraction in python list?

2006-09-18 Thread Daniel Mark
Hello all: I have a list AAA = [1, 2, 3] and would like to subtract one from list AAA so AAA' = [0, 1, 2] What should I do? Thank you -Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: How to efficiently proceed addition and subtraction in python list?

2006-09-18 Thread Tim Chase
I have a list AAA = [1, 2, 3] and would like to subtract one from list AAA so AAA' = [0, 1, 2] What should I do? Sounds like a list comprehension to me: a = [1,2,3] a_prime = [x-1 for x in a] a_prime [0, 1, 2] -tkc -- http://mail.python.org/mailman/listinfo/python-list

  1   2   >