Python Project (Release 0.1) – week 2

/* This post will keep updated until this Friday(Sep 13). After this Saturday(Sep 14), the project progress will be updated in a new post */

Sep 10

I’ve started my project for osd600. It is a tool, written in Python, translating a source file written in one programming language into another language. The translation will be done by Large Language Model AI(such as ChatGPT).

So far, I have implemented a part that gets arguments and options user enters when running the tool and reads the file(checked if it is properly read by printing on console).
Currently, to run this tool in terminal, user needs to use this commend

python3 translator.py source_file -t python
Enter fullscreen mode
Exit fullscreen mode

I personally find it ugly. Instead, what I want is running it with the following commend

translator source_file -t python -o result
Enter fullscreen mode
Exit fullscreen mode

From my 3 hours research, I learned that I should use Poetry(.toml) to do this. I could create a script in bin folder (connecting it to the python file with softlink). However, it wouldn’t work for other users, since it is set up locally. As a result, I need to use Poetry.
How it works is, it creates a virtual environment and generate a script in the virtual environment that can run the python script(the tool), so that I can run the python script without specifying “python3”

Since it is new to me and quite complicated, I need to study more about it.

There are a lot to do for release 0.1

  1. Using Poetry
  2. Integrating LLM API into the tool

Discover more from Coursity

Subscribe to get the latest posts sent to your email.

Leave a Comment

Your email address will not be published. Required fields are marked *

Discover more from Coursity

Subscribe now to keep reading and get access to the full archive.

Continue reading

Scroll to Top
Tag archives : final destination 2000 netflix.