栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

自动开启网页 程序 文件 档案

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

自动开启网页 程序 文件 档案

Private Sub CommandButton2_Click()'开启网页
    Shell "C:Program FilesInternet ExplorerIEXPLORE.EXE www.runoob.com/python/python-intro.html", vbNormalFocus
End Sub


Private Sub CommandButton2_Click()'调用外部程序
     Shell "D:Anacondapython.exe D:我的python语音.py", vbNormalFocus
End Sub



Private Sub CommandButton3_Click()'调用Python发送邮件
Shell "python D:我的python新.py", vbNormalFocus
End Sub
Private Sub CommandButton3_Click()'开启程序微信
Shell "C:Program Files (x86)TencentWeChatWeChat.exe", vbNormalFocus
End Sub
    With CreateObject("internetexplorer.application")
        .Visible = True
        .Navigate "https://www.baidu.com/s?wd=扯乎"
'关闭网页
'       .Quit
    End With
EXCEL表格函数打开应用程序
如果是在工作表里,我们可以使用该函数:
=HYPERLINK("C:WindowsSystem32calc.exe","打开计算器")



Dim Program As String
Dim TaskId As Double

Program = "calc.exe"   ' 计算器
On Error Resume Next   '遇到错误,继续执行下面语句
AppActivate "计算器"    ' 这里是应用程序面板的标题titile
If Err <> 0 Then   ' 如果没有捕捉到‘计算器’程序,则err不等于0
    Err = 0
    TaskId = shell(Program, 1)    ' 打开计算器
    If Err <> 0 Then MsgBox "无法打开计算器"
End If
Private Sub CommandButton9_Click()'开启文件夹
 Shell "explorer.exe D:我的python", vbNormalFocus
End Sub

Private Sub CommandButton11_Click()

Workbooks.Open Filename:="C:UsersAdministratorDesktop证件登记.xlsm"

End Sub


import cv2#摄像头拍照片
cap = cv2.VideoCapture(0)
   # 获得图片
ret, frame = cap.read()
    # 展示图片
#cv2.imshow("captur", frame)
cv2.imwrite("captura.jpg", frame)
cap.release()
cv2.destroyAllWindows()

import cv2#人脸识别

cap = cv2.VideoCapture(0)

while(True):
    # Capture frame-by-frame
    ret, frame = cap.read()

    # Our operations on the frame come here
    gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)

    xmlfile = r'D:AnacondaLibsite-packagescv2datahaarcascade_frontalface_default.xml'

    face_cascade = cv2.CascadeClassifier(xmlfile)

    faces = face_cascade.detectMultiScale(
        gray,
        scaleFactor=1.15,
        minNeighbors=5,
        minSize=(5, 5),
    )
    print("发现{0}个目标!".format(len(faces)))
    for (x, y, w, h) in faces:
        cv2.rectangle(frame, (x, y), (x + w, y + w), (0, 255, 0), 2)

    cv2.imshow("frame", frame)
    # Display the resulting frame
    if cv2.waitKey(1) & 0xFF == ord('q'):
        break

# When everything done, release the capture
cap.release()
cv2.destroyAllWindows()

Sub 宏4()
'
' 宏4 宏
'

'
    ActiveWorkbook.Worksheets.Add
    With ActiveSheet.QueryTables.Add(Connection:= _
        "URL;https://m.sz.pegatroncorp.com/ASSA/Modules/Login/Login.aspx", Destination:= _
        Range("$A$1"))
    
        .Name = "www.so.com"
        .FieldNames = True
        .RowNumbers = False
        .FillAdjacentFormulas = False
        .PreserveFormatting = True
        .RefreshOnFileOpen = False
        .BackgroundQuery = True
        .RefreshStyle = xlInsertDeleteCells
        .SavePassword = False
        .SaveData = True
        .AdjustColumnWidth = True
        .RefreshPeriod = 1
        .WebSelectionType = xlEntirePage
        .WebFormatting = xlWebFormattingNone
        .WebPreFormattedTextToColumns = True
        .WebConsecutiveDelimitersAsOne = True
        .WebSingleBlockTextImport = False
        .WebDisableDateRecognition = False
        .WebDisableRedirections = False
        .Refresh BackgroundQuery:=False
    End With
End Sub
import tkinter#时钟
import time

def gettime():
    timestr = time.strftime("%H:%M:%S")     # 获取当前时间并转换为字符串
    lb.configure(text = timestr)            # 重新设置标签文本
    root.after(1000, gettime)               # 每隔1S调用函数 gettime 自身获取时间

root = tkinter.Tk()
root.title('时钟')

lb = tkinter.Label(root, text = '', fg = 'blue', font = ("黑体", 80))
lb.pack()
gettime()
root.mainloop()

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/1002501.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号