java to python converter online

import java.util.*;
class D
{
public static void main(string args[])
}
int a[]=new int[5];
int b[]=new int[5];
Scanner kb=new Sacnner(System.in;
for(intcj=0;j<=2;j++)
{
a[j]=kb.nextInt();
for(int k=0;k<=2;k++)
}
b[k]=kb.nextInt();
}
int r1=a[2];
int r2=a[2];
double x=3.14*(double)r1*r1;  
double y=3.14*(double)r2*r2;
double sum=x+y;
double ans=(1.813/sum)*100;
System.out.printf("%.2f",ans);

3.71
7
Phoenix Logan 186125 points

                                    

#import libraries
import os, subprocess, time, shutil
from datetime import datetime

#format date to nonflex standard
def formatdate(date, time):
    input= date+time
    output= datetime.strptime(input, &quot;%d%b%y%H:%M:%S:&quot;).strftime(&quot;%m/%d/%Y|%H:%M:%S&quot;)
    return output

# stop the service, copy the log file to C:\NonFlex\RotatedLogs and start service
service_status = subprocess.run(['sc', 'stop', 'ghs_lm'])
time.sleep(10)
shutil.move(&quot;C:\\NonFlex\\DebugLogs\\ghs.dl.rtf&quot;,&quot;C:\\NonFlex\\RotatedLogs\\&quot;+&quot;ghslm_&quot;+str(datetime.now().strftime(&quot;%Y%m%d&quot;))+&quot;_ts-apps15.rl&quot;)
service_status = subprocess.run(['sc', 'start', 'ghs_lm'])

#pass log file into script
filename = (&quot;C:\\NonFlex\\RotatedLogs\\&quot;+&quot;ghslm_&quot;+str(datetime.now().strftime(&quot;%Y%m%d&quot;))+&quot;_ts-apps15.rl&quot;)
with open(filename) as g:
    content = g.readlines()

#create log file for output
filename = (&quot;C:\\NonFlex\\ReportLogs\\&quot;+&quot;ghslm_&quot;+str(datetime.now().strftime(&quot;%Y%m%d&quot;))+&quot;_ts-apps15.log&quot;)
f= open(filename,&quot;w+&quot;)

#parse the lines in the file
for line in content:
    line=line.split()
    try:
        date=formatdate(line[0],line[1])
    except:
        continue
    #process license checkouts | working
    if &quot;granted&quot; in line:
        username=(line[8].split(&quot;@&quot;)[0])
        ipaddress=(line[8].split(&quot;@&quot;)[1])
        feature=line[3]
        f.write(date+&quot;|OUT|&quot;+feature+&quot;|1|0|&quot;+username+&quot;|&quot;+ipaddress+&quot;\n&quot;)
    #process license checkins
    if &quot;exit&quot; in line or &quot;released&quot; in line:
        #process checkin
        if line[2]==&quot;exit&quot;:
            username=(line[4].split(&quot;@&quot;)[0])
            ipaddress=(line[4].split(&quot;@&quot;)[1])
            feature=line[3]
        else:
            username=(line[2].split(&quot;@&quot;)[0])
            ipaddress=(line[2].split(&quot;@&quot;)[1])
            feature=line[4]     
        f.write(date+&quot;|IN|&quot;+feature+&quot;|1|0|&quot;+username+&quot;|&quot;+ipaddress+&quot;\n&quot;)
    #log license startup| Working
    if &quot;Starting&quot; in line and &quot;License&quot; in line:
        f.write(formatdate(line[0],line[1])+&quot;|START&quot;+&quot;\n&quot;)
    #log license shutdowns| Working
    if &quot;Exiting&quot; in line:
        f.write(formatdate(line[0],line[1])+&quot;|END&quot;+&quot;\n&quot;)
    if &quot;Feature&quot; in line:
        date=formatdate(line[0],line[1])
        quantity=line[5]
        feature=(line[4][1:-2])
        f.write(date+&quot;|FEATURE|&quot;+feature+&quot;|&quot;+quantity+&quot;\n&quot;)

#close file and copy to \\orl4dfsns1.us.lmco.com\orlando\scoc_dfs\LicAdm\NonFlexPC
f.close()
shutil.copyfile(filename,&quot;\\\\orl4dfsns1.us.lmco.com\\orlando\\scoc_dfs\\LicAdm\\NonFlexPC\\&quot;+&quot;ghslm_&quot;+str(datetime.now().strftime(&quot;%Y%m%d&quot;))+&quot;_ts-apps15.log&quot;)

3.71 (7 Votes)
0
Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
exe to python converter online Exe to pyc online Easily convert .py to .exe online python to java converter convert a python program to exe how to convert a python file into exe convert python to java online how to convert python file to exe pyton to exe python to java converter translate java to python online online python script to exe python to java translator convert python to .exe python code to executable online converter python to java converter online online java to python converter convert java to python online Convert Python to Java translator online turn python into an executable online onlie python to exe converter convert python .exe to .py convert python files to executable online python into exe compiler online python 2 to exe online turn python into exe python to executable online python to exe online conrverter python script to exe py to exe how to convert python to exe python code to exe file .py to .exe converter python script to exe online how to convert the python file to exe file how to convert python to exe file exe to py online python convert to exe how to py to exe Convert Python file into exe .py to .exe python to exe online converter website python program to exe online converter .py to .exe python compiler to exe Exe to py converter online pyw to exe online .py to exe PYTHON EXE TO SOURCE CODE ONLINE convert exe to python source code online exe to python code online convert python file in exe online phyton to exe convert python code to exe online python to exe converter online .py to .exe converter .py to exe online turn python to exe online python exe to setup converter how to covert.py to .exe .py to .exe converter online how to convert .py to .exe exe to py online python3 to exe convert python to exe python to exe converter python to windows exe python to .exe exe to python online exe to python python file to exe py exe to py how to python to exe online python file to exe online convert python file to exe python to exe compiler python code to exe online how to convert a python file into an .exe convert .py to .exe python to exe online how to convert a .py to .exe python to exe python into exe online python to exe compiler exe to python file py to exe convert py to exe online .py to .exe online converter python convert exe to py online convert py to exe python to exe converter online convert .py to .exe online py file to exe file conversion online python to exe python to exe online converter convert python to exe online execute python code in exe using python java to python converter online .py to exe converter online pyc to py online py to exe online tool convert python file to exe online python file to exe converter online python 2 exe online make python executable online py to exe convert online python to exe 2020 how to convert 2 files on auto py to exe convert python script to executable online python executable file online auto py to exe auto py to exe error with pyttsx exe generator that downloads and runs python file py to exe online converter auto py to exe anaconda python3 to exe how convert py to exe py to exe online py autopy to exe how to install auto-py-to-exe python convert exe online py to exe converter auto-py-to-exe console app .exe to .python online py to exe converter online convert python script to exe online in linux convert .py to exe online how to convert py to exe py to exe convertor\ python to .exe online
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source