Skip to main content
deleted 29 characters in body
Source Link
Jamal
  • 35.2k
  • 13
  • 134
  • 238

This is my codeIn this library:

  1. text_data(val) translates val to computer data types
  2. colorcode() returns the selected color in hex

Can you please tell me how I can make it better?

from tkinter.colorchooser import askcolor
def text_data(text):
    texti = []
    binary = []
    ordv = []
    hexadecimal = []
    octal = []
    i = 0
    while i < len(text):
        j = ord(text[i])
        k = bin(ord(text[i]))
        l = hex(ord(text[i]))
        m = oct(ord(text[i]))
        k = k[2:]
        l = l[2:]
        m = m[2:]
        print(text[i], " ", j, " ", k, "", l, "", m)
        binary.append(k)
        ordv.append(j)
        hexadecimal.append(l)
        texti.append(text[i])
        octal.append(m)
        i += 1
    print("\n")
    print(binary)
    print("\n")
    print(ordv)
    print("\n")
    print(hexadecimal)
    print("\n")
    print(octal) 
def colorcode():
    return askcolor()[1]
print(colorcode())

What it does is:

  1. text_data(val) translates val to computer data types
  2. colorcode() returns the selected color in hex

Can you please tell me how to make it better?

This is my code:

from tkinter.colorchooser import askcolor
def text_data(text):
    texti = []
    binary = []
    ordv = []
    hexadecimal = []
    octal = []
    i = 0
    while i < len(text):
        j = ord(text[i])
        k = bin(ord(text[i]))
        l = hex(ord(text[i]))
        m = oct(ord(text[i]))
        k = k[2:]
        l = l[2:]
        m = m[2:]
        print(text[i], " ", j, " ", k, "", l, "", m)
        binary.append(k)
        ordv.append(j)
        hexadecimal.append(l)
        texti.append(text[i])
        octal.append(m)
        i += 1
    print("\n")
    print(binary)
    print("\n")
    print(ordv)
    print("\n")
    print(hexadecimal)
    print("\n")
    print(octal) 
def colorcode():
    return askcolor()[1]
print(colorcode())

What it does is:

  1. text_data(val) translates val to computer data types
  2. colorcode() returns the selected color in hex

Can you please tell me how to make it better?

In this library:

  1. text_data(val) translates val to computer data types
  2. colorcode() returns the selected color in hex

Can you please tell me how I can make it better?

from tkinter.colorchooser import askcolor
def text_data(text):
    texti = []
    binary = []
    ordv = []
    hexadecimal = []
    octal = []
    i = 0
    while i < len(text):
        j = ord(text[i])
        k = bin(ord(text[i]))
        l = hex(ord(text[i]))
        m = oct(ord(text[i]))
        k = k[2:]
        l = l[2:]
        m = m[2:]
        print(text[i], " ", j, " ", k, "", l, "", m)
        binary.append(k)
        ordv.append(j)
        hexadecimal.append(l)
        texti.append(text[i])
        octal.append(m)
        i += 1
    print("\n")
    print(binary)
    print("\n")
    print(ordv)
    print("\n")
    print(hexadecimal)
    print("\n")
    print(octal) 
def colorcode():
    return askcolor()[1]
print(colorcode())
deleted 2 characters in body
Source Link
alecxe
  • 17.5k
  • 8
  • 52
  • 93

This is my code:

from tkinter.colorchooser import askcolor
def text_data(text):
    texti = []
    binary = []
    ordv = []
    hexadecimal = []
    octal = []
    i = 0
    while i < len(text):
        j = ord(text[i])
        k = bin(ord(text[i]))
        l = hex(ord(text[i]))
        m = oct(ord(text[i]))
        k = k[2:]
        l = l[2:]
        m = m[2:]
        print(text[i], " ", j, " ", k, "", l, "", m)
        binary.append(k)
        ordv.append(j)
        hexadecimal.append(l)
        texti.append(text[i])
        octal.append(m)
        i += 1
    print("\n")
    print(binary)
    print("\n")
    print(ordv)
    print("\n")
    print(hexadecimal)
    print("\n")
    print(octal) 
def colorcode():
    return askcolor()[1]
print(colorcode())

What it does is:

  1. text_data(val)text_data(val) translates val to computer data types
  2. colorcode()colorcode() returns the selected color in hex
    Can you please tell me how to make it better?
    Thanks!

Can you please tell me how to make it better?

This is my code:

from tkinter.colorchooser import askcolor
def text_data(text):
    texti = []
    binary = []
    ordv = []
    hexadecimal = []
    octal = []
    i = 0
    while i < len(text):
        j = ord(text[i])
        k = bin(ord(text[i]))
        l = hex(ord(text[i]))
        m = oct(ord(text[i]))
        k = k[2:]
        l = l[2:]
        m = m[2:]
        print(text[i], " ", j, " ", k, "", l, "", m)
        binary.append(k)
        ordv.append(j)
        hexadecimal.append(l)
        texti.append(text[i])
        octal.append(m)
        i += 1
    print("\n")
    print(binary)
    print("\n")
    print(ordv)
    print("\n")
    print(hexadecimal)
    print("\n")
    print(octal) 
def colorcode():
    return askcolor()[1]
print(colorcode())

What it does is

  1. text_data(val) translates val to computer data types
  2. colorcode() returns the selected color in hex
    Can you please tell me how to make it better?
    Thanks!

This is my code:

from tkinter.colorchooser import askcolor
def text_data(text):
    texti = []
    binary = []
    ordv = []
    hexadecimal = []
    octal = []
    i = 0
    while i < len(text):
        j = ord(text[i])
        k = bin(ord(text[i]))
        l = hex(ord(text[i]))
        m = oct(ord(text[i]))
        k = k[2:]
        l = l[2:]
        m = m[2:]
        print(text[i], " ", j, " ", k, "", l, "", m)
        binary.append(k)
        ordv.append(j)
        hexadecimal.append(l)
        texti.append(text[i])
        octal.append(m)
        i += 1
    print("\n")
    print(binary)
    print("\n")
    print(ordv)
    print("\n")
    print(hexadecimal)
    print("\n")
    print(octal) 
def colorcode():
    return askcolor()[1]
print(colorcode())

What it does is:

  1. text_data(val) translates val to computer data types
  2. colorcode() returns the selected color in hex

Can you please tell me how to make it better?

Source Link

Translator-ish Library

This is my code:

from tkinter.colorchooser import askcolor
def text_data(text):
    texti = []
    binary = []
    ordv = []
    hexadecimal = []
    octal = []
    i = 0
    while i < len(text):
        j = ord(text[i])
        k = bin(ord(text[i]))
        l = hex(ord(text[i]))
        m = oct(ord(text[i]))
        k = k[2:]
        l = l[2:]
        m = m[2:]
        print(text[i], " ", j, " ", k, "", l, "", m)
        binary.append(k)
        ordv.append(j)
        hexadecimal.append(l)
        texti.append(text[i])
        octal.append(m)
        i += 1
    print("\n")
    print(binary)
    print("\n")
    print(ordv)
    print("\n")
    print(hexadecimal)
    print("\n")
    print(octal) 
def colorcode():
    return askcolor()[1]
print(colorcode())

What it does is

  1. text_data(val) translates val to computer data types
  2. colorcode() returns the selected color in hex
    Can you please tell me how to make it better?
    Thanks!