This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun replace-python-exp () | |
"Run the region as a Python script, kill the region, insert the output of the Python script." | |
(interactive) | |
(let* ((tmp-file (make-temp-file "tmppl")) | |
(rb (region-beginning)) | |
(re (region-end)) | |
(str (buffer-substring-no-properties rb re))) | |
(if (string-match "print" str) | |
(progn | |
(write-region rb re tmp-file nil 1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This code uses Biopython to retrieve lists of articles from pubmed | |
# you need to install Biopython first. | |
# If you use Anaconda: | |
# conda install biopython | |
# If you use pip/venv: | |
# pip install biopython | |
# Full discussion: |