Created
February 5, 2018 09:20
-
-
Save poanchen/7a1c072fb4b373ab9e96312349303416 to your computer and use it in GitHub Desktop.
A python script that will create a barebone Java code with the default main class along with testcase1 and printlist functions that are necessary for doing competeive programming questions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
i = 12 | |
while os.path.exists("./Solution" + str(i) + ".java"): | |
i += 1 | |
file_contents = """import java.util.*; | |
import java.lang.*; | |
public class Solution%s { | |
public static void testCase1() { | |
} | |
public static void printList() { | |
} | |
public static void main(String [] args) { | |
System.out.println(); | |
} | |
}""" % (str(i)) | |
os.system('echo "%s" > Solution%s.java' % (file_contents, i)) | |
os.system('open -a Sublime\ Text Solution' + str(i) + '.java') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment