简体   繁体   English

如何从字符串获取FileStorage对象

[英]How can I get a FileStorage object from string

I have this string: 我有这个字符串:

str = "FieldStorage('myfile', 'file.exe', 'hello\\n')"

So I would like to know if there is a way to get the FileStogare object from that string 所以我想知道是否有办法从该字符串中获取FileStogare对象

You could. 你可以。 The question is, should you? 问题是,你应该吗?

str = "FieldStorage('myfile', 'file.exe', 'hello\\n')"
obj = eval(str)

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

相关问题 如何从werkzeug.datastructures将base64编码的字符串转换为可以与FileStorage一起使用的Stream? - How do I convert a base64 encoded string to a Stream that I can use with FileStorage from werkzeug.datastructures? 如何从 FileStorage Object 中提取文件类型 - How to extract the file type from a FileStorage Object 如何在 Pillow 中打开 FileStorage 类型的图像 - how can I open an image of FileStorage type in Pillow 如何从字符串中获取 mongodb 的有效 object id? - how can I get a valid object id of mongodb from a string? Python:无法从FileStorage对象读取 - Python: Cannot read from a FileStorage object 如何在python中通过FTP传输FileStorage对象 - How to transfer FileStorage object via FTP in python 我怎样才能从物体上得到一条线? - How can I get a line from an object? 如何从Python中的logging.formatter对象获取格式化程序字符串? - How can I get formatter string from a logging.formatter object in Python? 如何从python电子邮件对象获取实际的电子邮件地址作为字符串 - How can I get actual email address as a string from python email object 当python对象包含在字符串中时,如何获取它的类型? - How can i get type of python object when it is enclosed in a string?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM