I have created the Python script below which i would like to run and call another script from and then give the called script a variable in this case it would be an email address as "line" from a text file. What would be the easiest way to accomplish this please?
The problem now is that the script that is being called will not take the 'line' variable as an argument.
import bob
import os
# file handle fh fh = open('mailout.txt') while True:
# read line
line = fh.readline()
line = line.replace("\r", "").replace("\n", "")
command = 'python3 bob.py ' + line
os.system(command)
# check if line is not a empty value
if not line:
break fh.close()
os.systemto call it from the command linefrom bob import a_funcand then latera_func(line)command = 'python3 bob.py "{}"'.format(line), assuming yourlinedoes not have any double quotes