<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="FeedCreator 1.8" -->
<?xml-stylesheet href="https://slightknowledge.com/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://slightknowledge.com/feed.php">
        <title>SlightKnowledge - lang:python</title>
        <description></description>
        <link>https://slightknowledge.com/</link>
        <image rdf:resource="https://slightknowledge.com/lib/exe/fetch.php?media=wiki:dokuwiki.svg" />
       <dc:date>2026-05-05T12:49:20+00:00</dc:date>
        <items>
            <rdf:Seq>
                <rdf:li rdf:resource="https://slightknowledge.com/doku.php?id=lang:python:flask&amp;rev=1774096404&amp;do=diff"/>
                <rdf:li rdf:resource="https://slightknowledge.com/doku.php?id=lang:python:pyinstaller&amp;rev=1757313666&amp;do=diff"/>
                <rdf:li rdf:resource="https://slightknowledge.com/doku.php?id=lang:python:smtplib&amp;rev=1774087967&amp;do=diff"/>
                <rdf:li rdf:resource="https://slightknowledge.com/doku.php?id=lang:python:venv&amp;rev=1756339976&amp;do=diff"/>
                <rdf:li rdf:resource="https://slightknowledge.com/doku.php?id=lang:python:wxpython&amp;rev=1755423429&amp;do=diff"/>
            </rdf:Seq>
        </items>
    </channel>
    <image rdf:about="https://slightknowledge.com/lib/exe/fetch.php?media=wiki:dokuwiki.svg">
        <title>SlightKnowledge</title>
        <link>https://slightknowledge.com/</link>
        <url>https://slightknowledge.com/lib/exe/fetch.php?media=wiki:dokuwiki.svg</url>
    </image>
    <item rdf:about="https://slightknowledge.com/doku.php?id=lang:python:flask&amp;rev=1774096404&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2026-03-21T12:33:24+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>flask</title>
        <link>https://slightknowledge.com/doku.php?id=lang:python:flask&amp;rev=1774096404&amp;do=diff</link>
        <description>Flask に関すること

インストール


sudo apt install python3-flask
sudo apt install libapache2-mod-wsgi-py3



sudo a2enmod cgid  


テスト


from flask import Flask
app = Flask(__name__)

@app.route(&#039;/&#039;)
def hello():
    hello = &quot;Hello world&quot;
    return hello

if __name__ == &quot;__main__&quot;:
    app.run(host=&#039;0.0.0.0&#039;, port=8080, debug=True)</description>
    </item>
    <item rdf:about="https://slightknowledge.com/doku.php?id=lang:python:pyinstaller&amp;rev=1757313666&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-09-08T06:41:06+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>pyinstaller</title>
        <link>https://slightknowledge.com/doku.php?id=lang:python:pyinstaller&amp;rev=1757313666&amp;do=diff</link>
        <description>pyinstaller

windows や mac で GUI アプリならば、クリックして
実行できるようにする。

共通
pyinstaller owned.py --noconsole
名前が “owned.spec” である spec ファイルを作成される。
その後は、
pyinstaller owned.spec</description>
    </item>
    <item rdf:about="https://slightknowledge.com/doku.php?id=lang:python:smtplib&amp;rev=1774087967&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2026-03-21T10:12:47+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>smtplib</title>
        <link>https://slightknowledge.com/doku.php?id=lang:python:smtplib&amp;rev=1774087967&amp;do=diff</link>
        <description>mail 送信

local ホストからメールが送信可能な場合、
以下でメールの送信が可能。


import os
import sys
import smtplib

from email.message import EmailMessage

msg = EmailMessage()

msg[&#039;Subject&#039;] = &quot;write subject&quot;  # subject
msg[&#039;From&#039;] = &quot;hoge@hogehoge&quot;     # 送信者
msg[&#039;To&#039;] = &quot;hoge@hogehoge&quot;       # 宛名 

msg.set_content(&quot;mail test&quot;)      # mail の中身

s = smtplib.SMTP(&quot;localhost&quot;)     # mail server
s.send_message(msg)
s.quit()</description>
    </item>
    <item rdf:about="https://slightknowledge.com/doku.php?id=lang:python:venv&amp;rev=1756339976&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-08-28T00:12:56+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>venv</title>
        <link>https://slightknowledge.com/doku.php?id=lang:python:venv&amp;rev=1756339976&amp;do=diff</link>
        <description>python 仮想環境 (venv)

python の仮想環境はいくつかあるが、venv は簡単に導入できる

構築

現在のディレクトリの元に、名前が “ownedVirtualName” の仮想環境を構築
python3 -m venv &quot;ownedVirtualName&quot;</description>
    </item>
    <item rdf:about="https://slightknowledge.com/doku.php?id=lang:python:wxpython&amp;rev=1755423429&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-08-17T09:37:09+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>wxpython</title>
        <link>https://slightknowledge.com/doku.php?id=lang:python:wxpython&amp;rev=1755423429&amp;do=diff</link>
        <description>wxpython


Linux/Mac/Windows で GUI アプリを！


基本

	*   インストール
	*   frame の作成
	*   レイアウト配置
	*   event と Bind

----

応用

	*  スプラッシュスクリーン

----------

TIPS

文字の中央寄せ

Mac でのボタン拡張

Mac では、wx.Button は wx.EXPAND しても縦には伸びない。
Mac の仕様らしい。</description>
    </item>
</rdf:RDF>
