Calling External (Perl)Script in Python

2012-08-26 Thread Pervez Mulla
Hi, I am trying to call perl script in my python view.py and store that data in logfile On shell I am able to display data. I wanna call that data on logfile , How can i do this ...? I wanna call perl objects in python ... So , How can I pass all that stuff in python(firstname, lastn

Re: Make error when installing Python 1.5

2012-08-26 Thread Cameron Simpson
On 27Aug2012 01:54, Steven D'Aprano wrote: | Yes, you read the subject line right -- Python 1.5. Yes, I am nuts ;) | | (I like having old versions of Python around for testing historical | behaviour.) | | On Debian squeeze, when I try to build Python 1.5, I get this error: | | fileobject.c:59

Make error when installing Python 1.5

2012-08-26 Thread Steven D'Aprano
Yes, you read the subject line right -- Python 1.5. Yes, I am nuts ;) (I like having old versions of Python around for testing historical behaviour.) On Debian squeeze, when I try to build Python 1.5, I get this error: fileobject.c:590: error: conflicting types for ‘getline’ /usr/include/stdio.

Python list archives double-gzipped?

2012-08-26 Thread Tim Chase
Playing around with the mbox module, I reached into the archives[1] to grab some real-world data files[2]. To successfully unpack the contents to an mbox file, I had to do the following: bash$ gunzip 2012-July.txt.gz bash$ mv 2012-July.txt 2012-July.txt.gz bash$ gunzip 2012-July.txt.gz So

Python 2.6 and Sqlite3 - Slow

2012-08-26 Thread bruceg113355
My program uses Python 2.6 and Sqlite3 and connects to a network database 100 miles away. My program reads approx 60 records (4000 bytes) from a Sqlite database in less than a second. Each time the user requests data, my program can continuously read 60 records in less than a second. However

Re: calling loaded DLL function expecting POINT * argument

2012-08-26 Thread Tim Roberts
Tim Williams wrote: >Hello all, > >I'm trying to use the ctypes module to call functions in a DLL. I've >figured out how to modify my path so the library is found, and I can >call LoadLibrary on it, but one of the functions expects an array of > POINTS. Here is the prototype from the .h file: >

Re: Flexible string representation, unicode, typography, ...

2012-08-26 Thread Paul Rubin
Steven D'Aprano writes: >> http://golang.org/ref/spec#Numeric_types > Thanks. > Well that's just plain nuts. I'm not sure how Rust handles Unicode, but overall I think it is more clueful than Go while having sort of comparable goals. See: http://rust-lang.org . -- http://mail.python.org/mailman

Re: Flexible string representation, unicode, typography, ...

2012-08-26 Thread Steven D'Aprano
On Sun, 26 Aug 2012 15:42:00 -0600, Ian Kelly wrote: > On Sun, Aug 26, 2012 at 2:13 PM, Steven D'Aprano > wrote: >> On Sun, 26 Aug 2012 09:40:13 -0600, Ian Kelly wrote: >> >>> I think the documentation for those functions is simply badly worded. >>> The "width in bytes" it returns is not the widt

Re: Objects in Python

2012-08-26 Thread Steven D'Aprano
On Sun, 26 Aug 2012 16:12:40 -0400, Dennis Lee Bieber wrote: > On 26 Aug 2012 13:43:33 GMT, Steven D'Aprano > declaimed the following in > gmane.comp.python.general: > > > >> (In some older versions of Python, wildcard imports are allowed, and >> the function then falls back on a namespace ins

Re: sys.path in python3.3

2012-08-26 Thread Ned Deily
In article , Nicholas Cole wrote: > It certainly does exist. Distutils will happily put packages into it, > but import won't find them. That's odd! It works for me on 10.8 and it worked for me yesterday on 10.7 which I tested just after completing the python.org installer builds. Perhaps th

Re: sys.path in python3.3

