Wednesday, February 12, 2020

how to check garbage collector is enable or not

import gc
print(gc.isenabled())

output
True

example2:

import gc
print(gc.isenabled())
gc.disable()
print(gc.isenabled())

output:
True

False

how to declare class in python

class Student:
    def __init__(self,x,y,z):
        self.name=x
        self.rollno=y
        self.marks=z
    def display(self):
        print("name:",self.name)
        print("rollno:",self.rollno)
        print("marks:",self.marks)
 
     
s=Student("anil",100,90)
s.display()

output:
name: anil
rollno: 100
marks: 90

How to write a basic functions in python



Tuesday, February 11, 2020

Tkinter geometry in python

from tkinter import *
import tkinter as tk

# creating Tk windowmaster = Tk()

# setting geometry of tk windowmaster.geometry("200x200+100+100")

# button widgetb1 = Button(master, text = "Click me !")
b1.place(relx = 1, x =-2, y = 2, anchor = NE)

# label widgetl = Label(master, text = "I'm a Label")
l.place(anchor = NW)

# button widgetb2 = Button(master, text = "GFG")
b2.place(relx = 0.5, rely = 0.5, anchor = CENTER)

# infinite loop which is required to# run tkinter program infinitely# until an interrupt occursmainloop()

how to write a basic class in python

Thursday, January 23, 2020

how to write a basic class in python

class Student:
    def read(self):
        print("Reading student class")
     
s=Student()
s.read()

outputL
Reading student class


you can call multiple times
class Student:
    def read(self):
        print("Reading student class")
     
s=Student()
s.read()
s.read()
s.read()
s.read()

output:
Reading student class
Reading student class
Reading student class
Reading student class


example 2:
class Student:
    def __init__(self,x,y,z):
        self.name=x
        self.rollno=y
        self.marks=z
 
       
s=Student("anil",100,90)
print(s.name,s.rollno,s.marks)

output:
anil 100 90

How to Perform Addition, Subtraction, Multiplication, Division and Modulus operation on two integers.


#include<stdio.h>
void main()
{ int a,b;
printf("\n enter two values: ");
scanf("%d %d",&a,&b);
printf("\n a + b = %d", a+b);
printf("\n a - b = %d", a-b);
printf("\n a * b = %d", a*b);
printf("\n a / b = %d", a/b);
printf("\n a modulus b = %d", a%b);
getch();
}

input:

 enter two values: 13  5

output:

 a + b = 18           
 a - b = 8
 a * b = 65
 a / b = 2
 a modulus b = 3

Wednesday, January 22, 2020

How to write a grid in Tkinter python

