web阅片系统,遇到dicom文件在文件夹不能正常读取的问题。解决方法如下:

def rep7(request):
file_path = os.path.dirname(__file__) + request.path
with open(file_path, 'rb') as file:
response = HttpResponse(file)
response['Content-Type'] = 'application/dicom'
return response

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd0 in position 140: invalid continuation byte的更多相关文章

  1. SyntaxError: (unicode error) 'utf-8' codec can't decode byte 0xd0 in position 2: invalid continuation byte

    [root@hostuser src]# python3 subprocess_popen.py File "subprocess_popen.py", line 23Syntax ...

  2. UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd0 in position 0: invalid continuation byte

    用pandas打开csv文件可能会出现这种情况,原因可能是excel自己新建一个*.csv文件时候容易出错.进入文件另存为,然后选择csv文件即可.

  3. UnicodeDecodeError: 'utf8' codec can't decode byte 0xce in position 47: invalid continuation byte

  4. UnicodeDecodeError: 'utf-8' codec can't decode byte 0xce in position 22: invalid continuation byte

    在使用python读取文本文件,一般会这样写: # -*- coding:utf-8 -*- f = open("train.txt", "r", encodi ...

  5. UnicodeDecodeError: 'utf-8' codec can't decode byte 0xce in position 52: invalid continuation byte

    代码: df_w = pd.read_table( r'C:\Users\lab\Desktop\web_list_n.txt', sep=',', header=None) 当我用pandas的re ...

  6. UnicodeDecodeError: 'utf-8' codec can't decode byte 0xef in position 99: invalid continuation byte

    Traceback (most recent call last): File "/Users/c2apple/PycharmProjects/easyToPython/fileMethod ...

  7. 【安装Python环境】之安装Selenium2时报UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc8 in position 12: invalid continuation byte问题

    问题描述: windows8.1系统,Python3环境安装Selenium2时报错,错误如下: ..... ..... File "F:\软件\python3.6.1\lib\site-p ...

  8. python3 报错:UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd6 in position 201: invalid continuation byte

    代码: # -*- coding:utf-8 -*- from urllib import request resp = request.urlopen('http://www.xxx.com') p ...

  9. Python:出现UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc9 in position 0: invalid continuation byte问题

    我在导入一个csv文件的时候出现了一个问题 报错的内容是这样的: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc9 in positio ...

随机推荐

  1. 在vue的element图片的上传及回调

    首先声明,本人用的是element组件写的图片的上传及回调,若非element本方法暂不支持. 下面开始正式讲图片的上传及回调.(本篇拒绝一切花里胡哨,都是干活,言辞粗糙,望请见谅) 1,elemen ...

  2. MSSQL 获取数据库、表、字段信息语句

    --获取所有数据库名称 SELECT Name FROM Master..SysDatabases ORDER BY Name --获取库里所有表名 SELECT * FROM SysObjects ...

  3. PCM-FTL

    1. 运行时第一行需要是write 错误位置 trace_stat->sectors += length;

  4. shell 监控

    #!/bin/shsource /etc/profileserverName=$1dingDingName=$2 #获取内存情况memory=(`free | awk 'NR==2{print $2, ...

  5. 【转帖】sysbench的安装和做性能测试

    iMySQL | 老叶茶馆 sysbench的安装和做性能测试 http://imysql.cn/node/312 我仿照这个学的 但是 需要用更新的版本才可以.   By yejr on 14 六月 ...

  6. 【AtCoder】ARC069

    ARC069 C - Scc Puzzle --不说了 #include <bits/stdc++.h> #define fi first #define se second #defin ...

  7. opencv实现人脸识别(五) 运用tkinter进行GUI绘制 整合人脸识别模块

    因为之前学习过tkinter库,所以在学习了人脸识别模块的编写后, 打算绘制一个简单的GUI来应用人脸识别功能. 主界面如下所示: 签到打开在点开后直接进行人脸识别,如果成功则自动关闭视频窗口. 录入 ...

  8. 11.vim常用操作

    :set nu在命令模式下显示行号 进入输入模式 新增 (append) a :从光标所在位置後面开始新增资料,光标後的资料随新增资料向後移动. A:从光标所在列最後面的地方开始新增资料.   插入 ...

  9. Codeforces 1097E. Egor and an RPG game

    传送门 首先考虑怎么算 $f(n)$ (就是题目里面那个 $f(n)$) 发现可以构造一组序列大概长这样: ${1,3,2,6,5,4,10,9,8,7,15,14,13,12,11,...,n(n+ ...

  10. SvcUtil.exe工具生成客户端代理类

    1.以管理员身份运行vs下命令工具: 2.运行代码示例:C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin>svcutil http: ...