How do I get the constructor signature for built-in types?

2012-06-04 Thread Steven D'Aprano
The inspect.getargspec and getfullargspec functions allow you to extract the function call signature for Python functions and methods. This allows you to work out the constructor signature for pure-Python classes, by calling inspect.getargspec on the __init__ or __new__ method. >>> import insp

Re: why i can't read sda1 with python?

2012-06-04 Thread Michael Hrivnak
Which makes total sense. If any user could directly read the entire contents of the disk, filesystem permissions would be useless. Michael On Mon, Jun 4, 2012 at 4:14 AM, Xia wrote: > so only root or accounts in group disk can access /dev/sda1, -- http://mail.python.org/mailman/listinfo/pytho

Re: file pointer array

2012-06-04 Thread Steven D'Aprano
On Mon, 04 Jun 2012 18:21:20 -0700, FSH wrote: > Hello, > > I have a simple question. I wish to generate an array of file pointers. > For example, I have files: > > data1.txt > data2.txt > data3.txt > > > I wish to generate fine pointer array so that I can read the files at > the same time

Re: file pointer array

2012-06-04 Thread Chris Rebert
On Mon, Jun 4, 2012 at 6:21 PM, FSH wrote: > Hello, > > I have a simple question. I wish to generate an array of file > pointers. For example, I have files: > > data1.txt > data2.txt > data3.txt > > > I wish to generate fine pointer array so that I can read the files at > the same time. > > f

Re: file pointer array

2012-06-04 Thread Ben Finney
FSH writes: > I have a simple question. I wish to generate an array of file > pointers. Welcome to Python. By your description, I think you want a different type: not an array, but a list. I recommend you become familiar with Python's data model http://docs.python.org/reference/datamodel.html>

file pointer array

2012-06-04 Thread FSH
Hello, I have a simple question. I wish to generate an array of file pointers. For example, I have files: data1.txt data2.txt data3.txt I wish to generate fine pointer array so that I can read the files at the same time. for index in range(N): fid[index] = open('data%d.txt' % index,'r

Re: ./configure

2012-06-04 Thread Irmen de Jong
On 4-6-2012 0:01, Janet Heath wrote: > > Thanks Alain. I should have a compiler on my Mac OS X Lion. I am thinking > that it > isn't set in my $PATH variable. I don't know where the $PATH is set at. I > will > check to see if their is a binary. You'll have to have the Apple Developer tool

RE: ./configure

2012-06-04 Thread Prasad, Ramit
> > Thanks Alain. I should have a compiler on my Mac OS X Lion. I am > thinking that it isn't set in my $PATH variable. I don't know where the > $PATH is set at. I will check to see if their is a binary. > > You need to install the command line tools package within XCode in > order to get them

Re: Use a locally built Tk for Python?

2012-06-04 Thread Ned Deily
In article <900b402d-c6b0-4e00-beea-a18417764...@b26g2000vbt.googlegroups.com>, > I have multiple Pythons locally installed so that I can test against > different versions. (On a 64-bit Debian stable system.) > > All of them use the system's Tcl/Tk installation. However, I want to > make some of

Re: Where is the latest step by step guide to use Jython to compilePython into Java?

2012-06-04 Thread Ian Kelly
On Mon, Jun 4, 2012 at 10:17 AM, Benjamin Kaplan wrote: > On Mon, Jun 4, 2012 at 11:47 AM, David Shi wrote: >> Hello, Mohan, >> >> Did you test it?  I am using Windows.  Where are the exact steps for >> compiling in DOS? >> >> Once .class or jar files created, how to use these files? >> >> Could

Re: Where is the latest step by step guide to use Jython to compilePython into Java?

2012-06-04 Thread Terry Reedy
On 6/4/2012 11:35 AM, David Shi wrote: Please post plain text rather than html. It just works better and is the convention for this newsgroup and mailing list. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Where is the latest step by step guide to use Jython to compilePython into Java?

2012-06-04 Thread Benjamin Kaplan
On Mon, Jun 4, 2012 at 11:47 AM, David Shi wrote: > Hello, Mohan, > > Did you test it?  I am using Windows.  Where are the exact steps for > compiling in DOS? > > Once .class or jar files created, how to use these files? > > Could you enlighten me with tested/proven step by step instructions? > >

Re: Where is the latest step by step guide to use Jython to compilePython into Java?

2012-06-04 Thread Stefan Behnel
David Shi, 04.06.2012 17:35: > Compiling your Python code with jythonc > I do not know whether I downloaded a wrong version of Jythonc? Or, got > mismatched software or instructions. Jythonc used to work in Jython 2.2 but is no longer supported in Jyton 2.5. Stefan -- http://mail.python.org/

Re: Where is the latest step by step guide to use Jython to compilePython into Java?

2012-06-04 Thread David Shi
Hello, Mohan, Did you test it?  I am using Windows.  Where are the exact steps for compiling in DOS? Once .class or jar files created, how to use these files? Could you enlighten me with tested/proven step by step instructions? Regards. David From: "Naraya

RE: Where is the latest step by step guide to use Jython to compilePython into Java?

2012-06-04 Thread Narayanaswamy, Mohan
David, Thanks for the link, here that compilation steps won’t produce java code, but it could create .class file (or jar). Regards Mohan From: David Shi [mailto:davidg...@yahoo.co.uk] Sent: Monday, June 04, 2012 11:35 PM To: Narayanaswamy, Mohan Cc: python-list@python.org Subject: R

Re: Where is the latest step by step guide to use Jython to compilePython into Java?

2012-06-04 Thread David Shi
Mohan, Please see the following link as an example. http://www.ssec.wisc.edu/~tomw/visadtutor/compile.html I just can not make any success with some of these instructions. Compiling your Python code with jythonc I do not know whether I downloaded a wrong version of Jythonc?   Or, got mismatched

Re: Where is the latest step by step guide to use Jython to compile Python into Java?

2012-06-04 Thread Stefan Behnel
Narayanaswamy, Mohan, 04.06.2012 16:56: > Python is dynanmic programming (but strongly typed), java is > static-typed language. Currently it is not possible to convert python > into java, since python types are dynamically identified, not identified > during compilation. That's not entirely true.

RE: Where is the latest step by step guide to use Jython to compilePython into Java?

2012-06-04 Thread Narayanaswamy, Mohan
David, As per my knowledge, You can’t find steps to convert python into java anywhere. 1) I am not expert in python, but familiar with Java. Python by default uses python-vm and converts into byte code, which is not compatible with JVM byte-code, Jython/Jruby/Jxxx are supporting lang

Re: Where is the latest step by step guide to use Jython to compile Python into Java?

2012-06-04 Thread Stefan Behnel
David Shi, 04.06.2012 16:36: > Where is the latest step by step guide to use Jython to compile Python into > Java? I don't think there is such a thing, simply because Jython does not compile Python into Java. > I found that it was very confusing by reading not updated text. It usually helps to

Where is the latest step by step guide to use Jython to compile Python into Java?

2012-06-04 Thread David Shi
Hello, Where is the latest step by step guide to use Jython to compile Python into Java? I found that it was very confusing by reading not updated text. Please help. Regards. David -- http://mail.python.org/mailman/listinfo/python-list

Re: Help needed with nested parsing of file into objects

2012-06-04 Thread richard
On Jun 4, 3:14 pm, Alain Ketterlin wrote: > richard writes: > > Hi guys i am having a bit of dificulty finding the best approach / > > solution to parsing a file into a list of objects / nested objects any > > help would be greatly appreciated. > > > #file format to parse .txt > > [code] > > An i

Re: Help needed with nested parsing of file into objects

2012-06-04 Thread Alain Ketterlin
richard writes: > Hi guys i am having a bit of dificulty finding the best approach / > solution to parsing a file into a list of objects / nested objects any > help would be greatly appreciated. > > #file format to parse .txt > [code] > An instance of TestArray > a=a > b=b > c=c > List of 2 A

Re: Help needed with nested parsing of file into objects

2012-06-04 Thread Roy Smith
In article <6b296278-fd32-45fb-b5c7-6c0fe5ce4...@q2g2000vbv.googlegroups.com>, richard wrote: > Hi guys i am having a bit of dificulty finding the best approach / > solution to parsing a file into a list of objects / nested objects any > help would be greatly appreciated. The first question is

Help needed with nested parsing of file into objects

2012-06-04 Thread richard
Hi guys i am having a bit of dificulty finding the best approach / solution to parsing a file into a list of objects / nested objects any help would be greatly appreciated. #file format to parse .txt [code] An instance of TestArray a=a b=b c=c List of 2 A elements: Instance of A element a

Re: Use a locally built Tk for Python?

2012-06-04 Thread Kushal Kumaran
On Mon, Jun 4, 2012 at 12:51 PM, Mark Summerfield wrote: > Thanks for your thoughtful replies. > > I don't use altinstall because using --prefix is sufficient to get a > locally built Python. > > Both your suggestions require root (or sudo) and changing the system > itself. Whereas I was hoping to

Re: Use a locally built Tk for Python?

2012-06-04 Thread Mark Summerfield
Thanks for your thoughtful replies. I don't use altinstall because using --prefix is sufficient to get a locally built Python. Both your suggestions require root (or sudo) and changing the system itself. Whereas I was hoping to just build a local Python and install my own Tcl/Tk in its lib and si

Re: why i can't read sda1 with python?

2012-06-04 Thread Xia
#ls -l /dev/sda1 will print brw-r- 1 root disk ... so only root or accounts in group disk can access /dev/sda1, you could add the account into group disk with usermod, then re-login. On Sat, 2 Jun 2012 10:14:36 +0800 "水静流深" <1248283...@qq.com> wrote: > tiger@debian:~$ sudo fdisk -l > > Dis

Re: why i can't read sda1 with python?

2012-06-04 Thread Corey Richardson
On Sat, 2 Jun 2012 10:14:36 +0800 "水静流深" <1248283...@qq.com> <1248283...@qq.com> wrote: > [snip] > i want to read sda1 with python: > >>> file=open('/dev/sda1','rb') > Traceback (most recent call last): > File "", line 1, in > IOError: [Errno 13] Permission denied: '/dev/sda1' > > how can i

why i can't read sda1 with python?

2012-06-04 Thread ????????
tiger@debian:~$ sudo fdisk -l Disk /dev/sda: 120.0 GB, 120034123776 bytes 255 heads, 63 sectors/track, 14593 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x073a3