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
#11
Sounds like you're running two different programs at different times (that "other script" has run and exited before "3rd script" runs). If so, the dataframe is gone and has to be recreated.

If you want to process some data and reuse the result multiple times, that generally means you need to do one of :
  • Run them in the same process
  • After processing the data, save it to disk in already-processed form and read it back quickly (like a database)
  • Process the data and keep it in memory, and have the second script talk to the first process (IPC) and request the data
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-04-2022, 02:45 PM

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