Tag Archives: programming

How to keep Python / R Running on Mac (without screen lock or sleep)

When the Mac (or MacBook) is running for a long time, it is very liable to do one of the following things: sleep screen saver lock screen The problem is that your Python program or R program running in the … Continue reading

Posted in Uncategorized | Tagged , , , | 1 Comment

Best way to time algorithms in Python

There are tons of ways to calculate elapsed time (in seconds) for Python code. But which is the best way? So far, I find that the “timeit” method seems to give good results, and is easy to implement. Source: https://stackoverflow.com/questions/7370801/measure-time-elapsed-in-pythonContinue reading

Posted in Uncategorized | Tagged , | 2 Comments

How to write Bash file to run multiple Python scripts simultaneously

Step 1 is to create a Bash file (using any editor, even Notepad). Sample code: #!/usr/bin/env bash python testing.py & python testingb.py & The above code will run two Python files “testing.py” and “testingb.py” simultaneously. Add more python scripts if … Continue reading

Posted in Uncategorized | Tagged , | 1 Comment

Python Online Courses for Teenagers/Adults

If your child is interested in a Computer Science/Data Science career in the future, do consider learning Python beforehand. Computer Science is getting very popular in Singapore again. To see how popular it is, just check out the latest cut-off … Continue reading

Posted in maths tuition | Tagged , , , , | 1 Comment