-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
34 lines (24 loc) · 915 Bytes
/
main.py
File metadata and controls
34 lines (24 loc) · 915 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Wrapper script to run the main application from the src directory.
This script ensures proper Python path handling when running from the project root.
The working directory remains at the project root so file paths work correctly.
"""
import sys
import os
# Get project root directory (where this script is located)
project_root = os.path.dirname(os.path.abspath(__file__))
src_path = os.path.join(project_root, 'src')
# Add src directory to Python path so imports work
if src_path not in sys.path:
sys.path.insert(0, src_path)
# Store original working directory (should be project root)
original_cwd = os.getcwd()
# Ensure we're in project root (important for relative file paths)
if original_cwd != project_root:
os.chdir(project_root)
# Import and run main function from src/main.py
from main import main
if __name__ == "__main__":
main()