Message from Python discussions
November 2018
— **
Okay, heres an example of my code:
import Display #import Display Python File
Data = {"time":"12:00:00"} #Dictionary
list = [Display.Hours] #List with function
list[0](Data) #call function from list
The Error i get is:
AttributeError: module 'Display' has no attribute 'Hours'
Display code:
def Hours(Data):
print("current time: ", Data["time"])
— Then you have two display files
— Import the right one
— I only have one Display file in my working directory, i renamed it to DisplayMetric and changed the name in my code to make sure i have the right file. But I get the same Error.
— Your code is working for me.
— That's confusing
— On my raspberry pi under python 3.4 and my Laptop with python 3.7 i can't get it to work
— That's weird
— Okay i'm really confused right now. If i write a new test script, it works like I wrote it. In my main Program it doesn't.
— Ok, so does your main program use "Display.py"?
— Yes it does