. , W:/mytest . .
Idle. :
import os
os.chdir("W:/mytest")
W:/mytest Idle.
import sys
sys.path.append(".")
, "", .
File/New Window, , File/Save As. Python, W:/mytest. () "test1.py".
test1.py :
""" test1.py is my test
"""
print ("This is test1.")
class Test1:
def __init__(self):
print ("Constructed")
, script .
, ; Idle "Python Shell". Python:
>>> execfile("test1.py")
This is test1.
>>> import test1
This is test1
>>> tt = test1.Test1()
Constructed