def Main(): running = True override = False while running: print "1. Manual" print "2. Automatic" print "3. Exit" input_option = input() input_option = control.verify_input(input_option) if input_option == 1: override = True if input_option == 2: override = False automatic.run() if input_option == 3: return if override == True: override_selection() break
def main(): # Hauptprogramm auto_eins = Auto.Auto("Kia", "Silber", 50, 3) auto_zwei = Auto.Auto("Bentley", "Weiß", 150, 5) auto_drei = Auto.Auto("Fiat", "Rot", 120, 3) print("\nDaten von Auto eins:") auto_eins.zeige_daten() print("\nDaten von Auto zwei:") auto_zwei.zeige_daten() print("\nDaten von Auto drei:") auto_drei.zeige_daten() print("\nDie Autos fahren ein wenig durch die Gegend...") auto_eins.strecke_fahren(64) auto_zwei.strecke_fahren(128) auto_drei.strecke_fahren(110) print("Kilometerstand des ersten Autos:", auto_eins.kilometerstand) print("Kilometerstand des dritten Autos:", auto_drei.kilometerstand) print("wir haben Spaß!") print("asef") print("so ist es besser!!")
def run(): RetrieveEmail.getMail() RetrieveEmail.convertToXlsx() ProcessSheet.processSheet() Auto.populateDataAuto() DoAssignments.doAssignments() FormatSheet.formatSheet()
def main(): # Hauptprogramm auto_eins = Auto.Auto("VW Käfer Rabitt", "Silbermetalic", 110, 5) auto_zwei = Auto.Auto("Golf", "Grün", 50, 3) print("\nDaten von Auto eins:") auto_eins.zeige_daten() print("\nDaten von Auto zwei:") auto_zwei.zeige_daten() print("Neues Auto erzeugt") print("Der Fehler wurde behoben!") auto_eins.strecke_fahren(64) auto_zwei.strecke_fahren(128) print("Kilometerstand des ersten Autos:", auto_eins.kilometerstand) print("Kilometerstand des zweiten Autos:", auto_zwei.kilometerstand)
class MainController(): def __init__(self, una_ventana): self.Auto = Auto() self.ventana = una_ventana def handler_subir_persona(self): self.Auto.subirPersonas() self.actualizar_Label() def handler_bajar_persona(self): self.Auto.bajarPersonas() self.actualizar_Label() def handler_subir_persona5(self): i = 1 while i <= 5: i += 1 self.handler_subir_persona() def handler_bajar_persona5(self): i = 1 while i <= 5: i += 1 self.handler_bajar_persona() def handler_subir_personax(self): x = self.ventana.entrada_texto.text() i = int(x) while i > 0: i -= 1 self.handler_subir_persona() def handler_bajar_personax(self): x = self.ventana.entrada_texto.text() i = int(x) while i > 0: i -= 1 self.handler_bajar_persona() def actualizar_Label(self): self.ventana.label.setText(str(self.Auto.cantPersonas))
def main(): # Hauptprogramm auto_eins = Auto.Auto("Kia", "Silber", 100, 3) print("\nDaten von Auto eins:") auto_eins.zeige_daten() print("\nDie Autos fahren ein wenig durch die Gegend...") auto_eins.strecke_fahren(64) print("Kilometerstand des ersten Autos:", auto_eins.kilometerstand)
def robotInit(self): """ This function is called upon program startup and should be used for any initialization code. """ self.table = NetworkTables.getTable("SmartDashboard") self.robot_drive = wpilib.drive.DifferentialDrive( wpilib.Spark(0), wpilib.Spark(1)) self.stick = wpilib.Joystick(0) self.elevatorMotor = wpilib.VictorSP(5) self.intakeMotor = wpilib.VictorSP(2) self.intakeMotorLeft = wpilib.VictorSP(3) self.intakeMotorRight = wpilib.VictorSP(4) self.climbMotor = wpilib.VictorSP(6) self.ahrs = AHRS.create_i2c(0) #self.gearSpeed = .5 #self.lights = wpilib.Relay(1) #self.lightToggle = False #self.lightToggleBool = True #self.togglev = 0 self.robot_drive.setSafetyEnabled(False) wpilib.CameraServer.launch() self.xb = wpilib.Joystick(1) self.Compressor = wpilib.Compressor(0) self.Compressor.setClosedLoopControl(True) self.enabled = self.Compressor.enabled() self.PSV = self.Compressor.getPressureSwitchValue() self.LeftSolenoid = wpilib.DoubleSolenoid(0, 1) self.RightSolenoid = wpilib.DoubleSolenoid(2, 3) self.Compressor.start() self.wheel = wpilib.Encoder(0, 1) self.wheel2 = wpilib.Encoder(2, 3, True) self.encoder = Sensors.Encode(self.wheel, self.wheel2) #wpilib.CameraServer.launch() self.ultrasonic = wpilib.AnalogInput(0) self.autoSchedule = Auto.Auto(self, ) self.intakeToggle = False self.intakePos = False self.openSwitch = wpilib.DigitalInput(9) self.closedSwitch = wpilib.DigitalInput(8) self.speed = 0.6 self.leftSpeed = 0.7 self.rightSpeed = 0.7 self.speedToggle = False
def start(ip, op, scale): io = IO.IO(ip) y, sr = io.load() auto = Auto.Autotune(y, sr, scale) print('Starting Pitch Correction.') yT = auto.correct() print('Pitch Correction Completed.') input('Enter any key to view output Plots.') print('Calculating Plots...') plt = Plotter.Plotter(y, sr, yT, sr) plt.plot() print('Dumping output to %s...' % op, end='') io.dump(op, yT, sr) print('Done.')
def authorized(self, user: str, password: str) -> bool: if isinstance(user, str) and isinstance(password, str) is False: print("Неверный тип данных!") return False if not os.path.exists(user): print('Неверные данные!') return False with open(os.path.abspath(user) + '/USER_INFO/password.txt', 'r') as file: user_password = file.read() if Auto.Autorise().check_password(user_password, password): with open(os.path.abspath(user) + '/USER_INFO/enc_key.txt', 'rb') as byte_enc_key_file: self.__user_secret_key = byte_enc_key_file.read() return True else: print('Неверные данные!') return False
def openDialogAuthorization(self): self.dial=Auto.authorizationClass(self) if self.dial.exec_(): print ('Authorization')
import Auto opel = Auto() print opel
def __init__(self, una_ventana): self.auto = Auto() self.ventana = una_ventana
class MainController(): def __init__(self, una_ventana): self.auto = Auto() self.ventana = una_ventana def handler_subir_persona(self): self.auto.subir_persona() print (self.auto.cantidad_personas) self.actualizar_label() def handler_bajar_persona(self): self.auto.bajar_persona() print (self.auto.cantidad_personas) self.actualizar_label() def actualizar_label(self): self.ventana.label.setText(str(self.auto.cantidad_personas)) def handler_subir5_personas(self): self.auto.subir5_personas() print (self.auto.cantidad_personas) self.actualizar_label() def handler_bajar5_personas(self): self.auto.bajar5_personas() print (self.auto.cantidad_personas) self.actualizar_label() def hanlder_subirN(self): x = self.ventana.entrada_valores.text() n = int(x) self.auto.subirN_personas(n) print (self.auto.cantidad_personas) self.actualizar_label() def hanlder_bajarN(self): x = self.ventana.entrada_valores.text() n = int(x) self.auto.bajarN_personas(n) print (self.auto.cantidad_personas) self.actualizar_label()
print('3-Обновить заметку') print('4-Удалить заметку') print('5-Количество заметок') print('6-Выход в меню управления аккаунтом') return None db = Data.Data() db.create_new_user_db() os.chdir('DataBase') sec = Security.Security() auth_flag = False secret_key = b'' while True: main_menu() main_menu_choice = Auto.Autorise().menu_choice() print() if main_menu_choice == 1: user = '' password = '' while True: user = Auto.Autorise().get_correct_str('логин') password = Auto.Autorise().get_password() if db.authorized(user, password): print('Авторизация прошла успешно') auth_flag = True master_key = sec.gen_master_key(password) secret_key = sec.decrypt(db.get_secret_key(), master_key) else: auth_flag = False if auth_flag:
import Auto renault_logan = Auto('Renault', 'Logan') renault_logan.desc_auto()