• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 115
  • Last Modified:

Trying to run a Python File

Hello Experts,

I'm trying to run the attached python file. I have no clue about Python. I installed the Windows release 3.6 of Python and when I try use the Python application to open the file I get the following output:

python1
I'm not sure what to do with the information.

Also when I try to execute the python file in windows I get the following output:

python2

Can someone let me know how to execute this file?

Cheers

Carlton
keygen.py
0
Member_2_7966113
Asked:
Member_2_7966113
  • 4
  • 3
  • 3
3 Solutions
 
KimputerCommented:
Seems like good ol' Phyton 2:

Python3 syntax changed it to:

print("Hello world!")

Either install Python 2, or adjust your script manually to correct all print commands (could be some other commands besides print might need adjustments as well)
0
 
ScobberCommented:
The file is Python 2.7 not 3.0

Print ("hello world") instead of print "hello world"

Do as it says

You should also install Python 2.7 and remove 3

Python 3 is not as mainstream as 2.7
0
 
Member_2_7966113Author Commented:
When I try to run the .py file from windows I get the following

python4
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
KimputerCommented:
Yes you said it already. But what action did you take AFTER the first question?
0
 
Member_2_7966113Author Commented:
I am now getting the following errors:

python5
python6
0
 
ScobberCommented:
I think your host ID is wrong, contains invalid characters or the location where it is being read is wrong.

create a file called hostid. in the same path as the py and enter the host id as hexadecimal chars,

i.e 0-9 a-f

ensure you enter no other characters space, carriage return/line feed {enter}, tab.

save and rerun
0
 
ScobberCommented:
Hi Calton

How did you go. If your problem is resolved please take the time to mark the comments that helped you resolve your question.

Cheers
0
 
ScobberCommented:
Sorry your reason makes no sense
I have to object to this being deleted
Kimputer and I deserve the points split between us
0
 
KimputerCommented:
It is correct, he may have found an answer, but that's for a problem that came AFTER the original problem. Technically, it doesn't make any sense indeed.
0
 
Member_2_7966113Author Commented:
Much obliged to you both.
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 4
  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now