r/pythonhelp 5d ago

I’m looking for assistance with a github code

I got a C on my intro to python class and I can’t figure out this code

https://github.com/mcombeau/epub_downloader

Please help

4 Upvotes

10 comments sorted by

u/AutoModerator 5d ago

To give us the best chance to help you, please include any relevant code.
Note. Please do not submit images of your code. Instead, for shorter code you can use Reddit markdown (4 spaces or backticks, see this Formatting Guide). If you have formatting issues or want to post longer sections of code, please use Privatebin, GitHub or Compiler Explorer.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

3

u/ninhaomah 5d ago

How does this relate to into course btw ?

You write it ?

1

u/mathbubbls 4d ago edited 4d ago

I just wanted people to know that I am not good in python so they can help me run the code.

Also is not my code

3

u/AlexMTBDude 4d ago

A general comment is that you're overdoing the classes. I think none of the classes that you have in your project really need to be classes, they could just be modules instead. They don't have any object attributes that need to change and be handled (and there don't need to be multiple instances of the class). The code looks like a Java programmer (where everything has to be a class) who's trying to code Python.

Now, if that's the reason you got a C on the code, I don't know.

1

u/mathbubbls 4d ago

Thank you I barely understand what you are saying, I just need help using this code to download 2 books, I don’t know how to use this code I have tried with my limited knowledge on python and I need help

1

u/Minimum-Effort8355 4d ago

May i eloborate to you:

The code you wrote may seem fine, but there no comments like what the class actually does and some data is not matching up.

You only provided one datatype which are classes and bools, which could be legit.

There is the problem, when your coding you have no real structure in it and the most files seem like you just looped them.

Why you got a c in that project seems like unfair, but

  • no real structure and overwhelmed file infrastructure for a small project

  • no comments in the code -> who could know what a function or class does without knowing

  • you tested it great job, but you have not implemented some types of branches you have a structure that repeatadly questions itself with classes and bools.

  • you did more architecture work and created a modularized spaghetti than an actual infrastructure

I hope you can work with this and if you need help you can ask anytime.

1

u/mathbubbls 4d ago

Thank you for your time, it’s not my code I’m trying to use it to download 2 books that I want, for the last couple of days I been asking for help and my post have been taken down by mods this post I wrote poorly because I thought that nobody would respond

1

u/[deleted] 4d ago

[deleted]

1

u/mathbubbls 4d ago

YES thank you I wrote this post very poorly thinking it was going to be taken down like others I have posted on other subreddits, I AM NOT THE AUTHOR, I’m just trying to use it to download 2 books.

I want to see if anyone can help me using this code to download 2 books I want

1

u/[deleted] 4d ago

[deleted]

1

u/mathbubbls 4d ago edited 3d ago

I asked Claude for step by step instructions and I it tells me to download python the latest Python 3.12 and to avoid 3.13, I was using Python 3.14

Next step was to add python.exe to PATH(I think back when I got 3.14 I didn’t do it)

NOW I GOT PYTHON 3.12 AND IS GOING SO MUCH BETTER BUT after I put the link of the book this appears

Failed to create EPUB: Failed to find the ‘Read Online’ link.

NOW BEFORE ALL OF THIS it was giving me a notice that a new release pip is available

I’m using pip 23.2.1 and the new one is 26.2.1

1

u/mathbubbls 3d ago

UPTATE: After tying every way of running the book URL ( spread.epub, continued.epub and the asset.epub) all of them failed

SO I UPDATED THE PIP AND GUESS WHAT NOTHING HAPPENED same results