Re: menu and file

2009-12-26 Thread Steven D'Aprano
On Fri, 25 Dec 2009 23:32:48 -0800, hong zhang wrote: > List, > > I want to read a file that has a list of data into a menu. User can pick > up a line of data and execute it. For example, file has data like > following > > 1 23 0x4530 > 2 42 0x8790 > 3 75 0x7684 > . > > User can

[no subject]

2009-12-26 Thread Yulin
Hi when I start my Pc I get error " The specified module could not be found. LoadLibrary(pythondll)failed Please Help once I have enterd I get the following..C:\Documents and settings\all users\.clamwin\quarentine\python25.DLL PLEASE help I cant load most of my programmes Thanks Yu

Question-Answer based web App

2009-12-26 Thread aditya shukla
Merry christmas guys, I am trying to make a web based application which has a set of questions and answers associated with it such that a report is generated based on the answers a user chooses for each question.It's like facebook apps where we have questions , answers and reports . Should i gener

Re: How do I install GMPY 1.11 on a Mac with OS X 10.6 and Python 3.1?

2009-12-26 Thread Mensanator
On Dec 25, 8:59�pm, Benjamin Kaplan wrote: > On Fri, Dec 25, 2009 at 1:19 PM, Mensanator wrote: > > On Dec 25, 9:25�am, Benjamin Kaplan wrote: > >> On Fri, Dec 25, 2009 at 1:48 AM, Mensanator wrote: > >> > On Dec 24, 10:18�pm, Benjamin Kaplan wrote: > >> >> On Thu, Dec 24, 2009 at 9:11 PM, Men

Re: Extra fields for logging

2009-12-26 Thread Joan Miller
On 26 dic, 04:34, Steven D'Aprano wrote: > On Fri, 25 Dec 2009 12:07:20 -0800, Joan Miller wrote: > > On 25 dic, 13:24, Steven D'Aprano > cybersource.com.au> wrote: > >> On Thu, 24 Dec 2009 05:06:48 -0800, Joan Miller wrote: > >> > I'm trying to add some extra fields to logging, I'm following thi

What is the equivalent of chr(x) for bytes in python 3?

2009-12-26 Thread Baptiste Lepilleur
Hi, I'm looking for the equivalent of the built-in chr(x) function that would return a bytes type taking an integer as parameter. The easiest way I found to do this is the function below, but there must be some simpler way to do that and I must be overlooking something fairly obvious... def byte(

Re: Is it possible to get the erroneous variable when getting a NameError exception?

2009-12-26 Thread Michael Fötsch
Stephen Hansen wrote: Dotan Barak wrote: ... eval("my_number < 10", {"__builtins__":None}, {}) Hm, is this true, though? Is there anything subtle or dangerous possible here? He's using eval-- so no statements, its only an expression. He's passing in a 'global

zope server on ubuntu 9.10

2009-12-26 Thread S.Selvam
Hi all, I am using Ubuntu 9.10 and when i tried to install Zope application server with the following , sudo easy_install -i http://download.zope.org/Zope2/index/2.12.1 Zope2 i got an error as shown below, --- . . Reading http://download.zope.org/Zope2/index/2.12.1/ No local packages

Re: What is the equivalent of chr(x) for bytes in python 3?

2009-12-26 Thread MRAB
Baptiste Lepilleur wrote: Hi, I'm looking for the equivalent of the built-in chr(x) function that would return a bytes type taking an integer as parameter. The easiest way I found to do this is the function below, but there must be some simpler way to do that and I must be overlooking somethi

Re: a huge shared read-only data in parallel accesses -- How? multithreading? multiprocessing?

2009-12-26 Thread Valery
Hi Antoine On Dec 11, 3:00 pm, Antoine Pitrou wrote: > I was going to suggest memcached but it probably serializes non-atomic > types. It doesn't mean it will be slow, though. Serialization implemented > in C may well be faster than any "smart" non-serializing scheme > implemented in Python. No

Re: getlist question

2009-12-26 Thread Victor Subervi
On Fri, Dec 25, 2009 at 8:28 PM, Steven D'Aprano < st...@remove-this-cybersource.com.au> wrote: > On Fri, 25 Dec 2009 12:59:20 -0500, Benjamin Kaplan wrote: > > > On Fri, Dec 25, 2009 at 12:40 PM, Victor Subervi > > wrote: > >> > >> It returns nothing. I believe I've stated that three times now.

Re: how to register with pypi - no such setup.py

2009-12-26 Thread Martin v. Loewis
Phlip wrote: >> What you want is a source distribution (sdist). > > Thanks. Yes, this is prob'ly documented somewhere. > > Now my next problem - how to get pypi.python.org to stop burning up > version numbers each time I test this? I don't speak English well enough to understand what "to burn up

Semantic of operations on a closed file object

2009-12-26 Thread Baptiste Lepilleur
Reading python io.IOBase class documentation, I'm kind of confused at the expected behavior of operation on a closed file object. The io.IOBase class doc says: """Note that calling any method (even inquiries) on a closed stream is undefined. Implementations may raise IOErrorin this case.""" But t

Re: Is it possible to get the erroneous variable when getting a NameError exception?

2009-12-26 Thread Dotan Barak
A simple expression is enough to write to files, for example. Try this expression in Python 3.0: [x for x in ().__class__.__base__.__subclasses__() if x.__name__ == '_FileIO'][0]('hello.txt', 'w').write('Hello, World!') To explain, "().__class__.__base__.__subclasses__()" gives you a li

Missing Images

2009-12-26 Thread Victor Subervi
For some reason, I'm not able to upload images to insert into my database. Here's my html: Picture #1 Picture #2 Here's the code from the page that processes the data from the preceding form: i = 0 for picsStore, num in pics().iteritems(): if picsStore ==

Re: How do I install GMPY 1.11 on a Mac with OS X 10.6 and Python 3.1?

2009-12-26 Thread Benjamin Kaplan
On Sat, Dec 26, 2009 at 4:57 AM, Mensanator wrote: > On Dec 25, 8:59�pm, Benjamin Kaplan wrote: >> On Fri, Dec 25, 2009 at 1:19 PM, Mensanator wrote: >> > On Dec 25, 9:25�am, Benjamin Kaplan wrote: >> >> On Fri, Dec 25, 2009 at 1:48 AM, Mensanator wrote: >> >> > On Dec 24, 10:18�pm, Benjamin K

Re: Missing Images

2009-12-26 Thread Carsten Haese
Victor Subervi wrote: > For some reason, I'm not able to upload images to insert into my > database. Here's my html: > > Picture #1 > > > > > Picture #2 > > > > > Here's the code from the page that processes the data from the preceding > form: > > i = 0 > for

Re: How do I install GMPY 1.11 on a Mac with OS X 10.6 and Python 3.1?

2009-12-26 Thread casevh
On Dec 26, 7:39 am, Benjamin Kaplan wrote: > On Sat, Dec 26, 2009 at 4:57 AM, Mensanator wrote: > > On Dec 25, 8:59 pm, Benjamin Kaplan wrote: > >> On Fri, Dec 25, 2009 at 1:19 PM, Mensanator wrote: > >> > On Dec 25, 9:25 am, Benjamin Kaplan wrote: > >> >> On Fri, Dec 25, 2009 at 1:48 AM, Mens

Re: Semantic of operations on a closed file object

2009-12-26 Thread Antoine Pitrou
Hello, > But the io.IOBase.close() method document says: """Once the file is > closed, any operation on the file (e.g. reading or writing) will raise > an IOError .""" which unlike the > class doc is not conditional about the behavior... > > Experimentation (see below) show that I get a ValueErr

Re: Recommendation for small, fast, Python based web server

2009-12-26 Thread Antoine Pitrou
Le Fri, 25 Dec 2009 10:38:19 -0800, Aahz a écrit : > In article , > Antoine Pitrou wrote: >> >>Apparently you have debugged your speed issue so I suppose you don't >>have performance problems anymore. Do note, however, that Python is >>generally not as fast as C -- especially for low-level stuff

