#1
|
|||
|
|||
user input problem
In the following script I want to have the user enter the name of a text file which is later read from within a called function. It works, but a yellow error marker appears at the line that calls the function and the cursor jumps to that line. This is annoying since I then have to find the place in the script where I was editing. Can you suggest a better way to do this?
import viz viz.go() filename = input('filename?') def openfile(): global filename file = open(filename, 'r') openfile() |
#2
|
|||
|
|||
Hi,
Try the following instead: Code:
if viz.running(): openfile() |
Thread Tools | |
Display Modes | Rate This Thread |
|
|