0

I was trying to learn to create a new window using this code:

from tkinter import *

window = Tk()
window.mainloop()

But I run into this error,

ValueError: source code string cannot contain null bytes

Can someone help me with this?

wjandrea
  • 28,235
  • 9
  • 60
  • 81
  • 1
    Please post the full error message with traceback. You can [edit]. BTW, welcome to Stack Overflow! Check out the [tour], and [ask] if you want tips. – wjandrea Sep 22 '21 at 14:17

1 Answers1

0

The code is absolutely fine and a tkinter window should pop up. A problem has emerged within your editor. Don't know if my answer helps much, but the code is fine and the editor is the problem.

Another thread where this problem is discussed: Python: source code string cannot contain null bytes

Gabriel
  • 37
  • 4