Python | Machine Learning | Coding | R
63.4K subscribers
1.13K photos
68 videos
144 files
783 links
List of our channels:
https://t.me/addlist/8_rRW2scgfRhOTc0

Discover powerful insights with Python, Machine Learning, Coding, and R—your essential toolkit for data-driven solutions, smart alg

Help and ads: @hussein_sheikho

https://telega.io/?r=nikapsOH
Download Telegram
كود #Python لانشاء رابط قصير #Short_URL باستخدام #Tkinter.

للمزيد: @CodeProgrammer
كود #Python لترجمة الجمل والكلمات من والى اي لغة تريدها اعتمادا على مكتبة #Googletrans باستخدام واجهات #Tkinter.

للمزيد قم بدعوة اصدقاءك للافادة والاستفادة: @CodeProgrammer

اعلان: يمكنكم الانضمام الى المجموعة الخاصة ب #Python من خلال المعرف:
@pythonArab
​​​​مجموعة دورات برمجية متكاملة متسلسلة باللغة العربية للراغبين في تعلم لغة #Python. تفيدك هذه الدورات باكتساب كافة المفاهيم حول #Python لتؤهلك دخول المجال الذي تريد الاتجاه نحوه ضمن #Python

💭 الدورة الاولى: تحتوى على 47 فيديو مقسمة على اربعة اجزاء مقدمة من #محمود_احمد

1⃣ اساسيات بايثون الجزء الاول:

https://www.youtube.com/playlist?list=PLtGOJcWqvbqfExUkG0ANIZ2Z6H6K0QcaE

2⃣ اساسيات بايثون الجزء الثاني:

https://www.youtube.com/playlist?list=PLtGOJcWqvbqePpE7IWDRTDXo_jjGvJsRA

3⃣ اساسيات بايثون الجزء الثالث:

https://www.youtube.com/playlist?list=PLtGOJcWqvbqdro121Y1IAbPOydAhyL13a

4⃣ اساسيات بايثون الجزء الرابع:

https://www.youtube.com/playlist?list=PLtGOJcWqvbqdRIJa8fdHeVhDG46G3cA2e

💭 الدورة الثانية: تحتوي على 54 فيديو مقدمة من #حسين_الربيعي

https://www.youtube.com/playlist?list=PLF8OvnCBlEY1j4hxoqXqJk08ASU7D_W87

💭 الدورة الثالثة: ما زالت قيد النشر مقدمة من #احمد_ابوعيسى

https://www.youtube.com/playlist?list=PLTcPeoMjkuCwV-ZUabT5HVhLliTT9of2I

💭 الدورة الرابعة: تحتوي على 64 فيديو مقدمة من #محمد_عيسى

https://www.youtube.com/playlist?list=PLMYF6NkLrdN98I0nEXOuR_gK8b4w-NJcN

💭 الدورة الخامسة: ما زالت قيد النشر مقدمة من #elzero_web_school

https://www.youtube.com/playlist?list=PLDoPjvoNmBAyE_gei5d18qkfIe-Z8mocs

قريبا سوف ننشر روابط كورسات تعلم #Django و #Tkinter و #PyQT و #KIVY بالاضافة لكورسات #الذكاء_الاصطناعي

قم بدعوة اصدقاءك 👍 للاستفادة والافادة.
https://t.me/CodeProgrammer
👍2❤‍🔥1
Title: #Python Script to convert #text to #speech using #tkinter GUI.

كود #بايثون لتحويل #النص الى #كلام باستخدام الواجهة الرسومية #tkinter مرفقا باوامر تثبيت المكتبات المطلوبة.

للمزيد قم بدعوة اصدقاءك للاستفادة: @CodeProgrammer
Title: Make your own #GUI Translator using #Python

#مشروع_برمجي لانشاء تطبيق شبيه بتطبيق #Google_Translator او كما يعرف ب #مترجم_غوغل باستخدام #tkinter حيث يتيح لك هذا المشروع #الترجمة من والى اي لغة تختارها بالاضافة للكشف الالي عن اللغة المدخلة.

#ملاحظة: يعتبر هذا المشروع من احد المشاريع الذي ينصح بها للمبتدئين لاكتساب الخبرة.

للمزيد قم بدعوة اصدقاءك للاستفادة: @CodeProgrammer

مجموعة القناة:
@PythonArab
Topic: Python Script to Convert a Shared ChatGPT Link to PDF – Step-by-Step Guide

---

### Objective

In this lesson, we’ll build a Python script that:

• Takes a ChatGPT share link (e.g., https://chat.openai.com/share/abc123)
• Downloads the HTML content of the chat
• Converts it to a PDF file using pdfkit and wkhtmltopdf

This is useful for archiving, sharing, or printing ChatGPT conversations in a clean format.

---

### 1. Prerequisites

Before starting, you need the following libraries and tools:

#### • Install pdfkit and requests

pip install pdfkit requests


#### • Install wkhtmltopdf

Download from:
https://wkhtmltopdf.org/downloads.html

Make sure to add the path of the installed binary to your system PATH.

---

### 2. Python Script: Convert Shared ChatGPT URL to PDF

import pdfkit
import requests
import os

# Define output filename
output_file = "chatgpt_conversation.pdf"

# ChatGPT shared URL (user input)
chat_url = input("Enter the ChatGPT share URL: ").strip()

# Verify the URL format
if not chat_url.startswith("https://chat.openai.com/share/"):
print("Invalid URL. Must start with https://chat.openai.com/share/")
exit()

try:
# Download HTML content
response = requests.get(chat_url)
if response.status_code != 200:
raise Exception(f"Failed to load the chat: {response.status_code}")

html_content = response.text

# Save HTML to temporary file
with open("temp_chat.html", "w", encoding="utf-8") as f:
f.write(html_content)

# Convert HTML to PDF
pdfkit.from_file("temp_chat.html", output_file)

print(f"\n PDF saved as: {output_file}")

# Optional: remove temp file
os.remove("temp_chat.html")

except Exception as e:
print(f" Error: {e}")


---

### 3. Notes

• This approach works only if the shared page is publicly accessible (which ChatGPT share links are).
• The PDF output will contain the web page version, including theme and layout.
• You can customize the PDF output using pdfkit options (like page size, margins, etc.).

---

### 4. Optional Enhancements

• Add GUI with Tkinter
• Accept multiple URLs
• Add PDF metadata (title, author, etc.)
• Add support for offline rendering using BeautifulSoup to clean content

---

### Exercise

• Try converting multiple ChatGPT share links to PDF
• Customize the styling with your own CSS
• Add a timestamp or watermark to the PDF

---

#Python #ChatGPT #PDF #WebScraping #Automation #pdfkit #tkinter

https://t.me/CodeProgrammer
Please open Telegram to view this post
VIEW IN TELEGRAM
21💯1