Mercurial > vim
comparison runtime/doc/if_pyth.txt @ 14864:40ef13331e02
Update runtime files.
commit https://github.com/vim/vim/commit/95bafa296ae97bf420d5c74dd6db517b404c5df7
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Oct 2 13:26:25 2018 +0200
Update runtime files.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 02 Oct 2018 13:30:07 +0200 |
parents | 34fd018452ed |
children | 0e473e9e70c2 |
comparison
equal
deleted
inserted
replaced
14863:ddb5bfb4114d | 14864:40ef13331e02 |
---|---|
58 print 'EAT ME' | 58 print 'EAT ME' |
59 EOF | 59 EOF |
60 endfunction | 60 endfunction |
61 | 61 |
62 To see what version of Python you have: > | 62 To see what version of Python you have: > |
63 :python import sys | |
64 :python print(sys.version) | 63 :python print(sys.version) |
64 | |
65 There is no need to import sys, it's done by default. | |
65 | 66 |
66 Note: Python is very sensitive to the indenting. Make sure the "class" line | 67 Note: Python is very sensitive to the indenting. Make sure the "class" line |
67 and "EOF" do not have any indent. | 68 and "EOF" do not have any indent. |
68 | 69 |
69 *:pydo* | 70 *:pydo* |
108 | 109 |
109 Python commands cannot be used in the |sandbox|. | 110 Python commands cannot be used in the |sandbox|. |
110 | 111 |
111 To pass arguments you need to set sys.argv[] explicitly. Example: > | 112 To pass arguments you need to set sys.argv[] explicitly. Example: > |
112 | 113 |
113 :python import sys | |
114 :python sys.argv = ["foo", "bar"] | 114 :python sys.argv = ["foo", "bar"] |
115 :pyfile myscript.py | 115 :pyfile myscript.py |
116 | 116 |
117 Here are some examples *python-examples* > | 117 Here are some examples *python-examples* > |
118 | 118 |