LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-29-2011, 03:55 PM   #1
vbx_wx
Member
 
Registered: Feb 2010
Posts: 181

Rep: Reputation: 16
Hide XTERM console


Hello, I have this simple code written in python:

Code:
import os

os.system("xterm -e 'ls /usr/lib'")
Is there anyway I can hide the xterm window that is opening ?
 
Old 03-29-2011, 05:16 PM   #2
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS,Manjaro
Posts: 5,646

Rep: Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697
Hide xterm

From Python you should not require xterm to execute a shell command.
Have you considered NOT calling xterm?
 
1 members found this post helpful.
Old 03-30-2011, 03:18 AM   #3
vbx_wx
Member
 
Registered: Feb 2010
Posts: 181

Original Poster
Rep: Reputation: 16
If I call xterm, i call it because I need it.
 
Old 03-30-2011, 04:15 AM   #4
MadCatMk2
LQ Newbie
 
Registered: Sep 2007
Location: Greece
Distribution: Archlinux
Posts: 3

Rep: Reputation: 0
Quote:
Originally Posted by vbx_wx View Post
If I call xterm, i call it because I need it.
Please tell us what you're trying to do.
 
Old 03-30-2011, 10:55 AM   #5
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
Have it displayed on an X virtual framebuffer (Xvfb).
Maybe set the geometry of the window to 1 X 1 pixel; it isn't hidden, bit its too small for many people to notice.
--- rod.

Last edited by theNbomr; 03-30-2011 at 10:59 AM.
 
Old 03-31-2011, 03:58 AM   #6
vbx_wx
Member
 
Registered: Feb 2010
Posts: 181

Original Poster
Rep: Reputation: 16
@MadCatMk2: I am trying to print for example the contents of a directory but the output should be in a new console. Something similar to start cmd 'dir c:\\' .
 
Old 03-31-2011, 04:18 AM   #7
dwhitney67
Senior Member
 
Registered: Jun 2006
Location: Maryland
Distribution: Kubuntu, Fedora, RHEL
Posts: 1,541

Rep: Reputation: 335Reputation: 335Reputation: 335Reputation: 335
vbx_wx:

I think MadCatMk2 was attempting to ask specifically why do you need to perform the operation if no one is to see it? What is the point of using a terminal (xterm) if no one is to see it? Is the point to run "ls" or is it to run "xterm"? Are the results of "ls" important to your application?

Anyhow, often times, if not always, when someone poses the question "what are you trying to accomplish?", it is important to specify why something is required to be done, not how it is going to be done.

At any rate, have you tried specifying the xterm option "-iconic"??
 
1 members found this post helpful.
Old 03-31-2011, 10:01 AM   #8
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS,Manjaro
Posts: 5,646

Rep: Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697
xterm?

Do you see why it seems pointless to us that you jump through hoops to display something, that you then need to be hidden?

If the results are not to be seen, why display anything at all?
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Xterm console capturing mendiratta Linux - General 2 08-23-2008 01:02 AM
[SOLVED] Midnight Commander hangs up console or xterm w1k0 Slackware 4 05-28-2008 08:11 PM
The character "d" is not recognized in console or xterm rwfoo Fedora 1 07-14-2007 09:37 PM
console to xterm andydoff Linux - Newbie 3 02-22-2005 03:50 AM
console/xterm scroll? marlor Slackware 4 08-04-2004 10:41 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:41 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration