Pythonでスクリプトのパスを得る方法。
get-script-path.py
import os, json, datetime
# スクリプトのパス
BASE_DIR = os.path.dirname(__file__)
# データファイルの指定
DATA_FILE = BASE_DIR + '/data.txt'
Go to list of users who liked
Share on X(Twitter)
Share on Facebook
More than 5 years have passed since last update.
Pythonでスクリプトのパスを得る方法。
import os, json, datetime
# スクリプトのパス
BASE_DIR = os.path.dirname(__file__)
# データファイルの指定
DATA_FILE = BASE_DIR + '/data.txt'
Register as a new user and use Qiita more conveniently
Go to list of users who liked