A. eric6.0 可以用於python2.7嗎
Python 2.7 +PyQt4+Eric6搭建
網上大家抄來抄去的那些東西我就不吐槽了,各種進行不下去,各種不成功。
一下都是我親自實踐得來的,按照我的步驟,確保可以成功。
一、環境:
win7 x64
二、所需軟體
1.Python2.7.10(鏈接:https:///ftp/python/2.7.10/python-2.7.10.amd64.msi)
2.PyQt4-4.11.4(鏈接:/projects/pyqt/files/PyQt4/PyQt-4.11.4/PyQt4-4.11.4-gpl-Py2.7-Qt4.8.7-x64.exe)
3.Eric6(鏈接:/project/eric-ide/eric6/stable/6.0.6/eric6-6.0.6.zip)
4.Eric6-i18n-zh_CN.GB.6 (漢化包)(鏈接:/project/eric-ide/eric6/stable/6.0.6/eric6-i18n-zh_CN.GB.6.zip)
三、安裝
step1.安裝python
直接運行Python 2.7.10,下一步下一步就ok,安裝到默認的位置(C:Python27)
step2.安裝PyQt4
直接運行PyQt4-4.11.4,其中有一步是選擇python的安裝位置,如果不是C:Python27手動改一下,因為PyQt依賴python的成功安裝,下一步下一步就ok。
打開python IDEL,如果能成功導入PyQt4這個模塊說明安裝成功。
step3.安裝Eric6
其實可以先將漢化包和安裝包合並,然後安裝,我安裝的時候忘了合並,那我就先安裝,後面再漢化。
先解壓eric6-6.0.6.zip,生成eric6-6.0.6,將其到c盤根目錄,直接運行install.py,進行安裝,完成後回車退出。
step4.配置Eric6並漢化
先運行C:Python27eric6_configure.bat這個文件,進行使用前的配置。
Editor—>Autocompation—>勾選所有
QScintilla—>勾上左右的兩個選框,然後在下面source中,選擇from Document and API files.
點擊Editor—>APIs—>勾上Complie APIs Autocompation,然後在Language中,選擇python2。點面下面的Add from installed APIs按鈕,選擇住需要的.api文件
ok,基本就這些設置了,然後漢化一下。
將漢化包eric6-i18n-zh_CN.GB.6eric6-6.0.6erici18n中的所有文件拷貝到C:Python27Libsite-packageseric6i18n中,
將Interface中的Language選中中文,我截圖的時候還沒有安裝安裝包,沒顯示。
ok,可以使用了,以後直接運行C:Python27eric6.bat。
B. python 如何操作在注冊頁面有div內嵌滾動條
#encoding=utf-8
from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import Select
import time
"""滾動條操作,****把想要的元素展示在頁面看得見的地方*****"""
driver=webdriver.Chrome(executable_path="c:\\Python27\\chromedriver")
driver.get("http://www.sohu.com/")
driver.maximize_window()
#將滾動條拖到底部
js="var q=document.body.scrollTop=100000"
driver.execute_script(js)
time.sleep(2)
driver.save_screenshot("c:\\Python27\\buttom.png")
#將滾動條拖到頂部
js="var q=document.body.scrollTop=0"
driver.execute_script(js)
time.sleep(2)
driver.save_screenshot("c:\\Python27\\top.png")
#將滾動條拖動到頁面的任意位置
js="var q=document.body.scrollTop=555"
driver.execute_script(js)
time.sleep(2)
driver.save_screenshot("c:\\Python27\\mid.png")
#將滾動條拖動到需要顯示的元素的位置!!!!
target=driver.find_element("link text",u"明星八卦")
driver.execute_script("arguments[0].scrollIntoView();",target)
time.sleep(2)
driver.save_screenshot("c:\\Python27\\port.png")
C. python-docx官方文檔中文
沒有找到。
第一個:
http://python-docx.readthedocs.io/en/latest/api/table.html#id1
和http://python-docx.readthedocs.io/en/latest/api/document.html#id1
有tables返回。
第二個:
用re來解決,\d{4}\D\d{1,2}\D\d{1,2}\D ,這些匹配到的就是日期,替換成你要的。
D. 如何在Windows系統中安裝Python
在WINDOWS系統中安裝PYTHON等簡單,以下為步驟:
1、去PYTHON的官網去下載PYTHON,下載地址為:https://www.python.org/downloads/windows/,選擇需要的版本,然後再下載相應操作系統的安裝文件(32位或64位),最新版本為2.7.11和3.5.1。
2、下載完成後,雙擊執行,按提示進行安裝即可。安裝過程中可以選擇安裝路徑,以及選擇組件等,直接默認即可。