-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.py
More file actions
29 lines (22 loc) · 761 Bytes
/
Copy pathrun.py
File metadata and controls
29 lines (22 loc) · 761 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
#!/usr/bin/env python
"""Launch the Particles simulator.
Usage:
python run.py # normal GUI
python run.py --headless # no window (used for automated screenshots/tests)
Requires: numpy, pygame (numba optional but strongly recommended for speed).
"""
import argparse
import os
import sys
def main() -> int:
parser = argparse.ArgumentParser(description="周期多类别粒子模拟器")
parser.add_argument("--headless", action="store_true",
help="run without opening a window (dummy video driver)")
args = parser.parse_args()
if args.headless:
os.environ["PARTICLES_HEADLESS"] = "1"
from particles.app import main
main()
return 0
if __name__ == "__main__":
sys.exit(main())