Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Importing Program Wide
#1
Hey everyone,


I’m new to python for, but I have done a lot of php programming.

One feature I liked in php was include. I know Python has import, but that seems to only have a scope to each file it’s in. Is there anyway I can import modules, that will be active in all the other files I open.

For example,

Main.py
Import a
Import b
print(x)
File a.py
x = ‘hello world’
File b.py
print (x)
Output:
hello world
hello world
Reply


Messages In This Thread
Importing Program Wide - by JarredAwesome - Sep-06-2020, 05:41 PM
RE: Importing Program Wide - by ndc85430 - Sep-06-2020, 06:38 PM
RE: Importing Program Wide - by JarredAwesome - Sep-06-2020, 11:53 PM
RE: Importing Program Wide - by ndc85430 - Sep-07-2020, 03:40 AM
RE: Importing Program Wide - by JarredAwesome - Sep-07-2020, 04:34 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Some help with my first python class and importing ....im making a lidar program jttolleson 7 1,379 Jul-28-2023, 08:34 AM
Last Post: jttolleson
  How to transform from wide to long format in python shantanu97 1 1,719 Nov-21-2021, 11:53 AM
Last Post: buran
  What is the best way to set application-wide config values? ajorona 1 1,971 May-07-2020, 05:03 PM
Last Post: buran
  output a list of random numbers 'x' columns wide adityavpratap 4 3,133 Jan-13-2020, 05:32 PM
Last Post: perfringo
  problem with importing my program meems 1 3,880 Nov-27-2016, 01:19 AM
Last Post: micseydel

Forum Jump:

User Panel Messages

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