Question: How do I make this python code for partition number, start sector, size in sectors , end sector, capacity and none into a tabular format?#
How do I make this python code for partition number, start sector, size in sectors end sector, capacity and none into a tabular format?# Input partial hex string
hexstring inputEnter the hex string: # this is the input statement that you should have.
partition hexstring: #Slices out partition
startinglbaaddress partition: #Slices out the starting LBA Address
sizeinsectors partition: #Slices out the size in sectors
startingchsaddress
partitiontype
endingchsaddress C
#startinglbaaddress
#Input sectors
#sizeinsectors
lestartinglbaaddress startinglbaaddress: startinglbaaddress: startinglbaaddress: startinglbaaddress:
lesizeinsectors sizeinsectors: sizeinsectors: sizeinsectors: sizeinsectors:
# change hex string to bytes
decimalforlestartinglbaaddress intlestartinglbaaddress,
decimalforlesizeinsectors intlesizeinsectors
capacity decimalforlesizeinsectors
#print for results
printPartition :
#printStarting CHS Address: startingchsaddress
#printPartition Type: partitiontype
#printEnding CHS Address: endingchsaddress
#printStarting LBA Address: startinglbaaddress
#printSize in sectors: sizeinsectors
#printLE Starting LBA Address: lestartinglbaaddress
#printLE Size in sectors: lesizeinsectors
printThe decimal for the LE Starting LBA Address: decimalforlestartinglbaaddress
printThe decimal for the LE Size in sectors: decimalforlesizeinsectors
print Capacity capacity
# Input partial hex string
hexstring inputEnter the hex string:
partition hexstring: #Slices out partition
startinglbaaddress partition: #Slices out the starting LBA Address
sizeinsectors partition: #Slices out the size in sectors
startingchsaddress
partitiontype
endingchsaddress C
#startinglbaaddress
#Input sectors
#sizeinsectors
lestartinglbaaddress startinglbaaddress: startinglbaaddress: startinglbaaddress: startinglbaaddress:
lesizeinsectors sizeinsectors: sizeinsectors: sizeinsectors: sizeinsectors:
# change hex string to bytes
decimalforlestartinglbaaddress intlestartinglbaaddress,
decimalforlesizeinsectors intlesizeinsectors
capacity decimalforlesizeinsectors
#print for results
printPartition :
#printStarting CHS Address: startingchsaddress
#printPartition Type: partitiontype
#printEnding CHS Address: endingchsaddress
#printStarting LBA Address: startinglbaaddress
#printSize in sectors: sizeinsectors
#printLE Starting LBA Address: lestartinglbaaddress
#printLE Size in sectors: lesizeinsectors
printThe decimal for the LE Starting LBA Address: decimalforlestartinglbaaddress
printThe decimal for the LE Size in sectors: decimalforlesizeinsectors
print Capacity capacity
# Input partial hex string
hexstring inputEnter the hex string:
partition hexstring: #Slices out partition
startinglbaaddress partition: #Slices out the starting LBA Address
sizeinsectors partition: #Slices out the size in sectors
startingchsaddress
partitiontype
endingchsaddress C
#startinglbaaddress
#Input sectors
#sizeinsectors
lestartinglbaaddress startinglbaaddress: startinglbaaddress: startinglbaaddress: startinglbaaddress:
lesizeinsectors sizeinsectors: sizeinsectors: sizeinsectors: sizeinsectors:
# change hex string to bytes
decimalforlestartinglbaaddress intlestartinglbaaddress,
decimalforlesizeinsectors intlesizeinsectors
capacity decimalforlesizeinsectors
#print for results
printPartition :
#printStarting CHS Address: startingchsaddress
#printPartition Type: partitiontype
#printEnding CHS Address: endingchsaddress
#printStarting LBA Address: startinglbaaddress
#printSize in sectors: sizeinsectors
#printLE Starting LBA Address: lestartinglbaaddress
#printLE Size in sectors: lesizeinsectors
printThe decimal for the LE Starting LBA Address: decimalforlestartinglbaaddress
printThe decimal for the LE Size in sectors: decimalforlesizeinsectors
print Capacity capacity
# Input partial hex string
hexstring inputEnter the hex string:
partition hexstring: #Slices out partition
startinglbaaddress partition: #Slices out the starting LB
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
