[Tutor] Problems install Python

2010-09-29 Thread Pham Nguyen Huy Phuong
Dear all, I had just download PeGreSQL, unzip and installed it, but I have a problem such as: phuong...@ubuntu:~/PyGreSQL-4.0$ python setup.py build sh: pg_config: not found Traceback (most recent call last): File "setup.py", line 94, in pg_include_dir = pg_config('includedir') File "setu

Re: [Tutor] Problems install Python

2010-09-29 Thread Evert Rol
> I had just download PeGreSQL, unzip and installed it, but I have a problem > such as: > > phuong...@ubuntu:~/PyGreSQL-4.0$ python setup.py build > sh: pg_config: not found > Traceback (most recent call last): > File "setup.py", line 94, in > pg_include_dir = pg_config('includedir') > F

Re: [Tutor] generating independent random numbers

2010-09-29 Thread Peter Otten
Carter Danforth wrote: > Thanks for the replies, Dave and Joel. The reason I'm not just using the > time or datetime modules for a random date is because it's restricted to > 1970-2038; I'm pulling dates from 1600-3099. Thanks a lot for the pointer The datetime module is not restricted to 1970...

Re: [Tutor] generating independent random numbers

2010-09-29 Thread Ewald Ertl
Hi, On Wed, Sep 29, 2010 at 11:42 AM, Peter Otten <__pete...@web.de> wrote: > Carter Danforth wrote: > > > Thanks for the replies, Dave and Joel. The reason I'm not just using the > > time or datetime modules for a random date is because it's restricted to > > 1970-2038; I'm pulling dates from 16

Re: [Tutor] generating independent random numbers

2010-09-29 Thread Peter Otten
Ewald Ertl wrote: >> Just an attempt from my side: > The year 1500 didn't have a 29th of February, the 28th work for me but > 29th also fails here. datetime.date( 1500, 2, 28 ) > datetime.date(1500, 2, 28) datetime.date( 1500, 2, 29 ) > Traceback (most recent call last): > File "", line

Re: [Tutor] I am looking for a book on Beginners who never programmed before or have no experience in programming

2010-09-29 Thread Calle's Pyt(h)onkonto
Or if you're like me (= Thinks reading a guide online is annoying since you have to switch between your browser and IDLE all the time), and would like to have a book that is easy to read and easy to understand, I would recommend Python Programming For The Absolute Beginner 3rd editon by Michael

Re: [Tutor] I am looking for a book on Beginners who never programmed before or have no experience in programming

2010-09-29 Thread Tim Golden
On 29/09/2010 12:20, Calle's Pyt(h)onkonto wrote: Or if you're like me (= Thinks reading a guide online is annoying since you have to switch between your browser and IDLE all the time), and would like to have a book that is easy to read and easy to understand, Merely from that perspective alone

Re: [Tutor] Writing a txt from dbf

2010-09-29 Thread Susana Iraiis Delgado Rodriguez
Hello Steven! Your guess was rigth, that's what I'm looking for! I need an output as: beta gamma etc... but I'm showing betagammaetc.. What can I do to my code to get the first ouput? By the way thanks for answering! ___ Tutor maillist - Tutor@python

Re: [Tutor] Writing a txt from dbf

2010-09-29 Thread Alan Gauld
"Susana Iraiis Delgado Rodriguez" wrote Your guess was rigth, that's what I'm looking for! I need an output as: beta gamma etc... but I'm showing betagammaetc.. I assume you mean in the file? print adds a newline automatically when printing to stdout. Steven already showed you how to ad

Re: [Tutor] generating independent random numbers

2010-09-29 Thread Carter Danforth
Wow... I'm really slipping here with the leaps years, good catch on the 2000s. And yeah, a list does make a whole lot more sense. Thanks Dave. I've checked multiple sources on Zeller's formula, initially came across it on this book on vedic math (highly recommend it): http://amzn.to/bNXBM6. But he

[Tutor] Writing txt from dbf

2010-09-29 Thread Susana Iraiis Delgado Rodriguez
Thanks Steven and Alan, your recommendation worked perfectly! ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] generating independent random numbers

2010-09-29 Thread Dave Angel
On 9/28/2010 5:11 PM, Carter Danforth wrote: Thanks for the replies, Dave and Joel. The reason I'm not just using the time or datetime modules for a random date is because it's restricted to 1970-2038; I'm pulling dates from 1600-3099. Thanks a lot for the pointer about the leap years, Dave, as

Re: [Tutor] function error

