且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

我可以使用python吗???

更新时间:2022-04-01 16:55:49

顺便说一句,我得到了firefox打开并访问了一些网页和winamp

正在运行..


以下代码

----------

导入os

导入os.path

导入子流程
>
#网页

ffox_exe = r''C:\程序文件\ Mozilla Firefox \ firefox.exe''

断言os.path .exists(ffox_exe)

#open gmail

url =" http://www.gmail.com"

child = subprocess。 Popen((ffox_exe,url),executable = ffox_exe)

rc = child.wait()


#Winamp

wamp_exe = r''C:\Program Files \Winamp \winamp.exe''

断言os.path.exists(wamp_exe)

url =" http ://64.236.34.97:80 / stream / 1040"

child = subprocess.Popen((wamp_exe,url),executable = wamp_exe)


------------


现在无论如何我可以输入用户名和密码,然后点击

好​​吧..(不适用于gmail,但适用于需要

loggin的其他类似网页).. ??


如何打开页面在标签.. ??


San

btw i got the firefox to open and access some webpage and winamp
running ..

code below
----------
import os
import os.path
import subprocess

# Web pages
ffox_exe = r''C:\Program Files\Mozilla Firefox\firefox.exe''
assert os.path.exists(ffox_exe)
# open gmail
url = "http://www.gmail.com"
child = subprocess.Popen( (ffox_exe, url), executable = ffox_exe)
rc = child.wait()

# Winamp
wamp_exe = r''C:\Program Files\Winamp\winamp.exe''
assert os.path.exists(wamp_exe)
url = "http://64.236.34.97:80/stream/1040"
child = subprocess.Popen( (wamp_exe, url), executable = wamp_exe)

------------

now is there anyway i can enter user name and password and then click
okay .. (not for gmail but for other similar webpages which require
loggin) .. ??

how to open pages in tabs .. ??

San


对于初学者,你需要os和webbrowser模块


导入os

导入webbrowser


webbrowser.open(" http://mail.google.com/邮件")


#需要知道用于启动应用程序的shell关键字

os.system(''start''+''Winword'')


#相当于双击文档或文件

os.startfile(" c:/MyFiles/MyTextFile.txt")


如果你真的想登录受密码保护的网站,它会快速获得
(超出我的范围)。您可以通过仔细阅读urllib2

模块或在groups.google.com/group/comp.lang.python上搜索此列表来了解



rick

For starters, you need the os and webbrowser modules

import os
import webbrowser

webbrowser.open("http://mail.google.com/mail")

# need to know the shell keyword for starting the app
os.system(''start '' + ''Winword'')

# the equivalent of double-clicking on the doc or file
os.startfile("c:/MyFiles/MyTextFile.txt")

If you actually want to log onto password-protected sites it gets
gnarly fast (beyond me). You can read about by perusing the urllib2
module or search this list at groups.google.com/group/comp.lang.python

Hope this helps.

rick


为什么要使用Python?

怎么样?

1.在控制面板中打开电源选项。 (单击开始,单击控制

面板,然后双击电源选项。)

2.单击Hibernate选项卡,选择启用hibernate支持检查

框,然后单击Apply。

(如果Hibernate选项卡不可用,则您的计算机不支持

此功能。)


然后:

1:单击开始和关机,

2:指向待机按钮并按住Shift键,

3:出现一个新的休眠按钮:点击它同时仍然按住

shift键:瞧你的电脑将休眠(它的男士电脑会保存

你当前的设置并将关闭)。


Petr Jakes

Why using Python?
What about?
1. Open Power Options in Control Panel. (Click Start, click Control
Panel, and then double-click Power Options.)
2.Click the Hibernate tab, select the Enable hibernate support check
box, and then click Apply.
(If the Hibernate tab is unavailable, your computer does not support
this feature.)

then:
1: Click Start and Shut Down,
2: Point the standby button and maintain the shift key pushed,
3: A new hibernation button appears: click it while still holding the
shift key: voila your PC will hibernate (it mens computer will save
your current setting and will switch off).

Petr Jakes