+ 35

[Python] What Is The Max Length Of Bytes Can Struct Pack ?

Sometimes I Try Big Integers With Struct Like 999999 And It Tells Me That This Is A Bad Char Or Something Like That So My Question Is What Is The Highest Integer Can Struct Pack In Python I Tried To Do Some for loop with a long range integers but that's almost impossible because it counts to a very very long range

21st Feb 2018, 6:44 PM
warlord
warlord - avatar
15 Respuestas
+ 1
8 bytes = 8 * 8 bits = 64 bits. So a 64 digit binary number. Or, the 64-bit integer limit (2 ^ 63 - 1 in case of a long long).
25th Feb 2018, 1:30 PM
LunarCoffee
LunarCoffee - avatar
+ 25
@Alper I Mean When You Do This struct.pack("q",99999999999999999) Error: Index Out If Range So What Is The Maximum Integer That Can Struct Pack
22nd Feb 2018, 12:54 PM
warlord
warlord - avatar
+ 20
@LunarCoffee So How Much Can C Do ?
24th Feb 2018, 9:09 PM
warlord
warlord - avatar
+ 19
@mglord ??
24th Feb 2018, 1:51 AM
warlord
warlord - avatar
+ 18
@Alex[WEB-DEV] this is not my question if you are sharing your code share it with the post "Show Your Codes Here" or "Let's Celebrate Your Day"
24th Feb 2018, 8:44 AM
warlord
warlord - avatar
+ 17
@Murali Kumar I Recommend You To Use Python Or HTML Also You Can Use This https://www.sololearn.com/Discuss/624826/?ref=app
25th Feb 2018, 4:28 PM
warlord
warlord - avatar
+ 15
It may help you, please check: https://docs.python.org/3/library/struct.html
21st Feb 2018, 8:29 PM
📈SmileGoodHope📈
📈SmileGoodHope📈 - avatar
+ 15
@mlglord no problem
24th Feb 2018, 8:59 AM
warlord
warlord - avatar
+ 15
do you mean 8 digits number @LunarCoffee ?
25th Feb 2018, 1:11 PM
warlord
warlord - avatar
+ 7
computer= " Bytes Can Struct Pack" print len(computer) :D
22nd Feb 2018, 10:06 AM
Alper Emir
Alper Emir - avatar
+ 5
#mlglord, it's just spamming, Please avoid it.
24th Feb 2018, 5:30 AM
📈SmileGoodHope📈
📈SmileGoodHope📈 - avatar
+ 1
oops sorry, my little brother must have done that
24th Feb 2018, 6:38 AM
mlglord
mlglord - avatar
+ 1
Probably as much as C can do.
24th Feb 2018, 7:05 PM
LunarCoffee
LunarCoffee - avatar
+ 1
I mean, a standard long long "packing" would be 8 bytes. There's a table in the documentation for struct.
25th Feb 2018, 1:09 PM
LunarCoffee
LunarCoffee - avatar
+ 1
Hello People Here, I'm a mechanical guy and wants to get in to it sector.....Can anyone suggest me the write way to move into the courses I should learn?
25th Feb 2018, 4:23 PM
Murali Kumar
Murali Kumar - avatar