Re: [Tutor] Further help needed!

2006-01-05 Thread John Corry
Notepad opens and prints the text file.

Regards,

John.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Behalf Of John Fouhy
Sent: 04 January 2006 21:54
To: Tutor
Subject: Re: [Tutor] Further help needed!


[resending 'cause I forgot to address to tutor..]

On 05/01/06, John Corry [EMAIL PROTECTED] wrote:
 This code works on windows XP + Windows 2000.  However it does not work on
 windows 98SE.  I have tried this code on 3 seperate machines with windows
 98SE.  They all come up with the same error:

  File
 C:\Python24\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py,
 line 310, in RunScript
 exec codeObject in __main__.__dict__
   File C:\test\Script1.py, line 12, in ?
 0
 error: (31, 'ShellExecute', 'A device attached to the system is not
 functioning.')

Have you verified that the printer on your Win98 machine does work?

For example, create a text file on that computer.  In Windows
Explorer, right-click on the text file and select 'print' from the
context menu.  What happens?

--
John.
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] Further help needed!

2006-01-04 Thread John Corry
I am using the following code to send a text file to the printer:-

import win32api
filename = testprint.txt
fileobj=open (filename, w)
fileobj.write (This is a test)
fileobj.close()
win32api.ShellExecute (
  0,
  print,
  filename,
  None,
  .,
  0
)

This code works on windows XP + Windows 2000.  However it does not work on
windows 98SE.  I have tried this code on 3 seperate machines with windows
98SE.  They all come up with the same error:

 File
C:\Python24\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py,
line 310, in RunScript
exec codeObject in __main__.__dict__
  File C:\test\Script1.py, line 12, in ?
0
error: (31, 'ShellExecute', 'A device attached to the system is not
functioning.')

Is there another way to print out a text file on windows 98SE?  Do I have to
do something different on the windows 98SE machine?  Any help would be
greatly appreciated.

Thanks,

John.

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Further help needed!

2006-01-04 Thread John Fouhy
[resending 'cause I forgot to address to tutor..]

On 05/01/06, John Corry [EMAIL PROTECTED] wrote:
 This code works on windows XP + Windows 2000.  However it does not work on
 windows 98SE.  I have tried this code on 3 seperate machines with windows
 98SE.  They all come up with the same error:

  File
 C:\Python24\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py,
 line 310, in RunScript
 exec codeObject in __main__.__dict__
   File C:\test\Script1.py, line 12, in ?
 0
 error: (31, 'ShellExecute', 'A device attached to the system is not
 functioning.')

Have you verified that the printer on your Win98 machine does work?

For example, create a text file on that computer.  In Windows
Explorer, right-click on the text file and select 'print' from the
context menu.  What happens?

--
John.
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Further help needed!

2006-01-04 Thread Alan Gauld
John,

On Win 9X try
1) copying the text file to PRN: using os.system()
2) use the DIS PRINT command using os.system()
3) Try opening the file LPT1: and copying your text to that.

All of the above should work. But I no onger have a
Win9X box to check...

HTH,

Alan G.

- Original Message - 
From: John Corry [EMAIL PROTECTED]
To: tutor@python.org
Sent: Wednesday, January 04, 2006 9:01 PM
Subject: [Tutor] Further help needed!


I am using the following code to send a text file to the printer:-

 import win32api
 filename = testprint.txt
 fileobj=open (filename, w)
 fileobj.write (This is a test)
 fileobj.close()
 win32api.ShellExecute (
  0,
  print,
  filename,
  None,
  .,
  0
 )

 This code works on windows XP + Windows 2000.  However it does not work on
 windows 98SE.  I have tried this code on 3 seperate machines with windows
 98SE.  They all come up with the same error:

 File
 C:\Python24\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py,
 line 310, in RunScript
exec codeObject in __main__.__dict__
  File C:\test\Script1.py, line 12, in ?
0
 error: (31, 'ShellExecute', 'A device attached to the system is not
 functioning.')

 Is there another way to print out a text file on windows 98SE?  Do I have 
 to
 do something different on the windows 98SE machine?  Any help would be
 greatly appreciated.

 Thanks,

 John.


 

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor