This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from docx import Document | |
from docx.shared import Inches, Pt, RGBColor | |
from docx.enum.text import WD_ALIGN_PARAGRAPH | |
from docx.enum.section import WD_ORIENT | |
# Creare document | |
doc = Document() | |
# Setare orientare landscape | |
section = doc.sections[0] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from docx import Document | |
from docx.shared import Inches, Pt, RGBColor | |
from docx.enum.text import WD_ALIGN_PARAGRAPH | |
from docx.enum.section import WD_ORIENT | |
# Creare document | |
doc = Document() | |
# Setare orientare landscape | |
section = doc.sections[0] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PIL import Image | |
from pathlib import Path | |
import img2pdf | |
def tiff_to_jpg_apoi_pdf(folder_input, nume_pdf="document.pdf"): | |
""" | |
1. Convertește TOATE TIFF-urile în JPG | |
2. Apoi combină toate JPG-urile într-un singur PDF | |
""" | |
folder_input = Path(folder_input) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PIL import Image | |
from pathlib import Path | |
def tiff_to_jpg(folder_input, folder_output=None): | |
""" | |
Convertește toate TIFF-urile în JPG cu calitate maximă. | |
""" | |
folder_input = Path(folder_input) | |
if folder_output is None: | |
folder_output = folder_input / "jpg" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
VARIANTĂ 1: Toate imaginile într-un singur PDF | |
pythonimport cv2 | |
import img2pdf | |
from pathlib import Path | |
from PIL import Image | |
def tiff_to_jpg_to_pdf(folder_input, folder_output=None, nume_pdf="document.pdf"): | |
""" | |
Convertește toate TIFF-urile în JPG și apoi într-un singur PDF. | |
Calitate maximă, fără pierderi. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Genereaza fragmente din carti sau filme legat de textul care ti-l dau. Iti dau un text, tu trebuie sa faci referire la o scena dintr-o carte sau dintr-un film care sa aiba legatura cu textul pe care ti-l dau. Trebuie sa-mi furnizezi 3 exemple, fiecare din ele sa aiba circa 3-5 propozitii. | |
Iata textul model: | |
Domnul in varsta mi-a spus: „Ești atât de cufundat în lumea acelei cărți, încât ai uitat complet de frigul de afară. Pantalonii scurți nu se potrivesc cu vremea asta. Vei răci, tânărule.” | |
I-am răspuns imediat, cu zâmbetul calm al celui ce deține un secret esențial: | |
„Dimpotrivă, aceasta este combinația perfectă pentru mine. Mintea mea se înfierbântă de idei, iar corpul răspunde instinctiv acestui flux energetic, funcționând la un potențial termic optim. Adevărata căldură vine din interior, din focul cunoașterii.” |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
def compare_files(): | |
base_dir = r"e:\Carte\BB\17 - Site Leadership\alte\Ionel Balauta\Aryeht\Task 1 - Traduce tot site-ul\Doar Google Web\Andreea\Meditatii\2023\Compara 2 fisiere txt si arata diferentele de linii care exista in unul, dar nu si in celalalt" | |
fisier_baza = f"{base_dir}\\Fisier de baza.txt" | |
fisier_comparat = f"{base_dir}\\Fisier de comparat.txt" | |
fisier_output = f"{base_dir}\\output.txt" | |
try: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
def compare_files(): | |
base_dir = r"e:\Carte\BB\17 - Site Leadership\alte\Ionel Balauta\Aryeht\Task 1 - Traduce tot site-ul\Doar Google Web\Andreea\Meditatii\2023\Compara 2 fisiere txt si arata diferentele de linii care exista in unul, dar nu si in celalalt" | |
fisier_baza = f"{base_dir}\\Fisier de baza.txt" | |
fisier_comparat = f"{base_dir}\\Fisier de comparat.txt" | |
fisier_output = f"{base_dir}\\output.txt" | |
try: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import re | |
def extract_volume_identifier(line: str) -> str: | |
"""Extrage identificatorul unic al volumului din linie.""" | |
# Simplificat: folosește linia completă (trimmed) ca identificator unic | |
# Aceasta va capta și diferențele de ordine între Seria A și Seria B | |
return line.strip() | |
def compare_files(): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
from bs4 import BeautifulSoup | |
import os | |
from urllib.parse import urlparse | |
import time | |
# Configurații | |
base_url = "https://www.3253453.ro/" | |
download_folder = "g:\\Downloads2" # Folderul principal |