你在瀏覽器調(diào)試一下試試,我之前用的時候沒出想過這種情況。有可能是你static路徑配置的問題。
你可以看看我寫的這篇文章——https://www.os373.cn/article/63
for i in open('score.txt', 'r'):
list1=i.split()
tuple1=tuple(list1)
print(tuple1)
open_tmp=open('score.txt', 'r')
key_tmp=open_tmp.readline()
key1=key_tmp.split()
stu_info = []
for i2 in open_tmp:
key2=i2.split()
zip_put=dict(zip(key1,key2))
stu_info.append(zip_put)
def three():
score = []
m_score = []
f_score = []
for dct in stu_info:
sco = dct['score']
score.append(sco)
if dct['sex'] == 'm':
sc_m = dct['score']
m_score.append(sc_m)
if dct['sex'] == 'f':
sc_f = dct['score']
f_score.append(sc_f)
# 最高分學(xué)生
for stu in stu_info:
if stu['score'] == max(score):
print(stu)
# 最低分學(xué)生
for stu in stu_info:
if stu['score'] == min(score):
print(stu)
def avg(score):
sum = 0
for i in score:
sum += int(i)
avg = sum/len(score)
return avg
# 平均分
print(avg(score))
print(avg(m_score))
print(avg(f_score))
three()
def four():
# 編輯
with open("score.txt","r",encoding="utf-8") as f:
lines = f.readlines()
with open("score.txt","w",encoding="utf-8") as f_w:
for line in lines:
if "舊內(nèi)容" in line:
line = line.replace("舊內(nèi)容", '新內(nèi)容')
f_w.write(line)
# 增加
with open("score.txt","r",encoding="utf-8") as f:
lines = f.readlines()
with open("score.txt","w",encoding="utf-8") as f_w:
f_w.write('新增內(nèi)容')
# 刪除信息
with open("score.txt","r",encoding="utf-8") as f:
lines = f.readlines()
with open("score.txt","w",encoding="utf-8") as f_w:
for line in lines:
if "你要刪的學(xué)生" in line:
continue
f_w.write(line)
four()
你確定 JSON 數(shù)據(jù)里都是字符串類型嗎?試試用回原生類型:
data = {'requestType':'3',
'quoteBeginTime':'2018-07-12',
'quoteEndTime':'2018-07-13',
'supplierSign': False,
'newQuality': False,
'newAutoQuote': False,
'inquiryTimesDesc': False,
'page': 1,
'pageSize': 20,
'orderBy': 0,
'ordered': False
}FundList_parse的代碼呢,只看到了FundIndex_parse
非常感謝,我昨天洗腳時突然想到了漏了一步,我只改了nginx文件下site-available,忘記改site-enabled文件下的配置,但是我有一點不明白是,在根目錄下指定urls的意思是什么?代碼如下
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
url_patterns += staticfiles_urlpatterns
因為我將其注釋掉重啟nginx
sudo nginx service reload
admin樣式仍然生效。所以我也不知道這一步是在干嘛?求解
SubTurnExport 在http://piccache.cnki.net/kdn/... 里,在你獲取的js里搜索就行了
this.$slots.default
this.$slots.name
this.$slots
兩種都可以,附上草案:
The label represents a caption in a user interface. The caption can be associated with a specific form control, known as the label element’s labeled control, either using for attribute, or by putting the form control inside the label element itself.round( 1503.8700000000001, 2)
對你需要設(shè)精度的列遍歷就行了
根據(jù)錯誤是卡到Android 系統(tǒng)變量的問題!
Laravel 的中間件里是不能直接返回視圖的,要使用 response 的 view 方法反回。
return response()->view('error_page');多線程應(yīng)該是這么操作的
#coding:utf-8
from multiprocessing.dummy import Pool #這里使用協(xié)程而不是線程,根據(jù)自己的情況選擇,協(xié)程可以開更多的thread
import time
def callback(result): # 回調(diào)
print result
def dealer(name): # 處理函數(shù)
time.sleep(3) # do some heavy job
return name
pool = Pool(20) # 準備一個20個thread的線程池
p = ["task1","task2","taskn"] # n個任務(wù)
for task in p:
pool.apply_async(dealer,(task,),callback=callback)
pool.close()
pool.join()
關(guān)鍵在join方法,這個方法是用來阻塞進程,保證多線程執(zhí)行完畢的,你每循環(huán)到一個任務(wù),就初始化一個線程池,并且阻塞到這個任務(wù)結(jié)束,其他的任務(wù)并沒有同時開始執(zhí)行,到下次循環(huán)才會開始另一個任務(wù).
Pool只應(yīng)該初始化一次,你的代碼里,在for循環(huán)中反復(fù)初始化Pool,并且調(diào)用join方法阻塞了程序,實際上你的代碼還是單線程在跑.
把我這個例子寫成你的風格就是
#coding:utf-8
from multiprocessing.dummy import Pool #這里使用協(xié)程而不是線程,根據(jù)自己的情況選擇,協(xié)程可以開更多的thread
import time
def callback(result): # 回調(diào)
print result
def dealer(name): # 處理函數(shù)
time.sleep(3) # do some heavy job
return name
p = ["task1","task2","taskn"] # n個任務(wù)
for task in p:
pool = Pool(20) # 準備一個20個thread的線程池
pool.apply_async(dealer,(task,),callback=callback)
pool.close()
pool.join()
這兩段代碼都可以直接復(fù)制出來跑,你感受一下就明白了.
你應(yīng)該把請求的Accept設(shè)置成application/octet-stream.
這其實有的奇怪, 因為一般情況下 Excel 文件的 Accept 是application/vnd.ms-excel.
但是由于 flasgger 是使用 swagger-ui 作為前端, 而 Swagger 發(fā)送文件類請求是使用 superagent, 使用的是 blob 技術(shù), 需要設(shè)置 xhr 的 ResponseType 為blob.
我們看flasgger_static/lib/http.js:
if(this.binaryRequest(accept)) {
r.on('request', function () {
if(this.xhr) {
this.xhr.responseType = 'blob';
}
});
}
SuperagentHttpClient.prototype. binaryRequest = function (accept) {
if(!accept) {
return false;
}
return (/^image/i).test(accept)
|| (/^application\/pdf/).test(accept)
|| (/^application\/octet-stream/).test(accept);
};
只在 Accept 匹配為image/i,/^application\/pdf/,/^application\/octet-stream/, 才將 responseType 設(shè)置成 blob
所以要么將/^application\/vnd.ms-excel/這個匹配加入http.js, 要么將發(fā)送的請求全部設(shè)置成application/octet-stream.
也就是這樣設(shè)置produces:app.py:
@app.route('/excel')
def excel():
"""
---
produces:
application/octet-stream
responses:
200:
description: description_text
schema:
type: file
"""
save_path = 'demo.xls'
response = make_response(send_file(save_path))
response.headers['Content-Disposition'] = 'attachment; filename=demo.xls'
return response
比如現(xiàn)在的目錄結(jié)構(gòu):
demo.py:
apidocs頁面:
不會python
1.segmentfault可以上傳圖片
2.創(chuàng)建好項目后,svn會自動生成鏈接
最后的解決辦法是調(diào)整swipe()里面的t取值為140左右可以滑倒比較后面。但是要滑到底部還是不夠
pycharm 是基于圖形界面的,沒有 desktop 的 Linux 服務(wù)器是無法運行 pycharm 的。
調(diào)試的時候加個no-cache,上線再去了?正常來講資源不應(yīng)該是有版本號或者hash的嗎。
不過你ctrl+f5應(yīng)該也能直接強制重新請求呀。
北大青鳥APTECH成立于1999年。依托北京大學(xué)優(yōu)質(zhì)雄厚的教育資源和背景,秉承“教育改變生活”的發(fā)展理念,致力于培養(yǎng)中國IT技能型緊缺人才,是大數(shù)據(jù)專業(yè)的國家
達內(nèi)教育集團成立于2002年,是一家由留學(xué)海歸創(chuàng)辦的高端職業(yè)教育培訓(xùn)機構(gòu),是中國一站式人才培養(yǎng)平臺、一站式人才輸送平臺。2014年4月3日在美國成功上市,融資1
北大課工場是北京大學(xué)校辦產(chǎn)業(yè)為響應(yīng)國家深化產(chǎn)教融合/校企合作的政策,積極推進“中國制造2025”,實現(xiàn)中華民族偉大復(fù)興的升級產(chǎn)業(yè)鏈。利用北京大學(xué)優(yōu)質(zhì)教育資源及背
博為峰,中國職業(yè)人才培訓(xùn)領(lǐng)域的先行者
曾工作于聯(lián)想擔任系統(tǒng)開發(fā)工程師,曾在博彥科技股份有限公司擔任項目經(jīng)理從事移動互聯(lián)網(wǎng)管理及研發(fā)工作,曾創(chuàng)辦藍懿科技有限責任公司從事總經(jīng)理職務(wù)負責iOS教學(xué)及管理工作。
浪潮集團項目經(jīng)理。精通Java與.NET 技術(shù), 熟練的跨平臺面向?qū)ο箝_發(fā)經(jīng)驗,技術(shù)功底深厚。 授課風格 授課風格清新自然、條理清晰、主次分明、重點難點突出、引人入勝。
精通HTML5和CSS3;Javascript及主流js庫,具有快速界面開發(fā)的能力,對瀏覽器兼容性、前端性能優(yōu)化等有深入理解。精通網(wǎng)頁制作和網(wǎng)頁游戲開發(fā)。
具有10 年的Java 企業(yè)應(yīng)用開發(fā)經(jīng)驗。曾經(jīng)歷任德國Software AG 技術(shù)顧問,美國Dachieve 系統(tǒng)架構(gòu)師,美國AngelEngineers Inc. 系統(tǒng)架構(gòu)師。