pyrays
A GitHub template for Python projects using uv
The main class of your application package.
This class is used to encapsulate the main functionality of your application. You can define methods and properties here to perform the main tasks of your application.
Source code in pyrays/src/main.py
print(text=None, color=None)
Print a message in a specified color.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text
|
Optional[str]
|
The message to print. Defaults to "Hello, world!". |
None
|
color
|
Optional[str]
|
The color to print the message in.
This should be a string specifying a color recognized by the |
None
|
Source code in pyrays/src/main.py
Run the main functionality of your application package.
This function is called when your application is run as a package. You can use this function to perform the main tasks of your application.
Example:
python -m pyrays -t "Ciao" -c "red"
python -m pyrays --text "Mondo" --color "green"
python -m pyrays -t "Ciao mondo"
Source code in pyrays/src/main.py
Parse command line arguments.
Returns:
| Type | Description |
|---|---|
Tuple[str, str]
|
Tuple[str, str]: The text to print in color. |