路径不对和写入得文件不对

问题遇到的现象和发生背景

我想用os.getcwd()得到得是我当前文件得目录practice1

用代码块功能插入代码,请勿粘贴截图

import sys
import os
import os.path

sys.path.append("C:\Users\bguox\OneDrive - Intel Corporation\Documents\python pratic\pratice2\practice1")

current_path = os.getcwd()
print(current_path)
i=int(input("输入一个数字"))

for x in range(0,i+1):
print(x)

with open(current_path+'/'+'123.txt','w',encoding='utf-8') as f:
f.seek(0)
f.write(str(x))

with open(current_path+'/'+'123.txt','w',encoding='utf-8') as f:
改为
with open(current_path+r''+'123.txt','w',encoding='utf-8') as f: