Displaying contents of a file using PyWin

M

MiguelS

import win32ui
from pywin.mfc import docview

t = object_template()
d = t.OpenDocumentFile("d:/temp/music.log", True)

Crashes PythonWin
 
M

Marc 'BlackJack' Rintsch

import win32ui
from pywin.mfc import docview

t = object_template()
d = t.OpenDocumentFile("d:/temp/music.log", True)

Crashes PythonWin

What do you mean by `crashes`? Any chance you get a name error like::

NameError: name 'object_template' is not defined

?

Ciao,
Marc 'BlackJack' Rintsch
 
M

MiguelS

Sorry, the code I posted was wrong. I tried


import win32ui
from pywin.mfc import docview

t = docview.DocTemplate()
t.OpenDocumentFile("d:/temp/music.log", True)

This caused windows to close PythonWin.
 
G

Gabriel Genellina

[Forwarded from python-list@...]

import win32ui
from pywin.mfc import docview

t = docview.DocTemplate()
t.OpenDocumentFile("d:/temp/music.log", True)

This caused windows to close PythonWin.

This appears to be a problem with pywin32.
Using release 209 for Python 2.4 I get an Access Violation.

Also I've noticed that this idiom:

try:
win32ui.GetApp().RemoveDocTemplate(template)
except NameError:
# haven't run this before - that's ok
pass

doesn't work anymore because RemoveDocTemplate raises a different
exception now.


--
Gabriel Genellina
Softlab SRL






__________________________________________________
Preguntá. Respondé. Descubrí.
Todo lo que querías saber, y lo que ni imaginabas,
está en Yahoo! Respuestas (Beta).
¡Probalo ya!
http://www.yahoo.com.ar/respuestas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,588
Members
45,093
Latest member
Vinaykumarnevatia00

Latest Threads

Top