from tkinter import *
import tkinter as tk
#ARM Cortex M0",48,16,2,16,1,5,2,1,1,1,8,0,0,"QFN20"
mc_list={
          1: {
                'id':'MM32f003NW',
                'processor':'ARM Cortex M0',
                'frequency':'48',
                'flash':'16',
                'ram':'2',
                "gpio":"16",
                "adv_tm":"1",
                "gptm":"5",
                "wdg":"2",
                "rtc":"",
                "uart":"1",
                "i2c":"1",
                "spi":"1",
                "adc":"8x12bit",
                "eeprom":"0",
                "pack":"QFN20",
                "dac":"",
                "usb":"",
                "can":"",
                "sdio":"",
                "comp":"",
                "aes":"",
                "trng":""
             
            },
            2:{
                "id":"MM32f003TW",
                "processor":"ARM Cortex M0",
                "frequency":"48",
                "flash":"16",
                "ram":"2",
                "gpio":"16",
                "adv_tm":"1",
                "gptm":"5",
                "wdg":"2",
                "rtc":"-",
                "uart":"1",
                "i2c":"1",
                "spi":"1",
                "adc":"8x12bit",
                "eeprom":"0",
                "pack":"TSSOP20",
                "dac":"",
                "usb":"",
                "can":"",
                "sdio":"",
                "comp":"",
                "aes":"",
                "trng":""
                },
#MM32f031 controller started
             3:{
                "id":"MM32F031F4P6",
                "processor":"ARM Cortex M0",
                "frequency":"72",
                "flash":"16",
                "ram":"4",
                "gpio":"16",
                "adv_tm":"1",
                "gptm":"5",
                "wdg":"2",
                "rtc":"-",
                "uart":"1",
                "i2c":"1",
                "spi":"1",
                "adc":"9x12bit",
                "eeprom":"",
                "pack":"TSSOP20",
                "dac":"",
                "usb":"",
                "can":"",
                "sdio":"",
                "comp":"",
                "aes":"",
                "trng":""
                },
            4:{
                "id":"MM32F031F4U6",
                "processor":"ARM Cortex M0",
                "frequency":"72",
                "flash":"16",
                "ram":"4",
                "gpio":"16",
                "adv_tm":"1",
                "gptm":"5",
                "wdg":"2",
                "rtc":"",
                "uart":"1",
                "i2c":"1",
                "spi":"1",
                "adc":"9x12bit",
                "eeprom":"",
                "pack":"QFN20",
                "dac":"",
                "usb":"",
                "can":"",
                "sdio":"",
                "comp":"",
                "aes":"",
                "trng":""
                },
                5:{
                "id":"MM32f031K4U6",
                "processor":"ARM Cortex M0",
                "frequency":"72",
                "flash":"16",
                "ram":"4",
                "gpio":"27",
                "adv_tm":"1",
                "gptm":"5",
                "wdg":"2",
                "rtc":"",
                "uart":"1",
                "i2c":"1",
                "spi":"1",
                "adc":"10x12bit",
                "eeprom":"",
                "pack":"QFN32",
                "dac":"",
                "usb":"",
                "can":"",
                "sdio":"",
                "comp":"",
                "aes":"",
                "trng":""
                },
                  6:{
                "id":"MM32f031K4T6",
                "processor":"ARM Cortex M0",
                "frequency":"72",
                "flash":"16",
                "ram":"4",
                "gpio":"25",
                "adv_tm":"1",
                "gptm":"5",
                "wdg":"2",
                "rtc":"-",
                "uart":"1",
                "i2c":"1",
                "spi":"1",
                "adc":"10x12bit",
                "eeprom":"-",
                "pack":"LQFP32",
                "dac":"",
                "usb":"",
                "can":"",
                "sdio":"",
                "comp":"",
                "aes":"",
                "trng":""
                },
                  7:{
                "id":"MM32f031C4T6",
                "processor":"ARM Cortex M0",
                "frequency":"72",
                "flash":"16",
                "ram":"4",
                "gpio":"39",
                "adv_tm":"1",
                "gptm":"5",
                "wdg":"2",
                "rtc":"",
                "uart":"1",
                "i2c":"1",
                "spi":"1",
                "adc":"10x12bit",
                "eeprom":"",
                "pack":"QFN32",
                "dac":"",
                "usb":"",
                "can":"",
                "sdio":"",
                "comp":"",
                "aes":"",
                "trng":""
                },
                8:{
                "id":"MM32f031K4U6",
                "processor":"ARM Cortex M0",
                "frequency":"72",
                "flash":"16",
                "ram":"4",
                "gpio":"27",
                "adv_tm":"1",
                "gptm":"5",
                "wdg":"2",
                "rtc":"",
                "uart":"1",
                "i2c":"1",
                "spi":"1",
                "adc":"10x12bit",
                "eeprom":"",
                "pack":"QFN32",
                "dac":"",
                "usb":"",
                "can":"",
                "sdio":"",
                "comp":"",
                "aes":"",
                "trng":""
                },
                9:{
                "id":"MM32f031K4U6",
                "processor":"ARM Cortex M0",
                "frequency":"72",
                "flash":"16",
                "ram":"4",
                "gpio":"27",
                "adv_tm":"1",
                "gptm":"5",
                "wdg":"2",
                "rtc":"",
                "uart":"1",
                "i2c":"1",
                "spi":"1",
                "adc":"10x12bit",
                "eeprom":"",
                "pack":"QFN32",
                "dac":"",
                "usb":"",
                "can":"",
                "sdio":"",
                "comp":"",
                "aes":"",
                "trng":""
                },
                10:{
                "id":"MM32f031K4U6",
                "processor":"ARM Cortex M0",
                "frequency":"72",
                "flash":"16",
                "ram":"4",
                "gpio":"27",
                "adv_tm":"1",
                "gptm":"5",
                "wdg":"2",
                "rtc":"",
                "uart":"1",
                "i2c":"1",
                "spi":"1",
                "adc":"10x12bit",
                "eeprom":"",
                "pack":"QFN32",
                "dac":"",
                "usb":"",
                "can":"",
                "sdio":"",
                "comp":"",
                "aes":"",
                "trng":""
                },
                11:{
                "id":"MM32f031K4U6",
                "processor":"ARM Cortex M0",
                "frequency":"72",
                "flash":"16",
                "ram":"4",
                "gpio":"27",
                "adv_tm":"1",
                "gptm":"5",
                "wdg":"2",
                "rtc":"",
                "uart":"1",
                "i2c":"1",
                "spi":"1",
                "adc":"10x12bit",
                "eeprom":"",
                "pack":"QFN32",
                "dac":"",
                "usb":"",
                "can":"",
                "sdio":"",
                "comp":"",
                "aes":"",
                "trng":""
                },
                         12:{
                "id":"MM32f031K4U6",
                "processor":"ARM Cortex M0",
                "frequency":"72",
                "flash":"16",
                "ram":"4",
                "gpio":"27",
                "adv_tm":"1",
                "gptm":"5",
                "wdg":"2",
                "rtc":"",
                "uart":"1",
                "i2c":"1",
                "spi":"1",
                "adc":"10x12bit",
                "eeprom":"",
                "pack":"QFN32",
                "dac":"",
                "usb":"",
                "can":"",
                "sdio":"",
                "comp":"",
                "aes":"",
                "trng":""
                },
                13:{
                "id":"MM32f031K4U6",
                "processor":"ARM Cortex M0",
                "frequency":"72",
                "flash":"16",
                "ram":"4",
                "gpio":"27",
                "adv_tm":"1",
                "gptm":"5",
                "wdg":"2",
                "rtc":"",
                "uart":"1",
                "i2c":"1",
                "spi":"1",
                "adc":"10x12bit",
                "eeprom":"",
                "pack":"QFN32",
                "dac":"",
                "usb":"",
                "can":"",
                "sdio":"",
                "comp":"",
                "aes":"",
                "trng":""
                },
                        14:{
                "id":"MM32f031K4U6",
                "processor":"ARM Cortex M0",
                "frequency":"72",
                "flash":"16",
                "ram":"4",
                "gpio":"27",
                "adv_tm":"1",
                "gptm":"5",
                "wdg":"2",
                "rtc":"",
                "uart":"1",
                "i2c":"1",
                "spi":"1",
                "adc":"10x12bit",
                "eeprom":"",
                "pack":"QFN32",
                "dac":"",
                "usb":"",
                "can":"",
                "sdio":"",
                "comp":"",
                "aes":"",
                "trng":""
                },
                                        15:{
                "id":"MM32f031K4U6",
                "processor":"ARM Cortex M0",
                "frequency":"72",
                "flash":"16",
                "ram":"4",
                "gpio":"27",
                "adv_tm":"1",
                "gptm":"5",
                "wdg":"2",
                "rtc":"",
                "uart":"1",
                "i2c":"1",
                "spi":"1",
                "adc":"10x12bit",
                "eeprom":"",
                "pack":"QFN32",
                "dac":"",
                "usb":"",
                "can":"",
                "sdio":"",
                "comp":"",
                "aes":"",
                "trng":""
                },
                                                        16:{
                "id":"MM32f031K4U6",
                "processor":"ARM Cortex M0",
                "frequency":"72",
                "flash":"16",
                "ram":"4",
                "gpio":"27",
                "adv_tm":"1",
                "gptm":"5",
                "wdg":"2",
                "rtc":"",
                "uart":"1",
                "i2c":"1",
                "spi":"1",
                "adc":"10x12bit",
                "eeprom":"",
                "pack":"QFN32",
                "dac":"",
                "usb":"",
                "can":"",
                "sdio":"",
                "comp":"",
                "aes":"",
                "trng":""
                },        17:{
                "id":"MM32f031K4U6",
                "processor":"ARM Cortex M0",
                "frequency":"72",
                "flash":"16",
                "ram":"4",
                "gpio":"27",
                "adv_tm":"1",
                "gptm":"5",
                "wdg":"2",
                "rtc":"",
                "uart":"1",
                "i2c":"1",
                "spi":"1",
                "adc":"10x12bit",
                "eeprom":"",
                "pack":"QFN32",
                "dac":"",
                "usb":"",
                "can":"",
                "sdio":"",
                "comp":"",
                "aes":"",
                "trng":""
                },
                                                                        18:{
                "id":"MM32f031K4U6",
                "processor":"ARM Cortex M0",
                "frequency":"72",
                "flash":"16",
                "ram":"4",
                "gpio":"27",
                "adv_tm":"1",
                "gptm":"5",
                "wdg":"2",
                "rtc":"",
                "uart":"1",
                "i2c":"1",
                "spi":"1",
                "adc":"10x12bit",
                "eeprom":"",
                "pack":"QFN32",
                "dac":"",
                "usb":"",
                "can":"",
                "sdio":"",
                "comp":"",
                "aes":"",
                "trng":""
                },
############################################################################
##------------------MM32F032-----
##-------------total 8 controllers available------
#############################################################################
                19:{
                "id":"MM32f032K4U6",
                "processor":"ARM Cortex M0",
                "frequency":"72",
                "flash":"16",
                "ram":"4",
                "gpio":"27",
                "adv_tm":"1",
                "gptm":"5",
                "wdg":"2",
                "rtc":"",
                "uart":"1",
                "i2c":"1",
                "spi":"1",
                "adc":"10x12bit",
                "eeprom":"",
                "pack":"QFN32",
                "dac":"",
                "usb":"",
                "can":"",
                "sdio":"",
                "comp":"",
                "aes":"",
                "trng":""
                },
                        20:{
                "id":"MM32f032K4U6",
                "processor":"ARM Cortex M0",
                "frequency":"72",
                "flash":"16",
                "ram":"4",
                "gpio":"27",
                "adv_tm":"1",
                "gptm":"5",
                "wdg":"2",
                "rtc":"",
                "uart":"1",
                "i2c":"1",
                "spi":"1",
                "adc":"10x12bit",
                "eeprom":"",
                "pack":"QFN32",
                "dac":"",
                "usb":"",
                "can":"",
                "sdio":"",
                "comp":"",
                "aes":"",
                "trng":""
                },
                                21:{
                "id":"MM32f032K4U6",
                "processor":"ARM Cortex M0",
                "frequency":"72",
                "flash":"16",
                "ram":"4",
                "gpio":"27",
                "adv_tm":"1",
                "gptm":"5",
                "wdg":"2",
                "rtc":"",
                "uart":"1",
                "i2c":"1",
                "spi":"1",
                "adc":"10x12bit",
                "eeprom":"",
                "pack":"QFN32",
                "dac":"",
                "usb":"",
                "can":"",
                "sdio":"",
                "comp":"",
                "aes":"",
                "trng":""
                },
                22:{
                "id":"MM32f032K4U6",
                "processor":"ARM Cortex M0",
                "frequency":"72",
                "flash":"16",
                "ram":"4",
                "gpio":"27",
                "adv_tm":"1",
                "gptm":"5",
                "wdg":"2",
                "rtc":"",
                "uart":"1",
                "i2c":"1",
                "spi":"1",
                "adc":"10x12bit",
                "eeprom":"",
                "pack":"QFN32",
                "dac":"",
                "usb":"",
                "can":"",
                "sdio":"",
                "comp":"",
                "aes":"",
                "trng":""
                },
                        23:{
                "id":"MM32f032K4U6",
                "processor":"ARM Cortex M0",
                "frequency":"72",
                "flash":"16",
                "ram":"4",
                "gpio":"27",
                "adv_tm":"1",
                "gptm":"5",
                "wdg":"2",
                "rtc":"",
                "uart":"1",
                "i2c":"1",
                "spi":"1",
                "adc":"10x12bit",
                "eeprom":"",
                "pack":"QFN32",
                "dac":"",
                "usb":"",
                "can":"",
                "sdio":"",
                "comp":"",
                "aes":"",
                "trng":""
                },
                                24:{
                "id":"MM32f032K4U6",
                "processor":"ARM Cortex M0",
                "frequency":"72",
                "flash":"16",
                "ram":"4",
                "gpio":"27",
                "adv_tm":"1",
                "gptm":"5",
                "wdg":"2",
                "rtc":"",
                "uart":"1",
                "i2c":"1",
                "spi":"1",
                "adc":"10x12bit",
                "eeprom":"",
                "pack":"QFN32",
                "dac":"",
                "usb":"",
                "can":"",
                "sdio":"",
                "comp":"",
                "aes":"",
                "trng":""
                },
                                        25:{
                "id":"MM32f032K4U6",
                "processor":"ARM Cortex M0",
                "frequency":"72",
                "flash":"16",
                "ram":"4",
                "gpio":"27",
                "adv_tm":"1",
                "gptm":"5",
                "wdg":"2",
                "rtc":"",
                "uart":"1",
                "i2c":"1",
                "spi":"1",
                "adc":"10x12bit",
                "eeprom":"",
                "pack":"QFN32",
                "dac":"",
                "usb":"",
                "can":"",
                "sdio":"",
                "comp":"",
                "aes":"",
                "trng":""
                },
                                        26:{
                "id":"MM32f032K4U6",
                "processor":"ARM Cortex M0",
                "frequency":"72",
                "flash":"16",
                "ram":"4",
                "gpio":"27",
                "adv_tm":"1",
                "gptm":"5",
                "wdg":"2",
                "rtc":"",
                "uart":"1",
                "i2c":"1",
                "spi":"1",
                "adc":"10x12bit",
                "eeprom":"",
                "pack":"QFN32",
                "dac":"",
                "usb":"",
                "can":"",
                "sdio":"",
                "comp":"",
                "aes":"",
                "trng":""
                }
         
                   
            }

def micro_controller_details():
    row_items=1
    d=1
    for i in range(0,26):
        microcontroller=Label(master,text=mc_list[d]['id'],bg="#142E54",fg="white",font="Lato 12 bold",padx="5",pady="5",borderwidth=2,relief="groove").grid(row=row_items,column=0,sticky=N+S+E+W)
        processor=Label(master,text=mc_list[d]['processor'],bg="#142E54",fg="white",font="Lato 12 bold",padx="5",pady="5",borderwidth=2,relief="groove").grid(row=row_items,column=1,sticky=N+S+E+W)
        frequency=Label(master,text=mc_list[d]['frequency'],bg="#142E54",fg="white",font="Lato 12 bold",padx="5",pady="5",borderwidth=2,relief="groove").grid(row=row_items,column=2,sticky=N+S+E+W)
        flash=Label(master,text=mc_list[d]["flash"],bg="#142E54",fg="white",font="Lato 12 bold",padx="5",pady="5",borderwidth=2,relief="groove").grid(row=row_items,column=3,sticky=N+S+E+W)
        ram=Label(master,text=mc_list[d]["ram"],bg="#142E54",fg="white",font="Lato 12 bold",padx="5",pady="5",borderwidth=2,relief="groove").grid(row=row_items,column=4,sticky=N+S+E+W)
        gpio=Label(master,text=mc_list[d]["gpio"],bg="#142E54",fg="white",font="Lato 12 bold",padx="5",pady="5",borderwidth=2,relief="groove").grid(row=row_items,column=5,sticky=N+S+E+W)
        adv_tm=Label(master,text=mc_list[d]["adv_tm"],bg="#142E54",fg="white",font="Lato 12 bold",padx="5",pady="5",borderwidth=2,relief="groove").grid(row=row_items,column=6,sticky=N+S+E+W)
        gptm=Label(master,text=mc_list[d]["gptm"],bg="#142E54",fg="white",font="Lato 12 bold",padx="5",pady="5",borderwidth=2,relief="groove").grid(row=row_items,column=7,sticky=N+S+E+W)
        wdg=Label(master,text=mc_list[d]["wdg"],bg="#142E54",fg="white",font="Lato 12 bold",padx="5",pady="5",borderwidth=2,relief="groove").grid(row=row_items,column=8,sticky=N+S+E+W)
        rtc=Label(master,text=mc_list[d]["rtc"],bg="#142E54",fg="white",font="Lato 12 bold",padx="5",pady="5",borderwidth=2,relief="groove").grid(row=row_items,column=9,sticky=N+S+E+W)
        uart=Label(master,text=mc_list[d]["uart"],bg="#142E54",fg="white",font="Lato 12 bold",padx="5",pady="5",borderwidth=2,relief="groove").grid(row=row_items,column=10,sticky=N+S+E+W)
        i2c=Label(master,text=mc_list[d]["i2c"],bg="#142E54",fg="white",font="Lato 12 bold",padx="5",pady="5",borderwidth=2,relief="groove").grid(row=row_items,column=11,sticky=N+S+E+W)
        spi=Label(master,text=mc_list[d]["spi"],bg="#142E54",fg="white",font="Lato 12 bold",padx="5",pady="5",borderwidth=2,relief="groove").grid(row=row_items,column=12,sticky=N+S+E+W)
        adc=Label(master,text=mc_list[d]["adc"],bg="#142E54",fg="white",font="Lato 12 bold",padx="5",pady="5",borderwidth=2,relief="groove").grid(row=row_items,column=13,sticky=N+S+E+W)
        eeprom=Label(master,text=mc_list[d]["eeprom"],bg="#142E54",fg="white",font="Lato 12 bold",padx="5",pady="5",borderwidth=2,relief="groove").grid(row=row_items,column=14,sticky=N+S+E+W)
        pack=Label(master,text=mc_list[d]["pack"],bg="#142E54",fg="white",font="Lato 12 bold",padx="5",pady="5",borderwidth=2,relief="groove").grid(row=row_items,column=15,sticky=N+S+E+W)
        dac=Label(master,text=mc_list[d]["dac"],bg="#142E54",fg="white",font="Lato 12 bold",padx="5",pady="5",borderwidth=2,relief="groove").grid(row=row_items,column=16,sticky=N+S+E+W)
        usb=Label(master,text=mc_list[d]["usb"],bg="#142E54",fg="white",font="Lato 12 bold",padx="5",pady="5",borderwidth=2,relief="groove").grid(row=row_items,column=17,sticky=N+S+E+W)
        can=Label(master,text=mc_list[d]["can"],bg="#142E54",fg="white",font="Lato 12 bold",padx="5",pady="5",borderwidth=2,relief="groove").grid(row=row_items,column=18,sticky=N+S+E+W)
        sdio=Label(master,text=mc_list[d]["sdio"],bg="#142E54",fg="white",font="Lato 12 bold",padx="5",pady="5",borderwidth=2,relief="groove").grid(row=row_items,column=19,sticky=N+S+E+W)
        comp=Label(master,text=mc_list[d]["comp"],bg="#142E54",fg="white",font="Lato 12 bold",padx="5",pady="5",borderwidth=2,relief="groove").grid(row=row_items,column=20,sticky=N+S+E+W)
        aes=Label(master,text=mc_list[d]["aes"],bg="#142E54",fg="white",font="Lato 12 bold",padx="5",pady="5",borderwidth=2,relief="groove").grid(row=row_items,column=21,sticky=N+S+E+W)
        trng=Label(master,text=mc_list[d]["trng"],bg="#142E54",fg="white",font="Lato 12 bold",padx="5",pady="5",borderwidth=2,relief="groove").grid(row=row_items,column=22,sticky=N+S+E+W)
        row_items=row_items+1
        d=d+1
 

     
     

