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 | 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 |
Python | If an exception is raised but not handled would the process definitely stop/crash? I have seen some programs that keep printing stack trace to cli but don't crash and keep trying. | EDIT: thanks i think i got my answer.
```py
while True:
try:
something_that_raises_exception()
except as e:
logger.error(e)
``` | 0.87 | t3_tsux1z | 1,648,714,032 |
Python | Print Emoji's using Python. | 0.38 | t3_tsusc7 | 1,648,713,463 |
|
Python | Real Time Speech Recognition | 0.83 | t3_tst6rj | 1,648,706,438 |
|
Python | Demo for game made with Pygame | 0.91 | t3_tssu7d | 1,648,705,022 |
|
Python | First Python Application - Blackjack Strategy Trainer - Seeking Feedback | Hi everyone! I just finished my initial beta for a blackjack training simulator. The application helps the user practice basic blackjack strategy. If you check it out and have some feedback for improvement, I would love to hear it! Thanks and enjoy!
&#x200B;
[https://github.com/lrassbach/blackjack-training-simulator/releases](https://github.com/lrassbach/blackjack-training-simulator/releases) | 0.78 | t3_tsrmiu | 1,648,700,446 |
Python | I made a utility library for downloading Wikimedia Data Dumps for analysis | I created a small utility library that exposes the directory structure of Wikimedia’s data dump site (and its mirrors).
It includes a method to easily download and decompress data dumps using Python’s built in libraries - this proved to be an especially difficult problem because the data dumps are sometimes several times larger than the system’s memory.
[Source code here.](https://github.com/jon-edward/wiki_dump) | 0.83 | t3_tsq2c8 | 1,648,695,137 |
Python | Tuple Reuse Quirks | I was testing tuple reuse today and noticed some strange behavior. If you run all the code below together as a script, 1) a and b have different IDs, as do c and d; but when you enter them in the interpreter line by line: 2) a and b have the same IDs, 3)c and d have the same IDs.
Of the 3 observations, only 2) matches my expectation based on my understanding of tuple reuse, which is that Python moves tuples with fewer than 20 items to a "free list" after their reference count reach 0, (to make them available for potential reassignment later)
Could someone explain why 1) and 3) happen? Thank you!
`a = (1,2,3)`
`print(id(a))`
`del a`
`b = (1,2,3)`
`print(id(b))`
&#x200B;
`c = (4,5,6)`
`print(id(c))`
`del c`
`d = (7,8,9)`
`print(id(d))` | 0.75 | t3_tso711 | 1,648,689,060 |
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.84 | t3_tsmv9p | 1,648,684,810 |
Python | Python or R? | I searched some differences but not found definite answer. So, I ask you. Which one is better for business?
My company has over 3 million customer and tons of data expectedly. I will study in a different department after 3 or 2 years later and it will be about data analysis of costumers. Which one should I start with? Python or R? | 0.3 | t3_tsjvib | 1,648,676,061 |
Python | Pollen Robotics' Reachy VR Digital Twin in Python (proof of concept) | Demonstration of a **"Reachy"** **digital twin** in **virtual reality**, based on **Python** and **HARFANG**.
The goal of this P.O.C is to demonstrate that a simple digital twin of an existing robot can be implemented in less than 500 lines of **Python**. This digital twin shows a **VR** experience that could serve to bootstrap a **tele-operation** project :
\- the user can see what the robot sees, using the 3D simulation in **virtual reality**
\- the user can move his hands around, the **arms** of the **robot** will follow
\- it helps to test the **challenge** of a tele-operation process
The robot in this demonstration is a **Reachy, developped by the French company Pollen Robotics**.
The physics & inverse kinematic solver is handled by PyBullet.
The VR is simulated by HARFANG 3D.
[https://www.youtube.com/watch?v=TBAjNGPpMfc](https://www.youtube.com/watch?v=TBAjNGPpMfc) | 0.84 | t3_tsjsaf | 1,648,675,816 |
Python | pymac: Install and manage macOS Python.org installers from the command line | 0.99 | t3_tsjhe7 | 1,648,675,001 |
|
Python | A simple Snooker 3D game in Python | Hi there,
I would like to share a tiny **game** project all made in **Python** : a **Snooker simulator.**
The gameplay is rather limited, as the aim of this project is to focus on the simulation aspect : how to produce a realistic snooker physics, with a visual rich enough to be on part with nowadays standards ?
To reach this goal, this project relies on 2 major **features** :
\- a **physics** engine, running at high frequency to handle the friction of the balls
\- a **3D rendering** engine, with 2 quality modes, the highest quality mode including realtime reflections and radiosity (doesn't require a RTX GPU).
I hope you folks will enjoy the project, can **learn** from it and maybe be turn it into something bigger!
[https://github.com/harfang3d/snooker-python-hg2](https://github.com/harfang3d/snooker-python-hg2) | 0.89 | t3_tsixth | 1,648,673,568 |
Python | Introducing Slap: A CLI to assist in the Python development process | I would like to share a project with you that I have been working on and actively using for over 1.5 years to streamline my day-to-day tasks developing Python projects. I use Slap tens to hundreds of times a day and would not want to miss it anymore.
**Slap streamlines Python development tasks**
>[Slap](https://niklasrosenstein.github.io/slap/) is a command-line tool to assist in the development of Python projects independent of the [PEP 517](https://peps.python.org/pep-0517/) build backend being used, capable of managing single- and multi-project repositories.
Among the things that Slap can do, here is a short selection:
* Perform development installs of your project (even for Poetry projects)
* Manage local & global virtual environments
* Bump version numbers (not just in `pyproject.toml`)
* Publish to PyPI
* Manage structured changelogs in TOML format
* All while capable of handling mono-repositories that consist of more than one Python project
*--- Check out the* [*Getting started*](https://niklasrosenstein.github.io/slap/getting-started/) *page in the documentation to get a more in-depth look into what Slap can do for you. ---*
**Slap seems similar to the Poetry CLI, what's different?**
Some people might find this similar to tools like Poetry, and while there is some overlap in functionality, Slap is **not a build backend** and is more targeted towards library development. Most of my projects use Poetry as the build backend but I never even once interact with the Poetry CLI throughout the lifetime of the project.
The most notable differences to Poetry are
* Slap supports mono-repositories (i.e. multiple related Python projects in the same repository), to the extent that it bumps version numbers of project inter-dependencies and installs your projects in topological order
* Slap supports development installs independent of the build backend (yes; this means you can install Poetry packages in editable mode even though the Poetry backend right now does not support editable installs)
* Slap's version bump command (`slap release`) updates the version not just in your `pyproject.toml` but also the `__version__` in your source code as well as in related projects (see mono-repositories above) and any additional references you can configure via Regex patterns
* Slap does not automagically create a virtual environment for you when installing your project(s); instead, it errors when you try to install into a non-virtual Python environment and gives you an easy-to-use tool to create and activate virtual environments (and allowing multiple environments per project as well as global environments)
* Slap uses Pip to install your project(s), unlike Poetry which comes with its own dependency resolver and package installer (which I have been having a lot of issues with in the past).
* Slap does not have a concept of lock files
**Ideas / Suggestions / Contributions**
Slap is currently very opinionated by the fact alone that I built it as my personal workflow tool, but I welcome suggestions and contributions, and I am hopeful it will be useful to a wider audience than myself.
**Links**
* Documentation: [https://niklasrosenstein.github.io/slap/](https://niklasrosenstein.github.io/slap/)
* GitHub: [https://github.com/NiklasRosenstein/slap](https://github.com/NiklasRosenstein/slap)
* PyPI: [https://pypi.org/project/slap-cli/](https://pypi.org/project/slap-cli/)
**Edit**: I've added an in-depth [Getting started](https://niklasrosenstein.github.io/slap/getting-started/) guide to the documentation. | 0.84 | t3_tsgavg | 1,648,669,463 |
Python | Python Tutorial - How to create a Screen Recorder using Python? | Hey Everyone! I created a short Python Tutorial explaining how I created a Screen Recorder using Python.
[https://www.youtube.com/watch?v=449c5lsGKKw](https://www.youtube.com/watch?v=449c5lsGKKw)
https://preview.redd.it/ro2g0wc5hkq81.png?width=2880&format=png&auto=webp&s=649c062e96554d29b4348c07eb076a767b3d929b | 0.74 | t3_tsdftv | 1,648,666,101 |
Python | [GUI] DyCall - Run exported functions from dynamic libraries | 0.75 | t3_tsdcn8 | 1,648,665,866 |
|
Python | I Created a Simple Pushup Counter Using Mediapipe Python | 0.77 | t3_tsb1mf | 1,648,659,632 |
|
Python | Any good Machine learning udemy courses ? | I recently took python course and I’m learning python I want to get into machine learning and ai is there any good udemy courses for this? I see an A-Z machine learning course but is it good ? If anyone has taken it can you tell me what it exactly teaches you or does it just skip important points thanks | 0.71 | t3_ts9m9n | 1,648,655,819 |
Python | Scrape Google Scholar Metrics Results to CSV with Python | Full code:
```python
import requests, lxml
from bs4 import BeautifulSoup
import pandas as pd
def scrape_all_metrics_top_publications():
params = {
"view_op": "top_venues", # top publications results
"hl": "en" # or other lang: pt, sp, de, ru, fr, ja, ko, pl, uk, id
}
# https://docs.python-requests.org/en/master/user/quickstart/#custom-headers
# whatismybrowser.com/detect/what-is-my-user-agent
headers = {
"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.88 Safari/537.36"
}
html = requests.get("https://scholar.google.com/citations", params=params, headers=headers, timeout=30)
soup = BeautifulSoup(html.text, "lxml").find("table")
df = pd.DataFrame(pd.read_html(str(soup))[0])
df.drop(df.columns[0], axis=1, inplace=True)
df.insert(loc=2,
column="h5-index link",
value=[f'https://scholar.google.com/{link.a["href"]}' for link in soup.select(".gsc_mvt_t+ td")])
df.to_csv("google_scholar_metrics_top_publications.csv", index=False)
# save to csv for specific language
# df.to_csv(f"google_scholar_metrics_top_publications_lang_{params['hl']}.csv", index=False)
def scrape_all_metrics_public_mandates():
params = {
"view_op": "mandates_leaderboard", # public access mandates results
"hl": "en" # or other lang: pt, sp, de, ru, fr, ja, ko, pl, uk, id
}
# https://docs.python-requests.org/en/master/user/quickstart/#custom-headers
# whatismybrowser.com/detect/what-is-my-user-agent
headers = {
"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.88 Safari/537.36"
}
html = requests.get("https://scholar.google.com/citations", params=params, headers=headers, timeout=30)
soup = BeautifulSoup(html.text, "lxml").find("table")
df = pd.DataFrame(pd.read_html(str(soup))[0])
df.drop(df.columns[[0, 2]], axis=1, inplace=True)
df.insert(loc=1, column="Funder Link", value=[link.a["href"] for link in soup.select("td.gsc_mlt_t")])
df.to_csv("google_scholar_metrics_public_access_mandates.csv", index=False)
# save to csv for specific language
# df.to_csv(f"google_scholar_metrics_public_access_mandates_lang_{params['hl']}.csv", index=False)
```
If you need an in-depth explanation, have a look at [Scrape Google Scholar Metrics Results to CSV with Python](https://serpapi.com/blog/scrape-google-scholar-metrics-results-to-csv-with-python/) blog post at SerpApi. | 0.4 | t3_ts9lzb | 1,648,655,795 |
Python | Building a Full Stack Flask HTMx Application | 0.75 | t3_ts8x51 | 1,648,653,894 |
|
Python | I created 80 Python and Pandas Challenges with Video Solutions | 0.84 | t3_ts8hpw | 1,648,652,727 |
|
Python | Transcribe Speech to Text with Python for Free | 0.67 | t3_ts6whh | 1,648,648,258 |
|
Python | What to expect from Python 3.11? | 0.95 | t3_ts6idv | 1,648,647,068 |
|
Python | GitLab Webhooks [Python and Google Chat Example] | 1 | t3_ts66bz | 1,648,646,050 |
|
Python | I made a video about efficient memory use in pandas dataframes! | 0.96 | t3_ts5mmf | 1,648,644,350 |
|
Python | Create a google account in Python |
I would like to be able to create google account with a python script. I've try with Mechanize but nothing conclusive. Do you have any idea to how to do that ?
I tried with the library Mechanize. I get the first form with:
* FirstName
* LastName
* UserName
* Password
I submit it, but impossible to get the second form... | 0.5 | t3_ts5l04 | 1,648,644,210 |
Python | Python program to find day of any date.(Yes any! from 1000 AD - 9999 AD) | &#x200B;
[Program in action!](https://preview.redd.it/5eorq0mfniq81.png?width=1484&format=png&auto=webp&s=426f40c1b36cd85844c3f1565b8906da58c404f2) | 0.65 | t3_ts5ij2 | 1,648,643,992 |
Python | ABCMeta library to limit derived classes their methods to follow the same signature as the parent | Python metaclass and abstract method library with restrictions.
This library provides a restricted way to validate abstract methods. The Python's default abstract method library only validates the methods that exist in the derived classes and nothing else. What this library provides is apart from that validation it provides validations over the method's signature. All you need is to import ABCMeta and abstractmethod from this library.
[https://github.com/mortymacs/abcmeta](https://github.com/mortymacs/abcmeta) | 1 | t3_ts4ooj | 1,648,641,121 |
Python | Authoring Opportunity: Developing a Python book with Packt Publishing | Hi all,
I am a Product Manager at Packt Publishing.
Packt is a publishing company helping the world put software to work in new ways, through the delivery of effective learning and information services to IT professionals.
We are planning to publish a book on Python to address the challenges and requirements of the Python community.
We are looking for an expert experienced Python developer who could share their valuable insights on the topic and collaborate with us in developing content for a book that we are planning to publish.
If you feel you might be interested in this opportunity please send me a direct message on or before 7th April 2022.
PS: Content development experience in terms of writing a blog or anything else is appreciated but not required. | 0.33 | t3_ts4caw | 1,648,639,896 |
Python | br4nch 1.2.1 - Data Structure Tree Builder for Python. | ***New patch released (1.2.1) that improves alot of features!***
&#x200B;
`br4nch` is created to provide an efficient implementation of tree data structure in ***Python***.
&#x200B;
The **libary** is built on pure python so you don't need **ANY** other libaries.
The amount of features are endless such as: **adding**, **deleting**, **renaming**, **moving**, **copying**, **painting**, **sizing**, **change symbols**, **importing folder structure**, **exporting to txt and br4nch file**, etc..
&#x200B;
*PyPi*: [https://pypi.org/project/br4nch/](https://pypi.org/project/br4nch/)
*Documentation*: [https://docs.br4nch.com/](https://docs.br4nch.com/)
*Github*: [https://github.com/TRSTN4/br4nch](https://github.com/TRSTN4/br4nch) | 0.75 | t3_ts4avc | 1,648,639,752 |
Python | python dictionary comprehension | 0.67 | t3_ts3lg7 | 1,648,637,091 |
|
Python | Do you have experience with stocks prices analysis? | I am about to start a hobby project, mainly for learning and curiosity. I want to analyze stocks data and try to learn some basic concepts about investing and machine learning. The flow should be following:
\- Use some free API to get historic stocks data.
\- Store data in the database (probably PostgreSQL hosted on Heroku).
\- Train neural network to predict stocks prices (here, I have the biggest knowledge gap).
\- Use some free API to get real-time stocks data.
\- Store real-time data in the database.
\- Compare predicted stocks prices with actual stock prices in BI tools like GoodData, or Looker.
I know it is not rocket science, but as I said, my motivation is to learn something new. Before I start, I would like to ask you if you have experience with such a similar project and if there is something you might recommend to me. | 0.71 | t3_ts2ujz | 1,648,633,956 |
Python | How to document python functions? | Link: [https://www.youtube.com/watch?v=fU6qB06rkz0](https://www.youtube.com/watch?v=fU6qB06rkz0) | 0.33 | t3_ts2t1f | 1,648,633,755 |
Python | Froyo: A Python GUI utility for downloading works from Archive Of Our Own/AO3 (made in Python with Dear PyGui): a fast, responsive graphical user interface results in a user-friendly tool | &#x200B;
[Froyo: A Python GUI utility for downloading works from Archive Of Our Own\/AO3 \(made in Python with Dear PyGui\): a fast, responsive and user-friendly tool](https://i.redd.it/xyrdfo9zahq81.gif)
Froyo is a small graphical application for downloading works from Archive Of Our Own (AO3). It supports batch downloading of works to supported formats (AZW3, EPUB, HTML, MOBI, PDF). The app is small, fast and functional, a perfect fit for Dear PyGui. Not every app has to be complex. Sometimes a tool just needs to get the job done. | 0.89 | t3_ts1iat | 1,648,627,758 |