zoukankan      html  css  js  c++  java
  • tempfile创建临时文件或目录

    import tempfile
    
    tempfile.TemporaryFile()  # 创建文件,返回文件对象
    tempfile.NamedTemporaryFile()  # 同上,不过会生成带有文件名的临时文件
    tempfile.TemporaryDirectory()  # 生成临时目录
    tempfile.gettempdir()  # 获取系统的临时目录。
    tempfile.gettempdirb() # 与 gettempdir() 相同,只是该函数返回字节串。
    tempfile.gettempprefix() #	返回用于生成临时文件的前缀名。
    tempfile.gettempprefixb() #与 gettempprefix() 相同,只是该函数返回字节串
    

    -------------------------------------------

    个性签名:代码过万,键盘敲烂!!!

    如果觉得这篇文章对你有小小的帮助的话,记得在右下角点个“推荐”哦,博主在此感谢!

  • 相关阅读:
    派生选择器
    HTML 标签
    $.get()
    CC150
    CC150
    CC150
    CC150
    HashMap和HashTable的区别
    CC150
    quickSort
  • 原文地址:https://www.cnblogs.com/weiweivip666/p/14869725.html
Copyright © 2011-2022 走看看