"Lang Hurst" wrote
I can't install anything at work (XP computer), hence the stand
alone file. Then when I run it, everything works fine, except when
I get to the point where I want notepad to open the file. I can
browse to the file and manually open it with notepad and it's fine.
It just
On 12/19/2010 01:16 PM, Steven D'Aprano wrote:
Lang Hurst wrote:
I have the following in my program:
try:
os.startfile('current_credit.txt')
except:
os.system('/usr/bin/xdg-open current_credit.txt')
Basically, open a file in notepad if I'm on windows,
On Sun, Dec 19, 2010 at 4:33 PM, Hugo Arts wrote:
> On Sun, Dec 19, 2010 at 10:11 PM, Sander Sweers
> wrote:
>> On 19 December 2010 21:54, jtl999 wrote:
>>> File "GettingStarted.py", line 91
>>> print ("Lesson Two")
>>> ^
>>> SyntaxError: invalid syntax
>>>
>>> Python 2.6.5
>>
>> You
On Sun, Dec 19, 2010 at 10:11 PM, Sander Sweers wrote:
> On 19 December 2010 21:54, jtl999 wrote:
>> File "GettingStarted.py", line 91
>> print ("Lesson Two")
>> ^
>> SyntaxError: invalid syntax
>>
>> Python 2.6.5
>
> You are using a howto for python version 3.X but you are using pytho
On 19 December 2010 21:54, jtl999 wrote:
> File "GettingStarted.py", line 91
> print ("Lesson Two")
> ^
> SyntaxError: invalid syntax
>
> Python 2.6.5
You are using a howto for python version 3.X but you are using python
2.X. In python 3 the print statement was changed to a function.
On Sun, Dec 19, 2010 at 4:05 PM, Alex Hall wrote:
> Sorry to top-post (gMail mobile).
> This looks like you missed a quote, colon, or something on a line
> elsewhere in the file (likely above it). Find that and this should be
> fixed.
>
> On 12/19/10, jtl999 wrote:
>> File "GettingStarted.py", l
Lang Hurst wrote:
I have the following in my program:
try:
os.startfile('current_credit.txt')
except:
os.system('/usr/bin/xdg-open current_credit.txt')
Basically, open a file in notepad if I'm on windows, vim if on my home
linux computer. It works fin
Sorry to top-post (gMail mobile).
This looks like you missed a quote, colon, or something on a line
elsewhere in the file (likely above it). Find that and this should be
fixed.
On 12/19/10, jtl999 wrote:
> File "GettingStarted.py", line 91
> print ("Lesson Two")
> ^
> SyntaxError: in
File "GettingStarted.py", line 91
print ("Lesson Two")
^
SyntaxError: invalid syntax
Python 2.6.5
signature.asc
Description: This is a digitally signed message part
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscript
I have the following in my program:
try:
os.startfile('current_credit.txt')
except:
os.system('/usr/bin/xdg-open current_credit.txt')
Basically, open a file in notepad if I'm on windows, vim if on my home
linux computer. It works fine in linux and in W
Thanks a lot to point this out!
Karim
On 12/19/2010 04:33 AM, Steven D'Aprano wrote:
Karim wrote:
class InputStrategy( object ):
"""This InputStrategy class is an abstract interface to various
read strategy objects.
"""
def read(self, filePath):
"""Abstract method to
On Sun, Dec 19, 2010 at 9:05 PM, Sander Sweers wrote:
> On 19 December 2010 13:43, lei yang wrote:
>> Right, it gets stuck at the readline(), is there a function not get
>> stuck to instead of readline().
>
> readline() will keep reading stdout until it received a newline
> character. So if there
On 19 December 2010 13:43, lei yang wrote:
> Right, it gets stuck at the readline(), is there a function not get
> stuck to instead of readline().
readline() will keep reading stdout until it received a newline
character. So if there is nothing to read it will wait forever. The
solution is to wai
On Sun, Dec 19, 2010 at 8:29 PM, Evert Rol wrote:
>> #!/usr/bin/env python
>> import datetime
>> import subprocess
>> import sys
>> import os
>> import signal
>> from time import sleep
>>
>> def host_run(cmd, secs=10):
>> print("running %s" % cmd)
>>
> #!/usr/bin/env python
> import datetime
> import subprocess
> import sys
> import os
> import signal
> from time import sleep
>
> def host_run(cmd, secs=10):
>print("running %s" % cmd)
>timeout = datetime.timedelta(seconds=secs)
>proc =
On Sun, Dec 19, 2010 at 8:09 PM, Evert Rol wrote:
#!/usr/bin/env python
import datetime
import subprocess
import sys
import os
import signal
from time import sleep
def host_run(cmd, secs=10):
print("running %s" % cmd)
timeout = datetime.
>>> #!/usr/bin/env python
>>> import datetime
>>> import subprocess
>>> import sys
>>> import os
>>> import signal
>>> from time import sleep
>>>
>>> def host_run(cmd, secs=10):
>>>print("running %s" % cmd)
>>>timeout = datetime.timedelta(seconds=secs)
>>>proc = subprocess.Popen(cmd, s
On Sun, Dec 19, 2010 at 7:56 PM, Evert Rol wrote:
>> #!/usr/bin/env python
>> import datetime
>> import subprocess
>> import sys
>> import os
>> import signal
>> from time import sleep
>>
>> def host_run(cmd, secs=10):
>> print("running %s" % cmd)
>> timeout = datetime.timedelta(seconds=secs
> #!/usr/bin/env python
> import datetime
> import subprocess
> import sys
> import os
> import signal
> from time import sleep
>
> def host_run(cmd, secs=10):
>print("running %s" % cmd)
>timeout = datetime.timedelta(seconds=secs)
>proc = subprocess.Popen(cmd, stdout=subprocess.PIPE,
>
#!/usr/bin/env python
import datetime
import subprocess
import sys
import os
import signal
from time import sleep
def host_run(cmd, secs=10):
print("running %s" % cmd)
timeout = datetime.timedelta(seconds=secs)
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE,
stderr=subprocess.STDO
On Sun, Dec 19, 2010 at 4:57 PM, Alan Gauld wrote:
>
> "lei yang" wrote
>
>
> def runForAWhile(cmd, secs=10):
> print("running %s" % cmd)
> timeout = datetime.timedelta(seconds=secs)
> print timeout
> proc = subprocess.Popen(cmd, stdout=subprocess.PIPE,
> stderr=subprocess.STDOUT, shell=T
"lei yang" wrote
def runForAWhile(cmd, secs=10):
print("running %s" % cmd)
timeout = datetime.timedelta(seconds=secs)
print timeout
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE,
stderr=subprocess.STDOUT, shell=True)
status = proc.poll()
You are still only checking status
22 matches
Mail list logo