在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問答/ Python問答
陌璃 回答

你在瀏覽器調(diào)試一下試試,我之前用的時候沒出想過這種情況。有可能是你static路徑配置的問題。

忘了我 回答

1

for i in open('score.txt', 'r'):

list1=i.split()
tuple1=tuple(list1)
print(tuple1)

2

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)

3

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()

4

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
    }
殘淚 回答

非常感謝,我昨天洗腳時突然想到了漏了一步,我只改了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里搜索就行了

櫻花霓 回答
  1. slot 不具名,默認為default
    this.$slots.default
  2. slot 具名
    this.$slots.name
  3. 具體的 你可以打印出來 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.
純妹 回答

根據(jù)錯誤是卡到Android 系統(tǒng)變量的問題!

款爺 回答

Laravel 的中間件里是不能直接返回視圖的,要使用 responseview 方法反回。

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 的 ResponseTypeblob.
我們看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):

clipboard.png
demo.py:

clipboard.png
apidocs頁面:

clipboard.png

舊時光 回答

1.segmentfault可以上傳圖片
2.創(chuàng)建好項目后,svn會自動生成鏈接

絯孑氣 回答

最后的解決辦法是調(diào)整swipe()里面的t取值為140左右可以滑倒比較后面。但是要滑到底部還是不夠

我以為 回答

告訴你找不到scripy==1.1.0這個依賴項,懷疑是你鏡像的倉庫沒有同步完全,改成官方倉庫安裝試試,應(yīng)該是你鏡像的有問題

莓森 回答

pycharm 是基于圖形界面的,沒有 desktop 的 Linux 服務(wù)器是無法運行 pycharm 的。

糖豆豆 回答

調(diào)試的時候加個no-cache,上線再去了?正常來講資源不應(yīng)該是有版本號或者hash的嗎。
不過你ctrl+f5應(yīng)該也能直接強制重新請求呀。