我正在为我写过的金字塔应用程序提供相当大的文件.我唯一的问题是下载经理不想玩得好.
我无法获得简历下载或分段以使用DownThemAll等下载管理器.
size = os.path.getsize(Path + dFile)
response = Response(content_type='application/force-download', content_disposition='attachment; filename=' + dFile)
response.app_iter = open(Path + dFile, 'rb')
response.content_length = size
Run Code Online (Sandbox Code Playgroud)
我认为问题可能存在,paste.httpserver但我不确定.
我想要一个文件夹中的所有文本文档的批处理脚本.这是我到目前为止所管理的:
@ECHO off
title Test
set dir1=C:\Users\Family\Desktop\Example
:Start
cls
echo 1. test loop
echo 2. Quit
set /p choice=I choose (1,2):
if %choice%==1 goto test
if %choice%==2 exit
:test
cls
echo running loop test
FOR %%n in (%dir1% *.txt) DO echo %dir1%\%%n
echo Done
pause
Run Code Online (Sandbox Code Playgroud)
我想输出的是:
running loop test
C:\Users\Family\Desktop\Example\doc 1.txt
C:\Users\Family\Desktop\Example\doc 2.txt
Done
Run Code Online (Sandbox Code Playgroud)
但我明白了:
running loop test
C:\Users\Family\Desktop\Example\C:\Users\Family\Desktop\Example
C:\Users\Family\Desktop\Example\doc 1.txt
C:\Users\Family\Desktop\Example\doc 2.txt
Done
Run Code Online (Sandbox Code Playgroud) 出于某种原因,我无法让python找到cairo.
当我做./waf配置我得到了
Setting top to : /home/user/pycairo/py2cairo-1.10.0
Setting out to : /home/user/pycairo/py2cairo-1.10.0/build_directory
./configure()
Checking for 'gcc' (c compiler) : ok
Checking for program python : /usr/bin/python
Checking for python version : (2, 7, 2, 'final', 0)
Checking for library python2.7 : yes
Checking for program python2.7-config : /usr/bin/python2.7-config
Checking for header Python.h : yes
Checking for program pkg-config : /usr/bin/pkg-config
Checking for 'cairo' >= 1.10.0 : yes
Configuration:
PREFIX : /usr/local
LIBDIR : /usr/local/lib
Run Code Online (Sandbox Code Playgroud)
接下来我跑了./waf install.
试着
import cairo
ImportError: …Run Code Online (Sandbox Code Playgroud) 我试图通过HTML标签进行排序,我似乎无法做到正确.
到目前为止我做了什么
import urllib
import re
s = raw_input('Enter URL: ')
f = urllib.urlopen(s)
s = f.read()
f.close
r = re.compile('<TAG\b[^>]*>(.*?)</TAG>',)
result = re.findall(r, s)
print(result)
Run Code Online (Sandbox Code Playgroud)
我用标签代替"TAG"的地方.
提前致谢.