View Single Post
Old 04-20-2017, 12:28 AM  
deonbell
Confirmed User
 
deonbell's Avatar
 
Industry Role:
Join Date: Sep 2015
Posts: 1,045
Python - Using A String Modifier With A Variable

Just curious, How would I have gotten this code to work with a variable instead of having "69" hard coded into the code

Code:
    
    secret=('%064x' % 0x69)
    print secret
This gives me
00000000000000000000000000000000000000000000000000 00000000000069


I ended up doing it this way instead. Reading the variable from a file. It works this way.
Also give me
00000000000000000000000000000000000000000000000000 00000000000069

But curious about the above.

Code:
   
    inputfile = open('inputfile.txt', 'r')
    startdata = inputfile.read()
    inputfile.close() 
    print "starting point"
    
    inputlove=startdata.strip()   
   
    fart = inputlove.zfill(64)

    print fart
Thank you my gfy friends.
deonbell is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote