FAQ

Paul Lemelle wrote:
Hi JM,

My last dumb question: When I try to run the below script as an
executable, I get the following error:
pttdev at pttTestVM:~$ ./argv.py 4
import: unable to open X server `/tmp/launch-c8feFG/org.x:0' @
import.c/ImportImageCommand/361.
./argv.py: line 8: syntax error near unexpected token `print'
./argv.py: line 8: ` print x'

The script:
# Writing the output to a standard argv argument

#!/usr/bin/env python

import sys

for x in sys.argv:
print x


#END

Any idea why?

Thanks,
Paul
Please don't remove python-list.

I see 2 possibilities:

1/ this is related to the open X server, for that I can't help you,
something related to your exported display if you're remotely logged on
the machine
2/ you are using python 2.x syntax within a python 3 interpreter. Try
"print (x)".


JM

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedAug 2, '10 at 8:50a
activeAug 2, '10 at 8:50a
posts1
users1
websitepython.org

1 user in discussion

Jean-Michel Pichavant: 1 post

People

Translate

site design / logo © 2022 Grokbase