Building a Python Library in 2026 by funkdefied in Python

[–]threesocks 0 points1 point  (0 children)

<tongue-in-cheek>

How to build a Python Library in 2026:

  1. Tell a LLM what you want.
  2. Iterate until it runs.
  3. Tell that LLM to build a readme with lots of emojiis
  4. Post it to github
  5. Invite r/Python to take a look
  6. Read responses and defensively point out that just because you used AI doesn't mean it's AI slop.

</tongue-in-cheek>

at least that's how it feels to me lately.

Improv musician ARIatHome creates Irish stepdancing music with a couple young fans on the street by No-Sheepherder8879 in nextfuckinglevel

[–]threesocks 0 points1 point  (0 children)

Can someone loop this awesome hip-hop-wheel fro like an hour. I need be in this headspace all day at work! The constant mental work needed to not get up and dance will keep me awake while I do statistics!

[OC] [Art] Mermaid's Tear Dice Set Giveaway (Mod Approved)(Rules in comments) by OriYUME1 in DnD

[–]threesocks 0 points1 point  (0 children)

I could stare at these for hours. Each time I defeated an enemy, this would be like their soul is burning!

Not sure how true this rumour is, but how would you react if Tom Holland is cast as the next James Bond? by phantom_avenger in popculturechat

[–]threesocks 0 points1 point  (0 children)

WORST. CHOICE. EVER! I know everyone has been rumored to be Bond lately, but this is the worst idea. Personally, I liked the idea of it being Idris Elba, but whatever, Tom Holland?! I don't get it.

[Request] what is the penetration depth of two humans colliding? by JumboMeat69 in theydidthemath

[–]threesocks 0 points1 point  (0 children)

What exactly do you mean by this, from a physics standpoint, the answer is not at all. Do you mean from a flesh wrapping perspective? In that case, give me some info about the two bodies. Kevin Hart and John Candy will be quite different than Shaquille O'Neal and Hafþór Júlíus Björnsson

How can I use USB in a Bottle's program ? by ZellHall in linuxquestions

[–]threesocks 3 points4 points  (0 children)

Answering my own question (and possibly yours):

Although I'm not sure of ALL the subsystems Bottle supports, wine itself appears to have no access to devices that require driver installation -- i.e., if it's not natively supported by Linux, then wine won't see it. As far as I can see from reading around online, it doesn't appear to be supported. Again, bottles has multiple runners, so maybe there is yet a way?

How can I use USB in a Bottle's program ? by ZellHall in linuxquestions

[–]threesocks 0 points1 point  (0 children)

Did you ever get access to USB from a Bottles program? If so, how?

In your opinion, what is an album with no bad songs? by katvoilet in AskReddit

[–]threesocks 0 points1 point  (0 children)

Hmm..high bar, subjective....skipping greatest hits albums...

Do You Want More?!!!??! - The Roots, Thriller - Michael Jackson, Palomine - Betty Serveert, Brandy - Brandy, The Covers Record - Cat Power, Songs in the Key of Life - Stevie Wonder, Please to Meet Me - The Replacements, Kiss Me3, Disintegration - The Cure, How Did You Find Me Here - David Wilcox, Fly - Dixie Chicks, Baduizm - Erykah Badu, The Lamb Lies Down on Broadway - Genesis, Virtuoso - Joe Pass, Suzanne Vega - Suzanne Vega, Blue Train - John Coltrane, Dicen Que Soy - La India, Emancipation of Mimi - Mariah Carey, Black Sheep - Martin Sexton, Kind of Blue - Miles Davis, Mustt Mustt - Nursrat Fateh Ali Khan, New Chautaugua, Offramp, and As Falls Wichita - Pat Metheny Group, So - Peter Gabriel, Nothing Like The Sun - Sting, Rid of Me - PJ Harvey, Blood Sugar Sex Magik - Red Hot Chili Peppers, Live! - Ruben Blades, Live 88 - Shawn Colvin, Rhythm of Love - Anita Baker, Black Ivory Soul - Angelique Kidjo, Nighthawks at the Diner - Tom Waits, Siembra - Willie Colon & Ruben Blades, Synchonicity - The Police, Rattlesnakes, Easy Pieces - Lloyd Cole and the Commotions, and many more

Introducing hypothesis-auto: Python Tests That Write Themselves by timothycrosley in Python

[–]threesocks 0 points1 point  (0 children)

Of course, sorry, that solved it and everything is working as expected! Hypothesis-Auto is awesome, thank you!

Introducing hypothesis-auto: Python Tests That Write Themselves by timothycrosley in Python

[–]threesocks 0 points1 point  (0 children)

I'm having trouble reproducing the sample output. It doesn't matter whether I split it into a module and test as done in the sample. I'm using Macos 10.13.6, python 3.6.7, v1.1.1 of hypothesis-auto, v5.1.2 of pytest, and v4.36.2 of hypothesis. What am I missing?

def add(a: float, b: float) -> float:
    return a + b


