Solved

Trying to run a Python File

Posted on 2016-08-22
11
93 Views
Last Modified: 2016-08-25
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
Comment
Question by:Member_2_7966113
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 3
11 Comments
 
LVL 36

Expert Comment

by:Kimputer
ID: 41765515
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
 
LVL 7

Expert Comment

by:Scobber
ID: 41765526
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
 
LVL 1

Author Comment

by:Member_2_7966113
ID: 41765530
When I try to run the .py file from windows I get the following

python4
0
Get HTML5 Certified

Want to be a web developer? You'll need to know HTML. Prepare for HTML5 certification by enrolling in July's Course of the Month! It's free for Premium Members, Team Accounts, and Qualified Experts.

 
LVL 36

Assisted Solution

by:Kimputer
Kimputer earned 250 total points
ID: 41765541
Yes you said it already. But what action did you take AFTER the first question?
0
 
LVL 1

Author Comment

by:Member_2_7966113
ID: 41765669
I am now getting the following errors:

python5
python6
0
 
LVL 7

Accepted Solution

by:
Scobber earned 250 total points
ID: 41766094
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
 
LVL 7

Expert Comment

by:Scobber
ID: 41768274
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
 
LVL 7

Assisted Solution

by:Scobber
Scobber earned 250 total points
ID: 41770042
Sorry your reason makes no sense
I have to object to this being deleted
Kimputer and I deserve the points split between us
0
 
LVL 36

Expert Comment

by:Kimputer
ID: 41770192
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
 
LVL 1

Author Closing Comment

by:Member_2_7966113
ID: 41770515
Much obliged to you both.
0

Featured Post

Get HTML5 Certified

Want to be a web developer? You'll need to know HTML. Prepare for HTML5 certification by enrolling in July's Course of the Month! It's free for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Plenty of writing has gone on the web trying to compare Python with other competitive programming languages and vice versa. However, not much has been put into a wholistic perspective. This article should help you decide whether to adopt Python as a…
"The time has come," the Walrus said, "To talk of many things: Of sets--and lists--and dictionaries-- Of variable kinks-- And why you see it changing not-- And why so strange are strings." This part describes how variables and references (see …
Learn the basics of if, else, and elif statements in Python 2.7. Use "if" statements to test a specified condition.: The structure of an if statement is as follows: (CODE) Use "else" statements to allow the execution of an alternative, if the …
Learn the basics of modules and packages in Python. Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…
Suggested Courses

615 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question