Guest User

Untitled

a guest
Apr 24th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. # Informacje o programach
  2.  
  3. class Program:
  4.  
  5. id = 0 # Nadawanie glownego numeru
  6. nazwa = "" # Nazwa pliku
  7. opis = "" # Krótki opis
  8. tag = "" # nadanie tagu
  9. wersja = "" # Wersja porgramu
  10. gdzie = "" # Kategoria
  11.  
  12.  
  13. class ListaP:
  14.  
  15. ile = 0 #ilosc programow
  16. list_prog = [] #lista programow
  17.  
  18. def stan(self) :
  19. print "="*30
  20. print "Lista dostepnych programow"
  21. print "="*30
  22. print "%-4d %-14s %-6s %-8s %-8s %-8s" % ('ID',' Nazwa','Opis','Tag','Wersja','Gdzie')
  23.  
  24. for p in self.list_prog:
  25. print "%4d %15s %160s %10s %5.3d %2.3d" % (p.id,p.nazwa,p.opis,p.tag,p.wersja,p.gdzie)
  26.  
  27. def add(self):
  28. print "="*30
  29. print "Dodaj program do bazy"
  30. print "="*30
  31. print
  32. nazwa = raw_input("Podaj nazwe pliku")
  33. opis = raw_input("Podaj opis")
  34. tag = raw_input("Wpisz tag")
  35. wersja = raw_input("Podaj wersje")
  36. gdzie = raw_input("Podaj lokalizaje szpula.nr_plytki")
  37. self.list_prog.append(ListaP())
  38. self.list_prog[self.ile].id=id+1
  39. self.list_prog[self.ile].nazwa=nazwa
  40. self.list_prog[self.ile].opis=opis
  41. self.list_prog[self.ile].tag=tag
  42. self.list_prog[self.ile].wersja=wersja
  43. self.list_prog[self.ile].gdzie=gdzie
  44. self.ile+=1
  45. print
Add Comment
Please, Sign In to add comment