Site Error
An error was encountered while publishing this resource.
Error Type: NameError
Error Value: global name 'select_addresses' is not defined
Troubleshooting Suggestions
* This resource may be trying to reference a nonexistent object or variable global name 'select_addresses' is not defined.
* The URL may be incorrect.
* The parameters passed to this resource may be incorrect.
* A resource that this resource relies on may be encountering an error.
For more detailed information about the error, please refer to the error log.
If the error persists please contact the site maintainer. Thank you for your patience.
Code: Alles auswählen
import os
import sys
import psycopg2
import re
import ftplib
# Datenbank-Connection und -Cursor erstellen
conn = psycopg2.connect(user = "*", password = "**", database = "***")
def select_addresses(conn):
sql = """
Hier steht ne SQL abfrage drinne
"""
cur = conn.cursor()
cur.execute(sql)
return cur
def main():
hierdrinn schreib ich die SQL abfrage in ne Dtei rein
main()
conn.close()
die Method mit der ich das ausführe sieht so aus:
Code: Alles auswählen
def zope_helfer(self):
exec file ("E:\\Zope_helfer.py")
Wäre nett wenn ihr mir da helfen könntet.
Gruß BoOnOdY