filesystem/plugins/texteditorbuiltin.plug

1 line
2.8 KiB
Plaintext

{'name': 'text editor. builtin', 'author': 'justus', 'main': '#path\nimport tkinter as tk\ndictionary = {\'0000\': \'0\', \'0001\': \'1\', \'0002\': \'2\', \'0003\': \'3\', \'0004\': \'4\', \'0005\': \'5\', \'0006\': \'6\', \'0007\': \'7\', \'0008\': \'8\', \'0009\': \'9\', \'0010\': \'a\', \'0011\': \'b\', \'0012\': \'c\', \'0013\': \'d\', \'0014\': \'e\', \'0015\': \'f\', \'0016\': \'g\', \'0017\': \'h\', \'0018\': \'i\', \'0019\': \'j\', \'0020\': \'k\', \'0021\': \'l\', \'0022\': \'m\', \'0023\': \'n\', \'0024\': \'o\', \'0025\': \'p\', \'0026\': \'q\', \'0027\': \'r\', \'0028\': \'s\', \'0029\': \'t\', \'0030\': \'u\', \'0031\': \'v\', \'0032\': \'w\', \'0033\': \'x\', \'0034\': \'y\', \'0035\': \'z\', \'0036\': \'A\', \'0037\': \'B\', \'0038\': \'C\', \'0039\': \'D\', \'0040\': \'E\', \'0041\': \'F\', \'0042\': \'G\', \'0043\': \'H\', \'0044\': \'I\', \'0045\': \'J\', \'0046\': \'K\', \'0047\': \'L\', \'0048\': \'M\', \'0049\': \'N\', \'0050\': \'O\', \'0051\': \'P\', \'0052\': \'Q\', \'0053\': \'R\', \'0054\': \'S\', \'0055\': \'T\', \'0056\': \'U\', \'0057\': \'V\', \'0058\': \'W\', \'0059\': \'X\', \'0060\': \'Y\', \'0061\': \'Z\', \'0062\': \'!\', \'0063\': \'"\', \'0064\': \'#\', \'0065\': \'$\', \'0066\': \'%\', \'0067\': \'&\', \'0068\': "\'", \'0069\': \'(\', \'0070\': \')\', \'0071\': \'*\', \'0072\': \'+\', \'0073\': \',\', \'0074\': \'-\', \'0075\': \'.\', \'0076\': \'/\', \'0077\': \':\', \'0078\': \';\', \'0079\': \'<\', \'0080\': \'=\', \'0081\': \'>\', \'0082\': \'?\', \'0083\': \'@\', \'0084\': \'[\', \'0085\': \'\\\\\', \'0086\': \']\', \'0087\': \'^\', \'0088\': \'_\', \'0089\': \'`\', \'0090\': \'{\', \'0091\': \'|\', \'0092\': \'}\', \'0093\': \'~\', \'0094\': \' \', \'0095\': \'\\t\', \'0096\': \'\\n\', \'0097\': \'\\r\', \'0098\': \'\\x0b\', \'0099\': \'\\x0c\'}\ndef totext():\n out = ""\n temp = open(path, \'r\')\n temp = temp.read()\n for i in range(0, len(temp), 4):\n temp2 = temp[i]\n temp2 = temp2+temp[i+1]\n temp2 = temp2+temp[i+2]\n temp2 = temp2+temp[i+3]\n if temp2 in dictionary:\n out = out + dictionary[temp2]\n return out\n\ndef tonormal(text):\n dictionary2 = {}\n for i in dictionary:\n dictionary2[dictionary[i]] = i\n out = ""\n for i in text:\n out = out + dictionary2[i]\n temp = open(path, \'w\')\n temp.write(out)\n temp.close()\n\ndef save():\n text = label.get("1.0", tk.END)\n tonormal(text)\n\ncontainer = tk.Tk("editor")\ntemp = totext()\nscrollbar = tk.Scrollbar(container)\nscrollbar.grid(row=0, column=1)\nlabel = tk.Text(container, yscrollcommand=scrollbar.set)\nlabel.insert(tk.INSERT, temp)\nlabel.grid(row=0, column=0)\nscrollbar.config(command=label.yview)\nsavebutton = tk.Button(container, text="speichern", command=save)\nsavebutton.grid()\ncontainer.mainloop()\n\n\n\n\n', 'extension': '.txt'}