Wednesday 15 August 2012

windows - python 2.7.9/pycharm 4/windows7: 'file' object has no attribute 'readall' -


I'm trying to write something very small in pycharm.

Problem:

with sourceText = "" source: text = sourceFile.readall with open ("lang.txt", "rt") as the source file () Print Source Text

When I ". "After the" sourcefile ", I get a popup that gives me the" readol () "method However, when I try to run the script, I'll"

  traceback (most recently In the last call): ... languages ​​/ languages. Py ", in line 4, in the  SourceText = sourceFile.readall () AttributeError: There is no attribute 'readel' in the 'file' object.  

method (I get popup, using Ctrl + Q for this method document) but

I get anything I'm in laziness.

I would like either:

  1. No get any popup for inaccessible ways in pycharm.
  2. Or find out why I can not see it despite being a document.

Advice?

I am using Windows 7 64bit , And two dragon 2.7.9 is installation (32 bit and 64bit), 64 bit is in Path 1. Pycharm 4.0.5 is community version.

You are right that readall is io Is documented for the module, but it is complaining about the file , which does not have that method, you want reading () to process all data in the file Should be read in a big basement. You can also use readlines () which comes back a list well, I have PyCharm Pro 3.4 version and it does not do this. I will report it to PyCharm as a bug.


No comments:

Post a Comment