vault backup: 2024-05-28 14:23:50

This commit is contained in:
2024-05-28 14:23:50 +08:00
parent cc1fd6974b
commit 9c62b93c48
2 changed files with 28 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
```python
import os
import sys
config_name = 'myapp.cfg'
# determine if application is a script file or frozen exe
if getattr(sys, 'frozen', False):
application_path = os.path.dirname(sys.executable)
elif __file__:
application_path = os.path.dirname(__file__)
config_path = os.path.join(application_path, config_name)
```