See Installation in the Poetry website.
Alternatives:
- General. Run this outside a virtual env. Note
pipx
is preferred so use it if you have it.$ pip install poetry
$ pipx install poetry
See Installation in the Poetry website.
Alternatives:
pipx
is preferred so use it if you have it.
$ pip install poetry
$ pipx install poetry
Install using apt-get.
sh $ sudo apt-get update $ sudo apt-get install python3 # OR python3.12
Warning: Note that for Debian, the major Python versions available are locked within a Debian release version. Therefore you must upgrade to a newer OS version to get a newer Python version. Or install Python from a different repository or build from source, but this is a custom installation which may be hard to get working or maintain, so I don't recommend it. For instance, when you install C headers or choose a Python version for your IDE, you system will not by default know to look in the custom location you've installed Python to. Using pyenv might make this easier though
Geckodriver allows you to set up a web driver instance in a package like Selenium and control Firefox (and any other Gecko-based browsers).
See the Geckodriver documentation on the Mozilla website.
Downloaded a zip from Releases:
From the Install doc:
$ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
$ # Previously the guide just said this:
$ curl https://sh.rustup.rs -sSf | sh
Customize VS Code with some code snippets so you can insert them into your projects
For more info see:
How to control a 9G servo motor with a Rasp Pi and a simple Python script
The use of the servo including the wiring and script is based on this YouTube tutorial - Raspberry Pi Servo Motor Control. There are also plenty of similar videos out there.
For Arduino, see Using Servo Motors with Arduino
Using GitHub GraphQL API.
See related gist here.
The Python script below demonstrates how to use regex to match on text with a known structure to build a dictionary, then convert the output to JSON data.
The task comes from this StackOverflow question.
Rather than using a procedural approach to handle the lines one at a time and extract the relevant items, I split the text into chunks and then dealt with each using regex pattern to extract the relevant pieces. Expecting questions A and B to always be present and C and D to be there sometimes.
Note use brackets for capture groups.
How to set up a Twitter dev account, register Twitter app and generate Twitter API tokens
This guide takes you through setting up a new Twitter account all the way through to generated Twitter auth tokens (aka API tokens or credentials). These tokens must be used on every request, such as fetch or create Twitter content.