Python Forum
Calling from many different files
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Calling from many different files
#1
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?
Reply
#2
No. You need import hand in bet.py for that to work.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Calling Variables from Other Files in Different Folders illmattic 14 5,530 Aug-01-2020, 07:02 PM
Last Post: deanhystad
  calling ".sql" files in python raopatwari 3 9,117 Jan-18-2018, 07:33 PM
Last Post: nilamo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020