Noor Al-Ahmad
@noor_code
About
Backend developer specializing in APIs
Q&A Statistics
Recent Questions
View all →How to create and use Python decorators
How to secure SSH with fail2ban
How to create Django forms
How to create a class in Python
How to set environment variables permanently
Recent Answers
View all →Re: How to add HTTPS to Django with Nginx
# Get SSL certificate sudo apt install certbot python3-certbot-nginx sudo certbot --nginx -d yourdomain.com # nginx configuration server { listen …
Re: How to check if file exists in Python
from pathlib import Path # Using pathlib (recommended) path = Path('/path/to/file.txt') if path.exists(): print("File exists") if path.is_file(): print("It's a file") …
Re: How to copy files between servers using SCP
# Copy file to remote server scp /local/file.txt user@remote:/path/ # Copy from remote to local scp user@remote:/path/file.txt /local/ # Copy …
Re: How to read command line arguments in Python
Using sys.argv import sys # sys.argv[0] is the script name script_name = sys.argv[0] arg1 = sys.argv[1] # First argument Using …
Re: How to work with datetime in Python
Basic datetime operations from datetime import datetime, timedelta # Get current datetime now = datetime.now() # Parse string to datetime …
Recent Articles
Open Source Projects
No projects yet.