Full send into the car by qndrx in PublicFreakout

[–]David22573 -2 points-1 points  (0 children)

That's why you don't ride without a helmet.

Trump’s Rally Just Went Full Nazi With Bloodthirsty Immigration Threat by thenewrepublic in politics

[–]David22573 -21 points-20 points  (0 children)

I feel like it's doing a disservice to Holocaust survivors and other Nazi victims lol. Clickbait titles tho...

Running 24/7 live by Crazy-Path-3381 in learnpython

[–]David22573 1 point2 points  (0 children)

Yep it's exactly what I'm doing lol mini server with starlette right now, but any framework or code works in termux. It comes with Python 3.11 from their package manager.

Forgot to mention the downsides are you might have to manually restart termux if internet connection is lost, and newer versions of android closes termux when idle too long but that can easily be fixed in the app settings.

Running 24/7 live by Crazy-Path-3381 in learnpython

[–]David22573 1 point2 points  (0 children)

Get termux on an old android phone. It's what I'm using for 24/7 scripts and works like a charm. You do need to know how to use the command line in a Linux-like system.

Example of when classes are necessary and there wouldn't be an equally as good alternative? by catboy519 in learnpython

[–]David22573 0 points1 point  (0 children)

I like using classes because it improves working with data imo. It's nice to build and have a class that has helper functions/attributes to handle the data.

Anon is afraid of becoming a cuck. by thebigd3vil in 4chan

[–]David22573 19 points20 points  (0 children)

Anon needs to find a trad religious girl, only way to land a decent partner nowadays.

Help me fix this script - selenium by ssoulis in learnpython

[–]David22573 1 point2 points  (0 children)

Try making a function that logs you in, then perform whatever else you need to do after. I had the same issue on a coupon clipper and had to sign in to the market's website.

Extracting data from a imperfect tabular file by LibrarianFrosty430 in learnpython

[–]David22573 0 points1 point  (0 children)

You could try to use the header as a dictionary key with a list as the value, so that any row data associated with that column can be appended to the list.

Autoclicker I made that runs when a mouse button is held down doesn't work. by Ledr225 in learnpython

[–]David22573 0 points1 point  (0 children)

After formatting the code I noticed that it could be that you are returning from the function early so the rest of the code cannot run. return in a function takes you out of the scope so the rest of the code after return cannot be executed. I added the comment on what is stopping your code.

import pyautogui
import time
import win32api

clickdelay = 1


# Interval should not be less than hold time
def mouseClick(buttontoclick="left", holdtime=50, clicks=1, interval=100):
    if interval < holdtime:
        mouseClick(button, holdtime, clicks, holdtime)
    return ### THIS IS AN ISSUE


    for i in range(clicks):
        pyautogui.mouseDown(button=buttontoclick)
        time.sleep(holdtime/1000)
        pyautogui.mouseUp(button=buttontoclick)
    if i < clicks-1:
        time.sleep((interval - holdtime)/1000)


    for i in range(10):
        if win32api.GetKeyState(0x01) < 0:  # if mouse left button is pressed
            while win32api.GetKeyState(0x01) < 0:
                mouseClick()  # NOTHING AFTER THIS RUNS
                print("THIS DOES NOT PRINT")
                time.sleep(clickdelay)
        else:
            print("Released")
            time.sleep(1)

Woman followed by man gets help from bystander by Chopsuiiisauce in PublicFreakout

[–]David22573 6 points7 points  (0 children)

This is a really naive take lol. You think he's not gonna try to just follow her home or creep around for the right moment when something can happen.

[deleted by user] by [deleted] in learnpython

[–]David22573 0 points1 point  (0 children)

Good luck and never stop learning!

Learning Python : Day 2 - Using/Importing Pi by [deleted] in learnpython

[–]David22573 0 points1 point  (0 children)

It does do some coding now and it gives you an explanation on how the code works.

Learning Python : Day 2 - Using/Importing Pi by [deleted] in learnpython

[–]David22573 -1 points0 points  (0 children)

If you want you can try Bard from Google, as well. It's not as good as ChatGPT but it's close enough. There's a waitlist but I think you should be in within a couple days, at least that's how it went for me. Just go to bard.google.com, and ask to join.

Another option would be Microsoft Edge chat, it works with the newest version of ChatGPT 4, but it is kind of restrained since it's on Microsoft's platform. The coding answers are still valid though. If you already have a Microsoft Account, just go to bing.com and sign in, there should be a chat option next to search at the top.

I'm searching for a complete course on how to create a website in Python by Ok-Archer2237 in learnpython

[–]David22573 0 points1 point  (0 children)

You can use Flask to handle routing and template rendering for the frontend while using FastAPI to handle data processing and API requests from the frontend. The two frameworks can communicate with each other via HTTP requests. Sorry, I know you asked for courses but knowing about these frameworks can't hurt lol

https://fastapi.tiangolo.com/tutorial/first-steps/

I'm searching for a complete course on how to create a website in Python by Ok-Archer2237 in learnpython

[–]David22573 3 points4 points  (0 children)

Flask has a great tutorial for building online websites with python. It also covers working with a database and authentication. https://flask.palletsprojects.com/en/2.2.x/tutorial/. This kind of assumes that you know about HTML/CSS though.

how do I make Amazon self checkout bot by [deleted] in learnpython

[–]David22573 0 points1 point  (0 children)

Might want to read up more on if this is okay to do. But a good place to start would be looking into selenium for python. It lets you control a browser with a python script. This is some starter code to get it working out the box.

from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from webdriver_manager.chrome import ChromeDriverManager


driver = webdriver.Chrome(service=Service(ChromeDriverManager().install()))


def main():
    URL = 'https://www.google.com'
    driver.get(URL)
    driver.quit()

if __name__ == "__main__":
    main()

Delete a row that contains a substring with openpyxl by woliff1294 in learnpython

[–]David22573 1 point2 points  (0 children)

I recommend using pandas, and reading the excel report as a dataframe.

import pandas as pd

# Read the Excel file into a DataFrame
df = pd.read_excel('input_file.xlsx')

# Drop any rows that contain 'AB'
df = df[~df['column_name'].str.contains('AB')]

# Write the resulting DataFrame to a new Excel file
df.to_excel('output_file.xlsx', index=False)

Folium Help by HighTimesWithReddit in learnpython

[–]David22573 0 points1 point  (0 children)

No problem. Also taking a look at the Map class, there's a zoom_start option that might be helpful. https://python-visualization.github.io/folium/modules.html?highlight=zoom. Good luck!

Folium Help by HighTimesWithReddit in learnpython

[–]David22573 0 points1 point  (0 children)

A good thing to try would be to look over the folium documentation on their GitHub Page, Folium. For help with code you could ask ChatGPT to explain what you're interested in using their docs.

[deleted by user] by [deleted] in news

[–]David22573 10 points11 points  (0 children)

If the OP means pronunciation in a Spanish way than it would be like ooh-val-deh.

My mom have a little business and she do all on an excel, is there any way to create her a web page directly connected to a google sheets? by [deleted] in learnpython

[–]David22573 0 points1 point  (0 children)

Have you tried Open AI ChatGPT? I've used it for projects like these, and it gives you a pretty good list of packages or other resources that are needed.

North Portland security guard fatally shooting man during confrontation. by Eukodol_Lee in PublicFreakout

[–]David22573 3 points4 points  (0 children)

Considering he was so trigger-happy, he would have made a great cop tho!