As of July 2018, Raspbian does not yet include the latest Python release, Python 3.7.4. This means we will have to build it ourselves, and here is how to do it.
- Install the required build-tools (some might already be installed on your system).
# WOrks in python 2.7 not sure if it works in python 3. | |
# Just straight up connect by any means possible. | |
from ftplib import FTP_TLS | |
def connect(): | |
ftp = FTP_TLS() | |
ftp.debugging = 2 | |
ftp.connect('localhost', 2121) | |
ftp.login('developer', 'password') |
#!/usr/bin/env zsh | |
# ------------------------------------------------------------------------------ | |
# Prompt for the Zsh shell: | |
# * One line. | |
# * VCS info on the right prompt. | |
# * Only shows the path on the left prompt by default. | |
# * Crops the path to a defined length and only shows the path relative to | |
# the current VCS repository root. | |
# * Wears a different color wether the last command succeeded/failed. | |
# * Shows user@hostname if connected through SSH. |
import { v4 as uuid } from 'uuid'; | |
export function generateId() { | |
return uuid(); | |
} | |
const v4 = new RegExp(/^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i); | |
console.log(generateId().match(v4)); | |
//console.log(generateId().length) |
package main | |
import ( | |
"fmt" | |
"github.com/spf13/viper" | |
) | |
// Create private data struct to hold config options. | |
type config struct { |
package main | |
import ( | |
"golang.org/x/sys/unix" | |
"log" | |
"os" | |
) | |
func main() { | |
file, err := os.Open("/sys/class/somefile") |
#!/usr/bin/env python | |
""" | |
A simple producer/consumer example, using Queue.task_done and Queue.join | |
From https://asyncio.readthedocs.io/en/latest/producer_consumer.html | |
""" | |
import asyncio | |
import random |
[[language]] | |
name = "python" | |
scope = "source.python" | |
injection-regex = "python" | |
file-types = ["py","pyi","py3","pyw",".pythonstartup",".pythonrc"] | |
shebangs = ["python"] | |
roots = [".", "pyproject.toml", "pyrightconfig.json"] | |
comment-token = "#" | |
language-servers = ["pyright", "ruff"] | |
indent = { tab-width = 4, unit = " " } |