I am trying to run a program from python command line. I installed python on D: drive. PLZZ help me in fixing this problem.
syeda amna 0 Light Poster
Recommended Answers
Jump to PostSee the light with python guru Mark Hammond.
Jump to PostLet's say you have this program saved as test.py in folder "C:/Python27/Mytests/"
# save as test.py for x in range(10): print(x)
Now you can do this in the Python shell and see the output...
Python 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 …
Jump to PostIn python 3 it would be
>>> exec(open("test.py").read())
instead of execfile.
All 10 Replies
untio 36 Light Poster
syeda amna 0 Light Poster
Gribouillis 1,391 Programming Explorer Team Colleague
Schol-R-LEA 1,446 Commie Mutant Traitor Featured Poster
syeda amna 0 Light Poster
TrustyTony 888 ex-Moderator Team Colleague Featured Poster
vegaseat 1,735 DaniWeb's Hypocrite Team Colleague
syeda amna commented: Thank u. +1
Gribouillis 1,391 Programming Explorer Team Colleague
syeda amna 0 Light Poster
syeda amna 0 Light Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.