Hi, I have a question. I'm getting the data from the text file until the sql handles it. What I want is to return the index value of the element I selected on the ComboBox named Companies to the other boxes. In this way, the passwords of the companies etc. will also be poured onto the screen. So exactly what I want is to set the index values of the selected item on the first ComboBox and the other ComboBoxes. I've done this with C#, and I'm leaving it as an example.
My Python Code:
C# Code:
KullaniciList.SelectedIndex = SirketList.SelectedIndex;
kodList.SelectedIndex = SirketList.SelectedIndex;
sistemList.SelectedIndex = SirketList.SelectedIndex;
isverenList.SelectedIndex = SirketList.SelectedIndex;
ListAraci.SelectedIndex = SirketList.SelectedIndex;
My Python Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
import sys from PyQt5 import QtWidgets from PyQt5.QtGui import QIcon from PyQt5.QtGui import QIcon from AyGrupOtomasyon import Ui_MainWindow from selenium import webdriver import time import os from selenium.webdriver.common.keys import Keys import threading class MyApp(QtWidgets.QMainWindow): def __init__( self ): super (MyApp, self ).__init__() self .ui = Ui_MainWindow() self .ui.setupUi( self ) self .ui.btn_Bildirge_2.clicked.connect( self .ButonV2Calistir) self .DosyaOku() def DosyaOku( self ): os.chdir( "Data" ) dosyaOku = open ( "sirket.txt" , "r" , encoding = "utf-8" ) for i in dosyaOku: self .ui.cb_Firmalar.addItem(i) dosyaOku = open ( "kullanici.txt" , "r" , encoding = "utf-8" ) for i in dosyaOku: self .ui.cb_Kullanici.addItem(i) dosyaOku = open ( "kod.txt" , "r" , encoding = "utf-8" ) for i in dosyaOku: self .ui.cb_Kod.addItem(i) dosyaOku = open ( "isveren.txt" , "r" , encoding = "utf-8" ) for i in dosyaOku: self .ui.cb_Isveren.addItem(i) dosyaOku = open ( "araci.txt" , "r" , encoding = "utf-8" ) for i in dosyaOku: self .ui.cb_Araci.addItem(i) dosyaOku = open ( "sistem.txt" , "r" , encoding = "utf-8" ) for i in dosyaOku: self .ui.cb_Sistem.addItem(i) def ButonV2Calistir( self ): def ButonV2(): browser = webdriver.Chrome( "chromedriver.exe" ) var = input () ButonV2CalistirThread = threading.Thread(target = ButonV2) ButonV2CalistirThread.start() def app(): app = QtWidgets.QApplication(sys.argv) app.setStyle( 'Fusion' ) win = MyApp() win.show() sys.exit(app.exec_()) app() |
KullaniciList.SelectedIndex = SirketList.SelectedIndex;
kodList.SelectedIndex = SirketList.SelectedIndex;
sistemList.SelectedIndex = SirketList.SelectedIndex;
isverenList.SelectedIndex = SirketList.SelectedIndex;
ListAraci.SelectedIndex = SirketList.SelectedIndex;