<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="FeedCreator 1.8" -->
<?xml-stylesheet href="https://hastur.tiaro.xyz/lib/exe/css.php?s=feed" type="text/css"?>
<rdf:RDF
    xmlns="http://purl.org/rss/1.0/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
    xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel rdf:about="https://hastur.tiaro.xyz/feed.php">
        <title>Знання programming:python</title>
        <description></description>
        <link>https://hastur.tiaro.xyz/</link>
        <image rdf:resource="https://hastur.tiaro.xyz/lib/tpl/dokuwiki/images/favicon.ico" />
       <dc:date>2026-07-17T12:13:21+00:00</dc:date>
        <items>
            <rdf:Seq>
                <rdf:li rdf:resource="https://hastur.tiaro.xyz/doku.php?id=programming:python:find_max_dictionary&amp;rev=1729763416&amp;do=diff"/>
                <rdf:li rdf:resource="https://hastur.tiaro.xyz/doku.php?id=programming:python:new_boto&amp;rev=1643298962&amp;do=diff"/>
                <rdf:li rdf:resource="https://hastur.tiaro.xyz/doku.php?id=programming:python:new_project&amp;rev=1617098722&amp;do=diff"/>
                <rdf:li rdf:resource="https://hastur.tiaro.xyz/doku.php?id=programming:python:pip&amp;rev=1524144763&amp;do=diff"/>
                <rdf:li rdf:resource="https://hastur.tiaro.xyz/doku.php?id=programming:python:secret_key&amp;rev=1651489775&amp;do=diff"/>
                <rdf:li rdf:resource="https://hastur.tiaro.xyz/doku.php?id=programming:python:venv&amp;rev=1652430420&amp;do=diff"/>
            </rdf:Seq>
        </items>
    </channel>
    <image rdf:about="https://hastur.tiaro.xyz/lib/tpl/dokuwiki/images/favicon.ico">
        <title>Знання</title>
        <link>https://hastur.tiaro.xyz/</link>
        <url>https://hastur.tiaro.xyz/lib/tpl/dokuwiki/images/favicon.ico</url>
    </image>
    <item rdf:about="https://hastur.tiaro.xyz/doku.php?id=programming:python:find_max_dictionary&amp;rev=1729763416&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-10-24T12:50:16+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>programming:python:find_max_dictionary</title>
        <link>https://hastur.tiaro.xyz/doku.php?id=programming:python:find_max_dictionary&amp;rev=1729763416&amp;do=diff</link>
        <description>How to find dictionary element with maximum field value

Given list of dictionaries I need to find one element of list (dictionary) with maximum field value:


people = [
    {'name': 'Alice', 'age': 25},
    {'name': 'Bob', 'age': 30},
    {'name': 'Charlie', 'age': 22}
]

# Find the dictionary with the maximum 'age'
oldest_person = max(people, key=lambda person: person['age'])

print(oldest_person)</description>
    </item>
    <item rdf:about="https://hastur.tiaro.xyz/doku.php?id=programming:python:new_boto&amp;rev=1643298962&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2022-01-27T17:56:02+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>programming:python:new_boto</title>
        <link>https://hastur.tiaro.xyz/doku.php?id=programming:python:new_boto&amp;rev=1643298962&amp;do=diff</link>
        <description>New boto3 project:
mkdir new_proj &amp;&amp; cd new_proj
python3 -m venv .venv
source .venv/bin/activate
pip install boto3
pip freeze|grep boto3 &gt; requirements.txt
після цього можна скопіювати .editorconfig, .gitignore, створити README та відкрити проєкт в PyCharm</description>
    </item>
    <item rdf:about="https://hastur.tiaro.xyz/doku.php?id=programming:python:new_project&amp;rev=1617098722&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2021-03-30T13:05:22+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>programming:python:new_project</title>
        <link>https://hastur.tiaro.xyz/doku.php?id=programming:python:new_project&amp;rev=1617098722&amp;do=diff</link>
        <description>Template


#!/usr/bin/env python3
# coding: utf-8
 
import sys
import argparse
import time
import logging
import locale

LOG_LEVEL = logging.DEBUG


def do():
    pass


def main(**kwargs):
  logger = _get_logger(name=__file__)
  start = time.time()
  logger.info(&quot;Script execution STARTED.&quot;)
  try:
      defined_params = {k: v for k, v in kwargs.items() if v is not None}
      file_name = defined_params.pop(&quot;input_file&quot;, &quot;text.txt&quot;)
      do()
  except Exception as e:
      logger.error(f&quot;Script…</description>
    </item>
    <item rdf:about="https://hastur.tiaro.xyz/doku.php?id=programming:python:pip&amp;rev=1524144763&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2018-04-19T16:32:43+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>programming:python:pip</title>
        <link>https://hastur.tiaro.xyz/doku.php?id=programming:python:pip&amp;rev=1524144763&amp;do=diff</link>
        <description>Установка pip

Самый простой способ - поставить менеджером пакетов:
sudo apt install python3-pip
Или вот еще так:
python3 -m ensurepip --default-pip
Вывести список установленных пакетов</description>
    </item>
    <item rdf:about="https://hastur.tiaro.xyz/doku.php?id=programming:python:secret_key&amp;rev=1651489775&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2022-05-02T14:09:35+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>programming:python:secret_key</title>
        <link>https://hastur.tiaro.xyz/doku.php?id=programming:python:secret_key&amp;rev=1651489775&amp;do=diff</link>
        <description>Генерація secret key

Інколи треба використовувати секретний ключ - для хешей, Flask тощо.

Із документації Flask: 
python3 -c 'import secrets; print(secrets.token_hex())'
----------

Трішки гірший спосіб:</description>
    </item>
    <item rdf:about="https://hastur.tiaro.xyz/doku.php?id=programming:python:venv&amp;rev=1652430420&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2022-05-13T11:27:00+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>programming:python:venv</title>
        <link>https://hastur.tiaro.xyz/doku.php?id=programming:python:venv&amp;rev=1652430420&amp;do=diff</link>
        <description>Начиная с версии 3.5 виртуальные среды рекомендуется создавать с помощью venv (входит в стандартную поставку Питона).
python3 -m venv /path/to/new/virtual/environment</description>
    </item>
</rdf:RDF>
