Wanted to converted code in java like fcntl.ioctl in python
i want to do the code in java from Python .
The code such as
def get(self):#correction
self.corrections = fcntl.ioctl(self.joystick, -2145097182, self.corrections)
for n in range(5):
self.correction[n].unpack(self.corrections[(n * 36):((n + 1) * 36)])
def set(self):
self.corrections = ""
for n in range(5):
self.corrections += self.correction[n].pack()
Kindly advice me
Re: Wanted to converted code in java like fcntl.ioctl in python
Step 1- Convert the python code to English (or whatever your native language is). What does the code do? How does it do it?
Step 2- Convert that English into pseudocode. How would you accomplish the same thing from an algorithmic perspective?
Step 3- Convert that pseudocode into Java. How would you implement the pseudocode in Java?
The point is, converting code from one language to another is not a direct 1 to 1 mapping. You have to think about what the code does, and then do it in Java. You can't just try to translate one syntactic "word" at a time.
Re: Wanted to converted code in java like fcntl.ioctl in python
thanks For ur reply ,
here I don't know what the Syntax exactly doing in Python Like that code
fcntl.ioctl
Re: Wanted to converted code in java like fcntl.ioctl in python
Then your step one is to figure out exactly what that function does. Sounds like a good place to start a google search.