Skip to content

Replace just a string’s portion in a list from a dictionary

I am struggling when trying to replace string’s portions from a list, using a dictionary. I have a list with network IPs and subnet masks: My idea is to create a dictionary to replace the subnet masks into prefix masks, for example: I am getting these IPs after using a small code to get IPs from a huge …

Can’t convert this text in normal format in python?

I am web-scraping some stuff and i got something like this “735 πš†πš’πš•πš•πš’πšŠπš– πšƒ π™Όπš˜πš›πš›πš’πšœπšœπšŽπš’ π™±πš•πšŸπš, π™³πš˜πš›πšŒπš‘πšŽπšœπšπšŽπš›, 𝙼𝙰 02122 Dorchester MA 02121” how do i convert it to normal text in python? Answer You can run it through Unicode normalization: Here’s a REPL screenshot that demonstrates it works:…