You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

2.0 KiB

Development Environment

Python Virtual Environment

ALWAYS use the virtual environment for this project:

# Activate virtual environment (Linux/Mac)
source venv/bin/activate

# Activate virtual environment (Windows)
venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

Running Python Code

When executing Python code or commands:

  • ALWAYS activate venv first: source venv/bin/activate
  • Use python command (not python3) inside venv
  • Install packages with pip install (they go into venv)
  • Never run Python outside venv

Terminal Commands

Before any Python operation:

cd /home/enne2/Sviluppo/newcraft
source venv/bin/activate
python your_script.py

Critical Development Rules

ALWAYS VERIFY OUTPUT BEFORE CLAIMING SUCCESS

NEVER assume code works without verification!

When creating or modifying code:

  1. RUN THE CODE and check actual output
  2. VERIFY FILES are created/modified as expected
  3. CHECK FOR ERRORS in terminal output
  4. VALIDATE RESULTS match requirements
  5. NEVER claim "it works" without testing

Examples of proper verification:

# After creating extraction script:
python extract_assets.py
ls -lh output_dir/          # Check files were created
du -sh output_dir/          # Check total size
find output_dir -type f | wc -l  # Count files

# After data processing:
python process_data.py
head -20 output.csv         # Check output format
wc -l output.csv            # Count records

# After API changes:
python test_api.py
grep -i "error\|fail" output.log  # Check for errors

Remember:

  • Exit codes can be misleading
  • File creation needs ls/find verification
  • Data processing needs content inspection
  • Success claims require proof

Contact & Resources

  • Author: Matteo Benedetto
  • github.com/enne2
  • license: MIT

Remember:

  1. Virtual environment must be active for all Python operations! Check prompt shows (venv) prefix.
  2. ALWAYS verify output before claiming success!