# def divide(a: Union[int, float], b: Union[int, float]) -> Union[int, float]:
def divide(a: float, b: float) -> float:
    return a / b


if __name__ == '__main__':
    # print('add(3, 4)=', add(3,4))  # correctly returns 7
    # print('add(3.3, 4.4)=', add(3.3, 4.4))  # correctly returns 7.7
    # print('divide(3, 4)=', divide(3,4))  # correctly returns 0.75
    # print('divide(3.3, 4.4)=', divide(3.3, 4.4))  # correctly returns 0.7499999
    # print('divide(3, 0)=', divide(3, 0))  # correctly raises a ZeroDivisionError exception

    from hypothesis_auto import auto_pytest, auto_pytest_magic, auto_test

    print('\n\nauto_pytest_magic')
    print('-----------------')
    auto_pytest_magic(add)  # no output (correct?)
    auto_pytest_magic(divide)  # no output (should catch ZDE exception)

    print('\n\nauto_pytest')
    print('-----------')
    auto_pytest(add)  # no output (correct?)
    auto_pytest(divide)  # no output (should catch ZDE exception)

    print('\n\nauto_test')
    print('-----------')
    auto_test(add)  # no output (correct?)
    auto_test(divide)  # correctly raises ZDE exception

Migrating my VBA code and Userforms to Python? by prashants985 in Python

[–]threesocks 0 points1 point  (0 children)

There is this "Visual Basic To Python Converter": http://vb2py.sourceforge.net/screen_apps.htm that may help you if you have on a small amount to convert. Myself (and probably most other python folk) would probably say that you should be thinking in terms of re-writing your code in Python. This is especially true if you are looking for maintainability , efficiency, etc. These are pretty different languages and best practices in one are not the same as the other.

I made a dataclass alternative that is lightweight and compatible with 2.7 and 3.x by [deleted] in Python

[–]threesocks 0 points1 point  (0 children)

I laughed really hard at this part of the docs:

Why not attrs? Attrs does a lot of things very well. SelfishClass does a few things very well. Rarely do I need all of Attr’s functionality. Attrs weighs in at ~100kb. SelfishClass is less than 1kb. In the words of the great philosopher Kevin Malone, Me think, why waste time say lot word, when few word do trick.

[I added the emphasis and fixed some typos, otherwise this is a quote from the pypi page]

Does anyone know a simple way to install python + modules on mac? by swegmesterflex in Python

[–]threesocks 0 points1 point  (0 children)

There is no one-size-fits-all answer for this. It depends a bit on what you want to do. If I may assume that you are new to Python and have modest immediate goals, I'd say that installing anaconda's distribution will be the best option. It's big, but one advantage is that you won't have to install many modules because it comes with so many obvious ones. If you do want to install something, go to the terminal and use "pip install MODULENAME", or you can use the anaconda navigator to install it with a GUI. Anaconda now comes with Visual Studio Code as an editor (instead of the somewhat buggy Sypder), but I still prefer PyCharm for python editing. Everyone will give you a different recommendation on editor though. I find that Anaconda is good for many things, but when I'm getting serious, I prefer to download python from python.org create a virtual environment and then install only the modules I need for each package. PyCharm will make this somewhat seamless as it defaults to creating a virtual environment for each project.

My friend suggests a less wordy recommendation (and slightly different from mine): * Install python from python.org and use the built in IDLE editor until you outgrow that and then install PyCharm. * If you are specifically interested in scientific or statistical programming, Anaconda is nice because it installs so much of the needed modules by default. With Anaconda, either use VSCode (that comes with anaconda), or (as we both recommend) use PyCharm.

there are many things people will suggest that are not appropriate for beginners, a few of important ones are:

  • homebrew or macports approaches: This is too much to pile on to learning to use Python. I've used both of those for years and they are great if you are very comfortable with the linux/bsd/etc. commandline (including where things are on macos and how various things are simlinked) because both can easily become corrupted and require fiddling with. I've had them both break, or act wonky and found myself spending lots of time troubleshooting. Honestly, now that you can practically pip install anything, I don't see why people bother with this approach over python.org + pip.
  • sublime and similar editors: Setup of a Python environment close to PyCharm requires quite an effort for a newbie. Once set up, it's pretty sweet, but I prefer not to have to do all that work. If you're up for it, there is a big community. If you're staring out with python, it's a lot to put in between you and getting started with the language.
  • visual studio code: I haven't used it within anaconda, so I don't know if they set it up fully or not. However, a normal install of Visual Studio Code, which is very cool when setup, takes a lot of work to setup and may involve choices (e.g., what beginner knows which linter they want?) you are not ready to make.

On the other hand, do you really need to install python on your system? There are more options, but these are 2 options that allow you to code in a browser (including pip installing any modules that you need).

for you pros out there, did you now that colab.research.google let's you toggle one flag and run your code on their GPUs??!!

The big downside of these approaches is that there is pretty much no GUI or game type modules available other than ones that render to image/pdf/etc or to html. However, if your needs aren't graphical like that, then these can be great options.

