Python Forum
How to include one script into another?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to include one script into another?
#1
This is not about the include command.
I am a PHP developer, just starting on python. I got stuck when I tried to save parts of the scripts into a separate .py file, just to avoid repetition, nothing more. Reading about module scopes, globals and parameters did not help to solve the include problem. Errors pop up one after another. This is why I ask this simple question:

Is there a simple way to put three .py scripts together?
So that the system would treat them as one .py?

Maybe using the os module, exiting to the operating system, creating a new .py script on the fly (by appending three .py's) and executing it?
Reply


Messages In This Thread
How to include one script into another? - by MorningWave - Mar-21-2024, 12:12 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  how include a python code in notpad++ plugin akbarza 2 677 Sep-25-2023, 08:25 PM
Last Post: deanhystad
  Regex Include and Exclude patterns in Same Expression starzar 2 833 May-23-2023, 09:12 AM
Last Post: Gribouillis
  How to include input as part of variable name Mark17 4 2,551 Oct-01-2021, 06:45 PM
Last Post: Mark17
  Can I include text using artist? tetrisbot 0 1,453 Aug-13-2020, 08:13 PM
Last Post: tetrisbot
  How to include pandas with pyinstaller Rickus 1 10,759 Feb-19-2020, 08:01 PM
Last Post: snippsat
  How to include Variable in File Path penahuse 3 7,350 Jan-05-2020, 03:08 AM
Last Post: ichabod801
  Cannot open include file: 'ft2build.h' thracian 0 4,856 Nov-11-2019, 09:08 PM
Last Post: thracian
  I need a query to select the numbers that include 2 digits of 3 omidvakili 1 1,663 Sep-20-2019, 03:49 PM
Last Post: Yoriz
  Trying to include an If statement in my While Loop junkankit 3 2,987 Jan-31-2019, 10:06 AM
Last Post: buran
  create dictionary from **kwargs that include tuple bluefrog 2 4,908 Oct-26-2016, 10:24 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