Make notes for me. Idk anything. I’ve got exam tomorrow
python -m markitdown "/home/daytona/workspace/attachments/e7a0a918-48e1-4ccd-98c4-91f54c2ced68/thyroid 1.pptx" 2>/dev/null
python -m markitdown "/home/daytona/workspace/attachments/e7a0a918-48e1-4ccd-98c4-91f54c2ced68/thyroid 2.pptx" 2>/dev/null
python3 -m markitdown "/home/daytona/workspace/attachments/e7a0a918-48e1-4ccd-98c4-91f54c2ced68/thyroid 1.pptx" 2>&1 | head -5
cd "/home/daytona/workspace/attachments/e7a0a918-48e1-4ccd-98c4-91f54c2ced68" && ls -la && python3 -c " import zipfile, os for fname in ['thyroid 1.pptx', 'thyroid 2.pptx']: print(f'\n===== {fname} =====') try: with zipfile.ZipFile(fname, 'r') as z: slides = sorted([n for n in z.namelist() if n.startswith('ppt/slides/slide') and n.endswith('.xml')]) print(f'Found {len(slides)} slides') except Exception as e: print(f'Error: {e}') "
python3 -c " import zipfile, re from lxml import etree def extract_pptx_text(fname): results = [] with zipfile.ZipFile(fname, 'r') as z: slides = sorted([n for n in z.namelist() if re.match(r'ppt/slides/slide\d+\.xml$', n)], key=lambda x: int(re.search(r'\d+', x.split('/')[-1]).group())) for sname in slides: with z.open(sname) as f: tree = etree.parse(f) ns = {'a': 'http://schemas.openxmlformats.org/drawingml/2006/main'} texts = [] for t in tree.findall('.//a:t', ns): if t.text and t.text.strip(): texts.append(t.text.strip()) results.append({'slide': sname, 'text': ' | '.join(texts)}) return results for fname in ['/home/daytona/workspace/attachments/e7a0a918-48e1-4ccd-98c4-91f54c2ced68/thyroid 1.pptx', '/home/daytona/workspace/attachments/e7a0a918-48e1-4ccd-98c4-91f54c2ced68/thyroid 2.pptx']: slides = extract_pptx_text(fname) print(f'\n========== {fname} ==========') for s in slides: print(f'[{s[\"slide\"]}]') print(s['text']) print() " 2>&1
python3 -c " import zipfile, re, xml.etree.ElementTree as ET def extract_pptx_text(fname): results = [] ns = {'a': 'http://schemas.openxmlformats.org/drawingml/2006/main'} with zipfile.ZipFile(fname, 'r') as z: slides = sorted([n for n in z.namelist() if re.match(r'ppt/slides/slide\d+\.xml\$', n)], key=lambda x: int(re.search(r'\d+', x.split('/')[-1]).group())) for sname in slides: with z.open(sname) as f: content = f.read().decode('utf-8', errors='ignore') # Simple regex extraction texts = re.findall(r'<a:t[^>]*>([^<]+)</a:t>', content) texts = [t.strip() for t in texts if t.strip()] results.append({'slide': sname, 'text': texts}) return results for fname in ['/home/daytona/workspace/attachments/e7a0a918-48e1-4ccd-98c4-91f54c2ced68/thyroid 1.pptx', '/home/daytona/workspace/attachments/e7a0a918-48e1-4ccd-98c4-91f54c2ced68/thyroid 2.pptx']: slides = extract_pptx_text(fname) print(f'\n========== {fname} ==========') for s in slides: slidenum = re.search(r'\d+', s['slide'].split('/')[-1]).group() print(f'--- Slide {slidenum} ---') print(' | '.join(s['text'])) print() " 2>&1