Du mußt schon was zurückgeben:
Code: Alles auswählen
def concat():
iterable = [["a", "b"], ["c", "d"]]
text = "x-y"
result = [text.split("-"), *iterable]
return result
Code: Alles auswählen
def concat():
iterable = [["a", "b"], ["c", "d"]]
text = "x-y"
result = [text.split("-"), *iterable]
return result
Danke.__blackjack__ hat geschrieben: ↑Montag 20. September 2021, 15:37 Die Funktion ist von hier: viewtopic.php?f=23&t=53023&p=393579&hil ... ng#p393579
Code: Alles auswählen
Msgbox RS_Python(0) (7) & CHR(13) & RS_Python(1) (0) (7)
Code: Alles auswählen
Msgbox RS_Python(0) (7) & CHR(13) & RS_Python(1) (7)
ja, Entschuldigung, das war wirklich nur meine Blindheit/Dummheit, denn ich verstehe das es das return braucht.Sirius3 hat geschrieben: ↑Montag 20. September 2021, 15:42 Das Python-Skript, das Du da gepostet hast, tut nichts, also was erwartest Du als Ausgabe?
Du mußt schon was zurückgeben:Code: Alles auswählen
def concat(): iterable = [["a", "b"], ["c", "d"]] text = "x-y" result = [text.split("-"), *iterable] return result
Code: Alles auswählen
import mysql.connector as mc
from contextlib import closing
from mysql.connector import connect
def kombiniert(host, port, user, password, database, sql):
with connect(
host=host, port=port, user=user, password=password, database=database
) as connection:
with connection.cursor() as cursor:
cursor.execute(sql)
ds = [
tuple((str(item) if item is not None else "") for item in row)
for row in cursor.fetchall()
]
columns = cursor.column_names
result = [columns, *ds]
return result