'''def details(processor,frequency,flash,ram,gpio,adv_tm,gptm,wdg,rtc,uart,i2c,spi,adc,eeprom="-",pack="-",dac="-",usb="",can="",sdio=0,comp=0,aes=0,trng=0,**para):
    T.insert(tk.END, "===========================================================================\n")
    T.insert(tk.END, "Max speed in hz\t\tFLASH\t\tRAM\t\tGPIO\n")
    T.insert(tk.END, "=========================================================================\n")
    T.insert(tk.END,"PROCESSOR::======>{}\n".format(processor))
    T.insert(tk.END,"Frequency Max speed ::====>{}Mhz\n".format(frequency))
    T.insert(tk.END,"FLASH::====>{}KBytes\n".format(flash))
    T.insert(tk.END,"RAM::====>{}KBytes\n".format(ram))
    T.insert(tk.END,"GPIO::====>{}Pins\n".format(gpio))
    T.insert(tk.END,"Advanced timer::====>{}\n".format(adv_tm))
    T.insert(tk.END,"GPTM::====>{}\n".format(gptm))
    T.insert(tk.END,"WDG::====>{}\n".format(wdg))
    T.insert(tk.END,"RTC::====>{}\n".format(rtc))
    T.insert(tk.END,"UART::====>{}\n".format(uart))
    T.insert(tk.END,"I2C::====>{}\n".format(i2c))
    T.insert(tk.END,"SPI::====>{}\n".format(spi))
    T.insert(tk.END,"ADC::====>{}x12bit\n".format(adc))
    T.insert(tk.END,"EEPROM::====>{}KBytes\n".format(eeprom))
    T.insert(tk.END,"PACk::====>{}\n".format(pack))
    T.insert(tk.END,"DAC::====>{}\n".format(dac))
    T.insert(tk.END,"USB::====>{}\n".format(usb))
    T.insert(tk.END,"CAN::====>{}\n".format(can))
    T.insert(tk.END,"SDIO::====>{}\n".format(sdio))
    T.insert(tk.END,"COMP::====>{}\n".format(comp))
    T.insert(tk.END,"AES::====>{}\n".format(aes))
    T.insert(tk.END,"TRNG::====>{}\n".format(trng))
    T.insert(tk.END,"===========================================================================\n")
''' 

#####------------------main program start_here-----------------
master = tk.Tk()
#scrollbar = Scrollbar(master)
#scrollbar.grid( side = RIGHT, fill=Y )

#mylist = Listbox(master, yscrollcommand = scrollbar.set )
microcontroller=Label(master,text="microcontroller",bg="#142E54",fg="white",font="Lato 12 bold",padx="5",pady="5",borderwidth=2,relief="groove").grid(row=0,column=0,sticky=N+S+E+W)
processor=Label(master,text="Processor",bg="#142E54",fg="white",font="Lato 12 bold",padx="5",pady="5",borderwidth=2,relief="groove").grid(row=0,column=1,sticky=N+S+E+W)
frequency=Label(master,text="Frequency",bg="#142E54",fg="white",font="Lato 12 bold",padx="5",pady="5",borderwidth=2,relief="groove").grid(row=0,column=2,sticky=N+S+E+W)
flash=Label(master,text="Flash",bg="#142E54",fg="white",font="Lato 12 bold",padx="5",pady="5",borderwidth=2,relief="groove").grid(row=0,column=3,sticky=N+S+E+W)
ram=Label(master,text="RAM",bg="#142E54",fg="white",font="Lato 12 bold",padx="5",pady="5",borderwidth=2,relief="groove").grid(row=0,column=4,sticky=N+S+E+W)
gpio=Label(master,text="GPIO",bg="#142E54",fg="white",font="Lato 12 bold",padx="5",pady="5",borderwidth=2,relief="groove").grid(row=0,column=5,sticky=N+S+E+W)
adv_tm=Label(master,text="Adv TM",bg="#142E54",fg="white",font="Lato 12 bold",padx="5",pady="5",borderwidth=2,relief="groove").grid(row=0,column=6,sticky=N+S+E+W)
gptm=Label(master,text="GPTM",bg="#142E54",fg="white",font="Lato 12 bold",padx="5",pady="5",borderwidth=2,relief="groove").grid(row=0,column=7,sticky=N+S+E+W)
wdg=Label(master,text="WDG",bg="#142E54",fg="white",font="Lato 12 bold",padx="5",pady="5",borderwidth=2,relief="groove").grid(row=0,column=8,sticky=N+S+E+W)
rtc=Label(master,text="RTC",bg="#142E54",fg="white",font="Lato 12 bold",padx="5",pady="5",borderwidth=2,relief="groove").grid(row=0,column=9,sticky=N+S+E+W)
uart=Label(master,text="UART",bg="#142E54",fg="white",font="Lato 12 bold",padx="5",pady="5",borderwidth=2,relief="groove").grid(row=0,column=10,sticky=N+S+E+W)
i2c=Label(master,text="I2C",bg="#142E54",fg="white",font="Lato 12 bold",padx="5",pady="5",borderwidth=2,relief="groove").grid(row=0,column=11,sticky=N+S+E+W)
spi=Label(master,text="SPI",bg="#142E54",fg="white",font="Lato 12 bold",padx="5",pady="5",borderwidth=2,relief="groove").grid(row=0,column=12,sticky=N+S+E+W)
adc=Label(master,text="ADC",bg="#142E54",fg="white",font="Lato 12 bold",padx="5",pady="5",borderwidth=2,relief="groove").grid(row=0,column=13,sticky=N+S+E+W)
eeprom=Label(master,text="EEPROM",bg="#142E54",fg="white",font="Lato 12 bold",padx="5",pady="5",borderwidth=2,relief="groove").grid(row=0,column=14,sticky=N+S+E+W)
pack=Label(master,text="PACK",bg="#142E54",fg="white",font="Lato 12 bold",padx="5",pady="5",borderwidth=2,relief="groove").grid(row=0,column=15,sticky=N+S+E+W)
dac=Label(master,text="DAC",bg="#142E54",fg="white",font="Lato 12 bold",padx="5",pady="5",borderwidth=2,relief="groove").grid(row=0,column=16,sticky=N+S+E+W)
usb=Label(master,text="USB",bg="#142E54",fg="white",font="Lato 12 bold",padx="5",pady="5",borderwidth=2,relief="groove").grid(row=0,column=17,sticky=N+S+E+W)
can=Label(master,text="CAN",bg="#142E54",fg="white",font="Lato 12 bold",padx="5",pady="5",borderwidth=2,relief="groove").grid(row=0,column=18,sticky=N+S+E+W)
sdio=Label(master,text="SDIO",bg="#142E54",fg="white",font="Lato 12 bold",padx="5",pady="5",borderwidth=2,relief="groove").grid(row=0,column=19,sticky=N+S+E+W)
comp=Label(master,text="COMP",bg="#142E54",fg="white",font="Lato 12 bold",padx="5",pady="5",borderwidth=2,relief="groove").grid(row=0,column=20,sticky=N+S+E+W)
aes=Label(master,text="AES",bg="#142E54",fg="white",font="Lato 12 bold",padx="5",pady="5",borderwidth=2,relief="groove").grid(row=0,column=21,sticky=N+S+E+W)
trng=Label(master,text="TRNG",bg="#142E54",fg="white",font="Lato 12 bold",padx="5",pady="5",borderwidth=2,relief="groove").grid(row=0,column=22,sticky=N+S+E+W)

         
#micro_controller_details(1)
#micro_controller_details(2)
micro_controller_details()


#mylist.pack( side = LEFT, fill = BOTH )
#scrollbar.config( command = mylist.yview )


tk.mainloop()

print(mc_list)
#print(mc_list[2])
print("end of the program\n")

label printing in Tkinter python


from tkinter import *
import tkinter as tk

def show_entry_fields():
    print("First Name: %s\nLast Name: %s" % (e1.get(), e2.get()))
#processor,frequency,flash,ram,gpio,adv_tm,gptm,wdg,rtc,uart,i2c,spi,adc,eeprom="-",pack="-",dac="-",usb="",can="",sdio=0,comp=0,aes=0,trng=0

#####------------------main program start_here-----------------
master = tk.Tk()
#scrollbar = Scrollbar(master)
#scrollbar.pack( side = RIGHT, fill=Y )

#mylist = Listbox(root, yscrollcommand = scrollbar.set )
processor=Label(master,text="processor",bg="black",fg="white").grid(row=0,column=0,sticky=N+S+E+W)
frequency=Label(master,text="frequency",bg="white",fg="black").grid(row=0,column=1,sticky=N+S+E+W)
flash=Label(master,text="flash",bg="black",fg="white").grid(row=0,column=2,sticky=N+S+E+W)
ram=Label(master,text="ram",bg="white",fg="black").grid(row=0,column=3,sticky=N+S+E+W)
gpio=Label(master,text="gpio",bg="black",fg="white").grid(row=0,column=4,sticky=N+S+E+W)
adv_tm=Label(master,text="adv_tm",bg="black",fg="white").grid(row=0,column=5,sticky=N+S+E+W)
gptm=Label(master,text="gptm",bg="black",fg="white").grid(row=0,column=6,sticky=N+S+E+W)
wdg=Label(master,text="wdg",bg="black",fg="white").grid(row=0,column=7,sticky=N+S+E+W)
rtc=Label(master,text="rtc",bg="black",fg="white").grid(row=0,column=8,sticky=N+S+E+W)
uart=Label(master,text="uart",bg="black",fg="white").grid(row=0,column=9,sticky=N+S+E+W)
i2c=Label(master,text="i2c",bg="black",fg="white").grid(row=0,column=10,sticky=N+S+E+W)
spi=Label(master,text="spi",bg="black",fg="white").grid(row=0,column=11,sticky=N+S+E+W)
adc=Label(master,text="adc",bg="black",fg="white").grid(row=0,column=12,sticky=N+S+E+W)
eeprom=Label(master,text="eeprom",bg="black",fg="white").grid(row=0,column=13,sticky=N+S+E+W)
pack=Label(master,text="pack",bg="black",fg="white").grid(row=0,column=14,sticky=N+S+E+W)
dac=Label(master,text="dac",bg="black",fg="white").grid(row=0,column=15,sticky=N+S+E+W)
usb=Label(master,text="usb",bg="black",fg="white").grid(row=0,column=16,sticky=N+S+E+W)
can=Label(master,text="can",bg="black",fg="white").grid(row=0,column=17,sticky=N+S+E+W)
sdio=Label(master,text="sdio",bg="black",fg="white").grid(row=0,column=18,sticky=N+S+E+W)
comp=Label(master,text="comp",bg="black",fg="white").grid(row=0,column=19,sticky=N+S+E+W)
aes=Label(master,text="aes",bg="black",fg="white").grid(row=0,column=20,sticky=N+S+E+W)
trng=Label(master,text="trng",bg="black",fg="white").grid(row=0,column=21,sticky=N+S+E+W)



#mylist.pack( side = LEFT, fill = BOTH )
#scrollbar.config( command = mylist.yview )
tk.mainloop()
print("end of the program\n")

scroll bar in python tkinter

from tkinter import *
import tkinter as tk
#from Tkinter import *

root = Tk()
scrollbar = Scrollbar(root)
scrollbar.pack( side = RIGHT, fill=Y )

mylist = Listbox(root, yscrollcommand = scrollbar.set )
for line in range(100):
   mylist.insert(END, "This is line number " + str(line))

mylist.pack( side = LEFT, fill = BOTH )
scrollbar.config( command = mylist.yview )

root.mainloop()

Wednesday, January 1, 2020

Monday, December 30, 2019

EC25 adb and fastboot devices installation of ubuntu linux


How to install android drivers on ubuntu


How to Install ADB & Fastboot on Ubuntu 16.04, 16.10, 14.04



This tutorial is going to show you how to install ADB & fastboot on Ubuntu 16.04, 14.04, 16.10, which is quite easy.
What is ADB and Fastboot
ADB and fastboot are two components of the Android SDK Platform-Tools.
ADB stands for Android Debug Bridge. It’s a command line utility that allows you to do the following stuff:
  • Control your Android device over USB from your computer
  • Copy files back and forth
  • install and uninstall apps
  • run shell commands
  • and much more
Fastboot is a command line tool for flashing and Android device, boot an Android device to fastboot mode, etc…
How to Install ADB and Fastboot on Ubuntu 16.04, 16.10, 14.04
It’s super easy. Simply run the following commands in a terminal window to install them from Ubuntu repository.
sudo apt update
sudo apt install android-tools-adb android-tools-fastboot
To check ADB version, run
adb version
Sample output:
Android Debug Bridge version 1.0.32
Enable USB Debugging on Your Android Device
While you Android device is unplugged from USB, go to your Android settings, scroll all the way down and tap About phone or About device. Then tap Build number 7 times which makes you a developer.
Now go back to the settings, you will see a new button called Developer options. Tap that button and enable USB debugging.
Test the Installation
To check if ADB is working properly, connect your Android device to your Ubuntu computer via USB cable. After that, type the following command in your Ubuntu terminal window.
adb devices
You will be prompted to allow USB debugging from Ubuntu computer like the screenshot below. Select OK.

Then type run adb devices command again and your Android device will show up.

If you get the following error,
????????????    no permissions
Then all you need to do is restart adb daemon, run
sudo adb kill-server
Then
sudo adb start-server


EC25 basic commands list

use qcomm for debug which support at commands ..tool is very useful
download here


python class topic video