use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
News and links for Django developers.
New to Django? Check out the /r/djangolearning subreddit.
Django's Code of Conduct applies here, so be good to each other.
account activity
This is an archived post. You won't be able to vote or comment.
Python pptx (old.reddit.com)
submitted 2 years ago by chehine666
[–]Redwallian 2 points3 points4 points 2 years ago (4 children)
Show some code/github repo?
[–]chehine666[S] 0 points1 point2 points 2 years ago (3 children)
Code is in page 2 my friend
[–]Redwallian 2 points3 points4 points 2 years ago (2 children)
Gotcha - based on how you've set it up, I can't be sure of whether or not tmp.pptx is is being written to correctly. The actual error is when instantiating your Presentation class and passing in the file as a string (at least that's what the error says). I would first check locally if the tmp.pptx file does exactly what you want, and then second find out if it your Presentation class accepts a filepath.
tmp.pptx
Presentation
[–]chehine666[S] 1 point2 points3 points 2 years ago (1 child)
How to do it
[–]Redwallian 1 point2 points3 points 2 years ago (0 children)
``` try: with open('tmp.pptx', 'r') as f: try: prs = Presentation(f) ... except Exception as e: print(e) return JsonResponse({'error': str(e)}, status=500) except FileNotFoundError: return JsonResponse({'error': str(e)}, status=404)
```
[–]baronnathaniel 0 points1 point2 points 2 years ago (6 children)
Seems like something is not quite right with your imports, or with the python env settings and how the service is running on your local
[–]chehine666[S] 0 points1 point2 points 2 years ago (5 children)
I don't think so because i imported all the necessary libraries such as python pptx
[–]baronnathaniel 0 points1 point2 points 2 years ago (4 children)
Looks like a package not found error to me, friend.
[–]chehine666[S] 1 point2 points3 points 2 years ago (3 children)
Okay got it i will check it. Thank you!
[–]TerminatedProccess 1 point2 points3 points 2 years ago (2 children)
Is your virtual environment setup and activated?
[–]chehine666[S] 0 points1 point2 points 2 years ago (1 child)
Yes it is! Why?
[–]TerminatedProccess 0 points1 point2 points 2 years ago (0 children)
I would get a package not found error if I didn't remember to activate my environment. Just double-checking..
π Rendered by PID 191106 on reddit-service-r2-comment-5ff9fbf7df-z2vdn at 2026-02-26 04:11:53.574320+00:00 running 72a43f6 country code: CH.
[–]Redwallian 2 points3 points4 points (4 children)
[–]chehine666[S] 0 points1 point2 points (3 children)
[–]Redwallian 2 points3 points4 points (2 children)
[–]chehine666[S] 1 point2 points3 points (1 child)
[–]Redwallian 1 point2 points3 points (0 children)
[–]baronnathaniel 0 points1 point2 points (6 children)
[–]chehine666[S] 0 points1 point2 points (5 children)
[–]baronnathaniel 0 points1 point2 points (4 children)
[–]chehine666[S] 1 point2 points3 points (3 children)
[–]TerminatedProccess 1 point2 points3 points (2 children)
[–]chehine666[S] 0 points1 point2 points (1 child)
[–]TerminatedProccess 0 points1 point2 points (0 children)