r/StackoverReddit • • Jul 07 '24

Python Feedback on a noob's python code?

6 Upvotes

I'm a beginner and I don't know where else to post this. I'd like for people to help run through it, check it for possible bugs and unintended outputs?

I'd prefer not to use ChatGPT since I hear it's killing the ocean now.

I am mainly using Main While Loops, a for loop, Conditional Statements, and print. I haven't learned much beyond that yet.

https://pastebin.com/jMj30Tkw

https://pastebin.com/MVSmuSwW (Forgot the persistent While Loop, better link)

r/StackoverReddit • • Sep 25 '24

Python Which is the best ide for python

0 Upvotes

r/StackoverReddit • • Jul 09 '24

Python How to solve this linear system with python?

2 Upvotes

I have a system with 3M equations and 3M + 3 variables such as:

https://imgur.com/a/pykWzAq

Assuming all coefficients a, b, c, d, e, f and g are known.

With the boundary conditions I add the 3 equations needed to have as many equations as variables, so I should be able to write a code on python that solves this, but I don't quite get how to do it... I would know how do it if one of the boundary conditions was tau_0 = 0 as then we just march in k, but I struggle a little bit with the boundary condition of u_k=M = 0...

I get that I have to put it in matrix notation I guess, so I should linearize it and have Ax = B where A is a matrix of 3Mx3M, x is a vector 3M, right? But even if I'm understanding the theory correctly I have no idea how to write it in python.

r/StackoverReddit • • Jul 11 '24

Python which is the best python course

2 Upvotes

I want to create automation softwares and web apps

r/StackoverReddit • • Jul 30 '24

Python where and how do i change the two needed directory paths for this project I'm following.

2 Upvotes

Sorry about the very dumb question and please feel free to call me dumb because i feel it right now. I wanted to try this project out and cant figure out what lines to change to point to my folders of pictures.

I think its lines 31 and 32 but when i change it doesn't work.

haystackPaths = list(paths.list_images(args["haystack"]))

this is what ive tried.

haystackPaths = list(paths.list_images(args["/path/to/folder"]))

haystackPaths = list(paths.list_images(args[/path/to/folder]))

any help would be great thank you

r/StackoverReddit • • Jul 30 '24

Python Python - Automation Query

5 Upvotes

Python - Automation Query

Hello Team,

I hope I am sharing my concern on right platform, any help or suggestion would be extremely helpful.

With the help of “copilot” I have setup a python script that helps me extract text from images from ppt files, the script works just as expected however here is a challenge -

The script first extracts images from ppt - converts those images into black and white or binary images - identifies the texts on it and extracts it into excel file.

The challenge is some texts have similar shade to background and when these images gets converted to binary those texts kind of get camouflaged & the script couldn’t read or extract texts from it.

How do I fix this?

FYI - I am using tesseract OCR

Any help here would be highly appreciated. Let me know if any other information might be needed.

r/StackoverReddit • • Jul 25 '24

Python Making a simple text and button based game to learn Python and tkntr and trying to figure out how to approach a problem

3 Upvotes

I'm making game with a very simple GUI consisting of text and buttons you press to perform actions to teach myself python and tkntr. My biggest hurdle, however, is figuring out how to update the buttons in the game. My goal is to have the buttons act similar to commands you would type in a text based adventure game, but instead of having to guess what to type, you have all the options for each area presented on buttons (I plan to challenge myself to also add combat too later on). I know there may be other ways to approach it besides using buttons, but for the sake of education I want to do the button approach. What's a streamlined and effective way I can have the buttons and their actions update depending on the situation or location you are currently in?

Also, what would be a good way to handle moving between areas in that regard (moving between areas would mostly just change what text is shown and what actions you can perform)

Once I get over this hurdle, everything else will be much easier as I have a good idea on how to approach the other stuff, I just have very limited experience with GUI elements and even less with tkntr.