Results 1 to 2 of 2
  1. #1
    soheilz92 is offline Member
    Join Date
    Apr 2011
    Posts
    3
    Rep Power
    0

    Default Run Python file in Java code

    Dear friends

    I want to run a Python executable file in Java
    In windows i installed Python and and execute this file easily in command line mode (this file accept some argument for its procedure)

    Java Code:
    D:\pyhon27\python D:\python27\cp_wordnet.py 2 2 2 2r 2e 3ssd 2dfdf 2 1 2 2

    Now i want to do same thing in Java code, i means i should cal cmd and execute that line on that, i have already tried these commands
    (The 'path' is String and equal to "D:\pyhon27\python
    Java Code:
    D:\python27\cp_wordnet.py 2 2 2 2r 2e 3ssd 2dfdf 2 1 2 2")
    
    Process p = Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler "+ path);
     
    Process p = Runtime.getRuntime().exec("cmd /c "+ path);
     
    Process p = Runtime.getRuntime().exec("rundll64 SHELL64.DLL,ShellExec_RunDLL "+ path);			
     
    Process p  = Runtime.getRuntime().exec(path);
    but i haven't had result !!


    could somebody pleas help me

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,305
    Rep Power
    20

Similar Threads

  1. Problem in java python socket reopening
    By cool in forum AWT / Swing
    Replies: 0
    Last Post: 01-19-2011, 10:15 AM
  2. calling python file from java
    By cool in forum AWT / Swing
    Replies: 3
    Last Post: 11-11-2010, 03:50 AM
  3. Java md5&Blowfish port from Python(Encryption)
    By Neo Angelus in forum Advanced Java
    Replies: 0
    Last Post: 06-08-2010, 04:38 PM
  4. Jython : python for java
    By cotarelo in forum New To Java
    Replies: 1
    Last Post: 03-25-2010, 08:53 AM
  5. Call java Methods from Python Script
    By hofsoc in forum New To Java
    Replies: 1
    Last Post: 02-18-2009, 04:47 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •