V
V
Vladimir Sakov2015-02-24 17:42:15
Python
Vladimir Sakov, 2015-02-24 17:42:15

Python file won't open, how to fix?

Hello.
I need to run the Start.py file, but a bunch of errors creep out when I run it:

[email protected]:/var/www# sh Start.py
Start.py: 2: Start.py: import: not found
Start.py: 8: Start.py: if sys.platform.startswith('win'):
        from twisted.internet import selectreactor
        selectreactor.install()
else:
        from twisted.internet import epollreactor
        epollreactor.install(): not found
Start.py: 11: Start.py: Syntax error: "(" unexpected

Twisted installed. Zope.interface too.
What does he not like? How to fix it?
Download file: https://www.dropbox.com/s/391lai8nz11rkoy/Start.py?dl=0

Answer the question

In order to leave comments, you need to log in

2 answer(s)
X
xSkyFoXx, 2015-02-24
@xSkyFoXx

The mystery, most likely, lies here:
Clearly a syntax error.
And if you have Win, it can also be covered here:

from: can't read /var/mail/twisted.internet
from: can't read /var/mail/datetime

Since win does not know how to do this.

L
landstalker, 2015-02-24
@landstalker

I may be wrong, but:
If you look at the errors ...
Then the import may indeed fail due to the lack of a shibang, as Pavel wrote. If python 3 , then in theory the shibang will be #!/usr/bin/env python3. But judging by the print statement without brackets, this is the 2nd.
For Windows, you need to change the environment variables.
A few lines in triple quotes, in theory, do not carry a semantic load ...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question