2012-08-26 Thread Nicholas Cole
On Sun, Aug 26, 2012 at 10:23 PM, Ned Deily wrote: > In article > , > Nicholas Cole wrote: > >> On Sun, Aug 26, 2012 at 8:21 PM, Ned Deily wrote: >> > In article >> > , >> > Nicholas Cole wrote: >> >> In all previous versions of python, I've been able to install packages >> >> into the path:

Re: Objects in Python

2012-08-26 Thread Steven D'Aprano
On Mon, 27 Aug 2012 00:54:05 +1000, Chris Angelico wrote: > On Mon, Aug 27, 2012 at 12:18 AM, Steven D'Aprano > wrote: >> Also, built-ins require a name lookup too. As you point out, locals are >> special, but Python will search an arbitrarily deep set of nested >> nonlocal scopes, then globals,

Re: Flexible string representation, unicode, typography, ...

2012-08-26 Thread Ian Kelly
On Sun, Aug 26, 2012 at 2:13 PM, Steven D'Aprano wrote: > On Sun, 26 Aug 2012 09:40:13 -0600, Ian Kelly wrote: > >> I think the documentation for those functions is simply badly worded. >> The "width in bytes" it returns is not the width of the rune (which as >> jmf notes is simply an alias for in

Re: sys.path in python3.3

2012-08-26 Thread Ned Deily
In article , Nicholas Cole wrote: > On Sun, Aug 26, 2012 at 8:21 PM, Ned Deily wrote: > > In article > > , > > Nicholas Cole wrote: > >> In all previous versions of python, I've been able to install packages > >> into the path: > >> > >> ~/Library/Python/$py_version_short/site-packages > >>

Re: Flexible string representation, unicode, typography, ...

2012-08-26 Thread Dan Sommers
On 2012-08-26 at 20:13:21 +, Steven D'Aprano wrote: > I note that not all 32-bit ints are valid code points. I suppose I can > see sense in having rune be a 32-bit integer value limited to those > valid code points. (But, dammit, why not call it a code point?) But if > rune is merely an alias

Re: Flexible string representation, unicode, typography, ...

2012-08-26 Thread Steven D'Aprano
On Sun, 26 Aug 2012 09:40:13 -0600, Ian Kelly wrote: > I think the documentation for those functions is simply badly worded. > The "width in bytes" it returns is not the width of the rune (which as > jmf notes is simply an alias for int32 that stores a single code point). Is this documented somew

Re: sys.path in python3.3

2012-08-26 Thread Nicholas Cole
On Sun, Aug 26, 2012 at 8:21 PM, Ned Deily wrote: > In article > , > Nicholas Cole wrote: >> In all previous versions of python, I've been able to install packages >> into the path: >> >> ~/Library/Python/$py_version_short/site-packages >> >> but in the rc builds of python 3.3 this is no longer

Re: sys.path in python3.3

2012-08-26 Thread Hans Mulder
On 26/08/12 21:21:15, Ned Deily wrote: > In article > , > Nicholas Cole wrote: >> In all previous versions of python, I've been able to install packages >> into the path: >> >> ~/Library/Python/$py_version_short/site-packages >> >> but in the rc builds of python 3.3 this is no longer part of sys

Re: sys.path in python3.3

2012-08-26 Thread Ned Deily
In article , Nicholas Cole wrote: > In all previous versions of python, I've been able to install packages > into the path: > > ~/Library/Python/$py_version_short/site-packages > > but in the rc builds of python 3.3 this is no longer part of sys.path. > > Before I go hacking the install, is t

sys.path in python3.3

2012-08-26 Thread Nicholas Cole
Dear List, In all previous versions of python, I've been able to install packages into the path: ~/Library/Python/$py_version_short/site-packages but in the rc builds of python 3.3 this is no longer part of sys.path. Before I go hacking the install, is there a reason that this path was removed?

Re: Unittest - testing for filenames and filesize

