添加了“ abcd - > defg-> ghij&quot由Apped_row
import gspread
import random
gc = gspread.service_account(filename='영업인만들기\gspread-******-**********.json')
sh = gc.open("관리자_종합_DB")
worksheet = sh.worksheet("영업인")
Name = input('영업인 이름 : ')
Email = input('영업인 이메일 : ')
alist = worksheet.col_values(4)[1:]
a = random.randint(10000,99999)
while a in alist :
a = random.randint(10000,99999)
worksheet.append_row([Name,Email,'',a])
如果我写下姓名和电子邮件,则会出现一个随机代码。
但是,当我运行它时,它写在Google表上。
这是运行3次的结果。
它不是以“ abcd - > abcd; abcd·Abcd”的形式编写“它以“ ABCD”形式写成 - >
我该如何解决?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
问题是
append_row
试图找到逻辑表附加到。而且,当您在上一行中有空单元格时,它可以将此逻辑表向右移动。 被引入以指定您要在哪里开始附加数据。这避免了append_row
尝试自己找到逻辑表。The issue is that
append_row
tries to find a logical table to append to. And when you have empty cells in your previous row it could move this logical table to the right. The parametertable_range
was introduced to specify where you want to start appending the data from. This avoidsappend_row
trying to find the logical table on its own.