Wie kann ich herausfinden, warum die for-Schleife überhaupt nicht funktioniert? [geschlossen]Python

Python-Programme
Anonymous
 Wie kann ich herausfinden, warum die for-Schleife überhaupt nicht funktioniert? [geschlossen]

Post by Anonymous »

Ich bin mir nicht sicher, warum mein Programm überhaupt nicht in die for-Schleife eintritt. Der Code ist unten:

Code: Select all

    ### Retrieve and edit polygons
def buttonEdit():
for line in myFile:
ptList = line.strip('[]').split(',')
for pt in range(1, len(ptList)):
t.pendown()
t.goto(ptList[pt][0], ptList[pt][1])

### Store polygons in a file
while True:
try:
myFile = open("polygon_data.txt", 'a+')
break
except OSError:
print("File does not exist, please try again!")

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post