Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/328.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
python中的基本数据存储_Python - Fatal编程技术网

python中的基本数据存储

python中的基本数据存储,python,Python,我需要将输入的用户数据以txt.xml格式存储到特定文件夹中 这就是我的代码(例如) 如何将“周”保存到特定文件夹中?这很容易做到 saving = int(input( "enter your saving" )) week = saving * 7 with open('give file path here', 'w') as file: file.write(str(week)) 检查Stackoverflow以了解更难的问题。不适用于编程101。这就是我们使用谷歌的目的。

我需要将输入的用户数据以txt.xml格式存储到特定文件夹中

这就是我的代码(例如)


如何将“周”保存到特定文件夹中?

这很容易做到

saving = int(input( "enter your saving" ))
week = saving * 7 

with open('give file path here', 'w') as file:
    file.write(str(week))

检查Stackoverflow以了解更难的问题。不适用于编程101。这就是我们使用谷歌的目的。下次,在这里提问之前,试着搜索你的答案。
saving = int(input( "enter your saving" ))
week = saving * 7 

with open('give file path here', 'w') as file:
    file.write(str(week))