Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. Variable from notepad problem
Forum Updated to NodeBB v4.3 + New Features

Variable from notepad problem

Scheduled Pinned Locked Moved Unsolved Qt for Python
3 Posts 3 Posters 282 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Samuel BachorikS Offline
    Samuel BachorikS Offline
    Samuel Bachorik
    wrote on last edited by
    #1

    Hello dear friends, i have made here simple function and if statement.

    Variable b is equal to "a" and i put in my text box "a". But label do not change. When i replace in if statement variable b with string "a" then it is working. So my question is what should i add there for get it work ? I tried str(b) but not working is there anything else iam missing ?

    b is equal to "a"
    and i put in my textbox "a"
    but label do not change

    d0a19a12-0d0e-44a5-b79e-0419804a29c2-image.png

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      To have an idea of their content, you should print both values. You may have a subtle difference between the two.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • Volodymyr14V Offline
        Volodymyr14V Offline
        Volodymyr14
        wrote on last edited by
        #3

        I n the login.txt file, the value of b is "some text\n". As I see, here is a QlineEdit. You can try:

        if self.textbox.text() == b.rstrip("\r\n"):
        

        PyQt/PySide

        1 Reply Last reply
        1

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved