3

I need to find out how to open my .py files after writing them in Notepad++. I find the interface more useful than the Python window.

In a tutorial I was following along with the guy uses

execfile(pathway)

but execfile does not work in 3.3.

Is there an equivalent statement in 3.x?

vaultah
  • 44,105
  • 12
  • 114
  • 143
Deaven Morris
  • 107
  • 1
  • 3
  • 13
  • I can never find answers on here, yet everyone else finds them so easily, thanks. The ones I was looking at were all imports and python filname.py – Deaven Morris May 13 '13 at 04:53
  • exec(open('Users\Deaven and Teigan\Document\Python Projects\Stock.py')) Traceback (most recent call last): File "", line 1, in exec(open('Users\Deaven and Teigan\Document\Python Projects\Stock.py')) FileNotFoundError: [Errno 2] No such file or directory: 'Users\\Deaven and Teigan\\Document\\Python Projects\\Stock.py' – Deaven Morris May 13 '13 at 04:59
  • In windows try with the drive letter, like `r"C:\Users\path\to\the\file"` or with a starting backslash. If you are generating the file path with `os.path`, use `os.path.abspath`. – Paulo Scardine May 13 '13 at 05:01

0 Answers0