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
  a class calling one of its own methods? Skaperen 1 81 Jul-21-2019, 04:43 AM
Last Post: Gribouillis
  Calling Extended Embedding Python as shared library jibarra 0 110 Jul-19-2019, 05:22 PM
Last Post: jibarra
  Calling C functions with PyObjects jibarra 6 183 Jul-17-2019, 02:52 PM
Last Post: jibarra
  Py4JJavaError: An error occurred while calling o22720.csv. twinpiques 0 97 Jul-11-2019, 12:41 AM
Last Post: twinpiques
  Random access binary files with mmap - drastically slows with big files danart 1 211 Jun-17-2019, 10:45 AM
Last Post: danart
  Error trying to Calling web service stahorse 2 178 May-22-2019, 09:09 AM
Last Post: stahorse
  Delete Lines that Contain Words - Loop through files in a folder - Write to new files dj99 3 339 May-18-2019, 06:34 AM
Last Post: heiner55
  Duplicate output when calling a custom function from the same file? road2knowledge 2 226 May-10-2019, 07:58 AM
Last Post: road2knowledge
  Scanning files to rename other files in the same folder. msd1391 6 433 Mar-11-2019, 07:19 PM
Last Post: msd1391
  Calling list() on permutation trevorkavanaugh 2 226 Mar-01-2019, 06:00 AM
Last Post: trevorkavanaugh

Forum Jump:


Users browsing this thread: 1 Guest(s)