how do i write to files and open with notepad?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Nnabu Ree Rebaone
    New Member
    • Sep 2010
    • 1

    how do i write to files and open with notepad?

    I want to learn how to write to file and open with notepad
  • melissajean
    New Member
    • Aug 2010
    • 6

    #2
    you can use the open command. Try this:

    Code:
    file = open('myfile.txt', 'w')
    s = "My String of Text I want In the File"
    file.write(s)
    you can then find the file you just created and open it with notepad.

    check this out for more info:
    There are several ways to present the output of a program; data can be printed in a human-readable form, or written to a file for future use. This chapter will discuss some of the possibilities. Fa...

    Comment

    Working...