Python Forum
passing-arguments-from-one-script-to-another
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
passing-arguments-from-one-script-to-another
#1
I have some question related to pass value from file A to File B, and from File B to File A. Do anyone know how it work.
In main.py input name, and in second.py enter your age.

I main.py i wish to use second.py value, and in second,py wish to use main.py value.

Do anyone have any idea?


main.py
import second 
string_name = input("please enter your Name : ")
print(second.age)
second.py
import main
age = input("please enter your Age : ")
print(main.string_name)
Reply


Messages In This Thread
passing-arguments-from-one-script-to-another - by jacklee26 - Apr-21-2020, 01:10 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  pass arguments from bat file to pyhon script from application absolut 2 993 Jan-13-2025, 11:05 AM
Last Post: DeaD_EyE
  Problems passing arguments containing spaces to bash script and then on to python kaustin 6 8,452 Apr-03-2024, 08:26 PM
Last Post: deanhystad
  Passing writable arguments to functions. Assembler 11 3,270 Jan-15-2024, 11:32 PM
Last Post: sgrey
  Passing string functions as arguments Clunk_Head 3 2,074 Jun-15-2022, 06:00 AM
Last Post: Gribouillis
  Passing flags to python script, through a function xbit 4 5,569 Apr-20-2021, 06:32 AM
Last Post: ndc85430
  redirect url_for passing arguments with the url Leon79 1 2,288 Jul-09-2020, 05:20 PM
Last Post: Leon79
  How to write a script to execute a program need passing additional input? larkypython 2 3,224 Nov-23-2019, 04:38 AM
Last Post: larkypython
  Still confused about how passing arguments works RedSkeleton007 3 3,746 Apr-25-2018, 11:01 AM
Last Post: snippsat
  Trouble passing arguments underoathed 2 3,606 Nov-13-2017, 04:20 PM
Last Post: underoathed
  Functions (Arguments Passing,Changing a mutable ,Assignment to Arguments Names) Adelton 2 4,619 Mar-02-2017, 10:23 PM
Last Post: zivoni

Forum Jump:

User Panel Messages

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