python 3.x - Python3 Appending Null bytes with bytearray() -


  पैक = ("test.packet") पैड = (bytearray (b '') खुले (पैक, 'एबी') के रूप में file_con_pad_1: file_con_pad_1.write (पैड) प्रिंट ('4 बाइट पैडिंग जोड़ा गया')  

तो मैं इस पद्धति के साथ रिक्त बाइट्स के बारे में कैसे जाना होगा? ऐसा करने का बेहतर तरीका?

  data_pad = ("00000000") file_pad = binascii.unhexlify ('4 bit padding added')  

इस का उपयोग करके समाप्त हो गया है, सभी के लिए धन्यवाद (file_pop): file_con_pad: file_con_pad.write (file_pad) प्रिंट के रूप में खुला (पैक, 'एबी') के साथ (डेटा_पैड) सहायता और डाउनवॉट, ऐसे सहायक समुदाय।


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -