DEV Community


Posted on

Python Introduction

Working with virtual environment

When working on a python project its always advisable to create for it a virtual environment.

Steps for doing that include :

  1. Navigate to the project's directory then

  2. Run python -venv dev
    -note dev is just the name of the virtual environment ,your free to name it however you prefer.

3.Activate the virtual environment using this command :
source dev/bin/activate

-Note if you are using windows run dev\Scripts\activate

  1. create a requirements.txt file using the command : ** pip freeze > requirements.txt**
  2. this file will contain all packages installed for thespecified project.

  3. Install any packages required using pip install

  4. Repeat command in step 4, to update the requirements.txt.

Top comments (0)

An Animated Guide to Node.js Event Loop

Node.js doesn’t stop from running other operations because of Libuv, a C++ library responsible for the event loop and asynchronously handling tasks such as network requests, DNS resolution, file system operations, data encryption, etc.

What happens under the hood when Node.js works on tasks such as database queries? We will explore it by following this piece of code step by step.