GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing pythonadventures.wordpress.com — tutorial – Python Adventures Python AdventuresWelcome to the Jungle!
Archive
Posts Tagged ‘tutorial’
moving from pipenv to poetryIn the past 1-1.5 years I’ve used pipenv, which worked very well for me but it was annoyingly slow. Creating a virtual environment took a minute sometimes, and installing the dependencies often took several minutes. I’ve heard lots of good things about poetry, so I decided to give it a try. After reading its documentation, I could do everything with it that I needed, so in the future I’ll use poetry for managing my virtual environments. Getting started The installation is a bit speacial: https://poetry.eustace.io/docs/. After the installation, open a new terminal and issue the command “ The installer puts poetry in the folder By default, new virtual environments are put in the folder $ poetry config settings.virtualenvs.path $HOME/.virtualenvs Actually, it’s a good idea to put this value in an environment variable too. Add this line to the end of your export WORKON_HOME=$HOME/.virtualenvs The config info is stored in the file Update poetry poetry self:update Use case #1: Create a new poetry project from scratch $ mkdir demo $ cd demo $ poetry new [--src] . It will create the basic structure of a new project (scaffolding). If you want to store the source files in the directory “ Create / activate / deactivate the virtual environment poetry shell If the virt. env. doesn’t exist yet, poetry will create it. For this to work, you need to have the file Install / remove a package poetry add requests [--dev] It’ll install the given dependency (requests in the example) and add it to your poetry remove requests Remove the package and if it installed some sub-dependencies, then those packages are also removed. Help poetry help install Show installed packages $ poetry show [--no-dev] $ poetry show --tree [--no-dev] Show the list of installed packages. With “ Version control Where is the directory of the virtual environment? poetry show -v and the result will be in the first line. If you need just this information, then here is how to extract it: venv_folder=`(poetry show -v | head -1) 2>/dev/null | cut -d" " -f3` Which packages are outdated? $ poetry show -o $ poetry show --outdated # same thing It will show which packages have newer versions. Update a package / all packages $ poetry update requests Update the given package. However, it takes into account the SemVer rules, defined in poetry update Update all packages. Again, it follows the SemVer rules. Edit your pyproject.toml poetry check Use case #2: Convert an existing project to a poetry project
Use case #3: Checkout a poetry project Relax and issue this simple command inside the project folder: poetry install [--no-dev] By default, it also installs the development packages. Use “ Windows support The installer adds the folder The virtual environments are created here: Unfortunately, when I activated a virt. env., the prompt didn’t change. Troubleshooting Under Ubuntu 18.04 I had to use some tricks to force poetry to use Python 3. Find the details here. In short: edit the file Links Posts on Python and Big DataSee Neal Caren’s tutorials and posts on Python and Big Data here: http://nealcaren.web.unc.edu/big-data/. install geventsudo apt-get install libevent-dev python-all-dev sudo pip install gevent Nice tutorial on gevent: here. Video tutorials at marakana.com“Marakana‘s raison d’être is to help people get better at what they do professionally. We accomplish this by organizing software training courses (both public and private) as well as publishing learning resources, sharing knowledge from industry leaders, providing a place to share useful tidbits and supporting the community. Our focus is open source software.” Their Python videos are here. Python video tutorialsSome video tutorials:
Ref.: python-list mailing list. Python tutorials at IBM developerWorksIBM developerWorks has great tutorials. Check out their Python tutorials. Python tutorials of Full Circle Magazine in a single PDFOn my other blog, I wrote a post on how to extract the Python tutorials from Full Circle Magazine and join them in a single PDF. For the lazy pigs, here is the PDF (6 MB). Get it while it’s hot :)
Categories: python
Tags: full circle magazine, pdf, tutorial
Should I use Python 2 or Python 3?“Should I use Python 2 or Python 3?” This is a very common question when someone wants to learn Python. Here is a nice article about this topic: http://wiki.python.org/moin/Python2orPython3. (Thanks Jaume for the link.) Update (20110404) If you are ready to dive in Python 3, here are some tutorials:
Update (20110526) I follow the following simple guideline: I use that version of Python that comes with Ubuntu by default. In Ubuntu 10.10 it was Python 2.6, in Ubuntu 11.04 it’s Python 2.7. When they switch to Python 3.x, I will switch too.
Categories: python
Tags: dive into python 3, documentation, python2, python3, tutorial
Blog Stats
Random PostRecent Postsascii
bash
beautifulsoup
book
bpython
challenge
command-line
convert
cron
crontab
date
datetime
distance
dropbox
email
eric
exercise
extract
file
firefox
github
google
hacking
heroku
html
ide
imdb
imgur
install
ipython
java
jinja2
json
linux
module
modules
MongoDB
movies
news
pdf
perl
pi
pip
print
pylint
pypi
python3
python shell
quote
readline
reddit
redirect
refactoring
regexp
requests
reverse
review
shell
sound
stdout
string
tab
text
threads
time
tip
tutorial
unicode
url
video
virtualenv
virtual environment
virtualenvwrapper
xml
zip Archives
Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy
|
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |