Reference blog
(https://blog.csdn.net/ShiMengRan107/article/details/70242245 )
(https://www.cnblogs.com/way_testlife/category/247553.html )
Simple output print ( 'hello Word')
Editor problem: Use IDLE and write Python Shell python (refer blog: https://blog.csdn.net/shimengran107/article/details/70856242 )
IDLE use:
(https://blog.csdn.net/Mrs_Wu/article/details/79265427 )
Python IDLE entry
(http://www.cnblogs.com/dsky/archive/2012/06/04/2535397.html )
1 Sometimes we only remember the first few letters of a function, then how do? For example, I want to type at run time using raw_input function from the standard input something, I would have this function name is remembered from the "Edit" menu, select "Show completetions" menu item, IDLE will give some tips.
2
def say_hello(name):
print("Hello{}".format(name))
for i in range(3):
print(name
input Output
>>> print('Hello Word!')
Hello Word!
>>> print('100+200=',100+200)
100+200= 300
问题:SyntaxError: multiple statements found while compiling a single statement
Case this problem occurs:
Copy the edited directly enter the code into IDLE
Solution steps:
The code is written .py file
Load the IDLE, run (run / F5) in .py file
Novice Python ** py SyntaxError:. Invalid syntax unknown syntax error
Syntax version may be incompatible
Clear screen
In the Linux shell, a clear screen operation is clear; in Win cmd, the operation is to clear the screen cls.
In interactive mode using python, if you want to clear the screen, you can import os, to invoke system commands clear or clear the screen cls be achieved by os.system ().
>>> import os
>>> os.system('clear')
But this time the state of the shell is:
0
>>>
The first line will have a 0. This is actually the os.system 0 () returns a value of 0 is successful, i.e., non-zero error code (particularly the os.system () returns the corresponding relationship between the command values may be reference herein).