1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

[Python] Read python output from another python script

Discussão em 'Python' iniciado por Stack, Setembro 29, 2024.

  1. Stack

    Stack Membro Participativo

    I have two python files, one contains code which generates an output and the other needs to read it. The generation code is:

    b=5
    return b


    The reading code is:

    import os
    c= os.system("test.py")
    print (c)


    When I run this, the output is 1. I don't understand why this isn't 5, any advise on how to fix this please?

    Continue reading...

Compartilhe esta Página