title: Calling an object from module function
body: <p>I have the following problem: In my main I have some objcts (currently the button and later the car). I want to acces their functions from functions in a module.</p>
  <p>first file (main):</p>
  <pre><code>from tkinter import *
  from tkinter import ttk
  from PIL import Image, ImageTk
  from buttonActions import *
  from Car import car
  
  auto = car()
  
  root = Tk()
  root.title(&quot;RemoteCar&quot;)
  root.state('zoomed')
  
  root.rowconfigure(0, weight=1)
  root.rowconfigure(1,weight=1)
  root.columnconfigure(0, weight=1)
  root.columnconfigure(1, weight=1)
  
  
  stream = ttk.Frame(root, borderwidth=5, relief=&quot;ridge&quot;)
  stream.grid(row=0, column=0, rowspan=3, columnspan=2)
  
  pil_image = Image.open(&quot;Bild.jpg&quot;)
  tk_image = ImageTk.PhotoImage(pil_image)
  
  imgLabel = Label(stream, image=tk_image)
  imgLabel.pack()
  
  
  keys = ttk.Frame(root ,borderwidth=5, relief=&quot;ridge&quot;)
  keys.grid(row=4, column=0)
  
  buttonWidth = 8
  buttonHight = 4
  
  
  button_w = Button(keys, text='W', width=buttonWidth, height=buttonHight, bg='lightgrey', command={})
  button_w.grid(row=0, column=1)
  
  root.bind('&lt;KeyPress-w&gt;', w_down)
  root.bind('&lt;KeyRelease-w&gt;', w_up)
  
  root.mainloop()
  </code></pre>
  <p>second file:</p>
  <pre><code>from tkinter import Button
  from RemoteCarActions import *
  
  def w_down(event):
      global button_w
      button_w.config(bg='yellow')
      w_gedrueckt()
  </code></pre>
  <p>Error Message: NameError: in w_down button_w.config(bg='yellow') name 'button_w' is not defined. Am I using global wrong or what is the problem?</p>