Skip to content

Conversation

@Chiemezuo
Copy link
Contributor

Without using any additional or "time-specific logic", this is what my first go at it looked like.

sys.stdout.flush()


def getCurrentTime():
Copy link
Owner

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):
Copy link
Owner

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(
Copy link
Owner

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:

  1. Splitting time into numbers
  2. Independently converting each number to a name
  3. 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():
Copy link
Owner

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, thanks a bunch!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants