Skip to main content

Command reference for programmers

 requirements.txt file for installing python packages

You can use a requirements.txt file to install multiple Python packages at once.

 1. Create a requirements.txt file

This file should list all the packages you want to install, with each package on a new line. Example:

makefile

numpy==1.23.1 pandas>=1.5 requests matplotlib<=3.6
  • == specifies an exact version.
  • >= installs a minimum version.
  • <= installs up to a certain version.

2. Install packages using requirements.txt

Run the following command in your terminal or command prompt:



pip install -r requirements.txt

This will install all the packages listed in the file.

3. Generate a requirements.txt file (Optional)

If you already have packages installed in your environment and want to create a requirements.txt file, run:


pip freeze > requirements.txt

This will generate a list of installed packages with their versions. Please note that output may be a dump of all packages in the environment that may not be very useful. 


Creating and using virtual environment in python

Using minoconda:

There is a detailed post here, for quick reference here is the command to be used:

conda create --name myenv python=3.9 conda activate myenv


mentioning python and its version is not mandatory if you want to use a common python


Using built-in python virtual environment:

python -m venv myenv
myenv\Scripts\activate     # On Windows


Github commands quick reference


Clone:

git clone https://github.com/username/repo.git

Create new repo (local):

git init
[or git init --initial-branch=main # If default branch name to be main]
git add .
git commit -m "Initial commit"
git branch -M main
git remote add origin https://github.com/username/repo.git
git push -u origin main

Working with changes:

git status         # Check status of changes
git add file.py    # Stage a file
git add .          # Stage all changes
git commit -m "Message"  # Commit changes
git push origin main     # Push to remote repo

Pull latest change:

git pull origin main  # Get latest changes

Working with branches:

git branch feature-branch       # Create new branch
git checkout feature-branch     # Switch to branch
git switch feature-branch       # Alternative (modern)
git checkout -b new-feature     # Create & switch
git push -u origin new-feature  # Push branch to remote

Merge branches:

git checkout main
git merge feature-branch
git push origin main


Comments

Popular posts from this blog

Example 1: ArchiMate relationship in PlantUML code to demonstrate 15 relationship types

 Following section presents 15 types of relationships in ArchiMate and PlantUML to generate the diagram. Since this code is generated by GEN-AI it may require precision on aspects other than PlantUML syntax: Diagram Plant UML Code:  @startuml '!includeurl https://raw.githubusercontent.com/plantuml-stdlib/Archimate-PlantUML/master/Archimate.puml ' Another way of including Archimate Library (above is commented for following) !include <archimate/Archimate> !theme archimate-standard from https://raw.githubusercontent.com/plantuml-stdlib/Archimate-PlantUML/master/themes title ArchiMate Relationships Overview <style> element{     HorizontalAlignment: left;     MinimumWidth : 180;     Padding: 25; } </style> left to right direction rectangle Other {     Business_Role(Role_SeniorManager, "Senior Manager")     Business_Role(Role_Manager, "Manager") } rectangle Dynamic {     Business_Event(Event_CustomerReques...

Examples 7: ArchiMate flow relationship between elements in layers

Diagram Code @startuml !include < archimate / Archimate > < style > element {     HorizontalAlignment : left ;     MinimumWidth : 180 ;     Padding : 20 ; } note {     BackgroundColor : #FFFFCC ;     RoundCorner : 5 ;     MaximumWidth : 250 ; } </ style > title "ArchiMate 3.2 Valid Flow Relationships" left to right direction ' Business Layer Flow Relationships rectangle "Business Layer Flows" {     Business_Process ( bp1 , "Order Process" )     Business_Process ( bp2 , "Payment Process" )     Rel_Flow ( bp1 , bp2 , "Order data" )     note on link         Flow between Business Processes     end note         Business_Function ( bf1 , "Sales Function" )     Business_Function ( bf2 , "Delivery Function" )     Rel_Flow ( bf1 , bf2 , "Sales information" )     note on link     ...

SmartSimpleTextGenerator: A Smarter Way to Generate Text

  Introduction In the world of text generation, simple n-gram models can produce decent results, but they often lack context-awareness and coherence. To address these limitations, I have developed SmartSimpleTextGenerator , an improved version of my previous project, ImprovedSimpleTextGenerator . This new version enhances the text generation process by integrating Part-of-Speech (POS) tagging , n-gram models , and a back-off strategy , making the generated text more meaningful and contextually relevant. Key Features of SmartSimpleTextGenerator ✅ N-Gram Model with POS Tagging – Uses trigrams (default n=3) and applies POS tagging for better word prediction. ✅ Back-off Strategy – If a trigram sequence is unavailable, it falls back to bigrams and unigrams to ensure smooth text generation. ✅ Sentence Tokenization & Structure Preservation – Tokenizes input text properly while maintaining sentence integrity. ✅ Randomized Word Selection – Generates diverse outputs rather ...