Re: [Tutor] Confusion with Python, Bash and Command Prompt

2012-08-09 Thread Dave Angel
On 08/10/2012 12:01 AM, Santosh Kumar wrote: > Hello There, > > We all know that line starting with "#" in Python is a comment. > > We also know that when the first line of any file (with any extension) > has "#!/usr/bin/env bash" and if you make it executable and do > ./filename.ext in the termina

Re: [Tutor] Confusion with Python, Bash and Command Prompt

2012-08-09 Thread Modulok
... > My Question: > Is it true that doing that is as same as doing #!/usr/bin/env python > on Unix? Because I think that the matter of shebang is limited to Bash > and Windows don't have a bash, it has a Command Prompt. And I don't > think such thing happens in Windows. It has nothing directly do

Re: [Tutor] Confusion with Python, Bash and Command Prompt

2012-08-09 Thread Steven D'Aprano
On 10/08/12 14:01, Santosh Kumar wrote: Hello There, We all know that line starting with "#" in Python is a comment. We also know that when the first line of any file (with any extension) has "#!/usr/bin/env bash" and if you make it executable and do ./filename.ext in the terminal then it will

[Tutor] Confusion with Python, Bash and Command Prompt

2012-08-09 Thread Santosh Kumar
Hello There, We all know that line starting with "#" in Python is a comment. We also know that when the first line of any file (with any extension) has "#!/usr/bin/env bash" and if you make it executable and do ./filename.ext in the terminal then it will be considered as bash file (in this case e

Re: [Tutor] receiving string from shell

2012-08-09 Thread Dave Angel
On 08/09/2012 10:24 PM, richard kappler wrote: > The summer of intensive learning continues. Working on subprocess today. > I figured out how to send data out, for example to my festival tts engine: > > [code]response = k.respond(input, "richard") > festivalCmd = '(SayText "%s")' % response > sub

[Tutor] receiving string from shell

2012-08-09 Thread richard kappler
The summer of intensive learning continues. Working on subprocess today. I figured out how to send data out, for example to my festival tts engine: [code]response = k.respond(input, "richard") festivalCmd = '(SayText "%s")' % response subprocess.Popen(['/usr/bin/festival', '-b', festivalCmd])[/c

Re: [Tutor] help -Global name xxxxxxxx is not definied.

2012-08-09 Thread Alan Gauld
On 09/08/12 13:20, leon zaat wrote: When i run the program i got the following message: NameError: global name 'schrijfExportRecord' is not found What I am doing wrong and how can i fix it? Looks like you found the problem in this case but for future reference... Please, always post the enti

Re: [Tutor] help -Global name xxxxxxxx is not definied.

2012-08-09 Thread leon zaat
Thanks, adding the self as suggested did the trick. > To: tutor@python.org > From: __pete...@web.de > Date: Thu, 9 Aug 2012 14:45:58 +0200 > Subject: Re: [Tutor] help -Global name is not definied. > > leon zaat wrote: > > > Hello everyone, > > > > Can anybody help me with this p

Re: [Tutor] help -Global name xxxxxxxx is not definied.

2012-08-09 Thread Peter Otten
leon zaat wrote: > Hello everyone, > > Can anybody help me with this problem. > Ik have a program that i' am modifying. > > Ik build a function to export data to a csv file. I tried the functions > over different parts, that needed to be extracted. The parts on it self > worked fine. Now I put a

Re: [Tutor] help -Global name xxxxxxxx is not definied.

2012-08-09 Thread leon zaat
Hello everyone, Can anybody help me with this problem. Ik have a program that i' am modifying. Ik build a function to export data to a csv file. I tried the functions over different parts, that needed to be extracted. The parts on it self worked fine. Now I put all parts in my function. Becaus

Re: [Tutor] help - SyntaxError: Non-UTF-8 code using python 3

2012-08-09 Thread Alan Gauld
On 09/08/12 04:26, Lily Tran wrote: I am getting the following error when I try to run this python program in eclipse. I am running python 3: I see you fixed that,but there are other problems: def MagicEightBallEmulator(): answers = ["As I see it, yes", "Very doubtful"] while