Results 1 to 7 of 7

Thread: executing .py file from qt

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts

    Default Re: executing .py file from qt

    Quote Originally Posted by prachi kamble View Post
    yes python is there on PATH..
    what if i have no argument list.. still i have to give empty?
    No, there is an overload that does not require the arguments QStringList if you just want to run the Python interpreter without a script.

    Cheers,
    _

  2. #2
    Join Date
    Apr 2015
    Posts
    26
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded PyQt3 PyQt4
    Platforms
    Windows
    Thanks
    2

    Default Re: executing .py file from qt

    thnx sir,
    so it means the following code is correct?

    Qt Code:
    1. QProcess process;
    2.  
    3. process.setWorkingDirectory("D:\\QTDev\\QuickEditor");
    4. process.setProgram("python helloworld.py");
    5. process.start("python helloworld.py");
    6. process.waitForFinished(1000);
    To copy to clipboard, switch view to plain text mode 

  3. #3
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts

    Default Re: executing .py file from qt

    No, unless you have an executable called "python hellowordl.py", which is highly unlikely, most programs don't have spaces in their program names.

    Cheers,
    _

Similar Threads

  1. doubt in by executing script file in qt
    By iswaryasenthilkumar in forum Newbie
    Replies: 5
    Last Post: 20th June 2015, 11:44
  2. Error while executing the exe release file
    By harmodrew in forum Newbie
    Replies: 7
    Last Post: 21st September 2010, 10:21
  3. Problems with executing the *.exe file
    By iksarp in forum Newbie
    Replies: 14
    Last Post: 28th February 2010, 05:49
  4. output while executing should be redirected to text file
    By AnithaRagupathy in forum Qt Programming
    Replies: 3
    Last Post: 13th October 2007, 10:33
  5. Executing SQL scripts from a file
    By William Wilson in forum Qt Programming
    Replies: 2
    Last Post: 30th August 2007, 19:28

Tags for this Thread

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
  •  
Qt is a trademark of The Qt Company.