Python Forum
How can I import a variable from another script without executing it
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How can I import a variable from another script without executing it
#13
Python docs have a section on IPC. In general it's more work because you have to manage a client/server interaction. https://docs.python.org/3/library/ipc.html

For external storage, maybe you could just write the information to disk. First attempt could be to just store it as JSON. If that's not performant enough, you could try a simple database like https://docs.python.org/3/library/sqlite...le-sqlite3.
ThomasFab likes this post
Reply


Messages In This Thread
RE: How can I import a variable from another script without executing it - by bowlofred - May-06-2022, 03:21 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Trouble with threading and reading variable from a different script Lembas 14 3,305 Apr-26-2023, 11:21 PM
Last Post: Lembas
Video doing data treatment on a file import-parsing a variable EmBeck87 15 3,131 Apr-17-2023, 06:54 PM
Last Post: EmBeck87
  Problem executing a script on a remote host tester_V 3 2,591 Sep-26-2021, 04:25 AM
Last Post: tester_V
  Using import in python script offline - HELP!! blackhatter1001001 1 2,343 Jul-25-2021, 05:57 AM
Last Post: ndc85430
  Import output from python script to another varietyjones 1 1,970 Oct-12-2020, 09:07 PM
Last Post: bowlofred
  Use dynamic variable from parallel running python script Sicksym 0 1,938 May-15-2020, 02:52 PM
Last Post: Sicksym
  [split] script: remove all "carriage return" from my json variable pete 2 2,893 May-05-2020, 03:22 PM
Last Post: deanhystad
  Using variable from a class in another .py script keegan_010 4 3,154 Mar-25-2020, 07:47 AM
Last Post: keegan_010
  Import and variable level tazalapizza 1 1,808 Mar-16-2019, 07:47 PM
Last Post: Larz60+
  script: remove all "carriage return" from my json variable mfran2002 4 11,390 Feb-20-2019, 05:07 AM
Last Post: mfran2002

Forum Jump:

User Panel Messages

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