Python Forum
Grabbing a value from one python script into another
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Grabbing a value from one python script into another
#1
Hi,
Very new to Python and trying to figure out how I can get the value from a variable in one script into another.

I have a python script called "Accelerator" which gets a constantly changing value from a UDP packet and then prints that value to the screen

-> print("Revs = " + str(int(revsPC)))

What I want to do is grab that value in revsPC pass it to another script and display it

I have tried the import i.e import Accelerator but this I understand executes the whole Accelerator script which throws up an error. I have also tried import revsPC from Accelerator but that doesn't seem to do anything.

Am I missing something really obvious? I am very new to python so my ignorance is high!

Thanks in advance for any help.
Reply


Messages In This Thread
Grabbing a value from one python script into another - by nickayres - May-24-2019, 12:39 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Is there a *.bat DOS batch script to *.py Python Script converter? pstein 3 3,274 Jun-29-2023, 11:57 AM
Last Post: gologica
  How to kill a bash script running as root from a python script? jc_lafleur 4 5,931 Jun-26-2020, 10:50 PM
Last Post: jc_lafleur
  crontab on RHEL7 not calling python script wrapped in shell script benthomson 1 2,313 May-28-2020, 05:27 PM
Last Post: micseydel
  Grabbing comma separed values from SQLite and putting them in a list PythonNPC 8 4,065 Apr-10-2020, 02:39 PM
Last Post: buran
  Grabbing a Subset of a String acemurdoc 3 2,599 Jun-18-2019, 04:57 PM
Last Post: perfringo
  Package python script which has different libraries as a single executable or script tej7gandhi 1 2,637 May-11-2019, 08:12 PM
Last Post: keames
  Grabbing questions from a quiz app CodingUnicorn 0 1,964 Mar-05-2019, 11:26 PM
Last Post: CodingUnicorn
  How to run python script which has dependent python script in another folder? PrateekG 1 3,161 May-23-2018, 04:50 PM
Last Post: snippsat
  How to call one python script and use its output in another python script lravikumarvsp 3 32,434 May-16-2018, 02:08 AM
Last Post: lravikumarvsp
  Check Python version from inside script? Run Pythons script in v2 compatibility mode? pstein 2 9,847 Jul-07-2017, 08:59 AM
Last Post: snippsat

Forum Jump:

User Panel Messages

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