Advertisement
Guest User

Untitled

a guest
Dec 14th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.41 KB | None | 0 0
  1.     tag_bilde_fil = open('Tag1.txt', 'r')
  2.     found = False
  3.     brukerID = input('Please enter node ID: ')
  4.     linje = tag_bilde_fil.readline()
  5.     skip = 0
  6.     while linje != '':
  7.         linje = linje.rstrip('\n')
  8.         if linje == brukerID:
  9.             found = True        
  10.         linje = tag_bilde_fil.readline()
  11.     tag_bilde_fil.close()  
  12.     if found == False:
  13.         print('We could not find the specified node ID.')
  14.     else:
  15.         Registrerte_Bilder_Fil = open('TagForPicture1.txt', 'r')
  16.         BrukerID = Registrerte_Bilder_Fil.readline().rstrip('\n')
  17.         while BrukerID != '':
  18.             imageId = BrukerID
  19.             tag = Registrerte_Bilder_Fil.readline().rstrip('\n')        
  20.             if brukerID == tag:
  21.                 details = getImageDetails(imageId)
  22.                 if len(details) > 0:
  23.                     comments = getAllComments(imageId)
  24.                     print('------------------------')
  25.                     print ('Dato:', details[2])
  26.                     print ('Navn:', details[4], details[5] )
  27.                     print ('Comments:', comments)
  28.                     print()
  29.                 else:
  30.                     print('------------------------')
  31.                     print ('No information fount for Bildenavn:', imageId)
  32.                     print()
  33.             BrukerID = Registrerte_Bilder_Fil.readline().rstrip('\n')
  34.         Registrerte_Bilder_Fil.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement