#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Simple test script for futures data player """ def main(): print("=== Futures Data Player Test ===") # Test 1: Check data file import os data_path = 'data/au2512_20251013.parquet' if os.path.exists(data_path): print(f"+ Data file exists: {data_path}") try: import pandas as pd df = pd.read_parquet(data_path) print(f"+ Data loaded: {len(df)} rows") except Exception as e: print(f"- Data loading failed: {e}") return else: print(f"- Data file not found: {data_path}") return # Test 2: Check imports try: import pandas as pd import numpy as np import matplotlib.pyplot as plt import tkinter as tk print("+ All required libraries imported successfully") except ImportError as e: print(f"- Import failed: {e}") return # Test 3: Create player instance try: from futures_player_enhanced import EnhancedFuturesPlayer print("+ Creating player instance...") player = EnhancedFuturesPlayer() if player.df is not None: print(f"+ Player created with {len(player.df)} data points") print("+ Test passed! Ready to run the full application.") # Clean up player.on_closing() else: print("- Player creation failed") except Exception as e: print(f"- Player test failed: {e}") print("\\nTo run the full application:") print("python futures_player_enhanced.py") if __name__ == "__main__": main()