About 50 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, 11 months ago Modified 3 months ago Viewed 381k times

  2. Create a python file using cmd in windows - Stack Overflow

    Jul 16, 2015 · I tried the following code to create a python file of the name "test.py" edit test.py This command is not recognised as an internal command. Please suggest me an alternative code for …

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

    Mar 5, 2016 · I'm trying to open a file, and if the file doesn't exist, I need to create it and open it for writing:

  4. 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?

  5. 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

  6. 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 Python so...

  7. open() in Python does not create a file if it doesn't exist

    Jun 3, 2010 · The file pointer is at the end of the file if the file exists. The file opens in the append mode. If the file does not exist, it creates a new file for reading and writing. - Python file modes seek () …

  8. How would you save a simple settings/configuration file in Python?

    Oct 27, 2024 · Configuration files in Python There are several ways to do this depending on the file format required. ConfigParser [.ini format] I would use the standard configparser approach unless …

  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 been …

  10. python - How do I create a directory, and any missing parent ...

    How do I create a directory at a given path, and also create any missing parent directories along that path? For example, the Bash command mkdir -p /path/to/nested/directory does this.