Solved

Trying to run a Python File

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

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
 

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
 

Author Closing Comment

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

Featured Post

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.

Question has a verified solution.

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

Suggested Solutions

Installing Python 2.7.3 version on Windows operating system For installing Python first we need to download Python's latest version from URL" www.python.org " You can also get information on Python scripting language from the above mentioned we…
Variable is a place holder or reserved memory locations to store any value. Which means whenever we create a variable, indirectly we are reserving some space in the memory. The interpreter assigns or allocates some space in the memory based on the d…
Learn the basics of strings in Python: declaration, operations, indices, and slicing. Strings are declared with quotations; for example: s = "string": Strings are immutable.: Strings may be concatenated or multiplied using the addition and multiplic…
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 …

749 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