我跟随路线。
1)事件的细节
app.get("/admin/events/:id", function(request, response, next) {
我也希望
2)活动日期列表
app.get("/admin/events/days", function(request, response, next) {
当我打电话时,第一条路线被执行,因为它将GET /admin/events/days
解释为/admin/events/:id
我尝试使用REST约定,因为设计事件包含天数(日期等)
请告知上述案例的解决方案和其他命名约定。
答案 0 :(得分:1)
如果您想保留命名约定,可以执行以下操作:
from collections import Counter
import re
dgWords = re.findall(r'\w+', open('test.txt').read().lower())
f = open('test2.txt', 'rb')
sWords = [line.strip() for line in f]
print(len(dgWords));
for sWord in sWords:
print (sWord)
print (dgWords)
while sWord in dgWords: dgWords.remove(sWord)
print(len(dgWords));
mostFrequentWord = Counter(dgWords).most_common(1)
print (mostFrequentWord)