Solved

Trying to run a Python File

Posted on 2016-08-22
11
83 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 35

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
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
LVL 35

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 35

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction On September 29, 2012, the Python 3.3.0 was released; nothing extremely unexpected,  yet another, better version of Python. But, if you work in Microsoft Windows, you should notice that the Python Launcher for Windows was introduced wi…
Strings in Python are the set of characters that, once defined, cannot be changed by any other method like replace. Even if we use the replace method it still does not modify the original string that we use, but just copies the string and then modif…
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…

751 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