LoginSignup
0
0

More than 1 year has passed since last update.

誰かに役立つかもしれない自分専用忘備録

Last updated at Posted at 2021-12-16

MySQL

ログイン

  • mysql -u youraccount
  • mysql -u youraccout password=password

基本コマンド

データベース変更
use *databese*;
パスワード変更
set password for *user*@localhost=password('*password*');
ユーザー一覧表示
select host,user from mysql.user;

Python

非同期処理

threadingによる監視処理

hello_threading.py
# -*- coding: utf-8 -*-
import threading
import time

def anlyze():
    print('  + Calculation start...')
    time.sleep(10)
    print('  + Calculation end...')
    return 0 

def check():
    print('    - CheckInn...')
    while thread1.is_alive():
        print('      :Checking...')
        time.sleep(2)
    print('    - CheckOut...')
    return 0

print('* Process start...')
thread1 = threading.Thread(target= anlyze)
thread2 = threading.Thread(target= check)
thread1.start()
thread2.start()
thread1.join()
thread2.join()
print('* Process end...')

Django

基本コマンド

プロジェクト作成
django-admin startproject ProjectName
アプリケーション作成
python manage.py startapp ApplicationName
サーバ起動
python manage.py runserver {8080}

VScode

venv(Python)で作成した仮想環境を利用する方法

Ctrl + Shft + 'Python: Select interpreter... -> [仮想環境のpython.exe]を指定

0
0
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0