[PYTHON] I wrote a script to get you started with AtCoder fast!

Save the contest name directory and a.py, b.py, c.py, d.py from the command line.

How to use (example)

  1. At the command line `python start_atcoder.py arc021` turn!
  2. arc021 is created in the executed directory.
  3. a.py, b.py, c.py, d.py are created in arc021.
  4. Eliminate the hassle of creating files!
import os
import sys

def main():
    argvs = sys.argv
    argc = len(argvs)

    if argc < 1:
        print('Usege\nstart_atcoder.py contest_name')
        exit(0)
    contest_name = argvs[1]
    if os.path.exists(contest_name):
        print(contest_name, 'is exists.')
    else:
        os.mkdir(contest_name)
        print(contest_name, 'is created.')

    problem_number = 4 
    for i in range(problem_number):
        path = contest_name+'\\'+chr(ord('a')+i)+'.py'
        if os.path.isfile(path):
            print(path, 'is exists')
        else:
            f = open(path,'w')
            f.close()
            print(path, 'created')

if __name__ == '__main__':
    main()

Recommended Posts

I wrote a script to get you started with AtCoder fast!
I tried to get started with Hy ・ Define a class
I wrote a script to get a popular site in Japan
I tried to get started with Hy
[Python] A memo that I tried to get started with asyncio
I wrote a script to upload a WordPress plugin
A layman wants to get started with Python
AtCoder writer I wrote a script to aggregate the contests for each writer
I tried to get started with blender python script_Part 01
I tried to get started with blender python script_Part 02
What I did to get started with Linux commands
I wrote you to watch the signal with Go
I wrote a program quickly to study DI with Python ①
I wrote a script to combine the divided ts files
Link to get started with python
How to get started with Scrapy
How to get started with Python
How to get started with Django
I wrote a script to create a Twitter Bot development environment quickly with AWS Lambda + Python 2.7
A memorandum when I tried to get it automatically with selenium
I just wrote a script to build Android on another machine
Here's a brief summary of how to get started with Django
I wrote a function to load a Git extension script in Python
What to do if you get a UnicodeDecodeError with pip install
I tried to get started with Bitcoin Systre on the weekend
I wrote a script to extract a web page link in Python
I wrote a script to help goodnotes5 and Anki work together
Step notes to get started with django
I made a script to display emoji
How to get started with laravel (Linux)
[Python] To get started with Python, you must first make sure you can use Python.
A story I was addicted to trying to get a video url with tweepy
I get a UnicodeDecodeError when trying to connect to oracle with python sqlalchemy
Coursera's TensorFlow introductory course to get you started with Deep Learning implementations
[To Twitter gentlemen] I wrote a script to convert .jpg-large to .jpg at once.
What to do if you get a TypeError with numpy min, max
Python hand play (let's get started with AtCoder?)
The easiest way to get started with Django
I want to make a game with Python
I tried to get CloudWatch data with Python
I get a UnicodeDecodeError when running with mod_wsgi
I made a tool to get new articles
I want to write to a file with Python
Python script to get note information with REAPER
I wrote a script to revive the gulp watch that will die soon
Python script to get a list of input examples for the AtCoder contest
I tried to make a simple image recognition API with Fast API and Tensorflow
I tried to create a table only with Django
I want to transition with a button in flask
I tried to draw a route map with Python
How to get a logged-in user with Django's forms.py
I started to analyze
I want to get started with the Linux kernel, what is the list head structure?
I want to work with a robot in python.
I want to split a character string with hiragana
I tried to automatically generate a password with Python3
Get started with MicroPython
I want to manually create a legend with matplotlib
[Python, ObsPy] I wrote a beach ball with Matplotlib + ObsPy
Get started with Mezzanine
I wrote a CLI tool in Go language to view Qiita's tag feed with CLI