Skip to content

Commit d5f872d

Browse files
committed
1 parent 61d1427 commit d5f872d

3 files changed

Lines changed: 54 additions & 61 deletions

File tree

Executor_Java.bat

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,22 @@ ECHO USER:%USERNAME%
66
echo.
77
ECHO java version installed:
88
ECHO -------------------------------------------------------------------------
9-
java --version
9+
java -version
1010
ECHO -------------------------------------------------------------------------
1111
cd /d "%~dp0"
1212
:first
1313
ECHO LOOKING FOR FILES IN:"%~dp0"
1414
echo.
1515
ECHO Name Of Java Executable Files Present In Folder Are:
16-
python Filename_java.py
16+
python filename_java.py
1717
set /p inp1=<Input.txt
1818
echo.
1919
ECHO =====================================================================================================================
2020
javac %inp1%
2121
ECHO =====================================================================================================================
2222
echo.
2323
ECHO Name Of Java Executable Class Present In Folder Are:
24-
python Filename_class.py
24+
python filename_class.py
2525
set /p inp2=<Input.txt
2626
echo.
2727
ECHO =====================================================================================================================
Lines changed: 26 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
'''
2-
Java Executor-Executes Java files with simplicity
2+
Java Executor-Executes Java files with simplicity
33
Copyright (C) 2020 Garvit Joshi
44
55
This program is free software; you can redistribute it and/or modify
@@ -17,37 +17,33 @@
1717
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
1818
'''
1919
#GitHub Link:https://github.com/garvit-joshi/Java_Executor-Windows
20-
import glob, os
21-
import sys
22-
a=sys.path
23-
count=0
24-
l=0
25-
os.chdir(a[0])
20+
import glob
21+
COUNT=0
2622
ifile=open("Input.txt","w")
27-
i=1
23+
SERIAL_NO=1
2824
for file in glob.glob("*.class"):
29-
if(count%2==0):
30-
print(i,".",file,end="")
31-
g=str(i)
32-
l=len(file)+len(g)
33-
else:
34-
print("".rjust(40-l,' '),i,".",file)
35-
i=i+1
36-
count=count+1
25+
if COUNT%2==0:
26+
print(SERIAL_NO,".",file,end="")
27+
SERIAL_LENGTH=str(SERIAL_NO)
28+
WORD_LENGTH=len(file)+len(SERIAL_LENGTH)
29+
else:
30+
print("".rjust(40-WORD_LENGTH,' '),SERIAL_NO,".",file)
31+
SERIAL_NO = SERIAL_NO + 1
32+
COUNT=COUNT+1
3733
print("")
38-
flag=1
39-
while flag==1:
40-
f=int(input("Enter The File No. You Want To Execute:"))
41-
i=1
42-
for file in glob.glob("*.class"):
43-
if(i==f):
44-
flag=0
45-
x=file
46-
break
47-
i=i+1
48-
if flag==1:
49-
print("File Not Found!!\nPlease Enter Again:")
50-
x= x[:-6]
51-
ifile.write(x)
34+
FLAG=1
35+
while FLAG==1:
36+
FILE_NO=int(input("Enter The File No. You Want To Execute:"))
37+
SERIAL_NO=1
38+
for file in glob.glob("*.class"):
39+
if SERIAL_NO==FILE_NO:
40+
FLAG=0
41+
FILE_NAME=file
42+
break
43+
SERIAL_NO = SERIAL_NO + 1
44+
if FLAG==1:
45+
print("File Not Found!!\nPlease Enter Again:")
46+
FILE_NAME= FILE_NAME[:-6]
47+
ifile.write(FILE_NAME)
5248
ifile.write("\n")
5349
ifile.close()
Lines changed: 25 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
'''
2-
Java Executor-Executes Java files with simplicity
2+
Java Executor-Executes Java files with simplicity
33
Copyright (C) 2020 Garvit Joshi
44
55
This program is free software; you can redistribute it and/or modify
@@ -17,35 +17,32 @@
1717
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
1818
'''
1919
#GitHub Link: https://github.com/garvit-joshi/Java_Executor-Windows
20-
import glob, os
21-
import sys
22-
a=sys.path
23-
count=0
24-
os.chdir(a[0])
20+
import glob
21+
COUNT=0
2522
ifile=open("Input.txt","w")
26-
i=1
23+
SERIAL_NO=1
2724
for file in glob.glob("*.java"):
28-
if(count%2==0):
29-
print(i,".",file,end="")
30-
g=str(i)
31-
l=len(file)+len(g)
32-
else:
33-
print("".rjust(40-l,' '),i,".",file)
34-
i=i+1
35-
count=count+1
25+
if COUNT%2==0:
26+
print(SERIAL_NO,".",file,end="")
27+
SERIAL_LENGTH=str(SERIAL_NO)
28+
WORD_LENGTH=len(file)+len(SERIAL_LENGTH)
29+
else:
30+
print("".rjust(40-WORD_LENGTH,' '),SERIAL_NO,".",file)
31+
SERIAL_NO = SERIAL_NO + 1
32+
COUNT = COUNT + 1
3633
print("")
37-
flag=1
38-
while flag==1:
39-
f=int(input("Enter The File No. You Want To Execute:"))
40-
i=1
41-
for file in glob.glob("*.java"):
42-
if(i==f):
43-
flag=0
44-
x=file
45-
break
46-
i=i+1
47-
if flag==1:
48-
print("File Not Found!!\nPlease Enter Again:")
49-
ifile.write(x)
34+
FLAG=1
35+
while FLAG==1:
36+
FILE_NAME=int(input("Enter The File No. You Want To Execute:"))
37+
SERIAL_NO=1
38+
for file in glob.glob("*.java"):
39+
if SERIAL_NO==FILE_NAME:
40+
FLAG=0
41+
FILE_NAME=file
42+
break
43+
SERIAL_NO = SERIAL_NO + 1
44+
if FLAG==1:
45+
print("File Not Found!!\nPlease Enter Again:")
46+
ifile.write(FILE_NAME)
5047
ifile.write("\n")
5148
ifile.close()

0 commit comments

Comments
 (0)