Skip to main content

Featured

Solving Economic Crisis Without Work-From-Home: A Systems Approach to Resource Prioritization

  1. The Economic Problem: Diagnosing the Crisis Type 1.1 Crisis Typology and Sector Dynamics Currency crises typically emerge from one or more of these imbalances: Current account deficits — Imports exceed exports; forex drains to cover the gap Capital account withdrawal — Foreign investors exit; hot money leaves Inflation-driven overvaluation — Real exchange rate strengthens despite nominal devaluation Debt servicing burden — External debt payouts drain reserves faster than exports can cover The empirical record shows that currency crises are sectoral crises —not aggregate demand crises. When Argentina devalued 75% in 2001, the economy contracted 10.9%, but manufacturing capacity utilization recovered within 18 months because input costs fell (Hausmann & Velasco, 2002). When Vietnam reformed in 1986, manufacturing capacity expansion drove recovery before demand-side effects materialized. Critical insight: Resource reallocation works when the constraint is supply-sid...

Python Projects Attendence marker With Feature

The script  includes several key features:

 1. Time-Restricted Attendance Registration:

   - The script only allows attendance registration within a specified time window, defined by `start_time` and `end_time`. If the current time falls outside this range, the script prevents any further attendance entries and exits.

 2. Password-Based Subject Entry:

   - The user inputs a password that represents a subject name. This allows for a flexible way to manage attendance across multiple subjects without hardcoding the subjects into the script.

 3. Attendance Tracking:

   - The script tracks the number of times attendance has been recorded for each subject (`count`).

   - It logs the date, time, and day of each attendance entry in a list associated with the subject.

 4. Persistent Data Storage:

   - The attendance data is saved in a JSON file (`attendance3.json`). This ensures that the data is persistent across different runs of the script, allowing the user to maintain a continuous log of attendance over time.

 5. User-Friendly Exit Option:

   - The user can exit the script at any time by entering 'q', providing a convenient way to stop the script without needing to close the terminal or forcibly terminate the program.

 6. Automatic Data Management:

   - If the JSON file does not exist when the script is run, it automatically creates a new one, ensuring that the attendance data is always stored properly.





import json
from datetime import datetime, time

def load_attendance_data():
    try:
        with open('attendance3.json', 'r') as file:
            data = json.load(file)
    except FileNotFoundError:
        data = {}
    return data

def save_attendance_data(data):
    with open('attendance3.json', 'w') as file:
        json.dump(data, file)

def update_attendance(subject):
    data = load_attendance_data()
    current_time = datetime.now()
    date_str = current_time.strftime("%Y-%m-%d")
    time_str = current_time.strftime("%H:%M:%S")
    day_str = current_time.strftime("%A")
   
    if subject in data:
        data[subject]['count'] += 1
        data[subject]['attendance'].append({'date': date_str, 'time': time_str, 'day': day_str})
    else:
        data[subject] = {'count': 1, 'attendance': [{'date': date_str, 'time': time_str, 'day': day_str}]}
   
    save_attendance_data(data)

def is_within_time_limit():
    now = datetime.now().time()
    start_time = time(20, 24)  # Customizable start time
    end_time = time(21, 20)    # Customizable end time
    return start_time <= now <= end_time

def main():
    while True:
        if not is_within_time_limit():
            print("Attendance registration time is over.")
            break
        password = input("Enter password (or 'q' to quit): ")
        if password == 'q':
            break
        else:
            update_attendance(password)

if __name__ == "__main__":
main() 

Comments

Popular Posts