Python相關文章索引(14) 基本常識 Debug P.K. 實戰演練

基本常識

  1. python中的左位移和右位移
  2. 利用Python在一個文件的頭部插入數據
with open(path, "r+") as f:
     old = f.read()
     f.seek(0)
     f.write(data)
     f.write(old)

Debug

  1. xpath中遇到<Element a at 0x39a9a80>
  2. AttributeError: 'dict' object has no attribute 'iteritems'

Python3.5中:iteritems變爲items

  1. 【Python】ufunc 'subtract' did not contain a loop with signature matching types dtype
  2. Pycharm 下Non-ASCII character '\xe5' in file.. 解決辦法
# -*- coding: utf-8 -*-:
  1. Python mysqldb執行execute時出現InterfaceError: (0, '')

P.K.

  1. Python中下劃線的5種含義
  2. python 單下劃線及雙下劃線使用總結
  3. python中open()函數中可選參數w,w+和a,a+的區別

實戰演練

Python mysql表數據和json格式的相互轉換

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章