import datetime
import platform
from smb.SMBConnection import SMBConnection
user = "test1"
password = "test1password"
host = "testserver"
shared_folder = "share"
conn = SMBConnection(user, password, platform.uname()[1], host, use_ntlm_v2 = True)
conn.connect(host, 139)
today = datetime.date.today()
todaystr = today.strftime("%Y%m%d")
conn.createDirectory(shared_folder, "foo/" + todaystr)
conn.close()
・pysmbのインストール
pip install pysmb