What is Threading?

Threading allows to make multiple threads of execution to take place in a Python program. Though threads appear to run simultaneously, only one can be executed at a time (enforced by Python’s global interpreter lock). Threading is a helpful module when working with tasks that are I/O bound (including web-oriented tasks like web scraping or downloading files).

Here’s an example of Threading:

import threading
import time


def eat_breakfast():
    time.sleep(3)
    print("You eat breakfast")


def drink_coffee():
    time.sleep(4)
    print("You drank coffee")


def study():
    time.sleep(5)
    print("You finish studying")


x = threading.Thread(target=eat_breakfast, args=())
x.start()

y = threading.Thread(target=drink_coffee, args=())
y.start()

z = threading.Thread(target=study, args=())
z.start()

x.join()
y.join()
z.join()

print(threading.active_count())
print(threading.enumerate())
print(time.perf_counter())

The method active_count() returns the number of thread objects that are currently there. The returned number is equal to the length of the list returned by the method ennumerate().

Sources: Threading – Python Python Multithreading

New “Skyrim 2.0”?

So a new game called Avowed is coming out sometime this year it is looks REALLY cool. I know lots of people are talking about the new Fable game (which I will also talk about soon) coming out too, but this caught my eye first.

From the looks of the announcement and gameplay trailer, it looks like a more polished Skyrim-ish game (which I LOVE). The powers look cool, the enemies look cool, the graphics, the lighting everything about it looks amazing. I wish they showed more of the combat and everything but yeah, I’m excited for this game.

Okay that’s my rant bye bye o/

Link to Gameplay trailer -> Avowed Official Gameplay Trailer

Link to announcement trailer -> Official Announcement Trailer