Skip to content

Instantly share code, notes, and snippets.


Sebastiano Ferraris SebastianoF

View GitHub Profile
SebastianoF /
Created Oct 14, 2018
Count words in latex
import os
import subprocess
Counts the words in the manually selected latex files in the list list_file
Commands to obtain the number of words in a .tex file:
'detex my_file.tex | wc -w'
where my_file.tex is one of the string in the list list_files

For future reference after the discussion

How to go from Cauchy notation to cyclic notation of a permutation with python

After insights from @Accumulation (working but with extra loop and with no inverse) and @Martin R (not working but with cool insight and inverse), here is what I have got: (it seems to work, but is far from the pythonic-elegance suggested by Martin R).

def permutation_from_cauchy_to_disjoints_cycles(cauchy_perm):
SebastianoF / gist:5a43eec688674f1b885bf1dda77c17c1
Created Sep 4, 2017
Python, upload to pypi the latest code release
View gist:5a43eec688674f1b885bf1dda77c17c1
# must be there
# create the latest version
python bdist_wheel
# upload to pypi
twine upload dist/<your_code_name>_<your_version>.whl -r pypi