코드 미화기
JavaScript, HTML, CSS 코드를 적절한 들여쓰기로 정리하고 포맷합니다. 압축된 코드를 정리합니다.
자주 묻는 질문
코드 구현
# Using autopep8 (pip install autopep8) to beautify Python code
import autopep8
ugly_code = """
def greet(name):
if name:
print( "Hello,",name)
else:
print("Hello, World")
greet("Alice")
"""
beautified = autopep8.fix_code(ugly_code, options={"indent_size": 4})
print(beautified)
# For JavaScript/HTML/CSS in Python, use jsbeautifier (pip install jsbeautifier)
# import jsbeautifier
# result = jsbeautifier.beautify(js_code)Comments & Feedback
Comments are powered by Giscus. Sign in with GitHub to leave a comment.