Re: menu and file

2009-12-26 Thread hong zhang
> > List, > > > > I want to read a file that has a list of data into a > menu. User can pick > > up a line of data and execute it. For example, file > has data like > > following > > > > 1   23   0x4530 > > 2   42   0x8790 > > 3   75   0x7684 > > . > > > > User can select line # and then exe

Simple distributed example for learning purposes?

2009-12-26 Thread Tim Golden
I'm trying to work up a programming course using Python, aimed at secondary school students [*] here in London. One of my aims is to have a series of compact but functional examples, each demonstrating a particular field in which Python (and programming) can be useful. I'm trying to come up with

Re: How do I install GMPY 1.11 on a Mac with OS X 10.6 and Python 3.1?

2009-12-26 Thread Benjamin Kaplan
On Sat, Dec 26, 2009 at 12:05 PM, casevh wrote: > (I'm one of the GMPY maintainers but I have no access to Macs) > > The same GMPY source should should compile with all version of Python > 2.4 and later. > Like I said in the my last post, it appears to be an issue with distutils distributed w

Re: Which version of MSVC?90.DLL's to distribute with Python 2.6 based Py2exe executables?

2009-12-26 Thread Ross Ridge
Jonathan Hartley wrote: >Am I right to infer that if I want to distribute a py2exe'd >application legally, and have half a chance of it working on a non- >developer's machine, then I have to: > >a) Ask my users to run the Visual C++ redistributable installer, as >well as download my program. This

Re: menu and file

2009-12-26 Thread Steven D'Aprano
On Sat, 26 Dec 2009 09:52:12 -0800, hong zhang wrote: > The question is I want to load a > text file and bring it to screen like > 1 23 0x4530 > 2 42 0x8790 > 3 75 0x7684 > > Then if I want to select 0x4530, then I simple select 1 and a handler > should get 0x4530 as input to process.

Re: Missing Images

2009-12-26 Thread Victor Subervi
On Sat, Dec 26, 2009 at 11:28 AM, Carsten Haese wrote: > It's hard to say what you have missed, since you're not giving us nearly > enough information to determine what you haven't missed. So, we can now > either beg for more information, make random guesses, or point you at a > code example that

Re: How do I install GMPY 1.11 on a Mac with OS X 10.6 and Python 3.1? -SOLVED!

