Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
a dingus
Mar 22, 2008

Rhetorical questions only
Fun Shoe
Going to have to 2nd that request for Eve stories. Was it something goons were doing?

And I can't learn from videos alone, but I think they're good supplements for well written articles. I am a newbie but find tutorials or written lessons with "challenges" that make you implement small portions on your own the best for learning.

That said I snagged the humble bundle and can't wait to dig into some of the books.

Adbot
ADBOT LOVES YOU

a dingus
Mar 22, 2008

Rhetorical questions only
Fun Shoe
Do any python message board exist where people post threads with their own tutorials? Or have these all moved in to blogs or lovely website? I miss that about the old web... the discussions around the tutorials always had good info.

a dingus
Mar 22, 2008

Rhetorical questions only
Fun Shoe

punished milkman posted:

Anyone have any package suggestions for extracting tables of data from image files (.png/.jpg) ? I tried using Tesseract/pytesseract and while it's doing a great job of detecting the text, the tabular aspect of it is totally lost and I couldn't find a straight forward path to processing tables with it. I've used Camelot with PDFs before, and it worked OK (at best), but I'm hoping to use something else this time around.

Can you extract the information into a tuple and create a table in something like pandas?

a dingus
Mar 22, 2008

Rhetorical questions only
Fun Shoe
That is a great question. I wonder the same thing. Like when I write a program that sends an email... do I split the code that sends an email into another object? Do I write the code in a functional style and then make all of the functions a method in my class?

a dingus
Mar 22, 2008

Rhetorical questions only
Fun Shoe
Datacamp helped me with pandas quite a bit years ago. It's like free code camp style learning but it costs like $30 a month.

a dingus
Mar 22, 2008

Rhetorical questions only
Fun Shoe
From my quick search it looks like you can reconnect to a browser session using selenium. You'd have to get the session information from the existing Firefox window, patch it into the reconnect function and then go from there. Have you explored this yet? Not sure what is involved in getting the existing session information.

a dingus
Mar 22, 2008

Rhetorical questions only
Fun Shoe
I was looking at this: https://stackoverflow.com/questions/8344776/can-selenium-interact-with-an-existing-browser-session it looks like an older answer, hopefully that works for what you're looking to do

Edit* looks like it's doing the same thing as above :(

a dingus
Mar 22, 2008

Rhetorical questions only
Fun Shoe
Maybe ask them about what they think advanced python features are. That could give you a good reference point on their experience so can explore follow up questions.

a dingus
Mar 22, 2008

Rhetorical questions only
Fun Shoe
yeah just post it

a dingus
Mar 22, 2008

Rhetorical questions only
Fun Shoe
My first instinct is that NewThing can't be a subclass of Thing because the signatures are different. Hiding a required param in **kwargs is just a sneaky workaround like you've said. I'd probably inspect your input within the events loop and either feed it to Thing or NewThing depending on what it goes to.

a dingus
Mar 22, 2008

Rhetorical questions only
Fun Shoe
IMO I wouldn't change the function signature of NewThing.update() if it's going to be a subclass of Thing. Changing it means you can't use NewThing in place of Thing without changing the way things are written. NewThing wouldnt conform to the metaclass either.

I'd be skeptical of using **kwargs as a way to pass in your new param1since in reality it sounds like it would be required in NewThing and its confusing to the user without it being explicit. You'd have to know how NewThing.update() works to know you actually need to pass that in.

If Im understanding correctly maybe NewThing would be better off as a new type which is composed of Thing instead of inheriting it.

Then I'd probably do this:

SporkOfTruth posted:

code:
# "Functional" NewThing version 
newthing_instance = NewThing()
for event in events:
    inputs = foo[event]
    param1_event = bar(inputs)
    for input in inputs:
        # Functional version
        result = newthing_instance.update(input, param1_event)

Another idea is inheriting Thing and overriding update to add param1_event as a parameter with a default value of None and doing different things depending on whether param1_event is passed in or not.

edit* oh boy I don't know how code snippets work

a dingus fucked around with this message at 21:54 on Mar 29, 2023

a dingus
Mar 22, 2008

Rhetorical questions only
Fun Shoe
I'll also give Fluent Python a great endorsement. I read it when I was a late beginner and felt like it made me an intermediate just by how it connected so many dots. It was something I referenced often and still would if I were doing python full time.

If anyone knows the same type of book for JS/TS I'm all ears!

a dingus
Mar 22, 2008

Rhetorical questions only
Fun Shoe
What do you do if a post fails? Can you retry without altering the state of the model? Will you have to start all over again? Sucks that you have to send it row-by-row. Our QA team did something similar to test a chat bot we were developing

a dingus
Mar 22, 2008

Rhetorical questions only
Fun Shoe
What does login_user() look like?

Adbot
ADBOT LOVES YOU

a dingus
Mar 22, 2008

Rhetorical questions only
Fun Shoe
Notebooks live in their own world of bad code and data science, where you prove something out with a notebook and then you throw it away.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply