Results 1 to 8 of 8
  1. #1
    jstys92 is offline Member
    Join Date
    Jun 2011
    Posts
    4
    Rep Power
    0

    Default Accessing Local File

    Hi,

    I'm not sure if this is remotely possible, but I have a situation where I want my java applet to execute a local file (python program) on my specific machine. The reason behind this being that I have a specific piece of hardware that I don't expect the user to have and want to try and give them the privilege of accessing its gathered data via the applet. Is this possible?

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,882
    Rep Power
    25

    Default

    I'm not sure where all the parts for this are located.
    There is a server with your html and applet.
    On your computer there is a python program
    And on the client's computer there is a browser that will load the html with the applet from the server and then access your computer to execute the program???
    What server or software do you run on your computer that would allow a connection to be made to it?
    Why not have the server on your computer? The client could connect to it load the applet and the applet could submit a request to that server and ask it to execute your program.

    Or if not, could you explain what you want to do

  3. #3
    jstys92 is offline Member
    Join Date
    Jun 2011
    Posts
    4
    Rep Power
    0

    Default

    What you mention about sending a request to execute the python program is what I want to do. The only thing I'm unsure of is that this python program relies on a USB connection with my particular computer, so would the client sending a request to the server try to access my USB connection or the client's?

  4. #4
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,882
    Rep Power
    25

    Default

    I still don't understand the configuration for your project.
    Where are all the parts for this project located?
    I mentioned 3 different locations.
    Where would the code for each part of the project execute?
    Can you step thru what you want to happen starting with the client opening a browser and entering a URL.

  5. #5
    jstys92 is offline Member
    Join Date
    Jun 2011
    Posts
    4
    Rep Power
    0

    Default

    I have an HTML file, a Java Applet, and a data text file all located on the server (network drive) and I have a python program located on my local hard drive. I would like the client to be able to , either on a button click or after an automatic timer, be able to update the data in the text file by running the python program which writes to this file. The Applet would then reread from the file and update its own contents (best way i could figure out to interface between python and java applet). The python program itself needs to access my own USB connection and not the client's because of a specific piece of hardware that I have connected to my computer.

    Sorry for the confusion

  6. #6
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,882
    Rep Power
    25

    Default

    I have an HTML file, a Java Applet, and a data text file all located on the server (network drive) and I have a python program located on my local hard drive.
    Is the server an HTTP server with a URL that the client uses?

    I would like the client to be able to be able to update the data in the text file(where is this file located)
    by running the python program (on your computer) which writes to this file (on your computer).
    How does the client's computer connect to your computer to execute the python program on your computer???

    The Applet would then reread from the file (where is the file) and update its own contents.
    How does the applet get to the file on your computer?
    The python program itself needs to access my own USB connection. No problem the USB and python program are on the same computer

  7. #7
    jstys92 is offline Member
    Join Date
    Jun 2011
    Posts
    4
    Rep Power
    0

    Default

    The server is an HTTP server with a URL. The text file is located on the server with the applet and not on the computer (the java applet accesses it as a URL on the server and not as a local text file). The part about the python program is my original question and may not be possible

  8. #8
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,882
    Rep Power
    25

    Default

    may not be possible
    That's probably right. Your computer would need to run a server of some kind that would allow the real server to connect to. The server on your computer would run the python program and return the results to the calling real server.
    That real server would write the results in a local file and could return that file to the applet when the applet requested it.

Similar Threads

  1. Replies: 1
    Last Post: 03-05-2011, 06:47 PM
  2. upload file from local system to database
    By harsha.udupa2008 in forum Advanced Java
    Replies: 3
    Last Post: 09-17-2010, 09:58 AM
  3. Local file access
    By joe_coolish in forum Java Applets
    Replies: 1
    Last Post: 02-18-2010, 02:51 PM
  4. Replies: 9
    Last Post: 09-01-2009, 08:17 PM
  5. Load class file which resides in local path c:\
    By praveen.kb in forum Advanced Java
    Replies: 2
    Last Post: 08-12-2008, 02:55 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
  •