I am making a little game thing in Python, I'm still fairly new to this. I am trying to access a variable in another file by using import, but it keeps saying
AttributeError: module 'core temp' has no attribute 'ct'
This is my code I am trying to run:
elif cmd == "temp":
if core.ct < 2000:
print(colored("Core temperature: "+core.ct+"°C", "green"))
elif core.ct < 4000:
print(colored("Core temperature: "+core.ct+"°C", "yellow"))
elif core.ct >= 3000:
print(colored("Core temperature: "+core.ct+"°C", "red"))
I am importing coretemp like this: import coretemp as core
This is the code in coretemp.py:
from time import sleep as wait
import coolant as c
ct = 10
while True:
if c.coolactive == False:
ct = ct + 1
wait(.3)
else:
ct = ct - 1
wait(1)
I've been stuck on this problem for ages!
PS: sorry if things aren't formatted right, I'm on mobile and it's hard.