Python Forum
PyQt5: How do you set the user input of a line edit to a specific variable?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PyQt5: How do you set the user input of a line edit to a specific variable?
#5
Okay @buran first off I do stand corrected but only partially -- for importing PyQt import QtWidgets does not import the same thing as from PyQt.QtWidgets import QApplication, etc... because in the latter you have a single reference to a single method and this denotes exactly what you are using within that library within your program. This in turn makes your code more direct, less confusing and less verbose. And again not being specific is being lazy and lazy coding is always bad coding.

On the other hand -- yes the only difference between the two statements is what name is bound; import QtWidgets binds the name QtWidgets to the entire module (so QtWidgets -> QtWidgets.modules['QtWidgets']), while from QtWidgets import QApplication binds a different name, QApplication, pointing straight at the attribute contained inside of the module (so QApplication -> QtWidgets.modules['QtWidgets'].QApplication). The rest of the QtWidgets module is still there, whether you use anything else from the module or not.

Next my statement about super( ) is not arguable but go ahead and make that false claim just know that I fully researched super( ) before I made that statement -- all the pros/cons that I could find (quite numerable btw). So I am confident that I do know what it does and does not do. On the flip-side however I am guessing you do not even know why it was initially created -- aka the rare and specific issue it was created to handle -- nor are you probably aware of the issues that it creates when you do use it otherwise you would not have made your basically false claim
Reply


Messages In This Thread
RE: PyQt5: How do you set the user input of a line edit to a specific variable? - by Denni - Dec-23-2019, 04:55 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [PyQt] PyQt5 QTableView SQLite : edit cell HeinKurz 2 2,723 Mar-27-2023, 10:41 AM
Last Post: HeinKurz
  [PyGUI] [Solved]Help storing in user input from line edit Extra 2 1,934 May-12-2022, 07:46 PM
Last Post: Extra
  [Tkinter] Help with input from specific devices Noob_hobbyist 3 2,543 Feb-02-2021, 04:11 AM
Last Post: deanhystad
  Convert combobox user input in to date with tkinter Ame 8 7,051 Jul-01-2020, 09:40 PM
Last Post: Yoriz
  Create an identification code from user input PeroPuri 1 1,986 Apr-11-2020, 11:56 AM
Last Post: Larz60+
  [PyQt] Python PyQt5 - Change label text dynamically based on user Input ppel123 1 14,009 Mar-20-2020, 07:21 AM
Last Post: deanhystad
  [Tkinter] Is there a way to sleep without stopping user input? GalaxyCoyote 2 2,230 Oct-23-2019, 06:23 PM
Last Post: Denni
  [Tkinter] Registering user's drop down menu choice and finding corresponding line in files ShadeLily 2 2,127 Oct-03-2019, 06:28 PM
Last Post: joe_momma
  Huge code problems (buttons(PyQt5),PyQt5 Threads, Windows etc) ZenWoR 0 2,960 Apr-06-2019, 11:15 PM
Last Post: ZenWoR
  [Tkinter] help please, checking the user input and outputting the result tomkovladko 3 2,867 Mar-05-2019, 08:58 PM
Last Post: joe_momma

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020