"""
run_live_tracker.py - Run this to continuously update ISS position every 10 seconds
Press Ctrl+C to stop
"""
import time
import subprocess
import sys

def run_update():
    """Run the update_position.py script"""
    try:
        result = subprocess.run([sys.executable, 'update_position5.py'], 
                              capture_output=True, 
                              text=True)
        print(result.stdout, end='')
        if result.stderr:
            print(result.stderr, end='')
    except Exception as e:
        print(f"Error running update: {e}")

if __name__ == '__main__':
    print("Starting ISS Live Tracker...")
    print("Updates every 10 seconds. Press Ctrl+C to stop.")
    print("-" * 50)
    
    try:
        while True:
            run_update()
            time.sleep(10)
    except KeyboardInterrupt:
        print("\n\nStopping tracker. Goodbye!")