我正在尝试按照本指南使用Google网站管理员工具
我实现了我的网址
(r'^googlece9fb428b0c84a39\.html$', lambda r: HttpResponse("google-site-verification: googlece9fb428b0c84a39.html", mimetype="text/plain")),
Run Code Online (Sandbox Code Playgroud)
但是在访问url时我收到以下错误:
NameError at /googlece9fb428b0c84a39.html
global name 'HttpResponse' is not defined
Run Code Online (Sandbox Code Playgroud) 我正在尝试使用SQLAlchemy,但是在行中:
session.save(login)
Run Code Online (Sandbox Code Playgroud)
我收到这个错误:
AttributeError: 'Session' object has no attribute 'save'
Run Code Online (Sandbox Code Playgroud)
这是我的代码:
def findOrCreateLogin(self, username, password):
login = self.findLogin(username)
if login:
return login
else:
login = DBLogin(username,password)
session.save(login)
return login
Run Code Online (Sandbox Code Playgroud) 我正试图在ios模拟器上用离子模拟我的应用程序.但是当我跑步时:
ionic build ios
ionic emulate ios
Run Code Online (Sandbox Code Playgroud)
我的应用程序没有出现在模拟器上.我该怎么办?
我正在尝试使用Goutte从这个url获取数据 但是当我尝试仅过滤具有“empresa”类的 div 时,我得到了整个页面。如何仅过滤具有特定类的 div?
这是我的代码:
<html>
<body>
<?php
require __DIR__ . '/vendor/autoload.php';
use Goutte\Client;
$client = new Client();
$crawler = $client->request('GET', 'http://sp.cadastrosindustriais.com.br/?consulta=cal%C3%A7ados');
$crawler->filter('div[id="empresa"]')->each(function ($node) {
print $node->text()."\n";
});
?>
</body>
</html>
Run Code Online (Sandbox Code Playgroud) I'm trying to use sequelize findOrCreate function, but I'm getting this error:
Error: Missing where attribute in the options parameter passed to findOrCreate.
Run Code Online (Sandbox Code Playgroud)
This is my code:
var values = { slack_id: profile.id, name: profile.user };
var selector = { where: { slack_id: profile.id } };
User.findOrCreate(values, selector)
.then(function() {
return done(err, user);
});
Run Code Online (Sandbox Code Playgroud) 我正在尝试按照本教程更新OpenSSL
我跑:
brew update && brew upgrade
brew install openssl
brew link --force openssl
sudo ln -s /usr/local/Cellar/openssl/1.0.2j/bin/openssl /usr/bin/openssl
mkdir -p /usr/local/lib
ln -s /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib /usr/local/lib/
ln -s /usr/local/opt/openssl/lib/libssl.1.0.0.dylib /usr/local/lib/
Run Code Online (Sandbox Code Playgroud)
当我检查
ls -l /usr/local/opt/openssl
Run Code Online (Sandbox Code Playgroud)
我明白了:
lrwxr-xr-x 1 Filipe admin 24 Apr 29 12:48 /usr/local/opt/openssl -> ../Cellar/openssl/1.0.2k
Run Code Online (Sandbox Code Playgroud)
但是当我跑步时:
openssl version -a
Run Code Online (Sandbox Code Playgroud)
我明白了:
-bash:openssl:找不到命令
我已经重启了终端,但没有改变.
我正在尝试from使用 boto3更改电子邮件客户端中显示的名称。但我无法做到这一点。
这是我的代码:
client = boto3.client(
'ses',
aws_access_key_id=AWS_ACCESS_KEY,
aws_secret_access_key=AWS_SECRET_KEY,
region_name='us-west-2'
)
response = client.send_email(
Destination={
'ToAddresses': [
to_address,
],
},
Message={
'Body': {
'Html': {
'Charset': 'UTF-8',
'Data': html_content,
},
'Text': {
'Charset': 'UTF-8',
'Data': 'Email formato text.',
},
},
'Subject': {
'Charset': 'UTF-8',
'Data': subject,
},
},
Source='no-reply@example.com.br',
)
Run Code Online (Sandbox Code Playgroud)
该from客户端总是因为没有答复,我如何更改为自定义名称?
我正在尝试在 Mac Sierra 中安装 TA-Lib:
须藤 pip 安装 TA-Lib
但我收到此错误:
error: command 'clang' failed with exit status 1
----------------------------------------
Command "/usr/local/opt/python/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/private/tmp/pip-build-bqV3xq/TA-Lib/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-5HBbJo-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/tmp/pip-build-bqV3xq/TA-Lib/
Run Code Online (Sandbox Code Playgroud)
我怎样才能解决这个问题?
我正在尝试使用sklearn实现SGDClassifier,但出现此错误:
ValueError: Invalid parameter loss for estimator Pipeline. Check the list of available parameters with `estimator.get_params().keys()`.
Run Code Online (Sandbox Code Playgroud)
这是我的代码:
pipeline = Pipeline([
('clf', SGDClassifier())
])
parameters = {
'seed': [0],
'loss': ('log', 'hinge'),
'penalty': ['l1', 'l2', 'elasticnet'],
'alpha': [0.001, 0.0001, 0.00001, 0.000001]
}
score_func = make_scorer(metrics.f1_score)
grid_search = GridSearchCV(pipeline, parameters, n_jobs=3,
verbose=1, scoring=score_func)
grid_search.fit(X, Y)
Run Code Online (Sandbox Code Playgroud)
我怎样才能解决这个问题?
我正在尝试在Ubuntu中安装Python Ta-Lib,但是当我运行时:
pip install TA-Lib
Run Code Online (Sandbox Code Playgroud)
我收到此错误:
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-YfCSFn/TA-Lib/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-swmI7D-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-YfCSFn/TA-Lib/
Run Code Online (Sandbox Code Playgroud)
我已经安装了:
sudo apt-get install python3-dev
Run Code Online (Sandbox Code Playgroud)
并安装了Ta-lib
我怎样才能解决这个问题?
python ×4
javascript ×2
macos ×2
amazon-ses ×1
boto3 ×1
cordova ×1
django ×1
goutte ×1
homebrew ×1
ionic ×1
ios ×1
node.js ×1
openssl ×1
php ×1
scikit-learn ×1
sequelize.js ×1
sqlalchemy ×1
ssl ×1
ubuntu ×1