Python Forum
Close script from another script
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Close script from another script
#6
Thank you for the example, and I admit that I made a stupid mistake complicating my life by creating an array variable, in short, I widened the circle then using the .tolist () etc. etc.
Starting with your example, my question is even simpler.
is it possible to change the variable X in Test1.py through Test3.py?
that is X = 10 in Test1.py
when I run Test3.py I import the variable X, which after some calculations becomes a value = 15, so this new x = 15, can I overwrite it at X = 10 you take in Test1.py?

Example:

test1.py
x=10


------------------------------------------------------------------------
test3.py
from test1 import x

y = int(x + 5)
print (y) ## result 15


-------------------------------------------------------------------------
(new)test1.py
x = 15 ## new value
Reply


Messages In This Thread
Close script from another script - by ilgrabbo - Jan-20-2021, 10:00 AM
RE: Close script from another script - by ndc85430 - Jan-20-2021, 12:50 PM
RE: Close script from another script - by ilgrabbo - Jan-20-2021, 05:19 PM
RE: Close script from another script - by ilgrabbo - Jan-21-2021, 10:00 AM
RE: Close script from another script - by ilgrabbo - Jan-21-2021, 03:11 PM
RE: Close script from another script - by ilgrabbo - Jan-21-2021, 04:45 PM
RE: Close script from another script - by ilgrabbo - Jan-22-2021, 09:33 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
Music Python Script Repeating Number When Saving Facebook Photos ThuanyPK 2 121 May-13-2024, 10:59 PM
Last Post: ebn852_pan
  Trying to generating multiple json files using python script dzgn989 4 249 May-10-2024, 03:09 PM
Last Post: deanhystad
  Problems passing arguments containing spaces to bash script and then on to python kaustin 6 527 Apr-03-2024, 08:26 PM
Last Post: deanhystad
  Using a script to open multiple shells? SuchUmami 9 678 Apr-01-2024, 10:04 AM
Last Post: Gribouillis
  How to include one script into another? MorningWave 8 598 Mar-21-2024, 10:34 PM
Last Post: MorningWave
  ChromeDriver breaking Python script genericusername12414 1 378 Mar-14-2024, 09:39 AM
Last Post: snippsat
  using PowerShell from Python script for mounting shares tester_V 8 628 Mar-12-2024, 06:26 PM
Last Post: tester_V
  No Internet connection when running a Python script basil_555 8 793 Mar-11-2024, 11:02 AM
Last Post: snippsat
Question Running Python script through Task Scheduler? Winfried 8 696 Mar-10-2024, 07:24 PM
Last Post: Winfried
  Combine console script + GUI (tkinter) dejot 2 492 Feb-27-2024, 04:38 PM
Last Post: deanhystad

Forum Jump:

User Panel Messages

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