Home > other >  Pycharm configuration problem
Pycharm configuration problem

Time:03-23

Not installed python installed pycharm directly and anancoda written in pycharm program can run but always there is red line write the print there is red line what is less installed configuration or for other reasons? Small white thank you consult

CodePudding user response:

Strange problem if the workspace for does not contain the py file directory, there is no red line, and as long as the open workspace directory contains the running py files will be red, this is how to return a responsibility?

CodePudding user response:

Read the file content can't use, or use:
1, with open (" keyword. TXT ", "r") as f:
2, file_name="keyword. TXT"
F=open (file_name, 'r')
Here the meaning of r took the form of binary read from the file content
Text=f.r ead ()
The point!!!!!!
After the file read here must perform f. lose () to close the file!!!!!! , and the difference between the first approach, the cause of the error you have two, one is to read the file format error, not utf-8, two is the file open must close

  • Related