Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Ignore Python byte code files
__pycache__/
*.pyc
*.pyo
*.pyd

# Ignore virtual environment directories (if using venv)
venv/

# Ignore IDE-specific files and directories (e.g., for Visual Studio Code)
.vscode/

# Ignore project-specific files like log files or database files
logs/
db.sqlite3

# Ignore user-specific settings or files
*.log
*.swp

# Ignore system and temporary files
*.bak
*.tmp

# Ignore any sensitive or secret information (e.g., API keys, credentials)
secrets.yml

output/
9 changes: 8 additions & 1 deletion chatcoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ class CodeConverterApp(tk.Tk):
def __init__(self):
super().__init__()

if not os.path.exists("output"):
os.mkdir("output")
print("Created output directory")
else:
print("Output directory already exists")

self.title("Natural Language to Code Converter")
self.geometry("600x400")

Expand Down Expand Up @@ -60,8 +66,9 @@ def convert_to_code(self):
self.output_text.insert(tk.END, code) # Inserting new converted code

def save_output(self):
filenames = os.listdir("output")
code = self.output_text.get(1.0, tk.END)
with open("output.py", "w") as file:
with open(f'output/{len(filenames)}.py', "w") as file:
file.write(code)

if __name__ == "__main__":
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nltk