About 434,000 results
Open links in new tab
  1. How to create a new text file using Python - Stack Overflow

    Feb 24, 2018 · How to create a new text file using Python Asked 7 years, 8 months ago Modified 1 month ago Viewed 375k times

  2. python - Create a file if it doesn't exist - Stack Overflow

    Miguel Hernandez 1,229 2 9 3 5 Possible duplicate of Open in Python does not create a file if it doesn't exist – Kevin J. Chase Mar 5, 2016 at 1:18

  3. python - How do I write JSON data to a file? - Stack Overflow

    How do I write JSON data stored in the dictionary data to a file? f = open ('data.json', 'wb') f.write (data) This gives the error: TypeError: must be string or buffer, not dict

  4. python - Automatically creating directories with file output - Stack ...

    Automatically creating directories with file output [duplicate] Asked 13 years, 1 month ago Modified 3 years, 2 months ago Viewed 541k times

  5. python - Automatically create file 'requirements.txt' - Stack Overflow

    Sometimes I download the Python source code from GitHub and don't know how to install all the dependencies. If there isn't any requirements.txt file I have to create it by hand. Given the …

  6. How can I make a Python script standalone executable to run …

    Jan 24, 2017 · I'm building a Python application and don't want to force my clients to install Python and modules. So, is there a way to compile a Python script to be a standalone executable?

  7. Creating a BAT file for python script - Stack Overflow

    Jan 1, 2011 · How can I create a simple BAT file that will run my python script located at C:\\somescript.py?

  8. How to create a file name with the current date & time in Python?

    A safer way to create your path, might be: folder_to_save_files = shutil.os.path.join(drive_letter, folder_name +folder_time) (also an import shutil statement can replace the import os statement )

  9. Create empty file using python - Stack Overflow

    Closed 10 years ago. I'd like to create a file with path x using python. I've been using os.system(y) where y = 'touch %s' % (x). I've looked for a non-directory version of os.mkdir, but I haven't …

  10. python - Write a file to a directory that doesn't exist - Stack Overflow

    You need to first create the directory. The mkdir -p implementation from this answer will do just what you want. mkdir -p will create any parent directories as required, and silently do nothing if …