2012-08-26 Thread Tigerstyle
Ahh, thank you very much Rob. Fixed now. Have a great day. T kl. 19:51:54 UTC+2 søndag 26. august 2012 skrev Rob Day følgende: > On Sun, 2012-08-26 at 10:36 -0700, Tigerstyle wrote: > > > self.assertEqual(statinfo.st_size, filesize) > > > > > > I'm still getting AssertionEr

Re: Unittest - testing for filenames and filesize

2012-08-26 Thread Rob Day
On Sun, 2012-08-26 at 10:36 -0700, Tigerstyle wrote: > self.assertEqual(statinfo.st_size, filesize) > > I'm still getting AssertionError and the error says: 100 !=b' > > filesize is the character 'b' repeated one million times (the contents of the file, in other words). statinfo

Re: Unittest - testing for filenames and filesize

2012-08-26 Thread Tigerstyle
Thanks Rob, I'v modified the test_3 like this: def test_3(self): f = open("test.dat", "wb") filesize = (b'b'*100) f.write(filesize) f.close() statinfo = os.stat("test.dat") self.assertEqual(statinfo.st_size, filesize) I'm still getting

Re: argparse localization support

2012-08-26 Thread Peter Otten
Kwpolska wrote: > I am using argparse in my project. I want to localize it, but it > seems to be impossible to change some things. See this, for example: > > usage: trash [-h] [-V] [-e] [-l] [-r] [-v] [-w] [PLIK [PLIK ...]] > > Trashman — menedżer śmietnika XDG w Pythonie. > > positional argu

Re: modeling complex data with sqlalchemy

2012-08-26 Thread Littlefield, Tyler
Hello: Thanks for the info. IT doesn't really model the data I wanted. The contents was easy enough, I'm just going to set up a 1:n relationship on the Entity to the actual player. But for components, it's a bit different. Each component inherits the actual Component class, and has a number of

Re: VPS For Python

2012-08-26 Thread Littlefield, Tyler
On 8/26/2012 1:41 AM, coldfire wrote: I will really appreciate if someone type the address of any of the following for use with python 1>Webhost 2>Shell Account 3>VPS I love Linode, it's amazing and you get decent resources for a decent price. If you sign up, I'd really appreciate it if you u

Re: Flexible string representation, unicode, typography, ...

2012-08-26 Thread Ian Kelly
On Sun, Aug 26, 2012 at 12:59 AM, wrote: > Sorry, you do not get it. > > The rune is an alias for int32. A sequence of runes is a > sequence of int32's. Go do not spend its time in using a > machinery to work with, to differentiate, to keep in memory > this sequence according to the *characers* c

Re: Flexible string representation, unicode, typography, ...

2012-08-26 Thread Ian Kelly
On Sun, Aug 26, 2012 at 5:49 AM, Steven D'Aprano wrote: >> Sorry, you do not get it. >> >> The rune is an alias for int32. A sequence of runes is a sequence of >> int32's. > > It certainly is not. Runes are variable-width. Here, for example, are a > number of Go functions which return a single run

Re: VPS For Python

2012-08-26 Thread python
> I will really appreciate if someone type the address of any of the following > for use with python > 1>Webhost > 2>Shell Account > 3>VPS Check out webfaction.com - they provide great support for Python. Malcolm -- http://mail.python.org/mailman/listinfo/python-list

argparse localization support

2012-08-26 Thread Kwpolska
I am using argparse in my project. I want to localize it, but it seems to be impossible to change some things. See this, for example: usage: trash [-h] [-V] [-e] [-l] [-r] [-v] [-w] [PLIK [PLIK ...]] Trashman — menedżer śmietnika XDG w Pythonie. positional arguments: PLIK pl

Re: Objects in Python

2012-08-26 Thread Chris Angelico
On Mon, Aug 27, 2012 at 12:18 AM, Steven D'Aprano wrote: > Also, built-ins require a name lookup too. As you point out, locals are > special, but Python will search an arbitrarily deep set of nested > nonlocal scopes, then globals, then builtins. Ah, builtins, forgot that. So yes, global scope in

