Fulltext results:
- 16 共用サーバで、pythonインストール
- 2023.07.31現在: さくらレンタルサーバの環境はFreeBSD13 <code> $ uname -a FreeBSD www1564.sakura.ne.jp 13.0-RELEASE-p12 ... ccess> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ /hello/index.cgi/$1 [QSA,... : utf-8 -*- from flask import Flask app = Flask(__name__) @app.route('/') def index(): return "Hello World!\n" if __name__ == '__main__': app.run() </code> <code|in
- 07 Python Selenium
- tc/yum.repos.d/google.chrome.repo [google-chrome] name=google-chrome baseurl=http://dl.google.com/linux/... de> # ID/PASSを入力して、ボタンクリック driver.find_element_by_name("USERID").clear() driver.find_element_by_name("USERID").send_keys("hoge") driver.find_element_by_name("PASSWORD").clear() driver.find_element_by_name("
- 08 Python 文字列リテラル(fr)
- 、 .format() を使うことなく 文字列の中に変数を埋め込むことが出来ます。 <code> name = 'King Kai' like = 'driving' print(f"My name is {name}. I like {like}.") # My name is King Kai. I like driving. </code> ===== r… raw string ===== 通常はバックスラッ
- 04 Python 並列処理
- er.setFormatter(Formatter("[%(asctime)s] [%(threadName)s] %(message)s")) logger = getLogger() lo... with ThreadPoolExecutor(max_workers=2, thread_name_prefix="thread") as executor: for i in ra... mit end") getLogger().info("main end") if __name__ == "__main__": main() </code> ===== 実行結果 =
- 05 上の階層からimport
- ==== <code|main.py> from ..conf import mod1 if __name__ == '__main__': print(mod1.MOD) </code> エラー... トパスを追加する <code|main.py> currnet_dir = os.path.dirname( os.path.abspath(__file__) ) sys.path.append(currnet_dir + '/../') from conf import mod1 if __name__ == '__main__': print(mod1.MOD) </code> {{
- 02 paramiko SSH
- _key_policy(paramiko.AutoAddPolicy()) cmd = ''' uname uptime exit ''' content_text = "" client.connect(ip='10.11.100.11', username='root', password='hogehoge') stdin, stdout, stder
- 09 Flask
- urllib.request import urllib.parse app = Flask(__name__) @app.route('/') def hello(): return "Hell... ood') def good(): return "Good" # start if __name__ == "__main__": app.run(host='0.0.0.0') </code>
- 01 PrettyTable
- ({"1","2","3"}) print(x.get_string()) if __name__ == '__main__': outputTable() </code> ====
- 10 Python retry処理
- + str(MAX_RETRY) ) return 2 # start if __name__ == "__main__": flg = retry() print('re
- 13 Python 非同期処理 asyncio
- _until_complete(gather) print(results) if __name__ == '__main__': main() </code> ===== 実行結果 =