sub
stringclasses 4
values | title
stringlengths 3
304
| selftext
stringlengths 3
30k
| upvote_ratio
float64 0.07
1
| id
stringlengths 9
9
| created_utc
float64 1.6B
1.65B
|
---|---|---|---|---|---|
Python
|
I made my first Discord Bot with Python!
|
Hello everyone! Over the past 2 weeks I have been working on Discord Bot using [discord.py](https://discord.py) and Python! Inspired by r/place I decided to make a simple bot where users and place pixels on a large canvas. Commands include:
$add\_pixel: Add a pixel to the grid at a specified coordinate and rgb color value
$playback: Create a video showing the full canvas history
$ban: Bans a user from placing new pixels (Admin only)
$unban: Unbans a user allowing them to place pixels again (Admin only)
One of the reasons I started with project was to learn how to use the MongoDB database as well as learn discord.py Here is a small example of the bot being used on my server
https://i.redd.it/m1ure9744gv81.gif
If you are interested feel free to add the bot to your server with this link: [https://discord.com/api/oauth2/authorize?client\_id=964251008115019847&permissions=116736&scope=bot](https://discord.com/api/oauth2/authorize?client_id=964251008115019847&permissions=116736&scope=bot) Also DM me (ScriptLine Studios#8597) if you need help or run into issues!
Thanks everyone!
| 0.9 |
t3_uar1v9
| 1,650,792,599 |
Python
|
Open source daily Capybara Website built with Python
|
Ever wondered "If a random Capybara was assigned to Today, what Capybara would it be?" Well wonder no more, [Capy.life](https://capy.life/) has your back!
[Capy.life](https://Capy.life) is a free & open source website built with Svelte & Python, what also has a Discord, Matrix & Twitter bot written in Python.
The Capybara submitting process uses perceptual hash to ensure two Capybara images aren't too much alike.
# Source code
* [Website](https://github.com/capylife/capyend) (Any PRs or Stars are appreciated)
* [Twitter bot](https://github.com/capylife/flappycapy)
* [Discord bot](https://github.com/capylife/capycord)
* [Matrix bot](https://github.com/capylife/neocapy)
# Previews
[Home page](https://preview.redd.it/yuq91y504gv81.png?width=1668&format=png&auto=webp&s=f7245094ddacf37ac8e0047f7854979cb35e40d8)
[Admin Page](https://preview.redd.it/9bnjcl614gv81.png?width=1668&format=png&auto=webp&s=fd72626f13a76e3bc8e2c6b450c9ff5c9975d26d)
| 0.63 |
t3_uar10e
| 1,650,792,493 |
Python
|
GitHub - roniemartinez/browsers: Python library for detecting and launching browsers
|
nan
| 0.69 |
t3_uaqavx
| 1,650,789,380 |
Python
|
What's your favorite GUI library and why? I'll start, mine is TKinter because its the first one I learned and I found it easy for basic display
|
nan
| 0.93 |
t3_uapobr
| 1,650,786,701 |
Python
|
Python Selenium Tutorial #10 - Scrape Websites with Infinite Scrolling
|
nan
| 0.8 |
t3_uapb3n
| 1,650,785,148 |
Python
|
Extracting WhatsApp messages from an iOS backup
|
nan
| 0.96 |
t3_ualvg6
| 1,650,771,297 |
Python
|
Program to document code snippets and control under-development projects
|
Hey there,
I wrote a **Tkinter** program specifically for developers based on two concepts:
* Giving the developer the ability to document (their/others) knowledge and important **code snippets** in an easy, readable, and organized manner.
* Grouping the under-development **projects in one place** for easy access and control, provided the directory path.
Please, feel free to have a look at the [Source Code](https://github.com/shehab-fekry/Developer-WorkSpace) and tell me what you think :)
There will be further features to be added.
​
https://preview.redd.it/p94e69l4xdv81.png?width=899&format=png&auto=webp&s=26e1359e3f2ac793765cfed2b05b9a3fa55c9c5a
https://preview.redd.it/llglv803xdv81.png?width=899&format=png&auto=webp&s=9bfc8a963025fdc9ecd7bc41829babdc6631ebac
| 0.64 |
t3_uaknmh
| 1,650,766,926 |
Python
|
just want to bury
|
I do not speak English so well so I will write with the help of google translator, I started studying programming for now and I'm having difficulty understanding the makes something object-oriented and something variable I hope not to be talking wrong i realized that often the staff talks about symbols and numbers as whole and letters as variable is right if I think that way ?
| 0.33 |
t3_uak5ot
| 1,650,765,192 |
Python
|
Pons, an async Ethereum RPC client library
|
I've been waiting a long time for async support in `web3`, and now that it started to appear, it only supports `asyncio` (while I use `trio` in my application), and is in general not quite finished. So I decided to write an RPC client of my own with convenient contract calls, simple structure (instead of a hundred levels of indirection in `web3`) and strictly typed. Still a lot of possible enhancements possible, but it is already useful (well, I use it, at least :).
Repo: https://github.com/fjarri/pons
A simple example:
import trio
from eth_account import Account
from pons import Client, HTTPProvider, AccountSigner, Address, Amount
async def main():
provider = HTTPProvider("<your provider's https endpoint>")
client = Client(provider)
acc = Account.from_key("0x<your secret key>")
signer = AccountSigner(acc)
async with client.session() as session:
my_balance = await session.eth_get_balance(signer.address)
print(my_balance)
another_address = Address.from_hex("0x<some address>")
await session.transfer(signer, another_address, Amount.ether(1.5))
my_balance = await session.eth_get_balance(signer.address)
print(my_balance)
trio.run(main)
More in the [Tutorial](https://pons.readthedocs.io/en/latest/tutorial.html#tutorial) (not very extensive for now, but hopefully gives an idea of how to use it), and of course there's always the [API reference](https://pons.readthedocs.io/en/latest/api.html).
I am sure there are a lot of usage scenarios I haven't even considered, so I would be especially grateful for complaints about this or that method/parameters/naming being inconvenient, counterintuitive, confusing, or out of place.
| 0.38 |
t3_uaj86y
| 1,650,761,986 |
Python
|
Sunday Daily Thread: What's everyone working on this week?
|
Tell /r/python what you're working on this week! You can be bragging, grousing, sharing your passion, or explaining your pain. Talk about your current project or your pet project; whatever you want to share.
| 0.93 |
t3_uai5y5
| 1,650,758,410 |
Python
|
Deciding what to use among Cython / Pypy / Numba
|
So I want to experiment and speed up my code. I have studied the basics of Cython and Numba but Pypy only has 10 year onld videos.
What I have found:
- Cython converts Python into C and makes the code useable in both Python and C
- Numba directly converts Python into Machine code and is useful for Math operations (numpy)
- Numba is JIT compiler
- Both Cython and Numba don't support 3rd party libraries like Pandas and spacy..
- Pypy is an implementation of Python. Normally the Python we use when we write python abc.exe in cmd is Cpython(not Cython).
- Numba and Cython speed up the code a lot if the code is compatible... things like list don't work with Numba...
Would be super helpful if someone can please explain the difference between Numba, Cython and Pypy and when to use which.
Even pointing me to the resources would be great!
Thanks in advance.
| 0.82 |
t3_uafu40
| 1,650,751,007 |
Python
|
Discussion: What is the most pythonic way to print an extra line break?
|
Which of these four equivalent methods do you prefer and why?
print('Beginning processing ...\n')
or
print('Beginning processing ...', '\n')
or
print('Beginning processing ...', end='\n\n')
or
print('Beginning processing ...')
print()
Is any of them more or less pythonic than another?
| 0.92 |
t3_uadbi3
| 1,650,743,421 |
Python
|
A simple python library that can be used to run large Web3 queries on Ethereum blockchain concurrently as per Ethereum JSON-RPC specification.
|
A simple python library that can be used to run large Web3 queries on Ethereum blockchain concurrently as per Ethereum JSON-RPC specification.
The library provides a bare minimal framework for expressing raw JSON-RPC queries as described in the Ethereum Specification and execute them together either concurrently (off-chain on the client side) or together as a batch (JSON-RPC batch specification on-chain). This method greatly reduces the time required to run large queries sequentially and thus can be used for use-cases where we need to index large number of transactions happening on ethereum blockchain in a local database for faster Web2 queries.
Source code: [GitHub](https://github.com/Narasimha1997/aio-eth)
PyPi: [aio-eth](https://pypi.org/project/aio-eth/)
| 0.25 |
t3_uad9mx
| 1,650,743,270 |
Python
|
Face detection algorithms comparison
|
I selected 5 ready-made algorithms for face detection and compared them with each other by such metrics as Precision, Recall, IOU and time on the dataset I marked up. I am ready to accept your Pull Request with your solutions(algorithms) and results!
Blog post: [https://habr.com/ru/post/661671/](https://habr.com/ru/post/661671/)
GitHub: [https://github.com/wb-08/face-detection-algorithms-comparison](https://github.com/wb-08/face-detection-algorithms-comparison)
| 0.64 |
t3_uacer5
| 1,650,740,697 |
Python
|
GitHub - plasma-umass/slipcover: Near Zero-Overhead Python Code Coverage
|
nan
| 0.93 |
t3_ua8sgx
| 1,650,730,255 |
Python
|
Parking space counter created using OpenCV and Python
|
Hello!
I created a simple two-step parking space counter:
\- first, you mark the positions of all parking spaces you are interested in using "parking\_space\_picker.py";
\- second, you run "parking\_space\_counter.py" to check if the parking space is vacant or not and count them.
[RESULT](https://youtu.be/LERHWFmSSdM)
[CODE](https://github.com/codegiovanni/Parking_space_counter)
&#x200B;
Video used in the code:
Tom Berrigan [https://www.youtube.com/watch?v=yojapmOkIfg&list=LL&index=10](https://www.youtube.com/watch?v=yojapmOkIfg&list=LL&index=10)
&#x200B;
The code is inspired by:
Murtaza's Workshop - Robotics and AI [https://www.youtube.com/watch?v=caKnQlCMIYI](https://www.youtube.com/watch?v=caKnQlCMIYI)
| 0.95 |
t3_ua6xh2
| 1,650,724,972 |
Python
|
Step by step explanation of Insertion Sort in Python
|
nan
| 0.54 |
t3_ua6x8j
| 1,650,724,949 |
Python
|
Space Science: Autoencoder latent space visualization of asteroid spectra
|
Hey Everyone,
Last time, I introduced Autoencoders (using Keras) to develop a deep learning architecture that learns a low-dimensional representation of asteroid reflectance spectra.
Although I compressed the 49-dimensional spectra to only 2 dimensions, the results were quite fair. So... why did I compress it so ridiculously high? Well, a 2-D space can easily be visualized!
And this visualization is being done today. In today's tutorial, we'll use Matplotlib for a static display of the data, and ipwidgets, to create an interactive widget within our notebook on Google Colab! Let's see whether our 25-fold compression leads to some proper latent space, where the asteroid classes can be distinguished:
GitHub Link: [https://github.com/ThomasAlbin/Astroniz-YT-Tutorials/blob/main/%5BML1%5D-Asteroid-Spectra/12\_dl\_autoencoder\_latent\_space.ipynb](https://github.com/ThomasAlbin/Astroniz-YT-Tutorials/blob/main/%5BML1%5D-Asteroid-Spectra/12_dl_autoencoder_latent_space.ipynb)
YouTube Link: [https://www.youtube.com/watch?v=h26O2qbc5DA](https://www.youtube.com/watch?v=h26O2qbc5DA)
The next session will be the final one of the asteroid science project. There, we will create a higher dimensional latent space and apply some clustering algorithm to determine the number of asteroid classes from a data-scientific perspective. Stay tuned!
Thomas
| 0.81 |
t3_ua6sq9
| 1,650,724,581 |
Python
|
What makes a good programmer?
|
I recently started a python course and I'm currently just focused on it but I feel like this is wrong and I'm missing something
| 0.54 |
t3_ua64gc
| 1,650,722,585 |
Python
|
Python matplotlib and numpy New Playlist
|
nan
| 0.33 |
t3_ua2fpl
| 1,650,709,546 |
Python
|
How do you manage conflicting packages in your requirements.txt ?
|
Hi,
Let's say you have in your requirements.txt :
package_A
package_B
package_C
package_D
but `package_A` requires `some_dependency<=1.5` and `package_B` requires `some_dependency>=2.2` . How do you handle that (knowing that I might have tens of conflicting packages)?
I don't think virtualenvs would be a good solution here since the project has one entry point and packages are imported in the same code ...
Thank you !:)
| 0.96 |
t3_ua2a7k
| 1,650,708,904 |
Python
|
"Community is essential to programmers" - Eric Matthes
|
I've just started working my way through Eric Matthes' Python Crash Course. In his introduction he states, " Community is essential to programers because programming isn't a solitary pursuit.... Having a well connected community is critical in helping you solve problems, and the Python community is fully supportive of people like you who are learning python as your first programming language."
&#x200B;
I've dabbled a bit in the basic front end languages and I'm currently playing around with Vue so I wouldn't say it's my first language. However, I did feel compelled to reach out to this community after reading that.
If you have any advice for someone starting to pick up python, I'm happy to listen and learn.
| 0.84 |
t3_ua1z3n
| 1,650,707,604 |
Python
|
10 examples of using Python for big data analysis
|
nan
| 0.73 |
t3_ua1kfl
| 1,650,705,802 |
Python
|
MNE — Open-source Python package for exploring, visualizing, and analyzing human neurophysiological data: MEG, EEG, sEEG, ECoG, NIRS, and more
|
nan
| 0.97 |
t3_ua0faz
| 1,650,700,833 |
Python
|
Python Tips and Tricks — Write Better Python Code
|
nan
| 0.61 |
t3_u9ziwb
| 1,650,697,016 |
Python
|
freeCodeCamp: Gradio Course - Create User Interfaces for Machine Learning Models in Python
|
nan
| 0.83 |
t3_u9y93f
| 1,650,691,784 |
Python
|
Call me naive, but would it not be possible to create a tool for python the auto adds type hints at run time?
|
I’m going to learn python over the summer, but coming from Java & c# in IDE’s where casting etc can auto completed within the problem pane when making newb mistakes, and also knowing the pain of PHP runtime errors, I’m hoping the dynamic experience will be smoother with python.
I’m ranting.. would this be feasible ? Just a thought.
| 0.17 |
t3_u9sdwa
| 1,650,672,030 |
Python
|
Saturday Daily Thread: Resource Request and Sharing! Daily Thread
|
Found a neat resource related to Python over the past week? Looking for a resource to explain a certain topic?
Use this thread to chat about and share Python resources!
| 1 |
t3_u9sdh3
| 1,650,672,009 |
Python
|
I have multiple interdependent Python services & modules for my work. I use conventional commits (changetype: scope: …) allowing automated changelogs. I think I need to go monorepo and add the changed service to the commit structure (service: changetype: scope). Does this look like a good strategy?
|
nan
| 0.82 |
t3_u9rgzf
| 1,650,669,201 |
Python
|
What is a good, pure Python alternative to lxml's objectify?
|
Reference: https://lxml.de/objectify.html
> Accessing the children of an XML element deploys object attribute access. If there are multiple children with the same name, slicing and indexing can be used. Python data types are extracted from XML content automatically and made available to the normal Python operators.
| 1 |
t3_u9qp2k
| 1,650,666,983 |
Python
|
Proper launch of python packages
|
nan
| 0.75 |
t3_u9q8tx
| 1,650,665,684 |
Python
|
Coding an Intelligent Battleship Agent
|
nan
| 0.5 |
t3_u9pn6u
| 1,650,664,027 |
Python
|
rashell (Relational Algebra Shell)
|
Hi all.
I've uploaded my project on Pypi. It is called **rashell** which stands for **R**elational **A**lgebra **S**hell. It provides a command line interface and a DSL to define, fill and query a relational model. This tool is intended for educational use only, to illustrate the underlying concepts of relational databases in a more interactive way. It can be installed via pip :
$ pip install rashell
Please refer to Readme on gitlab to know how to use it.
[https://gitlab.com/skebir/rashell](https://gitlab.com/skebir/rashell)
[https://pypi.org/project/rashell/](https://pypi.org/project/rashell/)
I would like to have your opinion on it. Thank you in advance.
| 1 |
t3_u9p9g6
| 1,650,662,976 |
Python
|
Does anyone know what editor this is or what sorts of editors have this feature?
|
[The editor is linked here](https://i.imgur.com/9HcadwR.gif)
Basically allowing you to similar parts to multiple lines of code by clicking and then hitting backspace?
| 0.5 |
t3_u9obb5
| 1,650,660,405 |
Python
|
A screenful of advice about writing command-line tools in Python
|
nan
| 0.77 |
t3_u9m149
| 1,650,654,132 |
Python
|
I've made a pure Python implementation of the QOI image format
|
[link to the code](https://github.com/SudoOmbro/qoi_converter)
as said in the title, it's a pure python implementation of the [qoi format](https://qoiformat.org/), a lossless image compression methd that manages be 50x faster while encoding and 3x-4x while faster decoding than PNG.
Python isn't known to be fast though, but this implementation is not too bad speed wise to be fair.
More info on how it was implemented in the README :)
| 1 |
t3_u9k3i3
| 1,650,648,791 |
Python
|
Cache in asynchronous Python applications
|
nan
| 0.8 |
t3_u9ihvl
| 1,650,644,486 |
Python
|
Car Wash Pattern: Parallelizing Non-Thread Safe and/or CPU-intensive Processes with Future Based Queue Centric Approach in Python
|
This article can be a useful guide for parallelizing non-thread-safe and CPU-bound processes, such as some machine learning models, for purposes such as model to web service conversion. While developing the solution, I tried to pay particular attention to the advantages, disadvantages and pitfalls of python. Maybe there is nothing new for the masters, but I think it is a neat resource for the enthusiasts.
[https://medium.com/vlmedia-tech/parallelizing-non-thread-safe-and-or-cpu-intensive-processes-with-future-based-queue-centric-b2247bbcf231](https://medium.com/vlmedia-tech/parallelizing-non-thread-safe-and-or-cpu-intensive-processes-with-future-based-queue-centric-b2247bbcf231)
| 0.88 |
t3_u9hhmv
| 1,650,641,812 |
Python
|
Searching a student apartment in Zürich was too boring so I made a Telegram bot.
|
[GitHub link](https://github.com/bskdany/WokoWGZScraperBot)
Basically anyone I know checks every day [woko.ch](https://woko.ch) and [wgzimmer.ch](https://wgzimmer.ch) for rooms and apartments that are being rented for students in Switzerland , the first to contact the seller usually gets the room. I don't have the time and will to do that.
So I made a bot that scrapes both those websites with requests and BeautifulSoup. The bot collects the urls of the rented rooms and saves them in a txt, then it checks the website every minute for changes. If a new url is found then the room data is sent to me with the Telegram API.
Both those websites don't have a policy against scraping, but they do have some little bot protection.
Yeah that's it, I made this in two days and I'm hosting the bot on heroku.
Suggestions are welcome (especially in security).
| 0.78 |
t3_u9g6jb
| 1,650,638,272 |
Python
|
Common Python Anti-Patterns to watch out for
|
nan
| 0.81 |
t3_u9g5r7
| 1,650,638,203 |
Python
|
How to Write a Python Script to Create and Update a Changelog
|
nan
| 0.5 |
t3_u9dy34
| 1,650,631,951 |
Python
|
copilot getting creepy
|
hey, yesterday I was making an auto reply bot with telethon (+ copilot)
I got a phone number as a suggestion in **plain text** , meaning that copilot does not have a 'personal info filter' or whatever.
Someone said that GitHub also used private repos to train copilot, well, let's hope that nobody gets a suggestion with my bybit api keys
https://preview.redd.it/i8mw9t26s2v81.jpg?width=384&format=pjpg&auto=webp&s=55d082b6ff58f8c9b1e527f424a72de9a88c3504
https://preview.redd.it/q3mhee6ir2v81.jpg?width=1354&format=pjpg&auto=webp&s=f2325cb1e6f144a9e6d571c3c86bae178e2ecfbd
| 0.88 |
t3_u9dobe
| 1,650,631,103 |
Python
|
Python 3.11 Preview: Task and Exception Groups – Real Python
|
nan
| 0.92 |
t3_u9dhsy
| 1,650,630,515 |
Python
|
Boihut bookstore(Ecommerce ) website made in Django
|
This was built as my first year university project.
&#x200B;
https://preview.redd.it/7ar5lrkw72v81.png?width=1920&format=png&auto=webp&s=fa8428c4ff54ca6ac149b89915153657b1aabe71
&#x200B;
Live link : [https://boihut.biz](https://boihut.biz)
Github: [https://github.com/shaongitt/boihut](https://github.com/shaongitt/boihut)
| 0.9 |
t3_u9bpmd
| 1,650,624,350 |
Python
|
Login and logout functionality in django framework
|
nan
| 0.65 |
t3_u97qgl
| 1,650,607,754 |
Python
|
Friday Daily Thread: Free chat Friday! Daily Thread
|
Use this thread to talk about anything Python related! Questions, news, projects and any relevant discussion around Python is permitted!
| 0.8 |
t3_u915sx
| 1,650,585,609 |
Python
|
Step by step explanation of Bubble sort with python implementation
|
nan
| 0.88 |
t3_u90cgx
| 1,650,583,086 |
Python
|
Intel 8051 microcontroller emulator
|
I made this app as a BE thesis. It's using Brython to make Python work in Chromium (Electron) and React with Material-UI for the front-end. It's supposed to be rendered in a fixed-sized Electron window, so it may not look the best in a browser.
[https://github.com/estarq/i8051emu](https://github.com/estarq/i8051emu)
| 0.75 |
t3_u8xutf
| 1,650,575,884 |
Python
|
dc_schema, a tiny library to generate JSON schema from python dataclasses
|
I wrote a small library for generating JSON schema from python dataclasses. I'm using pydantic a lot in my daily work, but wanted to understand JSON schema better myself and create a lightweight, focused solution for schema generation.
Posting here incase some of you are interested to try it out, maybe someone has some constructive feedback/review.
https://github.com/Peter554/dc_schema
| 0.75 |
t3_u8x9pw
| 1,650,574,245 |
Python
|
Cache in asynchronous Python applications
|
nan
| 0.67 |
t3_u8v01p
| 1,650,567,983 |
Python
|
Is it bad practice to start with Jupyter Notebooks?
|
Nowadays whenever I start a new Python project I always start with a jupyter notebook to test snippets of code, to later add to my main script.
Should I avoid doing this? Is this bad practice?
| 0.91 |
t3_u8tsd6
| 1,650,564,637 |
Python
|
Python’s Match-Case Is Too Slow (If You Don’t Understand It)
|
nan
| 0.44 |
t3_u8t99e
| 1,650,563,193 |
Python
|
Any suggestions for simple predictive modeling for class project using nba game data
|
Any suggestions for simple predictive modeling for class project using nba game data
| 0.6 |
t3_u8sby9
| 1,650,560,623 |
Python
|
A magic hand using DXL and servo motors
|
I recorded this quick demo to show how topology detection can work with DXLs or servo motors. I developed a few lines of code, if you want to see, I can share them with you!
| 0.78 |
t3_u8qjgg
| 1,650,555,851 |
Python
|
co-author.py - Creates "Co-authored-by" lines from usernames and issue/PR urls using GitHub REST API
|
I needed a quick way to credit the original PR authors while patching [my Alabaster fork](https://github.com/introt/alabester/releases/tag/0.7.22), so I wrote this little script to assist in the task.
The combination of using the REST API along with the no-reply email addresses seems novel in the co-authoring space, so I decided to share it - I hope someone finds it useful!
Feel to fork and/or put it up on PyPi etc, the code's released under the MIT license.
https://gist.github.com/introt/ad30bcbdf789aed5bba43082741c7769
| 0.6 |
t3_u8ol71
| 1,650,550,389 |
Python
|
Just started making a Pokémon wordle type game. Wish me luck, should be done by the end of two weeks
|
It's my first ever big project so I'm pretty excited :)
| 0.62 |
t3_u8of7m
| 1,650,549,900 |
Python
|
100%|██████████████| - TQDM is a simple library for adding progress bars to your python code. I made a tutorial about it.
|
nan
| 0.67 |
t3_u8nzzr
| 1,650,548,669 |
Python
|
Is everything worth solving?
|
When a bug takes ages to fix should I still keep trying or move on since I’m a beginner should I not try to move on to learn something else and then maybe come back at some point? Thanks
| 0.62 |
t3_u8nfcq
| 1,650,546,950 |
Python
|
Manage Encryption Key
|
I created a public Github repo for Creating, Encrypting, and Decrypting files called: [Manage Encryption Key](https://github.com/Moreless91/Manage-Encryption-Key)
[Main Menu](https://preview.redd.it/bgde2ghlkvu81.png?width=306&format=png&auto=webp&s=32be688c1e436dae386d3b3301745c4789afba18)
It's a CLI tool that I've needed for quite awhile for quickly creating a key for a new app or decrypting some older data from older projects.
Here's some screenshots:
Encrypting:
[Encrypting](https://preview.redd.it/lacxuedllvu81.png?width=325&format=png&auto=webp&s=3a2b8e0eb3c39648619ec2bd38aba2aa83873a78)
Decrypting:
&#x200B;
[Decrypting](https://preview.redd.it/vqsewmbslvu81.png?width=333&format=png&auto=webp&s=802a9c3e0b7041ce4830a5831517698b864981ee)
You can stay organized by adjusting the Settings option for storing your files quickly:
[Settings](https://preview.redd.it/8jgd4ckulvu81.png?width=321&format=png&auto=webp&s=48faf595e791bd713c78c390666150f83e79db02)
To setup, view the README on [https://github.com/Moreless91/Manage-Encryption-Key](https://github.com/Moreless91/Manage-Encryption-Key)
I'm still new to python and programming in general. No formal education. Tear my code apart, please!!
| 0.7 |
t3_u8mozm
| 1,650,544,746 |
Python
|
Know How to Create and Visualize a Decision Tree with Python
|
nan
| 0.72 |
t3_u8k0am
| 1,650,535,185 |
Python
|
2022 Update: Understanding Best Practice Python Tooling by Comparing Popular Project Templates
|
I have just posted a 2022 update to my old blog post from 2020 -> [https://medium.com/@jonas.r.kemper/2022-update-understanding-best-practice-python-tooling-by-comparing-popular-project-templates-5872602fe617?sk=a7ed50c63851d81093697c62b740396a](https://medium.com/@jonas.r.kemper/2022-update-understanding-best-practice-python-tooling-by-comparing-popular-project-templates-5872602fe617?sk=a7ed50c63851d81093697c62b740396a)
Hope you like it! :)
| 0.91 |
t3_u8jfcb
| 1,650,532,690 |
Python
|
Unpopular opinion: Matplotlib is a bad library
|
I work with data using Python a lot. Sometimes, I need to do some visualizations. Sadly, matplotlib is the de-facto standard for visualization. The API of this library is a pain in the ass to work with. I know there are things like Seaborn which make the experience less shitty, but that's only a partial solution and isn't always easily available. Historically, it was built to imitate then-popular Matlab. But I don't like Matlab either and consider it's API and plotting capabilities very inferior to e.g. Wolfram Mathematica. Plus trying to port the already awkward Matlab API to Python made the whole thing double awkward, the whole library overall does not feel very Pythonic.
Please give a me better plotting libary that works seemlessly with Jupyter!
| 0.92 |
t3_u8j6fn
| 1,650,531,638 |
Python
|
GitHub - aGIToz/PyInpaint: A lightweight image inpainting tool in python.
|
nan
| 1 |
t3_u8hao9
| 1,650,523,323 |
Python
|
Data Operations Using Python Mitosheets
|
nan
| 1 |
t3_u8fj6a
| 1,650,516,403 |
Python
|
Urwid wrapper for nvidia-smi
|
Hello. I wanted to share a simple urwid-based wrapper I wrote for nvidia-smi. I find that nvidia-smi takes up too much space in my terminal and I prefer graphical/bar based displays. These are not my GPUs - I am not that rich. Check it out here:
[https://github.com/nec4/gpu-array](https://github.com/nec4/gpu-array)
https://i.redd.it/7af8spadasu81.gif
It's written entirely in Python, and was my first departure from using ncurses directly. After diving in, I have to save urwid is very slick.
| 0.76 |
t3_u8bx7e
| 1,650,504,587 |
Python
|
Creating and API from scratch...
|
Hey guys, I just learned Django and React, I know my few things about python amd javascript. Ive done small projects using "Django Rest Framework".
My question is, can I build an API from scratch without using Django or DjangoRest Framework?
Im curious how its done. All the google searches Ive done they give back answers usimg Django or flask.
If I had only python, postgres, javascript, html and css to work on...how can I build an API without frameworks?
The idea of creating one from scratch confuses me since Ive only built one using Django Rest Framework.
Any guidance will help.
| 0.66 |
t3_u8ajpp
| 1,650,500,352 |
Python
|
Thursday Daily Thread: Python Careers, Courses, and Furthering Education!
|
Discussion of using Python in a professional environment, getting jobs in Python as well as ask questions about courses to further your python education!
**This thread is not for recruitment, please see** r/PythonJobs **or the thread in the sidebar for that.**
| 0.72 |
t3_u8a5pq
| 1,650,499,209 |
Python
|
Python Tutorial - How to create a Car Processor and Detector using Python?
|
Hey Everyone! I created a short Python Tutorial explaining how I created a Car Processor and Detector using Python.
[https://www.youtube.com/watch?v=ZXFS-uUNTcg](https://www.youtube.com/watch?v=ZXFS-uUNTcg)
https://preview.redd.it/gjbek5zoqru81.png?width=2880&format=png&auto=webp&s=149cf6b3e18c77d190c806686d588862ebcab56e
| 0.75 |
t3_u89kvw
| 1,650,497,426 |
Python
|
Flask vs FastAPI for a microservice
|
Hello,
&#x200B;
I'm going to build a microservice that processes images and does OMR on them, and I'm torn between using Flask or FastAPI.
&#x200B;
I have used Flask in the past, but recently I have been using Nodejs, so the async nature of FastAPI will make it similar to Nodejs, plus I have read that it's better for making APIs.
&#x200B;
Which one do you think is more suitable in my case?
| 0.76 |
t3_u86ra7
| 1,650,489,404 |
Python
|
Type hints immediately giving payoffs
|
[https://imgur.com/a/0NaPfxQ](https://imgur.com/a/0NaPfxQ)
So, I 'FORCED' myself to use typehints. Flask seems to already priovide some motivation, so I went ahead and carried on.
LOOK! WOW! PyCHARM!
Immediately, I know that I'm not 'properly' creating a file path. I can go back and fix this later, but look, joining a bunch of strings with '/' doesn't make an 'os.path'. Nice warning!
Typehints.... I'm becoming a fan. It's slowing me down a little developing, but this is an obvious place a bug can happen, and I didn't really think about it.
It's not ready, but this is a custom-built hls/dash packager. [https://github.com/flipmcf/CasterPak](https://github.com/flipmcf/CasterPak) It's only like 2 days old, so be nice.
| 0.61 |
t3_u86q6j
| 1,650,489,316 |
Python
|
Bloomberg just Open sourced Memray a memory profiler for Python
|
nan
| 0.98 |
t3_u84tjr
| 1,650,484,108 |
Python
|
Python learning group?
|
Hello! I recently graduated college with a psychology degree but figuring out it may not be something I want to do with my life, I recently started learning programing languages, specificly Python.
I'm currently doing okay. I'm understanding things so far but as it gets more advanced in the long run, I believe that learning with like minded people would increase the possibility of us seeing it through.
Does anyone want to form a study group, via discord or know of any??
| 0.76 |
t3_u81o93
| 1,650,475,476 |
Python
|
Python's stability
|
My production code has been running for a while. For the first 24 hours, every metric, errors, logging, etc.. happened as expected. But the last 6 hours was a disaster. Even though the state was unchanged, some logs were not shown, some services were not called, etc... Have you guys faced this kind of instability before?
| 0.22 |
t3_u7zog4
| 1,650,470,137 |
Python
|
I wrote an article on "Packaging and Publishing Packages on PyPI"
|
nan
| 1 |
t3_u7lr6r
| 1,650,420,710 |
Python
|
How to write a Python3 wrapper library/module for a JSON REST API in 15 simple steps
|
nan
| 0.96 |
t3_u7vquv
| 1,650,458,946 |
Python
|
37 Sixty Second Python Tutorials
|
Python 60 Second Videos: https://www.youtube.com/playlist?list=PL6lxxT7IdTxG5li13TmP0fvHaFRZaHi4d
| 0.8 |
t3_u7uhit
| 1,650,454,737 |
Python
|
Gaming oriented Turtle fork
|
I've been learning python for around 6 months and I've made a fork of the turtle module called "burtle", its meant to make games with, but i added other cool stuff like a text box and click detection.
Please check it out and give feedback!
[https://github.com/alannxq/Burtle](https://github.com/alannxq/Burtle)
| 0.64 |
t3_u7s0vo
| 1,650,444,648 |
Python
|
Java Vs Python Comparison: Which Programming Language is Right for My Business?
|
Entrepreneurs are presently facing a challenge in establishing their enterprise app since they must make a difficult decision: which language to employ for their app development. Both Java and Python have advantages and disadvantages and certain commonalities. However, there are some distinctions between Java and Python.
The most difficult decision for entrepreneurs who wish to automate their businesses is to choose between the two master languages. You may have read about the differences between these two options, depending on your project's technical requirements. This blog provides eye-opening insights into the [Java vs Python](https://www.bacancytechnology.com/blog/java-vs-python) difference in enterprise applications which you can check out.
&#x200B;
| 0.31 |
t3_u7rvi0
| 1,650,443,966 |
Python
|
Making the switch from academia to industry? R to Python?
|
I'm 32F and finally deciding to make the switch. The only snag is my experience in coding is all in R. I know there are lots of online Python courses but I'm looking for an intensive (couple of weeks maybe?) course that would be accredited and sit well on my CV. I've done well for myself in academia, in terms of reputation in data viz, but I have no connections in industry and I'm not sure how to get in the door. Anyone else made the switcheroo?
| 0.88 |
t3_u7qtvf
| 1,650,439,255 |
Python
|
Compiling Python programs with Pyinstaller
|
nan
| 0.73 |
t3_u7pu7w
| 1,650,435,048 |
Python
|
Visualization of the 3x+1 problem using turtle graphics
|
&#x200B;
[My new screen saver](https://preview.redd.it/8zfb0b1p4mu81.png?width=3814&format=png&auto=webp&s=a726b12997a7c6d3fad9a784e56550c878d192bd)
[Source code](https://github.com/Spovis/collatz)
This is a visualization of the sequence generated by the Collatz conjecture. It generates some beautifully intricate graphs from some very simple logic. I had a lot of fun making this, maybe it will give some ideas to someone else.
Any code critiques are welcome.
| 0.88 |
t3_u7ogas
| 1,650,429,653 |
Python
|
Novel and small python projects and code snippets
|
Share your answers to these tasks in the comments. Feel free to ask for help.
# Task 1 (Beginner) #
Create a class “NumberSet” that:
- Inherits from the built in set class
- That overrides __setitem__ to only allow numbers
You will learn about inheritance, “super”, and sets
# Task 2 (Intermediate) #
Create an NxN matrix where N is any odd number, where each cells value is the distance of that cell from the centre.
- For examples 3x3 matrix, the “middle” cells value will be 0, but any outer cells value will be 1
You will learn about basic algorithmic logic, nested loops (or arrays ;) ) and a bit of basic math
# Task 3 (Intermediate) #
Create a 100x100 pixel “blue” colour bitmap image from scratch (with no third party image libraries):
- You will use this to understand the file format required https://en.wikipedia.org/wiki/BMP_file_format?wprov=sfti1
- You will be working with binary data only
You will learn about file headers and formats, binary data, and image creation
# Task 4 (Intermediate) #
Create a function decorator that runs the decorated function twice.
You will learn about nested functions, higher order functions, and decorators
| 0.75 |
t3_u7ls2t
| 1,650,420,783 |
Python
|
How Python Enriched the Use of AI in Several Industries
|
Artificial intelligence and machine learning can be considered as the new backbones of the IT industry. While discussion over developing newer technologies to provide maximum safety continues, people innovate expanded abilities and capacities of artificial intelligence. [Artificial intelligence](https://en.wikipedia.org/wiki/Artificial_intelligence) went from being a part of science fiction to a daily need of people worldwide. AI's added abilities have successfully reduced manual labor to a great extent and almost perfected the accuracy level.
The amount of data produced increases its volume day by day, and the size has now become impossible to handle manually. AI helps analyze the data of many organizations to predict their future outcome and plan growth strategies accordingly. For example, many online websites have now launched the feature of chatbots that utilizes AI. This helps to enhance the customer experience. This shows how AI and machine learning efficiently and accurately process huge volumes of data for drawing in more customers.
Forming Future Technologies
The rising volume of data is increasing the complexity of data proportionately. As data becomes more complex, analyzing it manually becomes tougher. This machine intelligence is utilized to analyze and process the data for accurate results, and there is no limit to data.
Using artificial intelligence mainly enhances three aspects of any organization. They are:
* Accuracy in predictions and insight production increases business efficiency.
* It is a very low-cost venture instead of hiring many individuals at high salaries.
* Finally, it increases the productivity of the organization.
This gives a precise reason why many companies use AI and machine learning to propel product development and improve the overall performance. Research has also discovered that using AI-laded technologies is the new trend in industrial transformation, particularly for enhancing the company. It has also concluded that within a few years, the companies that utilized AI in producing innovative products and processes are most likely to expand their grounds. To sum up, AI and machine learning produce better results while giving much smaller efforts.
The Use of Python
[Python](https://www.python.org/) checks off many boxes that result in being useful for AI and machine learning. Many features are present in Python, which makes it one of the best languages for these purposes. Thus, the knowledge of Python is important in the data science field as many industries use it to predict and analyze data. Python is open-source in nature, so AI development companies' achievements can be shared with the community.
Some industries that extensively use Python in expanding their businesses are:
* Healthcare
* Travel and transportation
* Finance technology
Health Care
Health centers use data to scrutinize and diagnose their patients properly. The growing popularity of AI involvement in decrypting data leads to the rise in Python programmers' demand as it is the most popularly used program in the data science industry.
Travel and Transportation
Python and machine learning algorithms enable travel giants to predict airplane routes and behaviors easily. Therefore, implementing AI in the travel industry helps with customer efficiency, creating cost-effective budget plans, and setting the price details of new routes.
Finance Technology
AI has also used its way in finance sectors to save from risks and frauds. Programming languages can detect any anomaly behavior and also helps in analyzing market behavior effectively.
Take [**data science course**](https://360digitmg.com/data-science) today and get your dream job.
📷
| 0.2 |
t3_u7l4rv
| 1,650,418,780 |
Python
|
Looks like I'm going to prom thanks to Python!
|
[https://github.com/Jah-On/prom-decider](https://github.com/Jah-On/prom-decider)
| 0.5 |
t3_u7l0ce
| 1,650,418,382 |
Python
|
Learn how to Scraping Google and optimize search using google search operators
|
nan
| 0.33 |
t3_u7kzgt
| 1,650,418,303 |
Python
|
Wednesday Daily Thread: Beginner questions
|
New to Python and have questions? Use this thread to ask anything about Python, there are no bad questions!
This thread may be fairly low volume in replies, if you don't receive a response we recommend looking at r/LearnPython or joining the Python Discord server at [https://discord.gg/python](https://discord.gg/python) where you stand a better chance of receiving a response.
| 0.88 |
t3_u7j74e
| 1,650,412,810 |
Python
|
PyMailer: A small utility I wrote in Python3 to automate sending server notifications via an SMTP service
|
I do a lot of self-hosting and homelabbing, and I often found myself wishing that my various services and cron jobs had a simple way to send me notifications through a regular Gmail account. I know tools already exist to do this but I just wanted a dirt-simple utility that I could say pipe the output of a script in to and it would just automatically send it to me in an email.
So over the weekend I wrote [PyMailer](https://github.com/UltraChip/PyMailer) \- a basic command-line utility written in Python3 that does exactly that. Now getting my server to notify me is as simple as adding
cat /some/log/file/or/something | pymailer
to the end of a script. Configuration is accomplished by editing a JSON-esque config file - I tried to keep it as simple as possible.
Honestly it's nothing all that special - I banged it out in a couple hours - but it was a fun excuse to learn how to use argparse (especially figuring out how to read in data from stdin) as well as getting to play with Python's MIME and SMTP modules. And even though this is one of the simplest projects I've done the past few years it's likely going to end up being one I actually use a lot, so I'm glad I made it.
| 0.5 |
t3_u7hk4i
| 1,650,407,953 |
Python
|
I wrote a python script that you can copy into your projects for quickly logging information between your Terminal and Files
|
I’ve been working on a bunch of different python scripts recently and I found myself constantly referring back to Python’s built-in logging library for some basic debugging/logging setup. After doing this a few times I decided to sit down and write this script that you can quickly import into any existing python environment and quickly start logging information to either your terminal or a file. It’s a short 200-ish .py file that you can just copy over into your project and instantly start using.
Source can be found here: [https://github.com/henryriveraCS/logger](https://github.com/henryriveraCS/logger)
Let me know what you think :\^)
| 0.75 |
t3_u7gw5z
| 1,650,406,071 |
Python
|
Is anyone taking the CS50p (for Python) currently in progress from Harvard?
|
Just wondering what your thoughts are on it, how it compares to the original CS50, etc?
| 0.85 |
t3_u7g0ix
| 1,650,403,719 |
Python
|
Keylogger In Just 10 Lines Of Python
|
nan
| 0.69 |
t3_u7fczz
| 1,650,401,947 |
Python
|
Dash is Deeper than Dashboards
|
nan
| 0.89 |
t3_u7emja
| 1,650,399,953 |
Python
|
Program that counts lines of code
|
Posted this while back but its been changed quite a bit. At the time many of you had very constructive criticisms of my code that were incredibly helpful. Please do so again! This script runs on the command line and counts lines of code in a specified file or directory for files with a specified extension. Feel free to tear it apart :)
[https://github.com/carterdugan/LineCounter](https://github.com/carterdugan/LineCounter)
| 0.5 |
t3_u7e96y
| 1,650,398,975 |
Python
|
Just A Todo App
|
* **It's a Todo App that I wrote, and it's my first time developing a full-stack application with Flask. It's possible that it has multiple bugs, since I didn't thoroughly test it. Limiters or rate limitations are built into the routes and endpoints to avoid abuse. You can create or add additional Todos, but I haven't implemented** [**CRUD**](https://developer.mozilla.org/en-US/docs/Glossary/CRUD) **entirely yet, but I may do so in the future since I'm still learning fullstack development.**
https://preview.redd.it/u3yovjldbju81.png?width=1366&format=png&auto=webp&s=d39ecebde42df6e3dfa2d30ae47ce2e4690639d8
* **Github :** [SecretsX - JustATodoApp](https://github.com/SecretsX/JustATodoApp)
| 0.6 |
t3_u7cwkw
| 1,650,395,385 |
Python
|
Created Python Jobs (Backend and AI/ML) Website
|
Hey, Guys!
I'm building a Job board that connects Python Developers (Backend and AI/ML Engineers) with Startups and Companies hiring for Python roles. Launching in 2 Weeks!
Here is the link to keep in touch ➡ [pyhunt.com](https://www.pyhunt.com/)
Feedbacks and Questions are welcome,
Thanks :)
| 0.73 |
t3_u7ccs4
| 1,650,393,952 |
Python
|
UFC analysis with Python
|
I made the code in Python to get rankings of UFC fighters in Lightweight for period 2013-2022 from site [mma-stats.com](https://mma-stats.com), process them, and create bar chart race of these rankings. Code for my project is available on [https://github.com/SergeyZago/ufc\_analysis/blob/main/UFC%20Lightweight.py](https://github.com/SergeyZago/ufc_analysis/blob/main/UFC%20Lightweight.py). Visual representation of result is available on [https://youtu.be/cenZedT-B8o](https://youtu.be/cenZedT-B8o)
| 0.57 |
t3_u7c0jv
| 1,650,393,068 |
Python
|
How to Build Countable Classes in Python
|
nan
| 0.63 |
t3_u7bdds
| 1,650,391,390 |
Python
|
Snake Code
|
Snake Code:
&#x200B;
&#x200B;
import time
import pygame
from enum import Enum
import random
class Direction(Enum):
UP = 1
DOWN = 2
RIGHT = 3
LEFT = 4
window\_width = 720
window\_height = 720
pygame.init()
pygame.display.set\_caption("Snake Game 1")
window = pygame.display.set\_mode((window\_width, window\_height))
refresh\_controller = pygame.time.Clock()
snake\_position = \[250, 250\]
snake\_body = \[\[250, 250\],
\[240, 240\],
\[230, 250\]\]
food\_position = \[250, 250\]
scale = 20
global score
score = 0
global speed
speed = 1
def handle\_keys(direction):
new\_direction = direction
for event in \[e for e in pygame.event.get() if e.type == pygame.KEYDOWN\]:
if event.key == pygame.K\_UP and direction != Direction.DOWN:
new\_direction = Direction.UP
if event.key == pygame.K\_DOWN and direction != Direction.UP:
new\_direction = Direction.DOWN
if event.key == pygame.K\_RIGHT and direction != Direction.LEFT:
new\_direction = Direction.RIGHT
if event.key == pygame.K\_LEFT and direction != Direction.RIGHT:
new\_direction = Direction.LEFT
return new\_direction
def move\_snake(direction):
if direction == Direction.UP:
snake\_position\[1\] -= scale
if direction == Direction.DOWN:
snake\_position\[1\] += scale
if direction == Direction.LEFT:
snake\_position\[0\] -= scale
if direction == Direction.RIGHT:
snake\_position\[0\] += scale
snake\_body.insert(0, list(snake\_position))
def generate\_new\_food():
food\_position\[0\] = random.randint(5, ((window\_height - 2) // scale)) \* scale
food\_position\[1\] = random.randint(5, ((window\_height - 2) // scale)) \* scale
def get\_food():
global score
global speed
if abs(snake\_position\[0\] - food\_position\[0\]) < 20 and abs(snake\_position\[1\] - food\_position\[1\]) < 20:
score += 1
speed += 2
generate\_new\_food()
else:
snake\_body.pop()
def paint\_hud():
font = pygame.font.SysFont("Arial", scale\*2)
render = font.render(f"Score: {score}", True, pygame.Color(255, 255, 255))
rect = render.get\_rect()
window.blit(render, rect)
pygame.display.flip()
def repaint():
window.fill(pygame.Color(5, 0, 5))
for body in snake\_body:
pygame.draw.circle(window, pygame.Color(0, 255, 0), (body\[0\], body\[1\]), scale/2)
pygame.draw.rect(window, pygame.Color(255, 0, 0), pygame.Rect(food\_position\[0\]-scale/2, food\_position\[1\]-scale/2, scale, scale/2))
def game\_over\_message():
font = pygame.font.SysFont('Arial', scale\*3)
render = font.render(f"Score: {score}", True, pygame.Color(255,255,255))
rect = render.get\_rect()
rect.midtop = (window\_width / 2, window\_height / 2)
window.blit(render, rect)
pygame.display.flip()
time.sleep(2.5)
pygame.quit()
exit(0)
def game\_over():
if snake\_position\[0\] < 0 or snake\_position\[0\] > window\_width - 10:
game\_over\_message()
if snake\_position\[0\] < 0 or snake\_position\[1\] > window\_height - 10:
game\_over\_message()
for blob in snake\_body\[1:\]:
if snake\_position\[0\] == blob\[0\] and snake\_position\[1\] == blob\[1\]:
game\_over\_message()
def game\_loop():
direction = Direction.RIGHT
while True:
direction = handle\_keys(direction)
move\_snake(direction)
get\_food()
repaint()
game\_over()
paint\_hud()
pygame.display.update()
refresh\_controller.tick(speed)
if \_\_name\_\_ == "\_\_main\_\_":
game\_loop()
| 0.27 |
t3_u79ohy
| 1,650,387,027 |
Python
|
Hello everyone I have been creating a boilerplate/template for FastAPI and PostgreSQL. Please have a look and give me a star if you like. #Python #FastAPI #PostgreSQL #Pytest
|
nan
| 0.5 |
t3_u79f99
| 1,650,386,342 |
Python
|
Download Outlook Email Attachments Using Microsoft Graph API In Python[
|
Recently published a video covering how to download emails from your Outlook account with Microsoft Graph API using Python, and thought some of you might find the tutorial useful.
Video Link: [https://youtu.be/UF-hc2nZV\_A](https://youtu.be/UF-hc2nZV_A)
| 1 |
t3_u77n4y
| 1,650,381,620 |
Python
|
78 Python data science practice problems in a single github repo including numpy, pandas, matplotlib, scipy, regex, pytorch
|
nan
| 0.98 |
t3_u77fce
| 1,650,381,050 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.