One. Pass function 1 to Python via Pycharm. Write the parameters to get in the Pycharm terminal, get 1 start pycharm in the Terminal (Terminal) window click on the icon in the lower left corner of the pycharm, select Terminal 2 "in tests.py write the following code #/ usr/bin/python#coding=utf-8# @Time : 2017/10/12 20:37# @Auther: liuzhenchuan# @File : tests.py# print ' A ' import sys print (sys.argv[0]) print (sys.argv[1]) 3 "with tets.py get ' The hello ' parameter executes "python tests.py hello" in tests.py cmd,: tests.py #tests. Py by sys.argv[0 ] gets to. 0 get to the program itself path hello # Hello by sys.argv[1] get to 2. Set the fixed parameters to get in Pycharm, get 1 tests.py press ALT+SHIFT+F10 ----Select Edit configuration (edit configurations)---script parameters (script). As shown in: Click Run, the first parameter gets to the absolute path of the script, and the second parameter gets to the ' Liuzhenchuan ' Note: To get multiple parameters, write multiple print (sys.argv[x]) in tests.py. In Pycharm also write the corresponding parameter number, as follows: Import Sys print (sys.argv[0]) print (sys.argv[1]) print ( SYS.ARGV[2]) "ALT + Shift +F10"---Edit configuration---Script parameters---set two parameters liuzhenchuan Hello click Run: two. Pycharm debug mode pycharm debug mode (Breakpoint Debug mode), Also called debug mode 1. Set breakpoints: Before the code, after the line number, you can set breakpoints by clicking the mouse. as follows: 2. Debug Breakpoint (SHFIT+F9): Click on the green Beetle icon (it appears that the beetle has become a debug-only icon), and when you click on a breakpoint, it will run to the first breakpoint. The variable information before the breakpoint is displayed. Click Step Over or press F8, we continue to run down to the next breakpoint: . F7: Jumps to the next method, reads the statement in the method . F8: Read each statement, jump to the next breakpoint three. Extend the function of partial Vim+python auto-completionhttp://www.jianshu.com/p/f0513d18742a
Python_pycharm Debug mode + use Pycharm to pass parameters to Python