Solved

Trying to run a Python File

Posted on 2016-08-22
11
62 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
  • 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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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…
Sequence is something that used to store data in it in very simple words. Let us just create a list first. To create a list first of all we need to give a name to our list which I have taken as “COURSE” followed by equals sign and finally enclosed …
Learn the basics of lists in Python. Lists, as their name suggests, are a means for ordering and storing values. : Lists are declared using brackets; for example: t = [1, 2, 3]: Lists may contain a mix of data types; for example: t = ['string', 1, T…
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 …

911 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now