2009-12-26 Thread Mensanator
On Dec 26, 2:07 pm, Benjamin Kaplan wrote: PROBLEM RESOLVED! Yes, it does appear that the disk image on pytho.ord is defective (maybe they made the image from an obsolete version?) I installed Python 3.1 from macports and everything seems to work now. (I never would have figured it out, althoug

Re: Missing Images

2009-12-26 Thread Carsten Haese
Victor Subervi wrote: > Right. Thank you again. I'd forgotten to put in > enctype="multipart/form-data". Now I have the following snipped: > > for pic in ourPics: > sql = 'update %s set pic%d=%s where ID="%s";' % (store, i, > (MySQLdb.Binary(pic),), id) > print sql > #

Re: How do I install GMPY 1.11 on a Mac with OS X 10.6 and Python 3.1? -SOLVED!

2009-12-26 Thread Benjamin Kaplan
On Sat, Dec 26, 2009 at 4:36 PM, Mensanator wrote: > > I guess the point here is NEVER use the disk image on python.org, > ALWAYS use macports to install Python 3.1. > > At least until python.org fixes it. Have you filed a bug report on this? -- http://mail.python.org/mailman/listinfo/python-lis

Re: how to register with pypi - no such setup.py

2009-12-26 Thread Phlip
On Dec 26, 6:01 am, "Martin v. Loewis" wrote: > > Now my next problem - how to get pypi.python.org to stop burning up > > version numbers each time I test this? > > I don't speak English well enough to understand what "to burn up" > means - to my knowledge, PyPI does no such thing. I don't know

Re: how to register with pypi - no such setup.py

2009-12-26 Thread Phlip
> I have no alternative, to fix bugs in PyPi, _not_ in "that file", but > to continue burning up version numbers that nobody cares about. The > message is condescending because I am aware of the reason we version > packages, and the message is _not_ helping me apply that reason! Aaand I just found

Re: How do I install GMPY 1.11 on a Mac with OS X 10.6 and Python 3.1? -SOLVED!

2009-12-26 Thread Mensanator
On Dec 26, 3:57 pm, Benjamin Kaplan wrote: > On Sat, Dec 26, 2009 at 4:36 PM, Mensanator wrote: > > > I guess the point here is NEVER use the disk image on python.org, > > ALWAYS use macports to install Python 3.1. > > > At least until python.org fixes it. > > Have you filed a bug report on this?

PyCFunction_New(): to Py_DECREF() or not to Py_DECREF()

2009-12-26 Thread Ecir Hana
Hello, if creating new CFunction PyObject *function = PyCFunction_New(function_name, NULL); and then this is the only thing which uses it ("dictionary" stays alive...) PyDict_SetItemString(dictionary, "function", function); do I have to Py_DECREF(function) or not? -- http://mail.python.org/

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

2009-12-26 Thread Gabriel Genellina
QOTW: "It took Python to make me realize that programming *could* be fun, or at least not annoying enough to keep me from making a career of programming." - Aahz http://groups.google.com/group/comp.lang.python/msg/65ad4e71c194d97e How to compare dialects of csv module? http://gro

Re: how to register with pypi - no such setup.py

2009-12-26 Thread Stefan Krah
Phlip wrote: > On Dec 26, 6:01 am, "Martin v. Loewis" wrote: > > > > Now my next problem - how to get pypi.python.org to stop burning up > > > version numbers each time I test this? > > > > I don't speak English well enough to understand what "to burn up" > > means - to my knowledge, PyPI does n

Re: Is it possible to get the erroneous variable when getting a NameError exception?

2009-12-26 Thread Stephen Hansen
On Sat, Dec 26, 2009 at 4:34 AM, Michael Fötsch wrote: > To explain, "().__class__.__base__.__subclasses__()" gives you a list of > all object-derived classes, i.e., of *all* classes that exist in the > surrounding program. If you can find just one class that allows you to do > something subtle o

Re: Which version of MSVC?90.DLL's to distribute with Python 2.6 based Py2exe executables?

2009-12-26 Thread Jonathan Hartley
On Dec 26, 3:14 pm, Ross Ridge wrote: > Jonathan Hartley   wrote: > > >Am I right to infer that if I want to distribute a py2exe'd > >application legally, and have half a chance of it working on a non- > >developer's machine, then I have to: > > >a) Ask my users to run the Visual C++ redistributab

Re: [wxPy] Why I can not change a ListItem property?

2009-12-26 Thread Tim Roberts
David <71da...@libero.it> wrote: > >I have la ListCtrl in LC_REPORT mode and i need to change the color of a >single cell. That can't be done. In LC_REPORT mode, the whole row has to be the same color. You can't change individual cells within a row. You need an owner-draw control. See the List

Re: Which version of MSVC?90.DLL's to distribute with Python 2.6 based Py2exe executables?

2009-12-26 Thread John Bokma
Jonathan Hartley writes: > 2) About once a week the last couple of months I've had a friend phone > to say 'can you write me a simple program to do X', where X is stuff > like calling a web API to look up info for every postcode/zipcode in a > database. This sort of thing is ideally suited to Pyt

Re: PyCFunction_New(): to Py_DECREF() or not to Py_DECREF()

2009-12-26 Thread Benjamin Peterson
Ecir Hana gmail.com> writes: > do I have to > > Py_DECREF(function) > > or not? Yes, you still own the reference to the function. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to tailor output of help()

2009-12-26 Thread Kyle
> Try setting the __all__ variable in your module to a list of the names > you want your module to export. Perfect. Thanks for the help. -- http://mail.python.org/mailman/listinfo/python-list

Re: How do I install GMPY 1.11 on a Mac with OS X 10.6 and Python 3.1? -SOLVED!

