Jump to content

Cython - Problem with code


Recommended Posts

Hi, I have a problem with cython, namely with cython turned off = then python works fine but on cython I have a problem with the cPickle function.

when booting cython source client, cPickle import exits the game completely without any errors. Does anyone know why this is happening? Does cython have a problem using this function? Apparently it's some python function

 

in short, a client built in the new language cython does not detect this function at all and is nowhere in the client

 

sample code that uses this

	def LoadConfigurations(self):
		try:
			f = open('settings/switchbot.pkl', 'rb')
			self.dict = cPickle.load(f)
			f.close()
		except IOError:
			self.dict = {}	
		
		self.listBox.RemoveAllItems()
			
		lineWidth = self.listBox.GetWidth()
		if len(self.dict) > self.__GetViewItemCount():	
			lineWidth -= 20
			
		self.__AdjustScrollbar()
			
		for key in self.dict.iterkeys():
			config = self.dict.get(key, None)
			if not config:
				continue
				
			line = self.ConfigurationLine(lineWidth)
			line.Load(key, config["name"])
			line.SetLoadEvent(ui.__mem_func__(self.__OnApplyConfiguration))
			line.SetDeleteEvent(ui.__mem_func__(self.__OnDeleteConfiguration))
			self.listBox.AppendItem(line)
			
			self.listItems[key] = line

	def SaveConfigurations(self):
		with open('settings/switchbot.pkl', 'wb') as f:
			cPickle.dump(self.dict, f)

 

Edited by santa12
Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.