あらきけいすけのメモ帳

あらきけいすけの雑記帳2

2024-02-19から1日間の記事一覧

Google Colab で __file__ の代わりに Jupyter notebook のファイル名を知る方法

from requests import get from socket import gethostname, gethostbyname ip = gethostbyname(gethostname()) # 172.28.0.12 (2024.2.19現在) filename = get(f"http://{ip}:9000/api/sessions").json()[0]["name"] print(ip,filename)stackoverflow.com