question about function pointer

2012-02-16 Thread Zheng Li
def method1(a = None): print a i can call it by method1(*(), **{'a' : 1}) I am just curious why it works and how it works? and what do *() and **{'a' : 1} mean? when I type *() in python shell, error below happens File "", line 1 *() ^ SyntaxError: invalid syntax -- http://m

Re: Numerical Linear Algebra in arbitrary precision

2012-02-16 Thread Tim Roberts
Ken wrote: > >Brand new Python user and a bit overwhelmed with the variety of >packages available. Any recommendation for performing numerical >linear algebra (specifically least squares and generalized least >squares using QR or SVD) in arbitrary precision? I've been looking at >mpmath but can'

Re: [semi OT]: Smartphones and Python?

2012-02-16 Thread 88888 Dihedral
在 2012年2月16日星期四UTC+8下午11时22分44秒,Michael Torrie写道: > On 02/16/2012 07:53 AM, 8 Dihedral wrote: > > The law suites of JAVA Vitrtual Machine from Oracle > > are famous now. But in 201X the JVM patents will be > > expired, thus it is not very urgent to chunk out a new jython now. Anyway > > just

ANN: pyTenjin 1.1.0 - a high-speed and full-featured template engine

2012-02-16 Thread Makoto Kuwata
I released pyTenjin 1.1.0. http://pypi.python.org/pypi/Tenjin/ http://www.kuwata-lab.com/tenjin/ Overview of pyTenjin * Very fast: about 10 times faster than Django template engine * Easy to learn: no need to learn template-original language * Full-featured: nestable layout

tkinter.Toplevel

2012-02-16 Thread yves
With a tkinter.Toplevel, how can I "disable" the parent windown and all its widget, in the same fashion as tkinter.messagebox? -- Yves. http://www.SollerS.ca/ http://ipv6.SollerS.ca

Re: TEST AN EXECUTABLE PYTHON SCRIPT SPEED UNDER A PYTHON SHELL

2012-02-16 Thread gene heskett
On Thursday, February 16, 2012 08:40:04 PM Arnaud Delobelle did opine: > On 16 February 2012 21:10, Prasad, Ramit wrote: > >>> When you reply to a known bot, please include some indication of the > >>> fact, so we know your message can be ignored as well. > >> > >>Sometimes I wonder about 8.

Re: [semi OT]: Smartphones and Python?

2012-02-16 Thread Michael Torrie
On 02/16/2012 10:38 AM, Grant Edwards wrote: > I got curious about Dalvik, and was looking at the Wikipedia page, > where it says that programs for Android are compiled into bytecode in > JVM compatible .class files. Those files are then converted into .dex > files to run on Davlik. > > I don't k

Generating class definitions at runtime in memory from XSD or JSON

2012-02-16 Thread Stodge
Does anyone know of a library to generate class definitions in memory, at runtime, from XSD or JSON? I know about PyXB, generateDS and some others, but they all rely on generating python source files at the command line, and then using those to parse XML. Thanks -- http://mail.python.org/mailman/

Re: python file synchronization

