@@ -24,31 +24,17 @@ To switch to a specific version, use `git checkout` or modify it manually.
2424Install the Python plugin to ` $TEXMACS_HOME_PATH/plugins ` and then change
2525the python launcher in ` $TEXMACS_HOME_PATH/plugins/python/progs/init-python.scm ` .
2626
27- If you have permissions for ` $TEXMACS_PATH/plugins/python/progs/init-python.scm ` , you may also
28- change the system one.
27+ If you have permissions for ` $TEXMACS_PATH/plugins/python/progs/init-python.scm ` , you may also change the system one.
2928
30- Here is the detailed example of changing from python to python3 :
29+ Here is the detailed example of changing the python command :
3130
3231``` scheme
33- (define (python-launcher)
34- (if (url-exists? "$TEXMACS_HOME_PATH/plugins/tmpy")
35- (string-append "python \""
36- (getenv "TEXMACS_HOME_PATH")
37- "/plugins/tmpy/session/tm_python.py\"")
38- (string-append "python \""
39- (getenv "TEXMACS_PATH")
40- "/plugins/tmpy/session/tm_python.py\"")))
32+ (define (python-command)
33+ (if (url-exists-in-path? "python3") "python3" "python2"))
4134```
4235
43- To use python3 , just replace the above code with:
36+ By default, we prefer ` python3 ` . To use a specific python version , just change the return value of the ` (python-commond) ` function.
4437
4538``` scheme
46- (define (python-launcher)
47- (if (url-exists? "$TEXMACS_HOME_PATH/plugins/tmpy")
48- (string-append "python3 \""
49- (getenv "TEXMACS_HOME_PATH")
50- "/plugins/tmpy/session/tm_python.py\"")
51- (string-append "python3 \""
52- (getenv "TEXMACS_PATH")
53- "/plugins/tmpy/session/tm_python.py\"")))
39+ (define (python-command) "/path/to/python")
5440```
0 commit comments