how to hide the MS-dos window of an outside dos program in python

Posted on 2005-05-04
Last Modified: 2008-01-09
In my python program, I use spawnl and os.system to call an outside dos .exe program. When that dos program is called and running, a MS-Dos window appears briefly and then disappears as the dos program ends. My question is: is there any way to suppress the appearance of that Dos Window? I am using py2exe to distribuite the program.
Question by:bergel
    LVL 14

    Accepted Solution

    Instead of this, for example:


    you can do this:


    which will run the command invisibly, reading and discarding its output.

    Author Comment

    Excellent.  Thanks, this solved my problem.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Less strange, but still introduction This introduction was added (1st August, 2011) to reflect some reactions.  Firstly, the term basics in the title of the article...  As any other word, it is a symbol with meaning attached to the word by some a…
    Article by: Swadhin
    Introduction of Lists in Python: There are six built-in types of sequences. Lists and tuples are the most common one. In this article we will see how to use Lists in python and how we can utilize it while doing our own program. In general we can al…
    Learn the basics of strings in Python: declaration, operations, indices, and slicing. Strings are declared with quotations; for example: s = "string": Strings are immutable.: Strings may be concatenated or multiplied using the addition and multiplic…
    Learn the basics of if, else, and elif statements in Python 2.7. Use "if" statements to test a specified condition.: The structure of an if statement is as follows: (CODE) Use "else" statements to allow the execution of an alternative, if the …

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now