[英]PyCharm: Intellisense or auto-complete not working with Python 3.5.2
I have recently installed Python 3.5.2 then PyCharm (IDE), but intellisense or auto-complete not working in my Windows 10.我最近安装了 Python 3.5.2 然后 PyCharm (IDE),但智能感知或自动完成在我的 Windows 10 中不起作用。
# Method 1: intellisense or auto-complete not working for below
city = input("Enter your City \n")
print(city)
print(city.) *#<<<--- here not working when put a "." after "city"* variable
...but surprised to see that it works fine with below code: ...但惊讶地发现它在以下代码中运行良好:
myCity = "New York City"
print(myCity.upper())
Finally it working now:最后它现在工作:
I had to install the Python 3.4.1
for my PyCharm 2016.3.2
我必须为我的
PyCharm 2016.3.2
安装Python 3.4.1
Go to File
menu >> Settings...
>> Project: Python Programs
>> Project Interpreter
>> now follow below screenshot:转到
File
菜单>> Settings...
>> Project: Python Programs
>> Project Interpreter
>>现在按照以下屏幕截图:
...but not sure that why it was not working with Python 3.5? ...但不确定为什么它不适用于 Python 3.5? ---> Thank you to @Pavel Karateev for the helpful update.
---> 感谢@Pavel Karateev 提供的有用更新。
The value that input
may give you may have any type. input
可能给你的值可能是任何类型。 That is, if you happen to type {"a": 1}
, the return type of input
will be dict
.也就是说,如果您碰巧键入
{"a": 1}
, input
的返回类型将是dict
。 Test it.测试一下。
So with input
all attribute inference is moot.因此,对于
input
,所有属性推断都没有实际意义。 The completions offered are not even attributes, it seems, but expression modifiers.提供的补全似乎甚至不是属性,而是表达式修饰符。
If you only want to input a string value, use raw_input
.如果您只想输入字符串值,请使用
raw_input
。 The result should be considered a string, and attribute completion should work.结果应该被认为是一个字符串,并且属性完成应该工作。
To see it work, type:要查看它是否有效,请键入:
city_name = raw_input("What is your city? ")
city_name.l
Then press the completion key after the l
;然后按
l
后的完成键; i suppose you will be offered variants like lower()
and lstrip()
.我想你会得到像
lower()
和lstrip()
这样的变体。 This would mean that PyCharm understood that city_name
must be a string, and offers relevant methods.这意味着 PyCharm 理解
city_name
必须是一个字符串,并提供相关的方法。
Another answer is:另一个答案是:
I was facing the same problem because mistakenly I had turned on the Power Save Mode in PyCharm.我遇到了同样的问题,因为我错误地在 PyCharm 中打开了省电模式。 To turn it Off go to File -> Power Save Mode .
要关闭它,请转到File -> Power Save Mode 。 It solved my issue.
它解决了我的问题。 Thanks
谢谢
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.