WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #6  
Old 07-23-2010, 09:07 AM
nige777 nige777 is offline
Member
 
Join Date: Nov 2007
Location: UK
Posts: 78
Ok, I'm getting somewhere here I think. Here's what I am using now:
Code:
def ChooseFile():
	"""You can find documentation for CreateFileDialog at the following site:
		http://aspn.activestate.com/ASPN/docs/ActivePython/2.5/pywin32/win32ui__CreateFileDialog_meth.html"""
	parent = win32ui.CreateWindowFromHandle(viz.window.getHandle())
	dlg = win32ui.CreateFileDialog(1,'','',0,'',parent)
	if dlg.DoModal() == win32con.IDOK:
		file = dlg.GetFileName()
		inFileName  = dlg.GetPathName()
		print file
		print inFileName
- Thanks farshi

However, what I would really like to do is open the selected file, so I tried adding:
Code:
		FILE = open(file, 'r')
		
		for line in FILE:
			print line
- but all I get is
Code:
ÐÏࡱ


So my question is - what am I doing wrong here, I just want a participant to be able to select a file which is then read in / parsed into useful chunks of data.

Also when exiting winviz after running this I get a - "winviz.exe has encountered a problem and needs to close. We are sorry for the inconvenience." from windoze
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
IVEx file extenstion unrecognised. sindi Vizard 2 12-10-2009 02:20 AM
problems with output to a text file within executable Saz Vizard 1 07-01-2009 12:01 PM
Problem generating exe file Anfo Vizard 1 11-17-2008 05:21 PM
Read file....many issues Uttama_vizard Vizard 9 07-08-2008 03:16 PM
File Management Uttama_vizard Vizard 2 07-01-2008 10:44 AM


All times are GMT -7. The time now is 10:25 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC