Oct-29-2019, 12:38 PM
Hello,
I'm using Python 3.7.0 32-bit and wanted to print some variables with the format syntax
The variables are :
The code:
gives the result :
while in two lines the result is what I expected :
I'm using Python 3.7.0 32-bit and wanted to print some variables with the format syntax
The variables are :
1 2 |
client_address: ( '192.168.167.200' , 49706 ) message[ 'FrameNumber' ]: 396 |
1 |
print ( 'Accepted new connection from {}:{} {}' . format ( * client_address,client_address[ 1 ],message[ 'FrameNumber' ])) |
Output:Accepted new connection from 192.168.167.200:49706 49706
Why is there 2 times the value 49706 ?while in two lines the result is what I expected :
1 2 |
print ( 'Accepted new connection from {}:{}' . format ( * client_address,client_address[ 1 ])) print ( 'frame:{}' . format (message[ 'FrameNumber' ])) |
Output:Accepted new connection from 192.168.167.200:49706
frame:396