Small skills (b) python3 on urllib urlopen error in problem solving cmd create, delete files and folders

Original link: http://www.cnblogs.com/King-boy/p/10871048.html

Run command box

Run Python

Then import (library name)

Finally, help (library name)

About urllib python3 solve the problem of error in urlopen

Problems arise 00x1

 

00x2 problem solving approach

    We first look at the official documentation to explain:

 

[html] view plain  copy
 
 
 
 
  1. a new urllib package was created. It consists of code from  
  2. urllib, urllib2, urlparse, and robotparser. The old  
  3. modules have all been removed. The new package has five submodules:  
  4. urllib.parse, urllib.request, urllib.response,  
  5. urllib.error, and urllib.robotparser. The  
  6. urllib.request.urlopen() function uses the url opener from  
  7. urllib2. (Note that the unittests have not been renamed for the  
  8. beta, but they will be renamed in the future.)  


  That official 3.0 version has been put urllib2, urlparse five modules are incorporated urllib, that is integrated.

 

00x3 correct use

 

 

 

cmd create, delete files and folders

New folders and files

cd .. 返回上一级
md test 新建test文件夹
md d:\test\my d盘下新建文件夹
cd test 进入test文件夹
cd.>cc.txt 新建cc.txt文件
dir 列出文件夹下所有文件及文件夹
删除文件夹和文件

cd test 进入test文件夹
dir 查看所有文件目录
del a.txt 删除a.txt的文件
del *.txt 删除所有后缀为.txt的文件
rd test 删除名为test的空文件夹
rd /s D:\test 删除D盘里的test文件夹 会出现如下 test, 是否确认(Y/N)? 直接输入 Y 在回车
rd test/s 删除此文件夹下的所有文件 test, 是否确认(Y/N)? 直接输入 Y 在回车
d

转载于:https://www.cnblogs.com/King-boy/p/10871048.html

Guess you like

Origin blog.csdn.net/weixin_30344131/article/details/95028328