This is a demonstration of how to schedule a Python script with Windows Task Scheduler.
| File | Purpose |
|---|---|
lseg_market_data_example.py |
Main script (32 lines) |
run_market_data.bat |
Batch wrapper (4 lines) |
TASK_SCHEDULER_SETUP.md |
How to schedule it |
PRODUCTION_CHECKLIST.md |
What to add before production |
pip install lseg-datacd C:\path\to\script
python lseg_market_data_example.pyExpected output:
Session opened
Data saved to market_data_20260804.csv
Done
run_market_data.batFollow steps in TASK_SCHEDULER_SETUP.md
Creates: market_data_YYYYMMDD.csv in current directory
Example:
Instrument,Identifier,TR.PriceClose
IBM,IBM.N,180.45
MSFT,MSFT.O,425.30
Python Script:
- Opens LSEG session
- Retrieves 2 instruments (IBM.N, MSFT.O)
- Gets 1 field (TR.PriceClose)
- Saves to CSV with today's date
- Returns exit code 0 (success) or 1 (failure)
Batch File:
- Changes to script directory
- Runs Python script
- Returns exit code
That's it! See PRODUCTION_CHECKLIST.md for what's missing.