I have a Bash script that calls the Python script. First, I was just returning a variable and it Ok, but now I was asked to return two variables and I was wondering if there is a clean and easy way to return more than one variable. What does the call do with bash This gives the archive ID to the batch script Normally I know that you return many variables To do this, you can use a return statement in Python, but this is just a script the way I found a variable back. I can make it a festival called, but still, how will I get many variables which I will return? From your python script, output one variable per line one variable Again, you read one variable per line, from the Bash script: Python Bash Thanks Guillaume! You gave me a great starting point out soultion. I'm just going to post my solution here for others. The rest of the solution I want ArchiveID = $ (Python glacier_upload.py $ archive_file_name $ CURRENTVAULT)
Archive archive_id ['ArchiveId'] archive_id ['ArchiveId']
print "foo bar" print 5
#! / Bin / bash Python main.py | While reading the line; Do echo $ line done
last solution:
#! / Bin / bash array = () while reading the line; Array + = ($ line) done & lt; & Lt; (Python main.py) echo $ {array [@]}
No comments:
Post a Comment