Python - vanhoan310/tips GitHub Wiki

  1. Graph algorithm https://www.youtube.com/watch?v=HDUzBEG1GlA

  2. Draw graph with networkx https://stackoverflow.com/questions/20133479/how-to-draw-directed-graphs-using-networkx-in-python

  3. Run command line. import os os.system("./test") https://unix.stackexchange.com/questions/238180/execute-shell-commands-in-python

  4. Important concepts in Python https://www.quora.com/What-are-the-most-important-topics-to-learn-in-Python

  5. Python style https://www.python.org/dev/peps/pep-0008/

  6. Important * https://www.python-course.eu/python3_properties.php

  7. Avoid reload data many times https://stackoverflow.com/questions/45807324/avoid-reloading-data-each-time-you-want-to-work-on-it-with-python

  8. Add package to JupyterLab In order to make our pipe-line more reproducible, one should always run the Notebooks within the same conda enviroment using: source activate heterochromatin the enviroment used in our analysis can be reproduced with the py36.yml file. In Jupyterhub one will need to create a Jupyter Notebook kernel to launch this new enviromment, see for more details. After sourcing the desired enviroment: source activate heterochromatin python -m ipykernel install --user --name heterochromatin --display-name "Python (heterochromatin)" Go back to the Jupyterhub dashboard, reload the page, now you should have another option in the New menu that says heterochromatin. In order to use your new kernel with an existing notebook, click on the notebook file in the dashboard, it will launch with the default kernel, then you can change kernel from the top menu Kernel > Change kernel. In order to up-date/remove a Jupyterhub kernel. List the paths of all your kernels: jupyter kernelspec list Then simply uninstall your unwanted-kernel jupyter kernelspec uninstall unwanted-kernel

  9. How to make a Python package: https://www.tutorialsteacher.com/python/python-package https://packaging.python.org/tutorials/packaging-projects/ Publish your code to pypi: python -m twine upload --repository pypi dist/* (don't use testpypi).

  10. Error /lib64/libstdc++.so.6: version `CXXABI_1.3.9' not found https://stackoverflow.com/questions/49875588/importerror-lib64-libstdc-so-6-version-cxxabi-1-3-9-not-found

  11. Installation of SpiceFlow https://github.com/hongleir/SpaceFlow/issues/3

  12. Conda (when remove kernel we CAN"T use the package in capital (e.g., STAlinger -> stalinger)