1. Introduction to ExcelAn Excel file is a workbook workbook, where you can create multiple sheet sheet in a workbook, and a worksheet that contains multiple cell cells, which are made up of column rows (row), and are listed in uppercase English letters. From A to Z a total of 26 columns, and then from AA to AZ and 26 columns, and then from BA to BZ and then 26 columns and so on. Rows are represented by numbers, for example; A3 represents the first column of the third row, and E5 represents the
(unanswer_set))
Version_3
This version resolves a nan bug in set and also joins the Excel write feature, but only one table can be written at a time, so you can write two tables (sheet) by running two times. step_1
Import OS import numpy as NP import pandas as PD os.chdir (' C:\\users\\dell\\desktop ') print (' Work_directory: ', OS.GETCWD ( ) data = Pd.read_excel (' Directors and members list. xlsx ', ' Directors and Members ' list ') #1. Load E
Recently, an Iot project has a module: Air-Conditioning Control and TV control. Therefore, Windows is used. open and window. showmodaldialog. I think it will not be used frequently in the future. I just need to sort it out for you to view it later and will not forget it. I would also like to share with you!
Write the operations and code that you think are useful.
Setvalue ("iframe1", "iframediv ");
Window. Parent. Opener = NULL; // if this sentence is
Log on to the website using Python
For most forums, we need to log in first to capture the posts for analysis. Otherwise, we cannot view them.
This is because the HTTP protocol is a stateless (stateless) protocol. How does the server know whether the user requesting the connection has logged on? There are two methods:
Explicitly use the session ID in the URI;
The process of using cookies is that a cookie will be retained locally after you log on to a website. When you continue to browse the w
Window. Open is usually used to open a new window.
To obtain the control of the parent window, you can use window. opener to obtain the parent window.
However, if showmodaldialog is used, it is invalid.
If necessary, you need to modify the enabled syntax and the syntax in showmodaldialog.
To enable the syntax for the 2nd parameters, see self. The example is as follows:
VaR rc = Window. showmodaldialog (strurl, self, sfeatures );
Then there is the synt
In front of Urllib2 's simple introduction, the following is a partial urllib2 of the use of the details.
Settings for 1.Proxy
URLLIB2 uses the environment variable HTTP_PROXY to set the HTTP proxy by default.
You can use proxies if you want to explicitly control the proxy in your program and not be affected by environment variables.
Create a new test14 to implement a simple proxy demo:
Import urllib2 enable_proxy = True Proxy_handler = urllib2. Proxyhandler ({"http": ' http://some-proxy.com
Python login website details and examples, python login website details
Python logon website details and examples
For most forums, we need to log on first to capture the posts for analysis; otherwise, we cannot view them.
This is because the HTTP protocol is a Stateless (Stateless) protocol. How does the server know whether the user requesting the connection has logged on? There are two methods:
Explicitly use the Session ID in the URI;
When using cookies, a Cookie is stored locally after y
Python uses a proxy to access the server there are 3 main steps:1. Create a proxy processor Proxyhandler:Proxy_support = Urllib.request.ProxyHandler (), Proxyhandler is a class whose argument is a dictionary: {' type ': ' Proxy IP: port number '}What is handler? Handler is also known as a processor, and each handlers knows how to open URLs through a specific protocol, or how to handle various aspects of URL opening, such as HTTP redirection or HTTP cookies.2. Customize and create a opener:Opener
when writing a Python crawler, will we consider the use of cookies in addition to the exception handling of crawlers? When using cookies, have you ever wondered why you should use cookies? Let's take a look. cookies, which are data that some websites store on the user's local terminal in order to identify the user and track the session (usually encrypted) for example, some websites need to be logged in to access a page, and before you log in, you may not be allowed to crawl a page content. Then
Python writes crawlers using the Urllib2 method
Collated some of the details of Urllib2 's Use.Settings for 1.ProxyURLLIB2 uses the environment variable HTTP_PROXY to set the HTTP proxy by Default.Suppose you want to understand the control of a Proxy in a program without being affected by environment Variables. Ability to use Proxies.Create a new test14 to implement a simple proxy demo:Import urllib2 enable_proxy = True Proxy_handler = urllib2. Proxyhandler ({"http": ' http://some-pro
Python uses a proxy to access the server there are 3 main steps:1. Create a proxy processor Proxyhandler:Proxy_support = Urllib.request.ProxyHandler (), Proxyhandler is a class whose argument is a dictionary: {' type ': ' Proxy IP: port number '}What is handler? Handler is also known as a processor, and each handlers knows how to open URLs through a specific protocol, or how to handle various aspects of URL opening, such as HTTP redirection or HTTP cookies.2. Customize and create a opener:Opener
handle.The first thing you need to know about all handler's parent class Basehandler class is that he has many subclasses:
Httpdefaulterrorhandler: for handling HTTP response errors, errors throw httperror exceptions
Httpredirecthandler: for handling directed
Httpcookieprocessor: For processing cookies
Proxyhandler: Used to set proxy, default proxy is empty
Httppasswordmgr: A table for managing passwords, maintaining usernames and passwords
Httpbasicauthhandler: For
The client then requests the domain again with the correct account and password contained in the header. This is "Basic Authentication". To simplify this process, we can create aExamples of Httpbasicauthhandler and opener to use this handler.Httpbasicauthhandler uses a map called password-managed objects to handle the domain of URLs and user names and passwords. If you know what the domain is (from the authentication header sent from the server), you
, but it doesn't seem to support session(1) The simplest page accessRes=urllib2.urlopen (URL)Print Res.read ()(2) plus data to get or postdata={"name": "Hank", "passwd": "HJZ"}Urllib2.urlopen (URL, urllib.urlencode (data))(3) Plus HTTP headersheader={"user-agent": "mozilla-firefox5.0"}Urllib2.urlopen (URL, urllib.urlencode (data), header)
Use opener and handler opener = Urllib2.build_opener (handler) Ur
? Webid = 1 tid = 901 cateid = 101 "). read ()Doc = json. loads (doc)Print docPrint doc. keys ()Print doc ["msg"]Print doc ['data']Print doc ['ret ']
The time required for the first access is [Finished in 3.0 s].
The second access time is [Finished in 0.2 s].
It can be seen that the urllib module of python is cached.
A typical example of urllib/2 usage
The code is as follows:
Import urllib2Import cookielibImport urllib
Class Hi_login:Def _ init _ (self ):Cookie = cookielib. CookieJar ()Self.
checkproxy () process. It creates 10 threads, uses the map function to start these 10 threads at the same time, and finally waits for the thread to exit. Then, the data in the proxycheckedlist in the queue is processed again. These 10 threads share the same job. They read 10 HTTP proxy data (IP address, port, etc.) from a queue's proxycheckedlist ), then, the validity of the 10 pieces of data is judged iteratively. The validity judgment ideas are as follows:
Use urllib2.httpcookieprocessor () t
Recently, the project used the. NET Server control again!
It is found that the showmodaldialog method in Chrome does not display a modal dialog box. Just like opening a page, the parent window can still obtain the focus at will and open multiple forms, in addition, the returned returnvalue cannot be returned, which is always undefined. So many problems are a headache. Next we will test the latest mainstream browsers.
Browser
Supported?
Status
Ie9
○
. Opener = NULL ;//If this statement is not added, the system will prompt to close the inquiry window.;
Window. Parent. Close ();
II,Window. OpenArticle
1.Parent window operation on Child Window
Open:
VaR win = NULL;
Win = Window. Open ("open.html", "win", "width = 200, Height = 200 ");
Maximize:
//Window Maximization
Function sonmaximize ()
{
If (WIN Win. Open ! Win. Closed)
{
Win. moveTo (-4,-4 );
Win. resizeTo (screen.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.