2012-02-16 Thread Cameron Simpson
On 16Feb2012 22:11, Sherif Shehab Aldin wrote: | First sorry for my very very late reply, has been overloaded at work last | week :( Me too. There's no hurry at my end, take your time. [...] | > Can a simple byte count help here? Copy the whole file with FTP. From | > the new copy, extract the

Re: format a measurement result and its error in "scientific" way

2012-02-16 Thread Ian Kelly
On Thu, Feb 16, 2012 at 3:21 PM, Daniel Fetchinson wrote: > Thanks, it's simpler indeed, but gives me an error for value=1.267, > error=0.08: > > Traceback (most recent call last): >  File "/home/fetchinson/bin/format_error", line 26, in >    print format_error( sys.argv[1], sys.argv[2] ) >  Fil

Re: Undoing character read from file

2012-02-16 Thread MRAB
On 16/02/2012 23:10, Emeka wrote: Hello All, I know about seek and tell while using readline. What about if I am using read, and I want to undo the last character I just read(to return it back to the stream). How do I achieve this? Try: f.seek(-1, 1) It seeks -1 relative to the current p

Undoing character read from file

2012-02-16 Thread Emeka
Hello All, I know about seek and tell while using readline. What about if I am using read, and I want to undo the last character I just read(to return it back to the stream). How do I achieve this? Regards, \Emeka *Satajanus Nig. Ltd * -- http://mail.python.org/mailman/listinfo/python-list

Re: format a measurement result and its error in "scientific" way

2012-02-16 Thread Daniel Fetchinson
On 2/16/12, Ian Kelly wrote: > On Thu, Feb 16, 2012 at 1:36 AM, Daniel Fetchinson > wrote: Hi folks, often times in science one expresses a value (say 1.03789291) and its error (say 0.00089) in a short way by parentheses like so: 1.0379(9) One can vary things a bit, but l

Re: TEST AN EXECUTABLE PYTHON SCRIPT SPEED UNDER A PYTHON SHELL

2012-02-16 Thread Arnaud Delobelle
On 16 February 2012 21:10, Prasad, Ramit wrote: >>> When you reply to a known bot, please include some indication of the >>> fact, so we know your message can be ignored as well. > >>Sometimes I wonder about 8. Is there a real person there, as well as the >>bot? A lot of his/its > posts look

RE: TEST AN EXECUTABLE PYTHON SCRIPT SPEED UNDER A PYTHON SHELL

2012-02-16 Thread Prasad, Ramit
>> When you reply to a known bot, please include some indication of the >> fact, so we know your message can be ignored as well. >Sometimes I wonder about 8. Is there a real person there, as well as the >bot? A lot of his/its posts look too intelligent to be computer-generated - or maybe I'

RE: Python to Combine Multiple Excel Worksheets into One Worksheet

2012-02-16 Thread Prasad, Ramit
>I have one single Excel file with many separate worksheets, and for work I >need to combine all these separate worksheets into one single worksheet (I am >not worried about formatting, as the format is the same in each sheet, nor am >I worried about Excel's row limit). >Essentially, I am lookin

Re: python file synchronization

2012-02-16 Thread Sherif Shehab Aldin
Hi Cameron, First sorry for my very very late reply, has been overloaded at work last week :( Anyways... I will reply inline this time ;) On Wed, Feb 8, 2012 at 11:59 AM, Cameron Simpson wrote: > [ Please reply inline; it makes the discussion read like a converation, > with context. - Cameron

Python / Apache config issue

2012-02-16 Thread Alan McKay
OK, since you all said to send it, here it is :-) Though I think it may be an apache issue, I'll send it anyway. I'm using the software called "Open Freezer" which is used to track reagents and other chemicals in research labs. I also posted this here on their discussion forums but have not hear

Re: list of properties

2012-02-16 Thread Emile van Sebille
On 2/16/2012 9:19 AM Emmanuel Mayssat said... Hello, Is there a way to list 'properties' ? dir(thingy) from PyQt4.QtCore import * class LObject(QObject): def __init__(self, parent=None): super(LObject, self).__init__(parent) self.arg1 = 'toto' def getArg2(self

Re: [semi OT]: Smartphones and Python?

2012-02-16 Thread Grant Edwards
On 2012-02-16, Grant Edwards wrote: > On 2012-02-16, Michael Torrie wrote: > >> You claimed Jython is or will be available on Android. It's not and >> Jython isn't being ported to Dalvik and it has nothing to do with >> patents. Android might use java a language, but the virtual machines >> are

Re: [semi OT]: Smartphones and Python?

2012-02-16 Thread Grant Edwards
On 2012-02-16, Michael Torrie wrote: > You claimed Jython is or will be available on Android. It's not and > Jython isn't being ported to Dalvik and it has nothing to do with > patents. Android might use java a language, but the virtual machines > are very different. And no expired patents are

Re: format a measurement result and its error in "scientific" way

2012-02-16 Thread Ian Kelly
On Thu, Feb 16, 2012 at 1:36 AM, Daniel Fetchinson wrote: >>> Hi folks, often times in science one expresses a value (say >>> 1.03789291) and its error (say 0.00089) in a short way by parentheses >>> like so: 1.0379(9) >>> >>> One can vary things a bit, but let's take the simplest case when we >>>

Re: XSLT to Python script conversion?

2012-02-16 Thread Matej Cepl
On 15.2.2012 18:48, Tim Arnold wrote: Just a note to encourage you to stick with XSLT. I also use lxml for creating and postprocessing my DocBook documents and it is great. But I use the DocBook XSL stylesheets to convert to html; if you're like me, you got discouraged at the strangeness of the X

list of properties

2012-02-16 Thread Emmanuel Mayssat
Hello, Is there a way to list 'properties' ? from PyQt4.QtCore import * class LObject(QObject): def __init__(self, parent=None): super(LObject, self).__init__(parent) self.arg1 = 'toto' def getArg2(self): return self.arg1 + " <--" arg2 = property(getArg2) l

Re: Is this the right list?

2012-02-16 Thread Ethan Furman
On Fri, Feb 17, 2012 at 1:43 AM, Rick Johnson wrote: On 2/15/2012 4:51 PM, Alan McKay wrote: Is this the right list? >> This is neither the "right" or "left" list, however, it may be either the correct or incorrect depending on your question. Alan, Welcome to the list. There are lots of fr

Re: Is this the right list?

2012-02-16 Thread Alan McKay
> > Welcome to the list. There are lots of friendly folks here who will try > to help. > > I noticed that already - thanks! -- http://mail.python.org/mailman/listinfo/python-list

Re: Is this the right list?

2012-02-16 Thread Andrew Berg
On 2/16/2012 9:33 AM, Chris Angelico wrote: > On Fri, Feb 17, 2012 at 1:43 AM, Rick Johnson > wrote: >> On Feb 15, 4:04 pm, Terry Reedy wrote: >>> On 2/15/2012 4:51 PM, Alan McKay wrote: >>> >>> > Is this the right list? >> >> This is neither the "right" or "left" list, however, it may be either

ANN: mock 0.8 final released

2012-02-16 Thread Fuzzyman
After more than six months development work mock 0.8 has been released. 0.8 is a big release with many new features, general improvements and bugfixes. You can download mock 0.8.0 final from the PyPI page or install it with: pip install -U mock mock is a library for testing in Python. It all

Re: Is this the right list?

2012-02-16 Thread Chris Angelico
On Fri, Feb 17, 2012 at 1:43 AM, Rick Johnson wrote: > On Feb 15, 4:04 pm, Terry Reedy wrote: >> On 2/15/2012 4:51 PM, Alan McKay wrote: >> >> > Is this the right list? > > This is neither the "right" or "left" list, however, it may be either > the correct or incorrect depending on your question.

Re: [semi OT]: Smartphones and Python?

2012-02-16 Thread Benjamin Kaplan
On Feb 16, 2012 10:25 AM, "Michael Torrie" wrote: > > On 02/16/2012 07:53 AM, 8 Dihedral wrote: > > The law suites of JAVA Vitrtual Machine from Oracle > > are famous now. But in 201X the JVM patents will be > > expired, thus it is not very urgent to chunk out a new jython now. Anyway just wri

Re: [semi OT]: Smartphones and Python?

2012-02-16 Thread Michael Torrie
On 02/16/2012 07:53 AM, 8 Dihedral wrote: > The law suites of JAVA Vitrtual Machine from Oracle > are famous now. But in 201X the JVM patents will be > expired, thus it is not very urgent to chunk out a new jython now. Anyway > just write codes that can be maintained and ported to other lang

Re: [semi OT]: Smartphones and Python?

2012-02-16 Thread 88888 Dihedral
The law suites of JAVA Vitrtual Machine from Oracle are famous now. But in 201X the JVM patents will be expired, thus it is not very urgent to chunk out a new jython now. Anyway just write codes that can be maintained and ported to other languages and platforms easily. Then I personally prefer

Re: Is this the right list?

2012-02-16 Thread Rick Johnson
On Feb 15, 4:04 pm, Terry Reedy wrote: > On 2/15/2012 4:51 PM, Alan McKay wrote: > > > Is this the right list? This is neither the "right" or "left" list, however, it may be either the correct or incorrect depending on your question. -- http://mail.python.org/mailman/listinfo/python-list

Re: Reading sub-string from a file

2012-02-16 Thread Chris Angelico
On Thu, Feb 16, 2012 at 8:52 PM, Smiley 4321 wrote: > int Jockey_Apple_cat_1KK(float, int, char, int); > int Jockey_Apple_cat_look(int, float, int, int); > int Jockey_Apple_cat_test_ki21es(int, int, int, int); > int Jockey_Apple_cat_tarLK12OU(void, int, int, int); > --- > > Here substring "Jockey_

Re: Reading sub-string from a file

2012-02-16 Thread Peter Otten
Smiley 4321 wrote: > I am a python newbie. Welcome! > Let's say I have a filename (test.conf) as below - > > > int Apple(int, int); > void Jump_OnUnload(float, int); > int Jockey_Apple_cat_1KK(float, int, char, int); > int Jockey_Apple_cat_look(int, float, int, int); > int Jockey_Apple_ca

Re: Reading sub-string from a file

2012-02-16 Thread Chris Rebert
On Thu, Feb 16, 2012 at 1:52 AM, Smiley 4321 wrote: > All, > > I am a python newbie. > > Let's say I have a filename (test.conf) as below - > > > int Apple(int, int); > void Jump_OnUnload(float, int); > int Jockey_Apple_cat_1KK(float, int, char, int); > int Jockey_Apple_cat_look(int, float, i

Reading sub-string from a file

2012-02-16 Thread Smiley 4321
All, I am a python newbie. Let's say I have a filename (test.conf) as below - int Apple(int, int); void Jump_OnUnload(float, int); int Jockey_Apple_cat_1KK(float, int, char, int); int Jockey_Apple_cat_look(int, float, int, int); int Jockey_Apple_cat_test_ki21es(int, int, int, int); int Jock

Re: OT: Entitlements [was Re: Python usage numbers]

2012-02-16 Thread Ian Kelly
On Wed, Feb 15, 2012 at 8:04 AM, Rick Johnson wrote: > I have PROVEN that when people FIGHT back, they will NOT be subjects > to tyranny; race has NOTHING to do with it. I gave one example in > history where people would rather die than be subjected to tyranny, > there are many more. "GIVE ME FREE

Beware, my computer was infected.

2012-02-16 Thread Jugurtha Hadjar
Hello gentlemen, I'm writing these words to give you a heads up. My computer has recently been infected with "1.exe", and I am doing what I can to contain it. It spreads via mail and I fear it will send SPAM to lists I am subscribed to. If you receive weird mails from my address, thank you to

Re: format a measurement result and its error in "scientific" way

2012-02-16 Thread Daniel Fetchinson
>> Hi folks, often times in science one expresses a value (say >> 1.03789291) and its error (say 0.00089) in a short way by parentheses >> like so: 1.0379(9) >> >> One can vary things a bit, but let's take the simplest case when we >> only keep 1 digit of the error (and round it of course) and roun

Re: Wanted: Criticism of code for a Python module, plus a Mac tester

2012-02-16 Thread Arnaud Delobelle
On 16 February 2012 05:03, Ian Kelly wrote: > On Wed, Feb 15, 2012 at 6:11 PM, HoneyMonster > wrote: >> As to your first suggestion though, I am having some difficulty. Note >> that the vulnerability rotates; i.e. CONDITIONS[4] is not the same as >> CONDITIONS[0]. >> Is there a better way of doi