Reputation: 161
I have this program named
program.py
When i try to import it using the line:
import program.py as p
it makes an error that no such file exists.
Upvotes: 1
Views: 21
Reputation: 1176
The line:
.py
is used to identify that the program is in Python. To import anything, you only type:
import program as p
Unless a file or module with the same name exists.
Upvotes: 3