小编ket*_*tan的帖子

如何使用python读取CSV文件时跳过空白行

这是我的代码,我能够打印每一行,但当出现空行时,它打印; 因为CSV文件格式,所以我想在空行出现时跳过

import csv
import time

ifile = open ("C:\Users\BKA4ABT\Desktop\Test_Specification\RDBI.csv", "rb")
for line in csv.reader(ifile): 
    if not line: 
        empty_lines += 1 
        continue
    print line
Run Code Online (Sandbox Code Playgroud)

python csv

15
推荐指数
4
解决办法
3万
查看次数

Python读取特定的单元格值

我有一个excel文件,我想使用Python逐个读取特定的单元格,并且我将使用单元格的值作为一条消息发送到ECU(电子控制单元).

有人可以给我一些想法吗?我有两个列,例如我在下面给出的:

Request**                Response**
Client -> Server         Server -> Client

10 01                    50 01
10 81                    expected no answer

10 02                    50 02
10 01                    50 01
10 82                    expected no answer

10 03                    50 03
10 83                    expected no answer     

10 04                  7F 10 12
10 00                  7F 10 12
10 84                  7F 10 12
10 FF                  7F 10 12
10 01 00               7F 10 13
10                     7F 10 13
Run Code Online (Sandbox Code Playgroud)

python excel

2
推荐指数
1
解决办法
2万
查看次数

标签 统计

python ×2

csv ×1

excel ×1