2010-09-29 Thread roberto
On Tue, Sep 28, 2010 at 8:26 PM, Evert Rol wrote: > > Perhaps if you provide the full traceback from the error (assuming you're > still getting this >error); tracebacks generally show the offending code as > well. It may be something that's >simply overlooked but shows in the > traceback. > >

[Tutor] Runnig a windows.exe from python

2010-09-29 Thread Susana Iraiis Delgado Rodriguez
Hello everyone: I'm working in a simple python module to run a external command, this command is named "ogr2ogr.exe" . When I execute my python script : *import os def call(): os.system(' "C:\\Archivos de programa\\FWTools2.4.7\\bin\\ogr2ogr.exe" ')* * raw_input()* *call()* It runs, but

Re: [Tutor] function error

2010-09-29 Thread Evert Rol
>> Perhaps if you provide the full traceback from the error (assuming you're >> still getting this >error); tracebacks generally show the offending code as >> well. It may be something that's >simply overlooked but shows in the >> traceback. >> >> > > here it is: > > TypeError

Re: [Tutor] Runnig a windows.exe from python

2010-09-29 Thread Steven D'Aprano
On Thu, 30 Sep 2010 05:49:53 am Susana Iraiis Delgado Rodriguez wrote: > Hello everyone: > > I'm working in a simple python module to run a external command, this > command is named "ogr2ogr.exe" . When I execute my python script : > > *import os > def call(): > os.system(' "C:\\Archivos de >

Re: [Tutor] function error

2010-09-29 Thread Alan Gauld
"roberto" wrote Perhaps if you provide the full traceback from the error here it is: TypeError Traceback (most recent call last) ~/randomMove2.py in () > 1 2 3 4 5 ... ~/checkForward.py in out_of_bounds() 19 20 def outOfBo

Re: [Tutor] Runnig a windows.exe from python

2010-09-29 Thread Alan Gauld
"Susana Iraiis Delgado Rodriguez" wrote I'm working in a simple python module to run a external command, this command is named "ogr2ogr.exe" . When I execute my python script : *import os def call(): os.system(' "C:\\Archivos de programa\\FWTools2.4.7\\bin\\ogr2ogr.exe" ')* * raw_i

Re: [Tutor] generating independent random numbers

2010-09-29 Thread Carter Danforth
On Wed, Sep 29, 2010 at 1:53 PM, Dave Angel wrote: > On 9/28/2010 5:11 PM, Carter Danforth wrote: > >> Thanks for the replies, Dave and Joel. The reason I'm not just using the >> time or datetime modules for a random date is because it's restricted to >> 1970-2038; I'm pulling dates from 1600-30

Re: [Tutor] generating independent random numbers

2010-09-29 Thread Dave Angel
On 9/29/2010 9:17 PM, Carter Danforth wrote: On Wed, Sep 29, 2010 at 1:53 PM, Dave Angel wrote: On 9/28/2010 5:11 PM, Carter Danforth wrote: Thanks for the replies, Dave and Joel. The reason I'm not just using the time or datetime modules for a random date is because it's restricted to 19

[Tutor] system()? popen2()? How to execute a command & save its output?

2010-09-29 Thread James Hartley
I'm needing to transfer the following shell construct to Python, plus save the output of execution: FTP_SITE='ftp.somesite.com' ftp -a $FTP_SITE <___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.o

Re: [Tutor] generating independent random numbers

2010-09-29 Thread Dave Angel
On 2:59 PM, Dave Angel wrote: On 9/29/2010 9:17 PM, Carter Danforth wrote: On Wed, Sep 29, 2010 at 1:53 PM, Dave Angel wrote: On 9/28/2010 5:11 PM, Carter Danforth wrote: Thanks for the replies, Dave and Joel. The reason I'm not just using the time or datetime modules for a random date

Re: [Tutor] system()? popen2()? How to execute a command & save its output?

2010-09-29 Thread vijay
command_name = 'ps -ax|grep  sometext >>/tmp/output.txt'f = os.popen('%s' %command_name) fp = open('/tmp/output.txt') print fp.readlines() With Regards Vijay --- On Thu, 30/9/10, James Hartley wrote: From: James Hartley Subject: [Tutor] system()? popen2()? How to execute a comman

Re: [Tutor] system()? popen2()? How to execute a command & save its output?

2010-09-29 Thread Chris Fuller
You might also consider pexpect. http://pexpect.sourceforge.net/ It's designed for interactive console applications like ftp. For popen() style access, the recommended approach is the subprocess module. You should be able to find an example in the docs to fit your application. http://docs.pyth