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. QPdfDocument.Error.None : syntax error in Python
Forum Updated to NodeBB v4.3 + New Features

QPdfDocument.Error.None : syntax error in Python

Scheduled Pinned Locked Moved Solved Qt for Python
3 Posts 2 Posters 350 Views
  • 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.
  • G Offline
    G Offline
    Gotjek
    wrote on last edited by Gotjek
    #1

    Hello,

    In the Pyside6 documentation, there is QPdfDocument.Error.None.

    But if I run this script :

    pdf_path = "C:\myfile.pdf"
    pdf_doc = QPdfDocument()
    load_error = pdf_doc.load(pdf_path)
    if load_error != QPdfDocument.Error.None:
        print("All went good.")
    

    I get this error :

        if load_error != QPdfDocument.Error.None:
                                            ^^^^
    SyntaxError: invalid syntax
    

    I am not very familiar with Pyside6 and not a very good programmer in Python. But None seems to be a reserved word in Python and I cannot understand how to use this error. I found nothing else about QPdfDocument.Error.None on the internet.

    Regards

    1 Reply Last reply
    0
    • F Offline
      F Offline
      friedemannkleint
      wrote on last edited by
      #2

      Try: QPdfDocument.Error.None_ .

      1 Reply Last reply
      1
      • G Offline
        G Offline
        Gotjek
        wrote on last edited by
        #3

        Thank you very much !

        1 Reply Last reply
        0
        • SGaistS SGaist has marked this topic as solved on

        • Login

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