hi,
Please can anybody help me with this problem, i am creating an application that outputs to a notepad file on windows 7, i would like to know if there is a python module that i can use to invoke a notepad file(example trial.txt) to output into.THanks

Recommended Answers

All 3 Replies

import webbrowser
webbrowser.open('trial.txt')

Thanks alot but it opened my browser, if i may ask is there a way i can open notepad or microsoft word

something like:

import subprocess as sp
nameOfProgramToRun = "notepad.exe"
nameOfFileToOpen = "test.txt"
sp.Popen([nameOfProgramToRun, nameOfFileToOpen])

should do the trick.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.