Hello Friends,
I am an absolutely beginner in the world of computer programming. I started my voyage in this world yesterday by starting learning Python. I am reading an e-book on python here. That book has been written with examples from Linux platform. So, I felt this problem while going through that book.
I want to ask you that If I have a python script present in my computer at say D:\Python Practice\mytest1.py then what I should do to be able to use all the functions defined in this script in the Python shell? I mean what command I should run to import the functions of this script into my python shell.

In addition is there a way of starting the python shell from the directory in which my target script is present so that I don't have to write its absolute path but only its file name??????

Thankyou very much in advance!!!!!

8 Years
Discussion Span
Last Post by snippsat

import is taking files usually from the same directory as the script you write without problem, you only make sure that '.' is in your systems path or define another path variable PYTHONPATH with value D:\Python Practice\ or other locations of your own modules/books modules will be saved.

Also it is possible to put the modules in standard location for modules in <your python location>\Lib\site-packages

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.