About 1,190,000 results
Open links in new tab
  1. Python Save to file - Stack Overflow

    file was deprecated and removed in python 3, so it's perfectly ok to use there. I didn't see the 2.7 tag on the question, and I usually use python 3...

  2. How do I save data in a text file python - Stack Overflow

    Mar 24, 2015 · First of all you should ask your question clearly enough for others to understand.To add a text into text file you could always use the open built-in function.Do it like this.

  3. Telling Python to save a .txt file to a certain directory on Windows ...

    Nov 6, 2011 · How do you tell Python where to save a text file? For example, my computer is running the Python file off my desktop. I want it to save all the text file in my documents folder, not on my …

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

  5. python - How to save a dictionary to a file? - Stack Overflow

    For the save_obj() in this answer to work, a subdirectory named "obj" must already exist because open() won't create one automatically. Second the first argument to save_obj() is the Python object to be …

  6. How can I use pickle to save a dict (or any other Python object)?

    I have looked through the information that the Python documentation for pickle gives, but I'm still a little confused. What would be some sample code that would write a new file and then use pickle...

  7. python - How to save and load numpy.array () data properly? - Stack ...

    I wonder, how to save and load numpy.array data properly. Currently I'm using the numpy.savetxt () method. For example, if I got an array markers, which looks like this: I try to save it by the use ...

  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. How do I save and restore multiple variables in python?

    The question was "How do I save and restore multiple variables in python?" Please update your answer how to handle multiple variables in a pickle, instead of one variable.

  10. How to save a file to a specific directory in python?

    53 Currently, I am using this code to save a downloaded file but it is placing them in the same folder where it is being run from.