Python Forum
Importing variables from another file
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Importing variables from another file
#1
I've been googling this problem for a while now and nothing seems to work.

Here's my problem:

I have variables in 4 different files. I want these variables to be read by my main file. I started programming today, so I thought a simple text based combat sim would be something nice to start off with.

In one file I put variables for my character. In another I put variables for an enemy. And so on.

In the main file I would like to call all these variables into play to make the fight calculations.

So, what exactly do I have to type in to get these other files into play?
Reply


Messages In This Thread
Importing variables from another file - by IILawrenceII - Jan-17-2020, 08:32 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  importing variables from module 8376459 1 296 Feb-18-2024, 02:24 PM
Last Post: deanhystad
  File path by adding various variables Mishal0488 2 1,056 Apr-28-2023, 07:17 PM
Last Post: deanhystad
  New2Python: Help with Importing/Mapping Image Src to Image Code in File CluelessITguy 0 733 Nov-17-2022, 04:46 PM
Last Post: CluelessITguy
  Problem with importing Python file in Visual Studio Code DXav 7 5,189 Jun-15-2022, 12:54 PM
Last Post: snippsat
  importing functions from a separate python file in a separate directory Scordomaniac 3 1,398 May-17-2022, 07:49 AM
Last Post: Pedroski55
  Storing variables into one file for use in multiple Jupyter notebooks devansing 1 1,762 Feb-05-2022, 10:04 AM
Last Post: ibreeden
  Importing a function from another file runs the old lines also dedesssse 6 2,598 Jul-06-2021, 07:04 PM
Last Post: deanhystad
  Importing text file into excel spreadsheet with formatting david_dsmn 1 3,639 Apr-05-2021, 10:21 PM
Last Post: david_dsmn
  importing a CSV file into Python russoj5 1 2,974 Aug-02-2020, 12:03 AM
Last Post: scidam
  Importing data from a text file into an SQLite database with Python macieju1974 7 4,184 Jun-29-2020, 08:51 PM
Last Post: buran

Forum Jump:

User Panel Messages

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