0
I have a python script "dad":
# Executar script de outra pasta
if __name__ == '__main__':
cmd = "main.py -username abcd -password 1234"
subprocess.call(cmd, Shell=True)
Which calls the script "son" main.py (which is in another directory with all its modules and subfolders), also with the two parameters, as example above.
def main(argv):
global username = "" #argv
global password = "" #argv
acessa_site_com_login #criar csv na pasta para cada texto acessado, demora uns minutos para finalizar
if __name__ == "__main__":
main(sys.argv[1:])
Then I have in folder 1 the "father" and folder 2 with the "son".
I cannot find a way to call/run the script, it being in another directory. All the information I found here on the site shows imports to files that are in the same folder and/or to call functions from the "child" module, but I want to run the script as if I were running it at the command prompt. When I open the cmd prompt and type python main.py -u ABDC -p 1234
works normal.