如何urllib在Python 3中为最后一个设置代理.我正在做下一个
from urllib import request as urlrequest
ask = urlrequest.Request(url) # note that here Request has R not r as prev versions
open = urlrequest.urlopen(req)
open.read()
Run Code Online (Sandbox Code Playgroud)
我尝试添加代理如下:
ask=urlrequest.Request.set_proxy(ask,proxies,'http')
Run Code Online (Sandbox Code Playgroud)
但是,由于我收到下一个错误,我不知道它是多么正确:
336 def set_proxy(self, host, type):
--> 337 if self.type == 'https' and not self._tunnel_host:
338 self._tunnel_host = self.host
339 else:
AttributeError: 'NoneType' object has no attribute 'type'
Run Code Online (Sandbox Code Playgroud) 我有一个网络钩子机器人。它发送网络钩子消息,但它检测网络钩子消息与普通消息一样。所以它会产生垃圾邮件。
我使用discord.js版本 11.5.1
我以为这段代码会起作用,但它不起作用。
if (message.author.nickname == null) return;
Run Code Online (Sandbox Code Playgroud) 我已经创建了一个帐户npmjs。有一个Public Email领域。我写了我的电子邮件,但我有一个问题:我的电子邮件是共享的吗?我查看了我的设置,它说“这封电子邮件将被添加到您发布的包的元数据中”。其他人可以看到我的电子邮件吗?
我正在编码游戏的窗口部分。代码给出错误。我认为错误的原因是缺少GLFW库。我用于Notepad++编辑和MinGW编译。如何将库安装到我的文件夹中?
错误:
NPP_SAVE: C:\Users\User\Desktop\game\src\main.cpp
CD: C:\Users\User\Desktop\game\src
Current directory: C:\Users\User\Desktop\game\src
g++ "main.cpp" -o main -march=native -O3
Process started (PID=1568) >>>
In file included from main.cpp:4:
Display.h:7:10: fatal error: GLFW/glfw3.h: No such file or directory
#include <GLFW/glfw3.h>
^~~~~~~~~~~~~~
compilation terminated.
<<< Process finished (PID=1568). (Exit code 1)
NPP_RUN: main
; executing: NPP_RUN main
- the specified file was not found
================ READY ================
Run Code Online (Sandbox Code Playgroud) 我正在创建一个 Discord 机器人。我想通过公会 ID 创建邀请。创建邀请需要一个渠道。我想让机器人选择第一个频道。我怎样才能做到这一点?
我用了这个但没有用:
guild.channels[Object.keys(guild.channels)[0]]
//returns undefined
Run Code Online (Sandbox Code Playgroud)