Python Forum
Convert Int Value bigger 256 to Unicode
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Convert Int Value bigger 256 to Unicode
#5
Fixed it myself. Sometimes its so easy,but you simply are to blind and dont notice its already a Function available

def changeprg():
	
	a = 0
	fc = 0
	lc = 1
	lst3=[]
	addstr=""
	with io.open("ud- "+sys.argv[1]+"fr.seq", encoding='ascii', errors='replace') as f:
			for line in f:
				addstr=line
				a +=1
				lc +=1
				if a == 4:						# get numer of Files stored in this List
					fc = int(line)
					lc = 0
	
				if lc ==5:              # stop each 5th Line where PRG Filetype is stored, beginning with Line 9 in File
					addstr=""
					addstr=unicode(fc) + '\n'  # toggle Value to unicode 
					lc = 0
					fc -=1
				lst3.append(addstr)
			
			
				
	with io.open("ud- "+sys.argv[1]+"-fr-renumbered.seq", 'w', encoding='ascii', errors='replace', newline='\r') as f:
		for item in lst3:
			f.write(item)
				
	
Reply


Messages In This Thread
RE: Convert Int Value bigger 256 to Unicode - by lastyle - Mar-19-2020, 11:48 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Making a plot with secondary y-axis bigger snkm 0 1,131 Feb-10-2022, 09:40 AM
Last Post: snkm
  Counting number of words and organize for the bigger frequencies to the small ones. valeriorsneto 1 1,683 Feb-05-2021, 03:49 PM
Last Post: perfringo
  How to convert unicode to koi8-r? AlekseyPython 5 6,635 Mar-04-2019, 08:33 AM
Last Post: DeaD_EyE
  clean unicode string to contain only characters from some unicode blocks gmarcon 2 3,990 Nov-23-2018, 09:17 PM
Last Post: Gribouillis
  tkinter - Make circle for radio button bigger Raptor88 5 14,209 Mar-07-2017, 12:13 PM
Last Post: metulburr

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020