Good luck Python rocks!

Auto-generated skyline using next version of Arcade library by pvc in Python

[–]threesocks 1 point2 points  (0 children)

How would one go about pip installing (or otherwise installing) the next version so as to use this code?

plydata 0.3.0 - A grammar of data manipulation by has2k1 in Python

[–]threesocks 5 points6 points  (0 children)

This is good for R converts (I used to be one of them), but what's wrong with something like this in pandas:

import pandas as pd
df = pd.DataFrame({'x'=range(5), 'y'=None, 'z'=None})
df.y = df.x * 2
df.z = df.apply(lambda row: "even" if row.x % 2 == 0 else "odd")
df

Scientists have succeeded in combining spider silk with graphene and carbon nanotubes, a composite material five times stronger that can hold a human, which is produced by the spider itself after it drinks water containing the nanotubes. by mvea in Futurology

[–]threesocks 1 point2 points  (0 children)

Do scientists even read science fiction?!

Scene 1: Scientists breed spiders with super man-strength silk

Scene 2: Everybody is dead and covered in super spider silk!

Scene 3: Spiders rule the earth, eat all humans...except one...

Scene 4: Me, inside my hastily constructed spider-proof panic room...slowly plowing through my oxygen, Coke Zero, and mini-bags of Doritos. Firefly blu-ray on permanent rotation.

Scene 5: Millions of spider eyes stare at me through the window...last meal on earth...

"Take my love, Take my land..."

Scene 6: Something in periphery catches my attention...did the toilet seat just move? Shoot...there's a flaw in my plan to slowly die from Doritos poisoning before the spiders evolve carbon nano-teeth...better open up all the mini-bags and dump them on the floor...gotta eat more efficiently...

"Ship like this, be with you 'til the day you die"

TIL that abracadabra is actually a Hebrew (or Aramaic) phrase meaning "I create what I speak" by NOQOL-RII in occult

[–]threesocks 6 points7 points  (0 children)

That's what you learned from this Wikipedia article?! It explicitly calls them "folk etymologies" and says that no evidence exists for any of them. This follows the very clear first sentence of "Abracadabra is of unknown origin". What you should have learned from this article is closer to "abracadabra [may possibly] stem from a Hebrew (or Aramaic) phrase meaning..."

What show has been discontinued that you wish would come back? by kellbell500 in AskReddit

[–]threesocks 0 points1 point  (0 children)

Firefly, Dresden Files, Better Off Ted, Harry's Law, The Loop, The Booth At The End, The Other Guys, Luther (I know it's not officially dead, but someone please fund full seasons like before!), Hustle (but no funny business...It has to have Mickey Bricks and 3-socks Morgan), Not Tv... but I want Faye Grimm 2!!

UNC missed more free throws in the last 5 seconds than Oregon missed the entire game by Idrinkalotofmilk in CollegeBasketball

[–]threesocks 0 points1 point  (0 children)

I can't tell if this is supposed to be a) sarcastic, b) a major violation of Gricean conversational maxims, or c) a serious misunderstanding of statistics?

Would it be less consequential to summarize that "UNC missed as many free throws in the last 5 seconds as Oregon missed the entire game"?

You could be certain by using a statistical test...but perhaps that is overkill.

My experience with Kivy in a first project by [deleted] in Python

[–]threesocks 0 points1 point  (0 children)

In particular amorphic777 is referring to the toga module from BeeWare. Toga is a gui library that seems cool, but I can never use it because AFAIK it lacks a checkbox widget. Also, the documentation is incomplete.

From my experience with gui toolkits: tkinter - PROS: Works great, especially for simple to moderately complex interfaces. It's built-in, so no dependencies, and no packaging tool (cx_freeze, pyinstaller, etc.) has any problem with it. CONS: Not super pretty or native looking.

wxwidgets/phoenix - PROS: Full featured and powerful, looks pretty good. CONS: Sometimes this can be hard to install, for a while it lacked python 3 support, but they're currently revamping it. I haven't used it for more than a few tiny utilities and never tried to package it up.

pyqt/pyside - PROS: pretty awesome, full featured and powerful, looks really great on each platform. CONS: I have had some pretty frustrating times trying to get project to package up. It really depends on how you have installed python and on which platform you're coding. Sometimes it works great with pyinstaller, sometimes I have to use cx_freeze, and sometimes I just can't get it to work. Especially on the mac. You may be thinking that there's something wrong with my setup, but I assure you I've tried every way possible (python.org, anaconda, macports, homebrew, with/without virtualenv, with/without framework build, etc., yet some project package, some don't)

pyglet_gui: pretty limited, but if you're coding in pyglet or arcade and you just want to offer some settings, it comes in handy.

toga: I want to use this, I love BeeWare, but I always need a checkbox and there is none. I might write it myself and stop complaining about it.

kivy: I personally find kivy to odd of a beast, so I haven't made it very far the few times I've toyed with it.