Trying to automate a python script.....Using Windows scheduler
<p>So I have the following script which I am using to grab data from the net and save it as an html file in a folder on my pc (same pc) each time I run the script. I'm now trying to automate the process.</p>

<pre><code>import pandas as pd
import datetime as dt
today_date = dt.date.today().isoformat()
df = pd.read_html('http://www.livevol.com/largest-option-trades-on-the-day', header=1)[0].set_index('Time')
html_name = 'option data/{}.html'.format(today_date)
df.to_html(html_name)
</code></pre>

<p>Ordinarily, when I click on the .py, I get a the black screen (command prompt) which lasts for a few seconds and then If I go to a certain folder, I see that a new html has been created.</p>

<p>However, when I use Windows scheduler, the script seems to run but an html file is not being created. </p>

<p>The script seems to be running because the command prompt black screen pops up and stays there for <em>a few seconds</em> (rather than just flashing), just like it did when I manually clicked on the .py file. </p>

<p>I've played around with the different parameters of the "actions" field of Windows Scheduler.</p>

<p>Program/script: C:\Python27\python.exe
Add arguments: C:\Python27\Option.py</p>

<p>"Run when user is logged on" and "highest privileges" are check-marked.</p>

<p>Not sure what I'm doing wrong. 
Thanks. </p>

<p>I got it working by filling in the "Start in(optional)" parameter under the Actions tab, with the first part of the path to the Python exe. </p>

<p>"C:\Python27"</p>

python windows scheduler