Results 1 to 2 of 2

Thread: Trying to launch a program through another one.

  1. #1
    Join Date
    Mar 2015
    Posts
    105
    Thanks
    50

    Default Trying to launch a program through another one.

    Me and my sister made a program using Qt Framework in c++ and when i click in a button this program should launch another program(web crawler) made in python(she preferred to do using this language). The problem is when i click on that button i get the following error message:

    c:\Python34\python.exe is not recognized as an internal or external command, operable program or batch file.
    How we call it in my c++ code.
    Qt Code:
    1. void Historic::on_pushButton_clicked( ) {
    2. system("c:\Python34\python.exe d:\Programming\Python\Pycharm\test.py");
    3. }
    To copy to clipboard, switch view to plain text mode 

    Python code just to test:
    Qt Code:
    1. fw = open(r'd:\Programming\Python\Pycharm\test.txt', 'w')
    2. fw.write("working fine")
    3. fw.close( )
    To copy to clipboard, switch view to plain text mode 

    What is wrong? How can we fix it? We are using Windows 7-64bit.

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Trying to launch a program through another one.

    For one thing, in C++ you need to escape backslashes in strings: "C:\\Python34\\python.exe" as well as in the argument string.

    See the answer to your other post to learn how to do this the Qt way.

Similar Threads

  1. Launch octave from Qt
    By Nick_Neo in forum Newbie
    Replies: 4
    Last Post: 12th June 2015, 11:03
  2. Replies: 1
    Last Post: 11th November 2009, 11:46
  3. I cannot launch my app!
    By MIH1406 in forum Qt Tools
    Replies: 9
    Last Post: 26th October 2009, 12:53
  4. launch app
    By damien in forum Qt Programming
    Replies: 2
    Last Post: 5th February 2009, 20:42
  5. qpe launch problem
    By fishrei in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 15th October 2008, 04:17

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.