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
  Problems passing arguments containing spaces to bash script and then on to python kaustin 6 424 Apr-03-2024, 08:26 PM
Last Post: deanhystad
  Passing writable arguments to functions. Assembler 11 1,022 Jan-15-2024, 11:32 PM
Last Post: sgrey
  Passing string functions as arguments Clunk_Head 3 1,268 Jun-15-2022, 06:00 AM
Last Post: Gribouillis
  Passing flags to python script, through a function xbit 4 3,998 Apr-20-2021, 06:32 AM
Last Post: ndc85430
  redirect url_for passing arguments with the url Leon79 1 1,658 Jul-09-2020, 05:20 PM
Last Post: Leon79
  How to write a script to execute a program need passing additional input? larkypython 2 2,547 Nov-23-2019, 04:38 AM
Last Post: larkypython
  Still confused about how passing arguments works RedSkeleton007 3 2,984 Apr-25-2018, 11:01 AM
Last Post: snippsat
  Trouble passing arguments underoathed 2 2,947 Nov-13-2017, 04:20 PM
Last Post: underoathed
  Functions (Arguments Passing,Changing a mutable ,Assignment to Arguments Names) Adelton 2 3,886 Mar-02-2017, 10:23 PM
Last Post: zivoni
  multiprocess passing multiple arguments double asterisk pic8690 1 5,294 Oct-23-2016, 08:51 AM
Last Post: Skaperen

Forum Jump:

User Panel Messages

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