小编Nai*_*ive的帖子

354
推荐指数
5
解决办法
59万
查看次数

10
推荐指数
1
解决办法
2万
查看次数

使用 easy_install 安装“请求”

我正在尝试使用 easy_install 安装“请求模块”,但出现以下错误:

$ sudo easy_install requests
Processing requests
error: Not a recognized archive type: requests
Run Code Online (Sandbox Code Playgroud)

如果我尝试使用pip则会出现以下错误:

$ pip install requests
Unknown or unsupported command 'install'
Run Code Online (Sandbox Code Playgroud)

python

5
推荐指数
1
解决办法
3万
查看次数

为什么我的 Python 脚本会因语法错误而失败?

在运行下面的简单 Python 程序时,出现以下错误:

./url_test.py: line 2: syntax error near unexpected token `('                  
./url_test.py: line 2: `response = urllib2.urlopen('http://python.org/')'
Run Code Online (Sandbox Code Playgroud)
import urllib2      
response = urllib2.urlopen('http://python.org/')  
print "Response:", response

# Get the URL. This gets the real URL. 
print "The URL is: ", response.geturl()

# Getting the code
print "This gets the code: ", response.code

# Get the Headers. 
# This returns a dictionary-like object that describes the page fetched, 
# particularly the headers sent by the server
print "The Headers are: ", …
Run Code Online (Sandbox Code Playgroud)

python command-line

4
推荐指数
2
解决办法
2万
查看次数

从目录中读取所有文件

以下代码是读取下载目录中的所有文件,但是当我执行此代码时,它不会打印(显示),此代码有什么问题..?

import glob   
path = '/home/mypc/download/*.html'   
files=glob.glob(path)   
for file in files:     
    f=open(file, 'r')  
    f.readlines()   
    f.close() 
Run Code Online (Sandbox Code Playgroud)

python directory

4
推荐指数
1
解决办法
15万
查看次数

我的系统中不存在 vmware-vdiskmanager

我正在使用 Ubuntu 12.04 并尝试扩展分配给 Linux 虚拟机的大小,但我找不到vmware-vdiskmanager或找不到任何安装vmware-vdiskmanager. 谁能告诉我如何安装vmware-vdiskmanager或链接下载它...?

vmware disk 12.04

4
推荐指数
2
解决办法
2万
查看次数

如何将 url 作为变量传递给 wget ..?

我正在尝试通过传递使用 python 保存 url 的变量来使用 wget 下载页面,但它没有用。

url=http://www.example.com/support/security/


os.system("wget -P download url")
Run Code Online (Sandbox Code Playgroud)

任何人都可以指定这有什么问题......?

python wget

3
推荐指数
1
解决办法
7845
查看次数

Ubuntu 14.04:子进程 dpkg-deb --control 返回错误退出状态

我正在尝试进行“升级”并出现以下错误。

$sudo apt upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following package was automatically installed and is no longer required:
  notepadqq-common
Use 'apt-get autoremove' to remove it.
The following packages will be upgraded:
  fonts-opensymbol
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/110 kB of archives.
After this operation, 1,024 B of additional disk space will be used.
Do you want to continue? …
Run Code Online (Sandbox Code Playgroud)

upgrade package-management apt dpkg

3
推荐指数
1
解决办法
2万
查看次数

“磁盘正常,过去有一个属性失败”是什么意思?

我已经在旧系统上安装了新的希捷硬盘并安装了 Ubuntu 14.04。我使用检查磁盘状态gksudo gnome-disks并得出Disk is OK, one attribute failed in the past. 我没有得到此消息的任何正确链接。有人能说出这是什么意思吗?

partitioning hard-drive 14.04

3
推荐指数
1
解决办法
7318
查看次数