2009-12-26 Thread Mensanator
On Dec 26, 4:20�pm, Mensanator wrote: > On Dec 26, 3:57�pm, Benjamin Kaplan wrote: > > > On Sat, Dec 26, 2009 at 4:36 PM, Mensanator wrote: > > > > I guess the point here is NEVER use the disk image on python.org, > > > ALWAYS use macports to install Python 3.1. > > > > At least until python.org

Re: imports in __init__.py

2009-12-26 Thread lotrpy
On Dec 18, 12:34 pm, Ben Finney wrote: > Phil writes: > > From an arbitrary python module, I 'import packagename'. > > At that point, you have all the names that were defined within > ‘packagename’, available inside the namespace ‘packagename’. Since > ‘modulename’ is a module in that package, th

Re: PyCFunction_New(): to Py_DECREF() or not to Py_DECREF()

2009-12-26 Thread Ecir Hana
On Dec 27, 3:15 am, Benjamin Peterson wrote: > Yes, you still own the reference to the function. Thanks! -- http://mail.python.org/mailman/listinfo/python-list

Re: Mechanize - Click a table row to navigate to detail page

2009-12-26 Thread Brian D
On Dec 25, 4:36 am, "Diez B. Roggisch" wrote: > Brian D schrieb: > > > A search form returns a list of records embedded in a table. > > > The user has to click on a table row to call a Javascript call that > > opens up the detail page. > > > It's the detail page, of course, that really contains th

Re: How do I install GMPY 1.11 on a Mac with OS X 10.6 and Python 3.1? -SOLVED!

2009-12-26 Thread Benjamin Kaplan
On Sat, Dec 26, 2009 at 9:21 PM, Mensanator wrote: > On Dec 26, 4:20�pm, Mensanator wrote: >> On Dec 26, 3:57�pm, Benjamin Kaplan wrote: >> >> > On Sat, Dec 26, 2009 at 4:36 PM, Mensanator wrote: >> >> > > I guess the point here is NEVER use the disk image on python.org, >> > > ALWAYS use macpo

Re: How do I install GMPY 1.11 on a Mac with OS X 10.6 and Python 3.1? -SOLVED!

2009-12-26 Thread Mensanator
On Dec 26, 10:02 pm, Benjamin Kaplan wrote: > On Sat, Dec 26, 2009 at 9:21 PM, Mensanator wrote: > > On Dec 26, 4:20 pm, Mensanator wrote: > >> On Dec 26, 3:57 pm, Benjamin Kaplan wrote: > > >> > On Sat, Dec 26, 2009 at 4:36 PM, Mensanator wrote: > > >> > > I guess the point here is NEVER use

Re: Which version of MSVC?90.DLL's to distribute with Python 2.6 based Py2exe executables?

2009-12-26 Thread Stephen Hansen
Jonathan Hartley writes: > These are non-technical users, so I'd rather send them a single executable > that 'just works', [break] rather than asking them to install Python and then > coach them through running a script - they would HATE that as a > solution. > Whoa... How can you go from

Missing collections

2009-12-26 Thread Bearophile
What are the useful collections that are missing in the collections module? Let's see: - sortedDict, sortedSet (based on a search tree) - frozenDict - bitArray (or bitset) - graph - linkedList (*) (*) linkedList is like deque, it's a linked list of short arrays, but they aren't 100% full. Few mo

Re: Which version of MSVC?90.DLL's to distribute with Python 2.6 based Py2exe executables?

2009-12-26 Thread Martin v. Loewis
> FYI, my experience is that an entire manifest must be distributed. As > the manifest in question actually lists 3 DLLs, IIUC, you must ship all > 4 files - the 3 DLLs and the manifest, even if only one of the DLLs is > actually used. You don't actually need to include all three DLLs. Just inclu

Re: Which version of MSVC?90.DLL's to distribute with Python 2.6 based Py2exe executables?

2009-12-26 Thread Martin v. Loewis
> Does anyone have any recommendations on which version of the > MSVC?90.DLL's need to be distributed with a Python 2.6.4 PY2EXE (0.6.9) > based executable? You'll need to include Microsoft.VC90.CRT.manifest and msvcr90.dll. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list