Make python send the enter key when using curl
Question: I'm making a python script that curls the fantasy hockey scoreboard page,
calls a perl to regex substitute out the team names and scores, and display
it. The regex is all set up, but now I'm having trouble getting the webpage. I
notice when I do it on my computer after I run the

    
    
    curl -o /tmp/fantasyhockey.txt http://games.espn.go.com/fhl/scor...
    

command, pressing enter once will start it, and then pressing it again will
exit out and make my page. How do I force python to press enter? For my
curiosity sake, why is it waiting?

EDIT: Here's the script. Not much to it.

    
    
    import os
    def main():
    
        os.system("curl -o /tmp/fantasyhockey.txt http://games.espn.go.com/fhl/scoreboar\
        d?leagueId=xxxxx&seasonId=2013")
        unfix = open("/tmp/fantasyhockey.txt", "r").read().replace('\n', '')
        outfile = open("/tmp/fantasyhockey2.txt", "w")
        outfile.write(unfix)
        outfile.close()
        os.system("perl regex.pl < /tmp/fantasyhockey2.txt")
        os.system("rm /tmp/fantasyhockey*")
    main()
    


Answer: The `&` character in your URL has special meaning in the shell (it sends the
program to the background). This is why you have to hit enter.

To avoid this, quote the URL argument to `curl`, like this:

`curl -o /tmp/fantasyhockey.txt "http://...."`

