小编Anu*_*rag的帖子

Python:使用包含子字符串的单词拆分字符串

我有绳子text = "Fix me a meeting in 2 days"。我有一些话的清单meetingStrings"meet"在那里meetingStrings。因此,我必须通过开会来拆分案文。

所需输出:

2天内

meetingStrings = [
    "appointment",
    "meet",
    "interview"
]
text = "Fix me a meeting in 2 days"
for x in meetingStrings:
    if x in text.lower(): 
        txt = text.split(x, 1)[1]
        print(txt)
Run Code Online (Sandbox Code Playgroud)

这给出了输出:

在2天之内。

python regex string split python-3.x

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

Heroku 节点 js 部署问题:Web 进程未能在启动后 60 秒内绑定到 $PORT

我正在尝试通过在 Heroku 上部署它来测试示例节点 js 应用程序。我使用 mlab 作为我的数据库云托管。

但不幸的是,我遇到了一些错误。这是 Heorku 的错误日志:

2018-07-21T16:43:00.394188+00:00 heroku[web.1]: State changed from crashed to starting
2018-07-21T16:43:03.124528+00:00 heroku[web.1]: Starting process with command `npm start`
2018-07-21T16:43:06.239097+00:00 app[web.1]: 
2018-07-21T16:43:06.239139+00:00 app[web.1]: > quizgiri@1.0.0 start /app
2018-07-21T16:43:06.239141+00:00 app[web.1]: > node app.js
2018-07-21T16:43:06.239142+00:00 app[web.1]: 
2018-07-21T16:43:08.063152+00:00 app[web.1]: listening on port 3000 ...... 
2018-07-21T16:44:03.476862+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2018-07-21T16:44:03.476977+00:00 heroku[web.1]: Stopping process with SIGKILL
2018-07-21T16:44:03.631909+00:00 heroku[web.1]: Process exited with status 137 …
Run Code Online (Sandbox Code Playgroud)

deployment heroku node.js mlab

0
推荐指数
1
解决办法
2022
查看次数

标签 统计

deployment ×1

heroku ×1

mlab ×1

node.js ×1

python ×1

python-3.x ×1

regex ×1

split ×1

string ×1