小编Ham*_*chi的帖子

如何使用`openpyxl`库在Excel中的合并单元格中写入?

我正在使用openpyxl库在单独的单元格中写入现有的 Excel 文件。

如何在 Excel 合并单元格中写入一些文本?

错误 AttributeError: 'MergedCell' object attribute 'value' is read-only

合并单元格时:

代码:

        wb = openpyxl.load_workbook(filename=src)
        for row in df_short.itertuples():
            ws = wb[row.sheet]
            try:
                cell = 'N'+str(row.id)
                ws[cell] = '=HYPERLINK("%s","#%s")' % (row.txt_path, row.txt)

Run Code Online (Sandbox Code Playgroud)

python excel for-loop pandas openpyxl

6
推荐指数
1
解决办法
4569
查看次数

如何用python脚本写引号

我想知道如何''使用脚本编写此内容python

因为我不知道如何使用python从脚本中编写代码 ''

这是我的代码:

from selenium import webdriver
import time
from random import *
import pyautogui as pg


time.sleep(2)
for i in range(1,510):
    pg.typewrite('')
    # here i want to type quotes in typewrite
Run Code Online (Sandbox Code Playgroud)

在这里我想在typewrite中输入引号

我想用记事本在记事本中写引号,scriptwriting如果在abc或123中写一些字,那不是引号

谢谢!

是否有喜欢\n或喜欢的特殊字符?

python quotes python-3.x double-quotes

0
推荐指数
1
解决办法
50
查看次数

标签 统计

python ×2

double-quotes ×1

excel ×1

for-loop ×1

openpyxl ×1

pandas ×1

python-3.x ×1

quotes ×1