Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Opening other applications using python

Tags:

python

I am using Ubuntu 12.04 on a 64bit laptop. I am trying to open an application using python code.

import os
os.system("open /home/utsav/ab.txt")

It gives the following error:

"Couldn't get a file descriptor referring to the console 256"

What command do I want to use?

like image 546
Utsav Gudhaka Avatar asked Aug 11 '26 12:08

Utsav Gudhaka


1 Answers

The command you're using - open is actually another command referred to in the man pages as openvt, which opens a virtual terminal.

I don't think that's what you want to do, so you would want to use another command (such as gnome-open, xdg-open, geany, gedit, vim, or nano).

like image 190
Makoto Avatar answered Aug 13 '26 00:08

Makoto