简体   繁体   English

如何将.txt 文件保存为数据库?

[英]How to save .txt file in like as database?

I am trying to c format我正在尝试 c 格式

if request.method=='POST':
    username=request.form['user']
    userpassword=request.form['userpass']
    with open("userdata.txt","a") as f:
        f.write(f"Username:{username} Password:{userpassword}\n")

I had tried this code as d code and it works when i deploy these code to pythder.我曾尝试将此代码作为 d 代码,当我将这些代码部署到 pythder 时它可以工作。 soon as possible.尽快。

Thankyou in advance先感谢您

I am trying to c format我正在尝试 c 格式

if request.method=='POST':
    username=request.form['user']
    userpassword=request.form['userpass']
    with open("userdata.txt","a") as f:
        f.write(f"Username:{username} Password:{userpassword}\n")

I had tried this code as d code and it works when i deploy these code to pythder.我曾尝试将此代码作为 d 代码,当我将这些代码部署到 pythder 时它可以工作。 soon as possible.尽快。

Thankyou in advance先感谢您

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM