Bottom Page

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?
Quote
#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

Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  Python calling function unexpectedly lucaswinnerton 1 74 Jan-24-2019, 10:40 PM
Last Post: stullis
  calling os functions not in module os Skaperen 2 211 Nov-10-2018, 01:54 AM
Last Post: Skaperen
  improper function calling gbaker555 1 239 Aug-03-2018, 03:20 AM
Last Post: ichabod801
  calling a function in a comprehension Skaperen 1 343 Jul-13-2018, 09:12 PM
Last Post: gontajones
  Calling a Facebook API gpbarsky 0 317 Jun-04-2018, 02:55 PM
Last Post: gpbarsky
  Running a python tool transforming xml files into epub files silfer 7 760 May-10-2018, 03:49 PM
Last Post: snippsat
  Help with calling the function as the code keep firing chris0147 8 557 May-04-2018, 09:00 AM
Last Post: ThiefOfTime
  x.sum() VS sum(x) - Calling a function glidecode 2 453 Mar-27-2018, 06:27 PM
Last Post: glidecode
  WindowsError when calling nbtstat command using subprocess tsame 0 438 Mar-17-2018, 12:40 PM
Last Post: tsame
  calling a class multiple times GOB 2 530 Feb-02-2018, 05:10 AM
Last Post: GOB

Forum Jump:


Users browsing this thread: 1 Guest(s)