import os file_path = os.path.expanduser("~/EGYshot/templates/wallet.html") with open(file_path, "r", encoding="utf-8") as f: code = f.read() # الكود الذي سيتم إضافته (زر الإدارة) admin_button = ''' {% if session.get("user_id") == "admin@egyshot.com" %}
{% endif %} ''' if 'href="/admin"' not in code: # إضافته قبل إغلاق body if '