model.py 721 B

12345678910111213141516171819202122232425262728293031
  1. #!/usr/bin/env python3
  2. # -*- coding: utf-8 -*-
  3. import base64
  4. from curses import echo
  5. import re
  6. import os
  7. BASEPATH = "./line.txt"
  8. TOPATH_H = "./out.h"
  9. TOPATH_M = "./out.m"
  10. def encryptdo():
  11. if os.path.exists(TOPATH_H):
  12. os.remove(TOPATH_H)
  13. if os.path.exists(TOPATH_M):
  14. os.remove(TOPATH_M)
  15. f=open(BASEPATH,'r')
  16. alllines=f.readlines()
  17. f.close()
  18. fh=open(TOPATH_H,'w' ,encoding='utf8')
  19. # fm=open(TOPATH_M,'w' ,encoding='utf8')
  20. for eachline in alllines:
  21. repstr = eachline.replace(":",";// ")
  22. appstr = "youpaip"+repstr
  23. newstr = "@property (copy, nonatomic) NSString* "+appstr
  24. f.writelines(newstr)
  25. print(newstr)
  26. f.close()
  27. encryptdo()