TrabalhosGratuitos.com - Trabalhos, Monografias, Artigos, Exames, Resumos de livros, Dissertações
Pesquisar

Conversor de Temperatura em Python

Por:   •  11/6/2016  •  Trabalho acadêmico  •  1.143 Palavras (5 Páginas)  •  547 Visualizações

Página 1 de 5

from tkinter import *

from tkinter import ttk

from os import system

def falerta(*args):

aux = Tk()

Lcor = ttk.Label(aux, text=' O PROGRAMA DEVE SER EXECUTADO COMO ROOT \n \n'

'O PROGRAMA PODE TRAZER EFEITOS INDESEJADOS\n \n'

'AO CLICAR EM OK POR FAVOR DIGITE SUA SENHA', font=13)

Lcor.grid(row=2, column=0, sticky=(W, E))

botãoPecas = ttk.Button(aux, text='OK', command=aux.destroy)

botãoPecas.grid(row=3, column=0, sticky=(N))

aux.title('ALERTA DE USO')

aux.mainloop()

acessaRoot()

def acessaRoot():

system("gnome-terminal -e 'sudo python3.5 proxy.py'") #ABRE O TERMINAL LINUX PARA INSERIR A

#SENHA E PERMITIR QUE EXECUTE O PROGRAMA EM SUPER USUARIO

#OBS: APENAS É POSSÍVEL ALTERAR O PROXY PELO SUPER USUARIO

falerta()

_________________________________________NO MÓDULO PROXY______________________________________________________________

from tkinter import *

from tkinter import ttk

from os import remove

class PythonPY(ttk.Frame):

#este e o construtor da classe

def __init__(self,parente, *args, **kwargs):

ttk.Frame.__init__(self,parente, *args, **kwargs)

self.parente = parente

self.parente.grid_rowconfigure(0, weight=1)

self.parente.grid_columnconfigure(0, weight=1)

self.https = StringVar()

self.http = StringVar()

self.ftp = StringVar()

self.porta = IntVar()

self.retorno = StringVar()

# self.https.set('')

# self.http.set('')

# self.ftp.set('')

# self.porta.set('')

#################################REFERE-SE A CRIAÇÃO DA INTERFACE##################################################

style = ttk.Style()

style.configure('TButton', padding=4, width=15,relief='raised')

style.configure('TLabel', padding=3, relief='flat', font='helvetica 11')

self.Lcor = ttk.Label(self.parente, text='HTTPS')

self.Lcor.grid(row=2, column=0, sticky=(W, E))

self.Ecor = ttk.Entry(self.parente, textvariable=self.https, font='helvetica 10')

self.Ecor.grid(row=2, column=1, sticky=(W, E))

self.Lcor = ttk.Label(self.parente, text='HTTP')

self.Lcor.grid(row=3, column=0, sticky=(W, E))

self.Ecor = ttk.Entry(self.parente, textvariable=self.http, font='helvetica 10')

self.Ecor.grid(row=3, column=1, sticky=(W, E))

self.Lcor = ttk.Label(self.parente, text='FTP')

self.Lcor.grid(row=4, column=0, sticky=(W, E))

self.Ecor = ttk.Entry(self.parente, textvariable=self.ftp, font='helvetica 10')

self.Ecor.grid(row=4, column=1, sticky=(W, E))

self.Lcor = ttk.Label(self.parente, text='PORTA')

self.Lcor.grid(row=5, column=0, sticky=(W, E))

self.Ecor = ttk.Entry(self.parente, textvariable=self.porta, font='helvetica 10')

self.Ecor.grid(row=5, column=1, sticky=(W, E))

self.botãoPecas = ttk.Button(self.parente, text='ATIVAR', command=self.abrirarquivo)

self.botãoPecas.grid(row=6, column=1, sticky=(W))

self.botãoPecas = ttk.Button(self.parente, text='DESATIVAR', command=self.removeProxy)

self.botãoPecas.grid(row=7, column=1, sticky=(W))

self.botãoPecas = ttk.Button(self.parente, text='APAGAR', command=self.excluiArquivo)

self.botãoPecas.grid(row=8,

...

Baixar como (para membros premium)  txt (5.7 Kb)   pdf (64.3 Kb)   docx (11.5 Kb)  
Continuar por mais 4 páginas »
Disponível apenas no TrabalhosGratuitos.com