<div dir="ltr"><div>Dear alll,</div><div><br></div>my code is given below<div><br></div><div><div>if __name__ == '__main__':</div><div>    p = os.getcwd()</div><div>    filename = "\get scale of choice.txt"</div><div>    filepath = p + filename</div><div>    sys.stdout = open(filepath, "w")</div><div>    os.startfile(filepath)</div><div>    for i in <a href="http://data.info">data.info</a>:  # print all the scale info to window</div><div><br></div><div>        print i</div><div><br></div><div>    run = True</div><div>    while run:</div><div>        scaletemplate = ["C", "D", "E", "F", "G", "A", "B"]</div><div>        getscale = sys.stdin.raw_input(filepath)</div><div>        #getscale = raw_input("Which scale do you require?:")</div><div><br></div><div>        if len(getscale) > 1:</div><div>            getscale = getscale[0].upper() + getscale[1:]</div><div>        else:</div><div>            getscale = getscale.upper()</div><div><br></div><div><br></div><div><br></div><div>        if getscale in data.scalenames:</div><div><br></div><div>            scale = main(getscale)</div><div><br></div><div>            print scale</div><div><br></div><div>        elif getscale == "Q" or getscale == "X" or getscale == "":</div><div>            run = False</div><div>            print"exiting..."</div><div><br></div><div>        else:</div><div>            print "No such scale"</div><div><br></div><div>I need to get the stdin input from the text I type into the same text file that I have stdout at. How do I do that. None of the answers at stackoverflow got me going. Any help on a code snippet would be appreciated.</div><div><br></div><div>Thanks in advance</div><div><br></div><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr">Diliup Gabadamudalige<br><br><a href="http://www.diliupg.com" target="_blank">http://www.diliupg.com</a><br><a href="http://soft.diliupg.com/" target="_blank">http://soft.diliupg.com/</a><div><br>**********************************************************************************************<br>This e-mail is confidential. It may also be legally privileged. If you are not the intended recipient or have received it in error, please delete it and all copies from your system and notify the sender immediately by return e-mail. Any unauthorized reading, reproducing, printing or further dissemination of this e-mail or its contents is strictly prohibited and may be unlawful. Internet communications cannot be guaranteed to be timely, secure, error or virus-free. The sender does not accept liability for any errors or omissions.<br>**********************************************************************************************<br><br></div></div></div>
</div></div>