Results 1 to 4 of 4
  1. #1
    elentirmo is offline Member
    Join Date
    Feb 2017
    Posts
    2
    Rep Power
    0

    Default Java file convert to python

    hi,
    i have a question for you guys, maybe a dumb one but i'm not a java programmer. I have a device that communicates on serial port rs232 it uses a driver made in C but the company doesnt provide support for newer OS and i want to switch to linux. i found a java driver made by someone but i cant make it work on my computer but a friend of mine told me i should convert it to python. I know python but not java. The question is:

    Can i convert this java file to python? Can someone help me?


    Thank you

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    13,541
    Rep Power
    26

    Default Re: Java file convert to python

    The basic rule of converting code from one language to another is, understand the application.
    You are essentially writing a new app.
    Do not simply try and do a method-by-method translation...you just end up with something shoe-horned into the target language.

    Do you know why the Java code doesn't work?
    I'm wondering if it's because it uses that C driver under the hood, in which case a conversion will do you no good at all.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  3. #3
    elentirmo is offline Member
    Join Date
    Feb 2017
    Posts
    2
    Rep Power
    0

    Default Re: Java file convert to python

    hi,
    if i send you the entire package will you be able to extract from it the information i need?

    The device i use is a cash register and i'm sending commands to the cash register using the original driver. The commands are (sell item, subtotal, total, freetext) and i generate a txt file with those commands, the driver reads the file and send it to the cash register and then delete the file waiting for another one.

    All i need is someone tell me how it works in java and i'll build my own code in python.

    Thank you.

  4. #4
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    13,541
    Rep Power
    26

    Default Re: Java file convert to python

    That's not really what this site is for.
    If you can read Python then you should be able to read Java. Even though I know no Python, I can understand a piece of code put in front of me well enough to determine what it is up to.

    Pick one of the calls from Java to the cash register (say "sell item") and post it here.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

Similar Threads

  1. How to convert .exe file into .jar or java file?
    By ashok565656 in forum New To Java
    Replies: 3
    Last Post: 08-22-2012, 10:00 PM
  2. Run Python file in Java code
    By soheilz92 in forum Advanced Java
    Replies: 1
    Last Post: 05-07-2011, 12:01 PM
  3. Convert .java into a program i.e. .exe file
    By ravi1 in forum New To Java
    Replies: 33
    Last Post: 03-30-2011, 10:23 PM
  4. calling python file from java
    By cool in forum AWT / Swing
    Replies: 3
    Last Post: 11-11-2010, 03:50 AM
  5. Convert XML file into DTD using Java
    By veera in forum XML
    Replies: 0
    Last Post: 12-19-2008, 05:38 AM

Tags for this Thread

Posting Permissions

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