python學習中遇到的問題
阿新 • • 發佈:2019-05-11
def contract_str():
index = 8
db_size = 8
new_table_name = 'b''_'+str(index & (db_size-1))
print new_table_name
ImportError: No module named mysql.connector
import mysql.connector as sql_connector
Python儲存時提示“SyntaxError: Non-ASCII character '\xe8' in file”
# -*- coding: utf-8 -*-
IOError: [Errno 21] Is a directory: 'logs/a/a'
沒有指定檔案或目錄名稱
logging自定義
https://cloud.tencent.com/developer/article/1354396
判斷檔案是否存在的方法
https://www.cnblogs.com/jhao/p/7243043.html
python獲取同級資料夾名
os.path.join(os.path.dirname(os.getcwd()), dir_path)
python 中的迴圈
for a in rang(10):
python 中join的用法
https://www.cnblogs.com/jsplyy/p/5634640.html
python 中數字轉字串