Re: Objects in Python

2012-08-26 Thread Steven D'Aprano
On Sun, 26 Aug 2012 23:58:31 +1000, Chris Angelico wrote: > On Sun, Aug 26, 2012 at 11:43 PM, Steven D'Aprano > wrote: >> It gets worse: Python has multiple namespaces that are searched. >> >> "Go to the Excelsior Hotel and ask the concierge for Mr Smith. If Mr >> Smith isn't staying there, go ac

Re: Objects in Python

2012-08-26 Thread Chris Angelico
On Mon, Aug 27, 2012 at 12:02 AM, Roy Smith wrote: > In article <503a2804$0$6574$c3e8da3$54964...@news.astraweb.com>, > Steven D'Aprano wrote: > The mapping of name:address is part of the *compilation* process -- the compiler knows that variable 'x' corresponds to location 1234567

Re: Objects in Python

2012-08-26 Thread Chris Angelico
On Mon, Aug 27, 2012 at 12:02 AM, Mark Lawrence wrote: > On 26/08/2012 14:34, Chris Angelico wrote: >> >> Okay, that may be a bit of a fairy tale ending and completely illogical. >> >> ChrisA > > Then stick to the thread about flexible string representation, unicode and > typography :) Hehe. Prob

Re: Objects in Python

2012-08-26 Thread Roy Smith
In article <503a2804$0$6574$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: >>> The mapping of name:address is part of the *compilation* process -- >>> the compiler knows that variable 'x' corresponds to location >>> 12345678 Just to pick a nit, the compiler probably doesn't know

Re: Objects in Python

2012-08-26 Thread Mark Lawrence
On 26/08/2012 14:34, Chris Angelico wrote: Okay, that may be a bit of a fairy tale ending and completely illogical. ChrisA Then stick to the thread about flexible string representation, unicode and typography :) -- Cheers. Mark Lawrence. -- http://mail.python.org/mailman/listinfo/python

Re: Objects in Python

2012-08-26 Thread Chris Angelico
On Sun, Aug 26, 2012 at 11:43 PM, Steven D'Aprano wrote: > It gets worse: Python has multiple namespaces that are searched. > > "Go to the Excelsior Hotel and ask the concierge for Mr Smith. If Mr > Smith isn't staying there, go across the road to the Windsor Hotel and > ask there. If he's not the

Re: Objects in Python

2012-08-26 Thread Steven D'Aprano
On Sun, 26 Aug 2012 00:45:55 -0500, Evan Driscoll wrote: > On 08/24/2012 05:00 AM, Steven D'Aprano wrote: >> No. The compiler remembers the address of 'a' by keeping notes about it >> somewhere in memory during the compilation process. When you run the >> compiled program, there is no longer any r

Re: Objects in Python

