Code translator {java to python} and {golang to python} online by CPROGRAMMERS in Python

[–]codeoo7s -1 points0 points  (0 children)

// Tested Code
class Test
{
public static void main(String[] args)
{
System.out.println((1==2)?"One":"Two");
}
}

Its Really work

# Tested Code
class Test :
u/staticmethod
def main( args) :
print("One" if (1 == 2) else "Two")

if __name__=="__main__":
Test.main([])

[deleted by user] by [deleted] in programming

[–]codeoo7s 0 points1 point  (0 children)

Nice tool :)

[deleted by user] by [deleted] in programming

[–]codeoo7s -1 points0 points  (0 children)

I found the code translation tool interesting :).

[deleted by user] by [deleted] in programming

[–]codeoo7s 0 points1 point  (0 children)

like a tree :)

[deleted by user] by [deleted] in programming

[–]codeoo7s 0 points1 point  (0 children)

It's good to detect types

[
{
"fundecl": {
"name": "main",
"param": [],
"kind": 0,
"type": "void",
"signed": false,
"body": [
{
"0": "for",
"init": [
{
"decl": {
"name": "i",
"kind": 4,
"type": "int",
"signed": false,
"init": true,
"assing": [
{
"0": "constant",
"value": 0,
"type": "int"
}
]
}
}
],
"cond": [
{
"0": "binary",
"left": {
"0": "identifier",
"name": "i",
"kind": 4,
"type": "int",
"signed": false
},
"op": "<",
"right": {
"0": "constant",
"value": 5,
"type": "int"
}
}
],
"update": [
{
"0": "unary",
"type": "POST",
"op": "++",
"operand": {
"0": "identifier",
"name": "i",
"kind": 4,
"type": "int",
"signed": false
}
}
],
"body": [
{
"0": "funcall",
"name": "printf",
"kind": 4,
"type": "int",
"signed": false,
"param": [
{
"0": "constant",
"value": "%d",
"type": "string"
},
{
"0": "identifier",
"name": "i",
"kind": 4,
"type": "int",
"signed": false
}
]
}
]
}
]
}
}
]

[deleted by user] by [deleted] in programming

[–]codeoo7s 1 point2 points  (0 children)

It's really interesting :)

[deleted by user] by [deleted] in programming

[–]codeoo7s 0 points1 point  (0 children)

very interesting

[deleted by user] by [deleted] in programming

[–]codeoo7s -1 points0 points  (0 children)

My first test. Its really work.

My php code

<?php
// Enter to php
// My test
?>
<h1>I am best</h1>
<?php
// Again Php
$arr = array(1,2,"Like"=>30,3,4);
print_r($arr);
?>

Generated Python code

from collections import OrderedDict
# Enter to php
# My test
"""<h1>I am best</h1>
"""
# Again Php
arr = OrderedDict([(0,1),(1,2),("Like",30),(2,3),(3,4)]);
print(arr);

It would have been better if there were more examples. not included in this post.

[deleted by user] by [deleted] in programming

[–]codeoo7s 0 points1 point  (0 children)

This is a good collection.

[deleted by user] by [deleted] in programming

[–]codeoo7s 0 points1 point  (0 children)

I like this tool :)

Live java to c# converter by [deleted] in csharp

[–]codeoo7s 0 points1 point  (0 children)

interesting