1

I am quite new to Python. I have python27 installed in my PC(windows). I am trying to run a script in python command line. My script was named "Script". And that contains

import sys # Load a library module
print(sys.platform)
print(2 ** 100) # Raise 2 to a power
x = 'Spam!'
print(x * 8) # String repetition

and when i import the script with writing import Script, it gives this

win32
1267650600228229401496703205376
Spam!Spam!Spam!Spam!Spam!Spam!Spam!Spam!
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named py

why the error message appears here? TIA. :)

Hamuel
  • 633
  • 5
  • 16
Rashed
  • 11
  • 1

1 Answers1

0

instead of writing import myscript.py simply use

import myscript

note that myscript.py should be in the same location

varnit
  • 1,859
  • 10
  • 21