2012-08-26 Thread Roy Smith
In article , Chris Angelico wrote: > On Sun, Aug 26, 2012 at 3:45 PM, Evan Driscoll wrote: > > Third, and more wackily, you could technically create a C implementation > > that works like Python, where it stores variables (whose addresses aren't > > taken) in a dict keyed by name, and generates

Re: Objects in Python

2012-08-26 Thread Chris Angelico
On Sun, Aug 26, 2012 at 10:02 PM, Steven D'Aprano wrote: > On Sun, 26 Aug 2012 16:22:05 +1000, Chris Angelico wrote: > >> On Sun, Aug 26, 2012 at 3:45 PM, Evan Driscoll >> wrote: >>> Third, and more wackily, you could technically create a C >>> implementation that works like Python, where it stor

Re: psphere: how to make thread safe

2012-08-26 Thread jonathan . kinred
On Sunday, 26 August 2012 22:45:25 UTC+10, jonatha...@gmail.com wrote: > On Wednesday, 22 August 2012 22:03:48 UTC+10, sajuptpm wrote: > > > Hi, > > > > > > > > > > > > psphere: Python interface for the VMware vSphere Web Services SDK > > > > > > > > > > > > I already developed an

Re: issue with struct.unpack

2012-08-26 Thread Alexander Blinne
On 26.08.2012 01:31, Dennis Lee Bieber wrote: > The struct module relies upon the user knowing the format of the data. > If your problem is that you have some null-terminated string data in a > variable width field, you will have to locate the position of the null > FIRST, and specify the appropria

Re: psphere: how to make thread safe

2012-08-26 Thread jonathan . kinred
On Wednesday, 22 August 2012 22:03:48 UTC+10, sajuptpm wrote: > Hi, > > > > psphere: Python interface for the VMware vSphere Web Services SDK > > > > I already developed an app using https://bitbucket.org/jkinred/psphere. But > getting lot of errors since psphere is not thread safe (I think

Re: Objects in Python

2012-08-26 Thread Steven D'Aprano
On Sun, 26 Aug 2012 16:22:05 +1000, Chris Angelico wrote: > On Sun, Aug 26, 2012 at 3:45 PM, Evan Driscoll > wrote: >> Third, and more wackily, you could technically create a C >> implementation that works like Python, where it stores variables (whose >> addresses aren't taken) in a dict keyed by

Re: Flexible string representation, unicode, typography, ...

2012-08-26 Thread Steven D'Aprano
On Sat, 25 Aug 2012 23:59:34 -0700, wxjmfauth wrote: > Le dimanche 26 août 2012 00:26:56 UTC+2, Ian a écrit : >> More seriously, strings in Go are not sequences of runes. They're >> actually arrays of UTF-8 bytes. Actually, it's worse that that. Strings in Go aren't even proper UTF-8. They are

Re: Computing win/loss records in Python

2012-08-26 Thread Hans Mulder
On 26/08/12 04:42:59, Steven W. Orr wrote: > On 8/25/2012 10:20 PM, Christopher McComas wrote: >> Greetings, >> >> I have code that I run via Django that grabs the results from various >> sports from formatted text files. The script iterates over every line >> in the formatted text files, finds the

Re: help with simple print statement!

2012-08-26 Thread Hans Mulder
On 24/08/12 21:59:12, Prasad, Ramit wrote: > Also, print doesn't work inside a class. It works for me: > python3 Python 3.3.0a1 (v3.3.0a1:f1a9a6505731, Mar 4 2012, 12:26:12) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin Type "help", "copyright", "credits" or "license" for more informati

Re: Built-in open() with buffering > 1

2012-08-26 Thread Hans Mulder
On 24/08/12 06:35:27, Marco wrote: > Please, can anyone explain me the meaning of the > "buffering > 1" in the built-in open()? > The doc says: "...and an integer > 1 to indicate the size > of a fixed-size chunk buffer." > So I thought this size was the number of bytes or chars, but > it is not Th

VPS For Python

2012-08-26 Thread coldfire
I will really appreciate if someone type the address of any of the following for use with python 1>Webhost 2>Shell Account 3>VPS I am really new to all this Got web server and shell account but unable to figure out how to use it or deploy the Code, My problem is that I m using lot of third p

Re: Segfault when setting an instance property on 2.7.3

2012-08-26 Thread Vincent Pelletier
Le samedi 25 août 2012 11:38:47, Vincent Pelletier a écrit : > Any idea of ways to debug this problem further ? Trying with pypy ("just to see"), I got even more reproductible segfaults - even with valgrind. Turns out, I was not keeping strong references to ctypes buffers, which get very quickl

Re: Flexible string representation, unicode, typography, ...

2012-08-26 Thread wxjmfauth
Le dimanche 26 août 2012 00:26:56 UTC+2, Ian a écrit : > On Sat, Aug 25, 2012 at 9:47 AM, wrote: > > > For those you do not know, the go language has introduced > > > the rune type. As far as I know, nobody is complaining, I > > > have not even seen a discussion related to this subject. > >