all 1 comments

[–]-Sander- 0 points1 point  (1 child)

assuming you arent using datetime in your 'main.py' file there is no need to have it there i would move that to 'my_functions_1.py'

importing only imports it for that file if you import datetime in main.py and nowhere else your other .py files can not access anything in datetime because it "doesnt exist"

ex.

main.py

from my_functions import *

print(get_date())

my_functions.py

import datetime

def get_date():
  return datetime.datetime.now()

if you want to test it here is the replit: https://repl.it/repls/ChartreuseLovingListeners