sub
stringclasses 1
value | title
stringlengths 7
303
| selftext
stringlengths 0
8.65k
| upvote_ratio
float64 0.08
1
| id
stringlengths 9
9
| created_utc
float64 1.65B
1.65B
|
---|---|---|---|---|---|
Python | Machine Learning Sandbox in Python | Hope you are doing well. I was reaching out to share one of my projects with all of you . The idea was to build a sandbox of ML algorithms that people could use to demonstrate classical ML algorithms and also break down the same with simple from-the-scratch implementation in Python. You can simply fork the repo and start running the algorithms. I hope you find it useful. Do let me know your feedback on the same and if I can make any improvements in this.
​
Project Link: [https://github.com/devAmoghS/Machine-Learning-with-Python](https://github.com/devAmoghS/Machine-Learning-with-Python) | 0.9 | t3_tvw388 | 1,649,057,193 |
Python | Is List Comprehension The Most Effective Way to Solve Any Tasks? | Python | 0.25 | t3_tvut3j | 1,649,052,016 |
|
Python | Choosing Python over other languages | This is an interesting blog that I read. It's written by Brett Cannon who is a core developer of Python. It essentially explain why you shouldn't automatically ignore Python because it's not as fast as some other programs.
​
[Selecting a programming language can be a form of premature optimization (snarky.ca)](https://snarky.ca/programming-language-selection-is-a-form-of-premature-optimization/) | 0.69 | t3_tvubzw | 1,649,050,282 |
Python | Open-Source python package to find relevant images for a sentence | ​
[Search results for \\"a happy potato\\"](https://preview.redd.it/2cnopvno0gr81.jpg?width=744&format=pjpg&auto=webp&s=eecc9e9948c386fbd959289257c347fa19c35644)
You **don't** need to caption the images for the search to work, and it is **not** just limited to objects in the image but an overall understanding built using a neural network trained on images/text found on internet.
This is what [CLIP-as-service](https://github.com/jina-ai/clip-as-service) enables. It is an open-source library to create embeddings of images and text using CLIP. These embeddings can be used to find the relevant images for any sentence.
**What is CLIP?**
CLIP is a Neural Network trained on variety of images and natural language sentences available on the internet. It enables understanding of concepts in an image as natural language. This can be used for cases such as searching image by text or describing an image in natural language.
The demo screenshot shown in the post is an example showing relevant images for a particular query sentence.
More info on Github readme about how to achieve this
* Source code: [https://github.com/jina-ai/clip-as-service](https://github.com/jina-ai/clip-as-service)
* License: Apache 2.0
What would you use it for? And what next features/improvements should I work on? | 0.86 | t3_tvs0dp | 1,649,042,711 |
Python | If you're bored at work or school. | Try to open Python Idle and Import antigravity module
`import antigravity`
Then laugh. | 0.87 | t3_tvp8uf | 1,649,034,470 |
Python | swagger-gen: the Swagger spec generator you've been waiting for | Hey Python people,
As a .NET developer by day, I've always been bummed by the lack of real Swagger spec generators available for Flask compared to Swashbuckle for ASP.NET. I personally don't want to write some markup or clutter the service with a bunch of code to generate the docs, I wanted something that would generate the spec for you, with no setup required, with optional features to expand the detail of the documentation.
So I built that! If you like Swagger, you'll like this. It's a pretty full-featured library, but I'm sure there's room for improvement and welcome any friends that'd like to contribute.
[https://pypi.org/project/swagger-gen/](https://pypi.org/project/swagger-gen/)
[https://github.com/danleonard-nj/swagger-gen](https://github.com/danleonard-nj/swagger-gen)
Thanks for checking it out :) | 1 | t3_tvp63o | 1,649,034,247 |
Python | Is r/Python participating in r/place? | If so, where can one get involved? | 0.25 | t3_tvom5q | 1,649,032,639 |
Python | iMandelbrot is a tool made out of PyGame that visualizes the nature of a Mandelbrot fractal! | # Mandelbrot: An Interactive Module
**iMandelbrot** is a **learning aid** purely made out of **PyGame** that visualizes the nature of a **Mandelbrot** fractal!
GitHub Link: [https://github.com/wonmor/iMandelbrot-Plotter](https://github.com/wonmor/iMandelbrot-Plotter)
## Public Release 1.2.0
**DEVELOPED** AND **MAINTAINED** BY **JOHN SEONG** • **MIT** LICENSE
[Download for **Intel-based Macs**](https://github.com/wonmor/iMandelbrot-Plotter/raw/main/installer/iMandelbrot_Mac.dmg) → Make sure to turn on the '**Open Using Rosetta**' option on **M1 Macs**!
## Why Our Product Is Sexier Than Others
For the sake of **optimization**, **iMandelbrot** only generates the coordinates above the x-axis — basically duplicating to the corresponding coordinates below the horizontal line.
​
https://preview.redd.it/jr48nb5fper81.png?width=3456&format=png&auto=webp&s=3b116ded17242fd28d1f685145f0d283932eb5a5 | 0.67 | t3_tvofnv | 1,649,032,116 |
Python | Monday Daily Thread: Project ideas! | Comment any project ideas beginner or advanced in this thread for others to give a try! If you complete one make sure to reply to the comment with how you found it and attach some source code! If you're looking for project ideas, you might be interested in checking out Al Sweigart's, ["The Big Book of Small Python Projects"](https://inventwithpython.com/bigbookpython/) which provides a list of projects and the code to make them work. | 0.81 | t3_tvnusp | 1,649,030,411 |
Python | Python libraries for hierarchical or multilevel time series analysis | What are the python libraries best suited for analyzing time series with hierachical or multiple levels like geographic levels between neighborhoods within cities and cities within states. | 0.76 | t3_tvmdfk | 1,649,026,196 |
Python | Python and Blockchains | Why is Python is not used as much in blockchain technology, Specially in the core of blockchains | 0.22 | t3_tvl7m8 | 1,649,023,159 |
Python | Two new articles this week: Beginner tutorial on classes and object-oriented programming with exercises and Python careers research | Hi all,
In the last few days, I had a lot of fun publishing two brand new articles for you:
* [Python Classes Zero to Expert: A Tutorial with Exercises](https://codesolid.com/getting-started-with-python-classes/)
For new programmers just beginning with Python and learning about object orientation, this beginner-focused article covers the basics in some detail, with exercises at the end to reinforce what you've learned.
* [Best Python Careers: New Research Reveals Top Fields](https://codesolid.com/career-paths-for-python-programmers/)
Based on my own experience in the industry as well as job board research, I detail how many jobs there are in different areas of Python programming and what sorts of hoops you might need to jump through to break into the field.
Please upvote if you like them, and enjoy! | 0.85 | t3_tvkqlt | 1,649,021,930 |
Python | we need to make the python logo in r/place | Don't you think? Imo it would be so cool if some of us got together and started to plan it :) | 0.19 | t3_tvjg5x | 1,649,018,716 |
Python | Twitter read and analysis | # Import tweepy to work with the twitter API
import tweepy as tw
# Import numpy and pandas to work with dataframes
import numpy as np
import pandas as pd
from matplotlib import pyplot as plt
consumer_key ='mycode'
consumer_secret = 'mycode'
access_token ='mycode'
access_token_secret = 'mycode'
# Authenticate
auth = tw.OAuthHandler(consumer_key, consumer_secret)
# Set Tokens
auth.set_access_token(access_token, access_token_secret)
# Instantiate API
api = tw.API(auth, wait_on_rate_limit=True)
hashtag = "#slap"
query = tw.Cursor(api.search_tweets, q=hashtag).items(1000)
tweets = [{'Tweet':tweet.text, 'Timestamp':tweet.created_at} for tweet in query]
print(tweets)
df = pd.DataFrame.from_dict(tweets)
df.head()
willsmith_handle = ['willsmith', 'will smith', 'will', 'smith', 'slap\'s']
def identify_subject(tweet, refs):
flag = 0
for ref in refs:
if tweet.find(ref) != -1:
flag = 1
return flag
df['will smith'] = df['Tweet'].apply(lambda x: identify_subject(x, willsmith_handle))
df.head(10)
df.to_csv('Twitter_feed.csv', encoding='utf-8')
A working process based on an online tutorial. The code takes in twitter tweets and exports them to csv file.
I'm going to try and expand to read the sentiment and feedback of different tweets. | 0.6 | t3_tvj90z | 1,649,018,223 |
Python | Dice roll Probability | import random
import collections
import time
##Outcome List of Combinations Total
##2 1+1 1
##3 1+2, 2+1 2
##4 1+3, 2+2, 3+1 3
##5 1+4, 2+3, 3+2, 4+1 4
##6 1+5, 2+4, 3+3, 4+2, 5+1 5
##7 1+6, 2+5, 3+4, 4+3, 5+2, 6+1 6
##8 2+6, 3+5, 4+4, 5+3, 6+2 5
##9 3+6, 4+5, 5+4, 6+3 4
##10 4+6, 5+5, 6+4 3
##11 5+6, 6+5 2
##12 6+6 1
#create list
dice_list=[]
for i in range(1,7):
#dice 1
dice1= i
for j in range(1,7):
#dice 2
dice2= j
#dice total
dice_reads=dice1+dice2
##add to list
dice_list.append(dice_reads)
##sort list
dice_list.sort()
##dictionary
probability = {}
##Place a Bet
User_bet = input("Enter a bet between 2 to 12: ")
###using collections.Counter for number frequency
probability=collections.Counter(dice_list)
# printing the probability
#print(probability)
##percentage method
def math_percentage(User_bet):
print("The user bets a "+str(User_bet))
for dice in probability:
prob=probability[dice]
percentage=round(float(((prob)*100)/36))
#print("The percentage of a "+str(dice) +" is "+str(percentage)+ " %")
if dice==int(User_bet):
print("The percentage of a " + str(dice) + " is " + str(percentage) + " %")
##Pause
time.sleep(10)
##call method
math_percentage(User_bet)
##100 dice rolls
for i in range(0,1):
#dice 1
dice1= (random.randint(1,6))
#dice 2
dice2= (random.randint(1,6))
#dice total
dice_reads=dice1+dice2
print("Dice reads: "+str(dice_reads)) | 0.33 | t3_tvinqx | 1,649,016,754 |
Python | Who exactly is a python developer? I know this is a broad term which include many paths. But do we have to cover them all to become one? much like, one term to rule them all? | Hii all
I've seen the term "Python developer" been around online, and the roadmap to become one. As we all know, it does include many paths, web dev, analysis, DS, ML and so on. To be called a python dev, do we actually need to cover all potential paths and then just choose one? or we should be able to do anything under this big umbrella term?
My question is coming from my interest in learning python and DS. That's when I started my journey. I am still in process of learning. But I also want to learn some kills related for backend dev via python. For many reasons, first even though my love goes for DS but there's less opportunities and more competition. (as far as I know). So, probably having extra skills can add value or come in handy for model production. Also, I won't mind working as backend dev, as I'll def use DS in research for later future plans.
When I share this with someone, like my interest in DS and web dev. I got the response of these are totally different and I am heading to the wrong direction (well, maybe I am) but I wanted to cover my interest in more of a broader term like "python dev" but there's the fact that some of the paths under this term I don't have much of interest in.
Should I specify myself as python dev with some specific libraries "Generally speaking". I do understand when it come to job haunting I should be more specific like looking for DS, analysis...etc.
But let's say I want include sth in my linkedin bio. I don't want to throw analysis, DS, ML, web dev all at once. I was considering python dev and then when it's come to job haunting I can pick and choose.
I hope this is not a weird question :) | 0.42 | t3_tvi6ql | 1,649,015,670 |
Python | python logo in r/place | guys let’s make the python logo
discuss coordinates and such in the comments | 0.3 | t3_tvhwuf | 1,649,015,005 |
Python | I am working on some 3D reconstruction using TOMVIZ, does anybody know any tutorial for segmentation in this software? | 0.33 | t3_tvhi0d | 1,649,014,055 |
|
Python | Introducing File Folder Hider! (made with Tkinter Python) | I've been working on this project for a couple of months now, first it was in the from of a terminal where the user had to give certain commands to get the job done, but now, its a fully-fledged GUI with buttons and labels to guide you. It has its two main features, "Hide" and "Unhide", which help you hide and unhide any file and/or folder from the File Explorer (more in the readme.txt). Moreover, you can opt in optionally to enter your email address and in case you ever forget the Master Password used to access the program, you can press the "Forgot Password" button to have a recovery code sent to your email and after verifying, you will be allowed to change the current Master Password, or if you happen to remember it again, simply go back to the main menu (because you've already verified yourself through the recovery procedure, it is safe to assume the user is the correct one). One thing to keep in mind is that all the credentials (the Master Password and your email address specifically) are encoded to ensure minimum security. At least that's better than none at all. Another important thing to note is that some command prompt screens will appear when running the program and hiding/unhiding the files/folders. That is a side-effect of trying to have the program run on the user level in order to get around permission issues and not running as admin, so sorry for that.
Links:
File Folder Hider repository: [File Folder Hider on Github](https://github.com/Mubashir78/File_Folder_Hider_with_dialog_box)
My other repositories (basically to my Github profile): [My Profile on Github (Mubashir78)](https://github.com/Mubashir78)
Please feel free to try it out for your daily routine and let me know your guys' feedback in the comments!
[Dialog box for when creating\/changing Master Password. Email is optional as it says](https://preview.redd.it/if9ff53mqcr81.png?width=502&format=png&auto=webp&s=2b074f0ee02eec7f5e5394fe291a6ebf95432a5e)
[Main Menu Dialog Box \(after successfully creating\/entering the Master Password\)](https://preview.redd.it/63y52tj0scr81.png?width=501&format=png&auto=webp&s=75fb030989360f44e6e922927211b199ce5dfefe)
[Dialog box for after creating the Master Password and entering the email and running the program again. Incase of not adding an email, the \\"Forgot Password\\" is grayed out and an \\"?\\" icon shows up which tells you that you haven't added email in order to use the feature when hovering over it](https://preview.redd.it/rkxmbcp7tcr81.png?width=404&format=png&auto=webp&s=2618f24e11794d151e83000f5ceebe04da14e056) | 0.75 | t3_tvflrx | 1,649,009,385 |
Python | I made a video comparing different data storage formats that python users should consider. Feedback welcome! | 0.75 | t3_tver6p | 1,649,007,270 |
|
Python | Easier Regexps | 0.2 | t3_tveh1e | 1,649,006,548 |
|
Python | A Redux inspired store pattern for asyncio applications - SimpleEventMonitor | So, recently I had to deal with the issue of setting up a solution to monitor a few on-prem deployments for health status. The on-prem clusters were configured to send emails with multiple tables with the status of every node etc.
Well, it is a pretty straightforward solution was writing a python script to check the mailbox for new mail and download recent mail from the cluster, parse the mail and for each table entry verify for failed nodes and create an alert ticket of each node. I stumbled upon a [Github Project](https://github.com/wichmannpas/simple-mail-monitoring) that does something like this.
Considering the job was pretty much done, I was able to quickly use that script to do basic email retrieval and write parsers for my mail and get the job done in a few hours.
However, the code felt very complicated and it was pretty much thrown away, but after giving it a few hours of solace at home, it occurred to me, this kind of problem could be better tackled with queues or pubsub model and it has been a while I have played around with python. I wanted to avoid the hassle of setting up Redis/rabbitmq etc, I was rather looking for something like redux for python applications, which I can use to separate out my data producers and consumers.
I had a few things in my mind for this side project :
\- In memory pubsub
\- Use asyncio
\- Be able to schedule events without cron tasks
\- Unobtrusive pattern to design my python code into producer and consumer model
\- Ability to develop pull-based data sync, which can connect to your real time data feed
Here is the basic hello world program which demonstrates how you can create a publisher function and schedule it with run\_every to execute every 180 seconds after the last execution.
[aioredux hello world](https://preview.redd.it/6vb91s6accr81.png?width=3164&format=png&auto=webp&s=6de8ffdbda5fad9eb22404325887e8873a105c60)
Here is the link to my [fork](https://github.com/aregee/simple-mail-monitoring) of the Simple Mail Monitoring Github project, which utilizes this pattern to run the existing functionality provided by the original source.
I can't share my private repo, but I must say after moving that hackish script to this slightly better hack has made the code so clean and flexible, we have not just accomplished that email report task, but rather we are able to see many more such use cases internally where we can utilize this pattern.
Please feel free to share your thoughts, feedback, or even pull requests on the project. | 0.73 | t3_tve7uh | 1,649,005,890 |
Python | magic-timer: Conveniently get a rough idea of how long things take. (package) | 0.62 | t3_tvcnmr | 1,649,001,856 |
|
Python | Darts in higher dimensions | While browsing YouTube, I came across the following video in which a little puzzle is presented that is solved mathematically. Using maths, an answer was presented that I validated by implementing a simulation.
I thought this was a fun little challenge to program. Maybe others want to give it a go as well?
How would you have approached this?
Video: [https://www.youtube.com/watch?v=6\_yU9eJ0NxA](https://www.youtube.com/watch?v=6_yU9eJ0NxA)
My code: [https://gitlab.com/JeroenStiers/scripts/-/blob/main/darts\_in\_higher\_dimensions.py](https://gitlab.com/JeroenStiers/scripts/-/blob/main/darts_in_higher_dimensions.py) | 0.63 | t3_tvbluw | 1,648,999,132 |
Python | r/Place | Are people interested in putting the 2 snakes in there? | 0.22 | t3_tvakqu | 1,648,996,309 |
Python | Simple and Super Easy-to-use Colabs | [Github](https://github.com/BreezeWhite/interesting-colabs)
Tired of figuring out how to use a research demo colab? Feeling lost in the arrangements of all the messy colab blocks and information?
I want to share my personal collections of colabs that is definitely easy to use. This is not just another “awesome list” series of repo, with just links to the original resources. All the colabs within this collections are refactored and deliberately simplified by me. And I can promise you that they are all super easy to use, even your 6-year-old child would know how to use.
There are at most three code blocks to be executed!! Minimum steps are required to get directly to the expected final results. Example outputs are also provided to have a quick experience. Everything is just simple and clean, no lengthy and confusing intros, nor chaotic arrangements of blocks.
I will continually update the repo, adding more interesting yet hard to get started projects. Feel free to comment and leave feedbacks below. If you know something is really awesome and interesting, but just no way to figure out how to use, I would be very happy adding to the list and wrapping it! | 0.75 | t3_tva26l | 1,648,994,803 |
Python | Instagram bot and Data gathering with GUI | Hi,
InstaMachine is a post-oriented Instagram bot which means it is more focused on gathering data and storing it inside the SQLite database. I made this app solely to put to test my web scraping abilities as a beginner programmer and build up some portfolio, therefore I did not use any python's Instagram library such as instapy.
[https://github.com/theRJorj/Insta-Machine](https://github.com/theRJorj/Insta-Machine)
I would appreciate your feedback on any aspects of this project
[InstaMachine](https://preview.redd.it/8gftzkswibr81.png?width=1500&format=png&auto=webp&s=e5c30426a7429a8c9245914df4c03862d8ac566e) | 0.5 | t3_tv9nz9 | 1,648,993,681 |
Python | Python beginners created these games based on my tutorials! What do you think? | 0.68 | t3_tv9cin | 1,648,992,723 |
|
Python | Python open-source OpenBB Terminal against Bloomberg Terminal | 0.95 | t3_tv7xqp | 1,648,988,114 |
|
Python | How is PyPy Tested? | 0.83 | t3_tv7nyw | 1,648,987,167 |
|
Python | PtPython as default Django shell - my first Django package | Hey there!
I've built a package to use PtPython as default Django shell.
Due to extra functionalities of PtPython, I'm using that rather than Python and maybe many of you using ptpython too so I tried to make it default shell in Django framework.
You can give it a try:
`pip install django-ptpython`
Github repository: [https://github.com/reganto/django-ptpython/](https://github.com/reganto/django-ptpython/)
PyPi: [https://pypi.org/project/django-ptpython/](https://pypi.org/project/django-ptpython/)
​
I'd like to get your feedbacks.
Thank you. | 1 | t3_tv7jej | 1,648,986,698 |
Python | Python dictionary implementation | 0.73 | t3_tv4p4i | 1,648,974,980 |
|
Python | Share Python Code Snippets Like A Pro Without Using GitHub | 0.38 | t3_tv33br | 1,648,968,433 |
|
Python | Python Selenium Tutorial #7 - Save & Reuse Cookies | 0.91 | t3_tv2rby | 1,648,967,078 |
|
Python | What Lies Between the Fibonacci Numbers? | Enjoy this brief video, where we examine the Fibonacci numbers by using a Jupyter Notebook. It is this easy, and you can get started today!
[https://www.youtube.com/watch?v=Ge0k4kS9wE8](https://www.youtube.com/watch?v=Ge0k4kS9wE8)
In this little python video, we have a look at Fibonacci numbers. First, we try a few functions to generate the normal numbers: 0, 1, 1, 2, 3, 5, 8, 13, 21, ... Then we look at what happens between these numbers. If Fx is the xth Fibonacci number, then F7 = 8 and F8 = 13, but then what is F7.5? Join me and find out!
The notebook used in this video is available at:
[https://colab.research.google.com/drive/1K6jWQSXzhCz9sOy5SyEHA-k4samWhWhr](https://colab.research.google.com/drive/1K6jWQSXzhCz9sOy5SyEHA-k4samWhWhr) | 0.6 | t3_tv1yd2 | 1,648,963,949 |
Python | Data Visualization and simple Regression using Dash | Hi guys, I created my first application with Dash and am excited to share it.
It's a simple tool for analyzing already cleaned datasets. You can upload any dataset but generally it caps out at 100MB. Eventually, i'm hoping to allow for bigger datasets.
site: [https://www.regress.me/](https://www.regress.me/)
source: [https://github.com/SuljicAmar/Regress.me](https://github.com/SuljicAmar/Regress.me)
I have a ton more planned for this (logistic/ mixed effects etc) but would love to hear any thoughts from others!
https://reddit.com/link/tv1tq9/video/nnintgojxcr81/player
EDIT: Added 3D plots, to initial visualizations and to fit
​
https://reddit.com/link/tv1tq9/video/a17qsfy5hdr81/player | 0.97 | t3_tv1tq9 | 1,648,963,469 |
Python | Python App | Hello, I did a simple app on Python. This app is making a common shortcut from several. You can test it right here: [https://github.com/naelxd/Nepo](https://github.com/naelxd/Nepo)
I will be very glad to read your opinions and advices. Thanks!
https://i.redd.it/m7ytbr2i18r81.gif | 0.17 | t3_tuy9d5 | 1,648,951,431 |
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.92 | t3_tuwz6h | 1,648,944,010 |
Python | Naming convention for type aliases | I recently did a remote technical challenge/interview through a company that does assessments for other companys.
I scored very well, but they made a comment that they didn't like my naming convention, and marked me down in one category. The part they didn't like was:
SimpleTable = Dict[str, Dict[str, str]]
They're saying `SimpleTable` should be `simple_table`. I cased it the way I did because it's used as a type for hinting.
What are people's thoughts here? I can't find anything official. | 0.9 | t3_tuvz80 | 1,648,941,052 |
Python | A commit from my lead dev: "Improve readability". | I don't get it. Help!
https://preview.redd.it/emb8jxjrv6r81.png?width=607&format=png&auto=webp&s=871eae5047ac3c13dcba968fa2b49dd707469287 | 0.83 | t3_tuuq5l | 1,648,937,544 |
Python | Space Science with Python - Asteroids meet Deep Learning #10 | Hey everyone,
today I'd like to show you how to optimize a Conv1D network using [Keras-Tuner](https://keras.io/keras_tuner/). It enables one to automatically test some pre-defined networks; or it applies Bayesian or Hyperband optimization to find the best model!
In our case, we'll use it to find a good convolutional neural network for asteroid spectra to distinguish between 4 classes.
Link to video: [https://youtu.be/vhr48KgL-Ys](https://youtu.be/vhr48KgL-Ys)
Corresponding Code: [https://github.com/ThomasAlbin/Astroniz-YT-Tutorials/blob/main/%5BML1%5D-Asteroid-Spectra/10\_dl\_hyperparameter\_search.ipynb](https://github.com/ThomasAlbin/Astroniz-YT-Tutorials/blob/main/%5BML1%5D-Asteroid-Spectra/10_dl_hyperparameter_search.ipynb)
Please note that this is tutorial #10 in a long series of space science related videos. Feel free to take a look in the corresponding [playlist](https://www.youtube.com/playlist?list=PLNvIBWkEdZ2gagAcgm44cplgSvQ_Cmvbv) or on [my channel](https://www.youtube.com/c/Astroniz).
Tutorial #10 concludes the classification task. In the next 3 videos we'll take a look at Autoencoders and how to classify or identify different asteroid spectra in a low-dimensional latent space.
Stay tuned!
Thomas | 0.8 | t3_tuuc31 | 1,648,936,504 |
Python | Cloud server | I made an API to managing files remotely, it's protected from directory traversal, shells and more!
[https://github.com/ZSendokame/ViCl](https://github.com/ZSendokame/ViCl)
I wan't to improve it, so if you have any ideas or feedback please leave it on comments | 0.73 | t3_tuszb4 | 1,648,932,845 |
Python | Beautiful circos plots in Python | Circos is one of the most popular software packages for displaying the inter-relationships between data in a matrix. For example, in the bioinformatics field, circos style plots are often used for visualizing genomic similarities and features. However, the original package is implemented in Perl, and the other derived packages were also developed based on R or d3.js. Thus, there are no practical tools for drawing circos plots in matplotlib.
Here, I made [pyCircos](https://github.com/ponnhide/pyCircos) that allow drawing circos plots with matplotlib. By using this package, not only circos plots but also complex polar plots can be quickly drawn.
I hope the package help users visualize a beautiful polar plot.
[Example plots of pyCircos](https://preview.redd.it/v3g1huqtt5r81.png?width=2952&format=png&auto=webp&s=f8d8bf0f876d9facb27a12974793d70f9570e84b)
Additionally, example code can be executed on [Google colab.](https://colab.research.google.com/drive/1xmAnv7AHWUTA2HWfjqV1lFWkFMSLJHG0?usp=sharing) | 0.78 | t3_tupzwe | 1,648,924,973 |
Python | GitHub - minimaxir/imgbeddings: Python package to generate image embeddings with CLIP without PyTorch/TensorFlow | 0.67 | t3_tuokyp | 1,648,921,291 |
|
Python | Free and reliable language translation API for developers | Hi Pythons,
For years now, I have been developing and maintaining the [deep-translator](https://github.com/nidhaloff/deep-translator) package.
Recently, I started working on an API based on it and I want to show it to you. The API is based on fastapi and deep-translator. I deployed a "basic" version on azure, you can [try it out here](https://deep-translator-api.azurewebsites.net/)
If you want to check the API code, you can [find it here](https://github.com/nidhaloff/deep-translator-api)
I built the API as an extension to deep-translator to make it easier for other developers/enthusiasts to build apps/websites in their preferred languages and make use of deep-translator through the API.
In [this issue](https://github.com/nidhaloff/deep-translator/issues/144), I suggested building a translation website or desktop app based on deep-translator. Maybe there are people here, who will find this interesting.
​
​
# TL:DR
I built a free translation API based on deep-translator and fastapi.
API repo: [https://github.com/nidhaloff/deep-translator-api](https://github.com/nidhaloff/deep-translator-api)
deep-translator repo: [https://github.com/nidhaloff/deep-translator](https://github.com/nidhaloff/deep-translator)
Swagger UI: [https://deep-translator-api.azurewebsites.net/](https://deep-translator-api.azurewebsites.net/) | 0.8 | t3_tunvta | 1,648,919,507 |
Python | Help building a Python logo in r/place! | we are currently working at 1270 x 888 near the belgium flag
[https://www.reddit.com/r/placepython/comments/ttxp46/rplacepython\_lounge/](https://www.reddit.com/r/placepython/comments/ttxp46/rplacepython_lounge/)
[https://www.reddit.com/r/placepython/comments/tungzi/starting\_again\_at\_1270\_x\_888\_near\_the\_belgium\_flag/](https://www.reddit.com/r/placepython/comments/tungzi/starting_again_at_1270_x_888_near_the_belgium_flag/) | 0.68 | t3_tuno8s | 1,648,918,996 |
Python | Python GUI Programming With Tkinter – Real Python | 0.67 | t3_tulmi2 | 1,648,913,791 |
|
Python | ORM by dataclass with type hints✨✨✨ | ​
https://preview.redd.it/vvsaiq7yl4r81.png?width=754&format=png&auto=webp&s=b71bdbfcaabf44d9d52cf1743d1caa26c1efd92f
https://preview.redd.it/v6qf97zcl4r81.png?width=1118&format=png&auto=webp&s=281417df407d2cc011e3e02ed61da5791bcc3c3a
see more at [https://strongbugman.github.io/danio/](https://strongbugman.github.io/danio/), thanks for any suggestion | 0.64 | t3_tukdgh | 1,648,910,416 |
Python | we need a python logo in r/place | let's choose a good pixel art logo and draw it somewhere. | 0.48 | t3_tuizod | 1,648,906,468 |
Python | py-terraform: Python binding for Terraform | Hi, I wrote a Python binding for Terraform which called [**py-libterraform**](https://github.com/Prodesire/py-libterraform).
Terraform is a great tool for deploying resources. If you need to call the Terraform command in the Python program for deployment, a new process needs to be created to execute the Terraform command on the system. A typical example of this is the [python-terraform](https://github.com/beelit94/python-terraform) library. Doing so has the following problems:
* Requires Terraform commands on the system.
* The overhead of starting a new process is relatively high.
This library compiles Terraform as a **dynamic link library** in advance, and then loads it for calling. So there is no need to install Terraform, nor to start a new process.
In addition, since the Terraform dynamic link library is loaded, this library can further call Terraform's **internal capabilities**, such as parsing Terraform config files.
Feel free to use it and look forward to your feedback! | 0.92 | t3_tuiv20 | 1,648,906,072 |
Python | An Example of Automated Hacking with Python | 0.94 | t3_tuhe59 | 1,648,901,266 |
|
Python | Gradually Migrating Python Code to asyncio | 0.81 | t3_tuhb11 | 1,648,900,968 |
|
Python | PyTermGUI now lets you export your terminal contents as an SVG screenshot! | 0.84 | t3_tuh5ej | 1,648,900,443 |
|
Python | I made a simple access-code protected webpage. Any suggestions on how I can improve? | So for fun, I am making a webpage that can be only access through a 4 digit access code. Nothing fancy. No Username or password. I hardcoded a 4 digit pin in the flask app and am "authenticating" (not sure if I can call it this) in the way below.
​
Right now, I am also trying to "re-auth" after 100 seconds.
​
PS: Not sure if this belongs in learnpython.
How good/bad is my code and the way I am solving the problem? What are the flaws in this? Thanks for the help!
# This is placed in the utils file that i will be importing in the app.
@dataclass
class Authanticate:
PIN: str = "1111"
verified: bool = False
verified_at = dt.now()
def session_valid(self):
delta = dt.now() - self.verified_at
# print(f"delta - {delta.seconds} seconds || {delta.days} days")
if(delta.seconds >= 0 and delta.seconds <= 100):
self.verified = False
return True
else:
return False
def validate_pin(self, entered_pin):
if(entered_pin == self.PIN):
self.verified = True
self.verified_at = dt.now()
# print(f"Verified {self.verified} {self.verified_at}")
return True
else:
self.verified = False
return False
My actual routing code:
#Placed at the top
# This is a global var. Any better way?
auth_obj = utils.Authanticate()
@app.route('/handledata', methods=['GET', 'POST'])
def handledata():
if(request.method == 'POST'):
input_1 = request.form['digit-1']
input_2 = request.form['digit-2']
input_3 = request.form['digit-3']
input_4 = request.form['digit-4']
entered_pin = f"{input_1}{input_2}{input_3}{input_4}"
print(f"entered pin - {auth_obj.validate_pin(entered_pin)}")
return redirect(url_for('showdata'))
@app.route('/showdata')
def showdata():
# print(verified)
if(auth_obj.session_valid()):
data = {"Yes": "Lord"}
else:
data={"Lol": "You wrong"}
return data
# return render_template('data.html', show='dir', dir_data = data) | 1 | t3_tugf5s | 1,648,897,756 |
Python | XRP Blockchain Wrapper | Hi
I made a simple wrapper based on "xrpl-py" package which makes it easier to interact with xrp blockchain.
It's still a work in progress. I hadn't had enough time to write a sphinx doc for it, but the library is very easy to understand
In other words, it's a more simplified version of the "xrpl-py" package.
Github: [https://github.com/amiwrpremium/xrpy](https://github.com/amiwrpremium/xrpy)
PyPi: [https://pypi.org/project/xrpy/](https://pypi.org/project/xrpy/)
Feel free to contribute and use it.
Any feedback will be appreciated.
If you bump into any bugs or issues please submit them on Github.
Thanks. | 0.33 | t3_tue6z7 | 1,648,888,626 |
Python | Handle Exception and Close Resource Using Python Context Manager With-Statement | 0.6 | t3_tudfqc | 1,648,885,400 |
|
Python | Best OOP Tutorial | Wanted a primer on Python OOP and came across this course from FreeCodeCamp. The instructor does a great job explaining all the concepts related to OOP.
If anyone is looking to get more info on OOP, I highly recommend you go and check this course out: https://youtu.be/Ej_02ICOIgs
Cheers. | 0.85 | t3_tucz71 | 1,648,883,543 |
Python | Every 15 Minutes, Random YouTube Comment Gets Featured on the Thumbnail - Dynamic YouTube with Python | I wanted to explore dynamic video making, which are YouTube videos where the title or thumbnail changes during the video's lifetime. You may have seen Tom Scott's changing title video or Mr. Beast's changing thumbnail.
For this Python project, I made a Python script using the YouTube API hosted on AWS Lambda where every 15 minutes, a random comment from my comment section is put onto the thumbnail. This is a cool way to interact with an audience!
Most of the used code and information can be found on [GitHub](https://github.com/techtribeyt/random_comment_on_thumbnail).
Most importantly, [**here is the video where this is all running live**](https://www.youtube.com/watch?v=RXN1d_UpaAY)! Please leave some comments so that the thumbnail stays active and keep changing!
Basically, the thumbnail below keeps changing every 15 minutes. The top gets updated to the username of the commenter and the body changes to the content of the comment.
https://preview.redd.it/ovxjod5he1r81.jpg?width=1280&format=pjpg&auto=webp&s=7ba2c84f11d57ecaa70114fd3835924ad22297fb | 0.71 | t3_tu9lyd | 1,648,870,971 |
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! | 0.75 | t3_tu5ckr | 1,648,857,610 |
Python | Pokete: A terminal based Pokemon like game | &#x200B;
https://reddit.com/link/tu1zat/video/u3812q8qkzq81/player
I wrote a Pokemon clone, called [Pokete](https://github.com/lxgr-linux/pokete), for the terminal supporting:
* Different Pokete types
* Effectiveness of those types against each other
* Attack effects
* A map
* NPCs to talk to (partly with complex interaction choices)
* Trainers to fight against
* Weather that effects the effectiveness of some attacks
* Achievements
* A Dex to see all caught Poketes in
* Special abilities (like flying)
* A self written [ASCII game engine](https://github.com/lxgr-linux/scrap_engine) and much more
* Pipenv | 0.95 | t3_tu1zat | 1,648,848,316 |
Python | largestinteriorrectangle - my first PyPI published package | I implemented the in 2019 described [Algorithm for finding the largest inscribed rectangle in polygon](https://journals.ut.ac.ir/article_71280_2a21de484e568a9e396458a5930ca06a.pdf). Today I published the package on [PyPI](https://pypi.org/project/largestinteriorrectangle/). I developed it to solve the [problem of black borders around a stitched image](https://stackoverflow.com/questions/33497928/crop-image-after-stitching).
Since it's my first contribution on PyPI I would love to get feedback from experienced developers! | 0.91 | t3_tu0tfu | 1,648,845,350 |
Python | bundling python virtualenv AND interpreter? | I can use pex to bundle a archive of a virtualenv, that I can run with a specific version of a python interpreter on a host.
Is there a project that will let me bundle the virtualenv AND the python interpreter? | 0.85 | t3_ttyskq | 1,648,840,116 |
Python | I've made a "Falling sand" Sandbox with Python (using pygame) | It's extremely slow and incefficient but it does work :)
It implements:
\- Sand & Water Physics
\- Buoyancy
\- Heath transfer
\- Status changes (ice -> water -> vapor)
Here's a demo for how it looks like in action: [https://www.youtube.com/watch?v=7cgfJqnVVTg](https://www.youtube.com/watch?v=7cgfJqnVVTg)
And here's a link to the code: [https://github.com/SudoOmbro/OmbroBox](https://github.com/SudoOmbro/OmbroBox)
Thanks for reading :) | 0.96 | t3_ttxxxq | 1,648,837,926 |
Python | How are python threads different from other languages? I understand GIL limits code exec to one thread but how does "usual" threading is like without GIL. | I have used many other languages but I've only touched concurrency in python. I have learnt about threading, asyncio and multiprocessing.
I was reading about GIL and can easily understand "it limits code exec to one thread", that's plain definition. Its a mutex and all that.
But how exactly does it limits and what? So in languages without GIL like Java and C++ can each thread execute code without taking turns as in python? So if there are say 20 threads, all of those are executing code simultaneously?
So effectively in python threading CAN ONLY HELP I/O BOUND programs but in Java/C++ threading CAN HELP BOTH CPU BOUND AND I/O BOUND PROGRAMS? | 0.77 | t3_ttx3k4 | 1,648,835,841 |
Python | Are we all joining r/placetux for the Linux community or can we build a python on r/place? | Where else are y'all dedicating your tiles? And who else is using selenium to automate their process? | 0.57 | t3_ttwg06 | 1,648,834,226 |
Python | A Vigenère (de)ciphering program with frequency analysis attack. | The project can be found here: https://github.com/Nathan-Furnal/frequency-analysis
Hi everyone, this is a project about ciphers, entirely in Python. The goal is to provide a way to cipher plain text files based on a key and then automatically find the key back to decipher the text.
Some trade-offs were made for simplicity: only the basic 26 letters alphabet was allowed and any spaces or punctuation was removed as well.
In that sense, it's a good introduction to implement ciphering but not a real-world tool!
More information about what a cipher is and how they're implemented can be found in the README and in the documentation of the code.
We can start with the most simple example, a *Caesar* cipher which is a one letter shift.
For example, the sentence `Hello World!`, shifted by the letter `K` ("a" is 0 and "k" is 10), will become :
| H | E | L | L | O | | W | O | R | L | D | plain text
| K | K | K | K | K | | K | K | K | K | K | key
| R | O | V | V | Y | | G | Y | B | V | N | ciphered text
This kind of cipher is very susceptible to be cracked because the letters are all shifted by the same key (a unique letter). Since that's the case, one can try to count the frequencies of each letter, plug back in the usual letter frequencies for each letter and it's done.
A Vigenère cipher is more elaborate, the key is a word or a sentence and not one letter. Because of this, the same letters can be shifted by a different amount and the resulting ciphered text is not susceptible to the deciphering explained above.
For example, The sentence `Hello World!`, encrypted with the word `key` (with letters indexed from 0 to 25), becomes:
| H | E | L | L | O | | W | O | R | L | D | plain text
| K | E | Y | K | E | | Y | K | E | Y | K | key
| R | I | J | V | S | | U | Y | V | J | N | ciphered text
You'll find that where the key from this cipher matches the key from the previous one, the ciphered text matches! This is one of the basic building blocks used to attack this ciphering scheme, it's a bit more elaborate but you can find the references and examples in the documentation of the code.
I hope it's clear =) | 0.88 | t3_ttqlac | 1,648,819,457 |
Python | Sierpiński Triangle With Python Turtle | 0.81 | t3_ttqer3 | 1,648,818,933 |
|
Python | I'm creating a tool to enrich your datasets with relevant external data | Hey all,
I love doing market research and all kinds of exploratory analyses, but getting the data is a major pain point, as it is in many places (data dumps, apis, marketplaces, web data) and in all kinds of formats
I'm trying a different approach, where instead of searching for data sources, and then integrating manually, you just upload your dataset. My service has a large index with datasets and api providers, and finds relevant ones for your dataset which you can add easily.
&#x200B;
[Example](https://i.redd.it/7ou7f2egowq81.gif)
Does this seem useful to you? Would love to hear your thoughts | 0.91 | t3_ttosfb | 1,648,813,824 |
Python | jupino: Annotate data in Jupyter notebooks | Often times I need a quick way to annotate data for my experiments and since I use Jupyter notebook quite a lot, overtime I developed a simple way to annotate data using Jupyter widgets and recently published it to Github([https://github.com/jangedoo/jupino](https://github.com/jangedoo/jupino)) and pypi to share it with others.
I hope you find it useful. The README file contains code samples for common data annotation scenarios. I would love to get your feedbacks!
https://preview.redd.it/3moyq5fqhwq81.png?width=734&format=png&auto=webp&s=74309c310d96acd056726f354f5de2c24e981878 | 0.86 | t3_tto7z2 | 1,648,811,835 |
Python | Python Data Persistence - DBM Package | 0.67 | t3_ttmu0f | 1,648,806,221 |
|
Python | Old Project Showcase [ThoughtLogger] | ## Backstory
I made this application a long time ago. And really didn't think about showcasing this off in this subreddit. It was a big mistake. But now, I think this project might help somebody, so here it is,
# ThoughtLogger.
Your Personal Thought Logging application that you can use anytime without losing any focus. **Made using tkinter in Python.**
You can write down your thoughts, make a list, use it as a diary, your choice. You get two profiles to write into. This might be useful with people with CBT (Cognitive Behavioral Disorder)
The text is then saved as a '.log' file.
Image of [Main Window](https://user-images.githubusercontent.com/68242099/137069866-9de85060-c0cf-4907-9e3d-3931f614e35f.png)
## You can also customize stuff
You can use the '.ini' file to customize the application to your liking. \[still in beta stages\]
[ini file](https://user-images.githubusercontent.com/68242099/135040471-4d9fd50b-72d3-4696-baac-9490145b5b62.png)
## You can try it out from this [Github Repo](https://github.com/moiSentineL/ThoughtLogger).
It was just a beginner project. Didn't know many things.
## Also hoping that you guys would help improve the code.
## Thank you. | 0.75 | t3_ttmrs1 | 1,648,805,960 |
Python | Removal of supported types in the sample function of the random-library. Why would this be done? | When reading the [documentation of the random module](https://docs.python.org/3/library/random.html) I noded the following:
> Deprecated since version 3.9: In the future, the *population* must be a sequence. Instances of [set](https://docs.python.org/3/library/stdtypes.html#set) are no longer supported. The set must first be converted to a [list](https://docs.python.org/3/library/stdtypes.html#list) or [tuple](https://docs.python.org/3/library/stdtypes.html#tuple), preferably in a deterministic order so that the sample is reproducible.
And my question is why would you do something like this, rather than further supporting all iterables and then casting them to sequences if needed. Maybe make a keyword only argument that has tuple as default parameter so that a user can pass in a custom function to convert non-sequence iterables and raise an error if and only if the convert function fails? Why would we want reproducible results for the random module anyway? I know it is more for games than security purposes but still doesn't this defeat the purpose. | 0.66 | t3_ttlu6q | 1,648,801,881 |
Python | Object Counting by Color. Learn how to count selected color objects using OpenCV and Python. | 0.78 | t3_ttlipp | 1,648,800,408 |
|
Python | Transfer file wirelessly between two computer over the Bluetooth Low Energy protocol Using Python | 0.75 | t3_ttl4ra | 1,648,798,697 |
|
Python | GitHub - brenw0rth/pync: arbitrary TCP and UDP connections and listens (Netcat for Python). | 0.63 | t3_ttkpio | 1,648,796,851 |
|
Python | Why does it seem that python pays more than Java (from what little googling I’ve done)? I would assume that since Java runs faster and more efficient (and since it’s harder to learn, thus, making it a more scarce skill) that Java would be the higher paying language. | 0.31 | t3_ttjbrc | 1,648,791,346 |
|
Python | Automated WiFi Hacking Script In Python - Tutorial | 0.91 | t3_tticqk | 1,648,787,748 |
|
Python | simple and fast reverse port forwarding tool by python | I write a port forwarding tool using pyhton. Please have a try, thanks !
[xitongsys/moonlight: moonlight is a reverse port forwarding tool written by python (github.com)](https://github.com/xitongsys/moonlight) | 0.67 | t3_ttht7k | 1,648,785,809 |
Python | my Hacker News interface, displays thumbnails and details about the linked page. written in Python 3.8, with Playwright for scraping, requests for API querying, Wand for thumbnail generation, and pickle for caching link data so I don't poll the Hacker News API too often | I'd like to share with you [my interface for reading the Hacker News feed](https://www.thnr.net/top/1/). It started as a Django app, but several iterations in I realized I was basically just creating static pages (for speed of UX) so I pivoted to using Python for just a backend of querying the Hacker News API to get the link info and generate the page html and the thumbnails and other details. Web serving is just nginx serving the generated static html pages.
I'm happy to answer technical or design/architecture questions. My plan is to make the code public once it's in a less embarrassing state, but I'm happy to share source code as illustrations if anyone is curious about specific points.
Oddly, the thumbnails have consumed the majority of my dev time. I use Playwright to get the [og:image](https://duckduckgo.com/?q=og%3Aimage) link (if it's present) and then I use good ole `requests` to download the og:image itself. I use Wand (an ImageMagick binding) to trim away large blocks of solid color and then I pad the image to make it either squarish or a 3:1 width to height aspect ratio. Finally I use Wand to save the file as webp since it's small but still good looking. Currently I also create thumbnails if the linked item (not og:image but the actual link) is to a PDF. I'm using Wand to do the conversion with Inkscape as the backend delegate for rasterizing. But sometimes the quality is kinda meh, so I'd like to experiment with using good old ghostscript for rasterizing PDFs, either through a binding (any suggestions?) or by calling a process from Python to the shell.
For the curious:
[Hacker News default interface](https://news.ycombinator.com/), [their public API](https://github.com/HackerNews/API) | 0.75 | t3_tthmk7 | 1,648,785,205 |
Python | Is taking hand-write note on Python Library courses good? In your opinion? | 0.38 | t3_ttfj0z | 1,648,778,283 |
|
Python | PEP 2241: Back to the Past | 0.81 | t3_ttdl90 | 1,648,772,073 |
|
Python | PEP 9001 | &#x200B;
[The Best, and Only, Code Autoformatter You'll Ever Need](https://preview.redd.it/t15arr245tq81.png?width=758&format=png&auto=webp&s=b1accb0f300af6253cff6c14a458601abc5d0ebe)
&#x200B;
[PEP 9001](https://peps.pythondiscord.com/pep-9001/)
Our friends over at the [Python Discord](https://discord.gg/python) have been asked to draft and submit a PEP based on their experiences on Discord based on how to make Python development better for all.
As the Python Discord Server, they are in a unique position to see how Python programmers grow along side the Python programming language. With that experience, they've noticed how much developer time and energy is expended on python formatting and how the guidelines of PEP8 even influence how people learn.
In an effort to ensure Python continues to be the dominant and best programming language to ever exist, the Python Discord is submitting [PEP 9001](https://peps.pythondiscord.com/pep-9001/)—the New Ultimate Final Python Formatting Guide!
This PEP is the final, ultimate, complete Python Formatting Guide that also includes proposed changes to the Python's syntax to encourage better coding practices. We encourage you all to begin porting your code to this new and final coding style.
To help with this drastic but very necessary change, they’ve started drafting a new autoformatter for it, Blurple, so everyone can experience what their code looks like in it's ultimate form.
This PEP is still in a draft state, so please suggest and make contributions in the #pep-9001 channel over in the [Python Discord](https://discord.gg/python). Play around with the autoformatter in #blurple-code-formatter and experience what it’s like for your code to be expertly styled. | 0.93 | t3_ttdjl6 | 1,648,771,923 |
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.67 | t3_ttdb2f | 1,648,771,207 |
Python | 5 Powerful Python one-liners 🤯 | [https://medium.com/@needablackcoffee/5-powerful-python-one-liners-260dd61c4d09](https://medium.com/@needablackcoffee/5-powerful-python-one-liners-260dd61c4d09) | 0.12 | t3_ttbviw | 1,648,766,763 |
Python | Django Boilerplate: new open source project, asking for feedback | I just finished the first iteration on my new open source side project, a Django boilerplate.
What do you think about it? I won't explain much here since I'd like the [readme.md](https://readme.md) to be self-explanatory.
interesting in feedback about:
\- it is useful?
\- it is properly done?
\- it is something you don't like?
\- there is something "not django-ish"?
\- and, of course, any other feedback you may want to leave me! I'd appreciate even the small bit of time you'd dedicate to my project.
here's the link: [https://github.com/carloocchiena/django\_boilerplate](https://github.com/carloocchiena/django_boilerplate) | 0.57 | t3_tt8dpi | 1,648,757,067 |
Python | I made a random class generator for Elden Ring | `import random`
`classes=['Hero', 'Bandit', 'Astrologer', 'Warrior', 'Prophet' 'Vagabond', 'Confessor', 'Wretch', 'Prisoner', 'Samurai' ]`
`class_selection = random.choice(classes)`
`print(class_selection)`
Please give me any feedback on how to improve this, it's one of my first projects | 0.55 | t3_tt753s | 1,648,753,658 |
Python | Files and Dictionary practice | I had already posted but i did not read the rules all the way so I had to remove it, but I am back.
This project came on a whim and I thought it would be fun. The code in my opinion is a tad bit messy but readable. Most of the code came from me with some help from Stack-overflow
[Guthub Link](github.com/Gamelift/File-and-Dictionary-Practice/tree/main) | 0.4 | t3_tt53sn | 1,648,748,158 |
Python | Create a progression of recommendations with any recommender | Hi! For work I made a [recommendation progression package](https://github.com/askarthur/graph-progression) which we've open sourced! Let me explain.
# Reason
We are an ArtTech company and have created a few recommendation engines around artists and artworks. For the artwork one in particular, we thought it'd be cool to see a progression of artworks given a "seed" work. During that process, we discovered a solution like this doesn't exist when all the recommendations aren't calculated before hand and stored (like a graph database) ... so we built this.
# Summary
The main idea behind the package is to allow users to create a series of recommendations in a sort of "progression" from one another using a *context-based* recommender. So you supply the recommendation engine (or client to it), the starter item (seed), and the progression length. It will then try to create a progression of recommendations from the start (seed -> rec 1 -> rec 2 -> etc.).
Some cool features it has are memoization (it won't call the recommender again if it hits the item again), backtracking (if an item has no valid recommendations), and post-selection filters (if you want to filter out certain recommendations).
## Sample
Checkout out a [sample](https://github.com/askarthur/graph-progression/blob/main/docs/samples/README.md) (for artworks) starting with a VanGogh painting!
&#x200B;
Would love to hear any feedback and/or questions people have! Thanks for reading! | 0.55 | t3_tt4k17 | 1,648,746,668 |
Python | Interceptor algorithm (no relevance to current world events) | [https://www.youtube.com/watch?v=RoIsWAdIqos](https://www.youtube.com/watch?v=RoIsWAdIqos)
I made a bot that uses a few altered kinematic equations. It's designed to be an aiming algorithm, but it also works as an unjukable bot. I made the control physics work like starships in SWBF just for fun. Change the speed and acceleration values to see some interesting results. Turn off the constant unit vector speeds and watch it intercept extremely well. | 0.73 | t3_tt4i7h | 1,648,746,529 |
Python | Asynchronous Web Scraping With Python AIOHTTP | 0.67 | t3_tt2qi2 | 1,648,741,724 |
|
Python | Bulk file rename app |
[Tr.Rename](https://preview.redd.it/oubod92w2qq81.jpg?width=150&format=pjpg&auto=webp&s=3a86f3ee1bbace7e43757a38b9dcb0ad1575d74a)
&#x200B;
this app is my first project on Github. it is a bulk file rename/translator. it is based on python. only tested on windows 10 64bit. the GUI is based on qt.
the app name is Translate.Rename and it is capable of:
1. translates all the files into a folder and renames. (uses Built-in google translate API).
2. adds any characters and dates to every file inside the selected folder. (both before or after original filename).
3. completely renames all files in a folder by user-given characters and adds \_1,\_2,...
4. change the suffixes of given files.
5. filters affected files by text, date, size, and type.
[https://github.com/theRJorj/Translate.Rename](https://github.com/theRJorj/Translate.Rename)
EXE: [https://sourceforge.net/projects/trans-rename/](https://sourceforge.net/projects/trans-rename/)
would be glad to have your feedback. | 0.76 | t3_tt007r | 1,648,734,034 |
Python | A feature complete W-TinyLFU cache implementation in Python | While learning Python I tried to implement the cache architecture proposed in the paper [A Highly Efficient Cache Admission Policy](https://arxiv.org/pdf/1512.00727.pdf). I have seen that Python only propose LRU cache as a decorator so I thought a more efficient cache was something meaningful and funny to code.
Not an expert, tried my best.
Brief description of the cache structure:
>W-TinyLFU uses a small admission LRU that evicts to a large Segmented LRU if accepted by the TinyLfu admission policy. TinyLfu relies on a frequency sketch to probabilistically estimate the historic usage of an entry. The window allows the policy to have a high hit rate when entries exhibit recency bursts which would otherwise be rejected. The size of the window vs main space is adaptively determined using a hill climbing optimization. This configuration enables the cache to estimate the frequency and recency of an entry with low overhead.
Here's the github link: [https://github.com/vanika/TinyPyCache](https://github.com/vanika/TinyPyCache) | 0.75 | t3_tszssv | 1,648,733,396 |
Python | I wrote okjson - A fast, simple, and pythonic JSON Schema Validator | I had a requirement to process and validate large payloads of JSON concurrently for a web service, initially I implemented it using [jsonschema](https://github.com/python-jsonschema/jsonschema) and [fastjsonschema](https://github.com/horejsek/python-fastjsonschema) but I found the whole [JSON Schema Specification](https://json-schema.org/) to be confusing at times and on top of that wanted better performance. Albeit there are ways to compile/cache the schema, I wanted to move away from the schema specification so I wrote a validation library inspired by the design of [tiangolo/sqlmodel](https://github.com/tiangolo/sqlmodel) (type hints) to solve this problem easier.
**Here is a simple example:**
```py
from okjson import JSONValidator
schema = { 'name': str, 'age': int }
json_string = '{ "name": "Charly Gordon", "age": 32 }'
assert JSONValidator().is_valid(instance=json_string, schema=schema)
```
There is an [example covering all the features](https://github.com/mufeedvh/okjson#every-feature-in-a-single-example) in the README.
It also has well defined exceptions for each error case when you want to get the reason for the validation failure. (Helpful when you want to show user facing error messages)
**GitHub:** https://github.com/mufeedvh/okjson
This is my first time publishing a Python library, please share your feedback/suggestions. :) | 0.71 | t3_tsz0i3 | 1,648,730,942 |
Python | Current situation of library support for M1 | I am planing to swap my old MacBook with a M1 Pro MacBook. I would like know if anyone has experience with the current situation of supported library support/ general usability of python on M1.
I need support for most of the common data science libraries. I can sacrifice some performance problems since I am mostly just doing DevOps for a Data Science project. But I need to be able to execute it.
Furthermore, I am doing a lot of Docker stuff, but as far as I know this is mostly supported.
So, any knowledge or experience is welcomed :) | 0.93 | t3_tsyuig | 1,648,730,378 |
Python | Flame graph rendering in the terminal | 0.63 | t3_tsya02 | 1,648,728,441 |
|
Python | Concurrent Web Scraping with Selenium Grid and Docker Swarm - updated! | 0.5 | t3_tsy5pb | 1,648,728,034 |
|
Python | Project idea for Python lovers in the Linux world | I'm just throwing this somewhere cuz it'd truly be a blessing if it was made, but I don't get my hopes too high.
I'm very bad at Linux, but I basically spent a week on and off trying to find an easy to use and configure fan control program for CPU and GPU.
There's plenty that need you to write config files yourself, or that require 15 steps configuration process where it's always failed me somewhere.
So, having a software with a gui that doesn't require you to jump into the Terminal times and times again would be a blessing to me, and I bet to many other inexperienced Linux users as well.
I find open-source OS so attractive for many reasons, but at the same time I can't do much because I don't have the technical knowledge for it. Life's really hard as a new user who can't deep dive and learn all the technicalities. (the love-hate relationship is very real - > \^ 3 \^ // = --O)
Maybe, if you can relate in some ways and have more knowledge and free time... the door's open for you to contribute. | 0.57 | t3_tsxyc3 | 1,648,727,281 |
Python | Python in Visual Studio Code – April 2022 Release | 0.9 | t3_tsxkgp | 1,648,725,776 |
|
Python | ^fassert$: Fuzzy assert only data that matters | Hello,
In almost every project I worked on I had a need to fuzzy match (assert) recursively nested structures such as combinations of lists/dicts/tuples/sets etc... If you need to assert some data deep within the nested structures, especially if the position within the list is not known, the complexity can raise quickly with several nested for loops. I always wrote more-or-less the same test fixture to do this kind of thing but figured I am not the only one having this problem so I decided to made this into a small library with emphasis of having 0 dependencies.
The whole library is also implemented in a single file (I would like to keep it that way if possible) so if you don't feel like installing something from pypi you can just copy paste the content into your pytest fixtures and start using it straight away.
Source code: [https://github.com/SourceCode-AI/fassert](https://github.com/SourceCode-AI/fassert) | 0.61 | t3_tswigu | 1,648,721,347 |
Python | An A Markov-Chain Twitter bot trained on Elon Musk Tweets and Childrens Books | Ever wondered what would happen if Elon Musk started quoting childrens books halfway through his Tweets? Wonder no longer!
Github: [https://github.com/FlynnOwen/elon-markov-chain-twitter-bot](https://github.com/FlynnOwen/elon-markov-chain-twitter-bot)
Twitter: [https://twitter.com/elonstorybot](https://twitter.com/elonstorybot) | 0.82 | t3_tsvexj | 1,648,716,375 |
Subsets and Splits