[Tutor] Late Introduction
Jacob S.
keridee at jayco.net
Mon Oct 18 04:05:55 CEST 2004
Hello again!
What I actually meant was to send a text file to a printer connected to
a parallel or usb port. I happen to know that I could dynamically write a
batch file that would print the particular file and use os.startfile() to
run it. However, recently I noticed that one of the modules has functions
for executing one line command line commands. So I could probably skip the
batch command. (It would look something like this "myfile.txt > lpt1".
Anyway, I was looking for something that would skip the use of command line
commands and just use a python function instead.
Thanks for the interesting new way to write to a file though. I have
been using just things like,
>>> a = open("myfile.txt","w")
>>> stri = "Hello world, how are you today? " # I use stri as the
variable because string and str are potentially reserved words.
>>> a.write(stri)
>>> a.close()
>>>
I thank you again for the print >>myfile,"This is a test. Hello world. "
Jacob Schmidt
More information about the Tutor
mailing list