Python Forum

Full Version: Calling from many different files
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I wonder if in python you can call function from many different files without having to reference it yourself?


for example:

bet.py
def hit(deck, hand)
	
	single_card = deck.deal()
	hand.add_card(single_card)
	hand.adjust_for_ace()
adjust_for_ace is from hand.py in sublime I can hover it and check where it comes from. Will this works automatically?
No. You need import hand in bet.py for that to work.