Skip to content

Instantly share code, notes, and snippets.

View vnckppl's full-sized avatar

Vincent Koppelmans vnckppl

View GitHub Profile
@bonzanini
bonzanini / search_biopython.py
Last active May 19, 2024 08:45
Searching PubMed with Biopython
# 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:
@jl2
jl2 / replace-python-region.el
Created November 10, 2011 17:45
Emacs Lisp to run the current region through Python, then replace the region with the output of the script.
(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)