-
-
Notifications
You must be signed in to change notification settings - Fork 1
introduced v1 of nmr clock #19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
| sys.stdout.flush() | ||
|
|
||
|
|
||
| def getCurrentTime(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The intermediate variables don't help here.
Also, it's "time"!
return datetime.now().strftime(TIME_FORMAT), where TIME_FORMAT is some constant at the top of the file.
| return current_time | ||
|
|
||
|
|
||
| def splitTimeString(timeStr: list): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is much too short to be a function.
Also, the type isn't right, it should be str, and what's with all the mixEdCaseStuff, this isn't Java!
| clear_terminal() | ||
| while True: | ||
| raw_time_string = getCurrentTime() | ||
| [hour, minute, second] = [nmr.str_to_name( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this doesn't actually work.
What you are actually doing is this:
- Splitting time into numbers
- Independently converting each number to a name
- Printing it
But this gives the same name to the same time each day - and it isn't actually dealing with any of the issues.
| time.sleep(1) | ||
|
|
||
|
|
||
| def clear_terminal(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you were using textual, this wouldn't be needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, thanks a bunch!
Without using any additional or "time-specific logic", this is what my first go at it looked like.