I meet a problem in Ubuntu 20.04 python3

Asked by TokiYe

I installed virtkey in Ubuntu 20.04 through "sudo apt-get install python3-virtkey".It's my first time to use virtkey . And I meet a problem.The system tells me that
"File 'shishi.py',line 3, in <module>
 v = virtkey.virtkey()
 virtkey.error: failed initialize dispaly : ("

I think when my code is run the system knows I tries to initialize.But I can't figure out what is able to cause initialization failure.

Here is my code:

import virtkey

v = virtkey.virtkey()
if v.press_unicode(ord('a'))==True:
    print ('YES!')

Can you give me some instructions?

Question information

Language:
English Edit question
Status:
Solved
For:
virtkey Edit question
Assignee:
No assignee Edit question
Solved by:
TokiYe
Solved:
Last query:
Last reply:
Revision history for this message
Manfred Hampl (m-hampl) said :
#1

Probably the same problem as https://stackoverflow.com/q/38025503 (click on "show 4 more comments")

Revision history for this message
TokiYe (tokiye) said :
#2

thank you.With your help I can run my program very well!