Python Forum
module to store functions/variables and how to call them?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
module to store functions/variables and how to call them?
#2
variables.py
VARIABLE1 = 'Variable1'
my_funtions.py
def function1(something):
    print(something)
another.py
import variables
import my_funtions

my_funtions.function1(variables.VARIABLE1)
Output:
Variable1
Reply


Messages In This Thread
RE: Another basic question sorry im new lol - by Yoriz - Jun-03-2020, 06:10 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  importing variables from module 8376459 1 359 Feb-18-2024, 02:24 PM
Last Post: deanhystad
  How to store columns of a .csv in variables (when the .csv has no headers) ? hobbyist 6 1,471 Aug-18-2023, 02:06 PM
Last Post: deanhystad
  using variables with functions imported from different files. Scordomaniac 3 1,370 May-24-2022, 10:53 AM
Last Post: deanhystad
  Storing whole functions in variables dedesssse 3 2,167 Jul-29-2021, 09:17 PM
Last Post: deanhystad
  Getting parent variables in nested functions wallgraffiti 1 2,234 Jan-30-2021, 03:53 PM
Last Post: buran
  How to call multiple functions sequentially Mayo 2 9,672 Jan-06-2021, 07:37 PM
Last Post: Mayo
  how do i store then call a mp3 from sqlite3 .db file gr3yali3n 3 5,940 Dec-11-2020, 10:28 AM
Last Post: snippsat
  local/global variables in functions abccba 6 3,568 Apr-08-2020, 06:01 PM
Last Post: jefsummers
  How to access variables from dirsync module steve_shambles 3 3,988 Apr-02-2020, 08:18 AM
Last Post: steve_shambles
  Python 2.7 passing variables from functions zetto33 1 1,846 Mar-19-2020, 07:27 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

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