Spaces:
Build error
Build error
Adam Molnar commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -44,6 +44,7 @@ bot_ids = [1136614989411655780, 1166392942387265536, 1158038249835610123, 113077
|
|
| 44 |
""""""
|
| 45 |
api = HfApi()
|
| 46 |
""""""
|
|
|
|
| 47 |
|
| 48 |
|
| 49 |
@bot.event
|
|
@@ -58,14 +59,17 @@ async def on_ready():
|
|
| 58 |
csv_url_test = URL_test.replace('/edit#gid=', '/export?format=csv&gid=')
|
| 59 |
data = pd.read_csv(csv_url)
|
| 60 |
|
| 61 |
-
|
| 62 |
with open(csv_file, 'w', newline='') as file:
|
| 63 |
writer = csv.writer(file)
|
| 64 |
for row in data:
|
| 65 |
-
writer.writerow(row)
|
|
|
|
| 66 |
|
| 67 |
data2 = open('import.csv', 'r').read()
|
|
|
|
| 68 |
worksheet_test = gspread_bot.open("test").sheet1
|
|
|
|
| 69 |
gspread_bot.import_csv(worksheet_test.id, data2)
|
| 70 |
|
| 71 |
|
|
|
|
| 44 |
""""""
|
| 45 |
api = HfApi()
|
| 46 |
""""""
|
| 47 |
+
csv_file = 'import.csv'
|
| 48 |
|
| 49 |
|
| 50 |
@bot.event
|
|
|
|
| 59 |
csv_url_test = URL_test.replace('/edit#gid=', '/export?format=csv&gid=')
|
| 60 |
data = pd.read_csv(csv_url)
|
| 61 |
|
| 62 |
+
|
| 63 |
with open(csv_file, 'w', newline='') as file:
|
| 64 |
writer = csv.writer(file)
|
| 65 |
for row in data:
|
| 66 |
+
writer.writerow(row)
|
| 67 |
+
print(f"done! {data}")
|
| 68 |
|
| 69 |
data2 = open('import.csv', 'r').read()
|
| 70 |
+
print(data2)
|
| 71 |
worksheet_test = gspread_bot.open("test").sheet1
|
| 72 |
+
print(worksheet_test)
|
| 73 |
gspread_bot.import_csv(worksheet_test.id, data2)
|
| 74 |
|
| 75 |
|