May-24-2022, 09:29 AM
hey, I'm trying to run a function from a different file in my main file. this isn't working as the function won't load variables across files, how can this be achieved?
main file:
main file:
inv.invcheck()function file:
def invcheck(): print("function has loaded...") print(lifesaver, """Lifesavers """, apple, """Apples """, tidepod, """Tidepods """, alcohol, """Bottles Of Alcohol """, rifle, """Hunting Rifles """, laptop, """Laptops """, cheese, """Cheese Slices """, pole, """Fishing Poles """, fish, """Common Fish """, rarefish, """Rare Fish """, exoticfish, """Exotic Fish """, legendaryfish, """Legendary Fish """, rarepepe, """Rare Pepe """, pepec, """Pepe Coins """, pepem, """Pepe Medal """, pepet, """Pepe Trophys""")when I run the main file:
Error:Traceback (most recent call last):
File "O:\Jackpot Studios\PyMemer DEV\pymemer.py", line 294, in <module>
inv.invcheck()
File "O:\Jackpot Studios\PyMemer DEV\functions\inv.py", line 3, in invcheck
print(lifesaver, """Lifesavers
NameError: name 'lifesaver' is not defined
how do i get this function to run with the variables in the main file?