小技能(二) python3关于urllib中urlopen报错问题的解决 cmd新建、删除文件和文件夹

原文链接: http://www.cnblogs.com/King-boy/p/10871048.html

运行命令框

运行Python

接着import(库名)

最后help(库名)

python3关于urllib中urlopen报错问题的解决

00x1 问题的出现

00x2 问题的解决途径

    我们先来看下官方文档的解释:

[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.)  


  也就是说官方3.0版本已经把urllib2,urlparse等五个模块都并入了urllib中,也就是整合了。

00x3 正确的使用方法

 

cmd新建、删除文件和文件夹

新建文件夹和文件

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

猜你喜欢

转载自blog.csdn.net/weixin_30344131/article/details/95028328
今日推荐