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-nbxmpp 2.0.6 out! | 0.6 | t3_tpi6fh | 1,648,381,174 |
|
Python | Backtesting A Put Option With An Example Of A Sell Put | Here's a simple post for people looking to try to backtest a put option strategy, or even a sell put strategy. I did this up because I was trying to look at a stock with a favorable put premium, and wanted to see based on a historical basis what are the chances of profit if I kept selling puts on these underlying at that premium
[https://medium.com/@derivativestester/backtesting-a-vanilla-put-option-or-warrant-on-python-eec3ebaea5b](https://medium.com/@derivativestester/backtesting-a-vanilla-put-option-or-warrant-on-python-eec3ebaea5b)
Hope that helps.
Thanks. | 0.87 | t3_tpggqk | 1,648,373,495 |
Python | I made a Python program that AUTOMATICALLY edits YouTube Videos! | https://youtu.be/WYiKb5Ggtjc | 0.9 | t3_tpgeiw | 1,648,373,209 |
Python | I've created a extension for the Tornado framework that makes working with the framework easier and code development faster. | The extension is located in the [PyPi](https://pypi.org/project/usernado/) and you can easily install and use it. But the documentation and doc strings are not complete. This can be a good starting point if you want to [participate in open source](https://github.com/reganto/Usernado/issues).
Install it via pip: `pip install usernado`
Check it out here: [https://github.com/reganto/usernado](https://github.com/reganto/Usernado)
Thank you for your attention. | 0.74 | t3_tpfzq3 | 1,648,371,196 |
Python | Using Python and Django, I've built to a GPT-3 powered web application to help myself write better | I am good in writing in my native language but when it comes to my second language, sometimes I struggle. So, for this reason, using Python and Django, I've built to a GPT-3 powered web application to help myself write better.
I've been using it for a while and it is working so good!
[https://www.youtube.com/watch?v=mfzW-LDajog](https://www.youtube.com/watch?v=mfzW-LDajog)
Looking forward to your feedback.
Best, | 0.5 | t3_tpb1qd | 1,648,349,987 |
Python | I made my first gui program! | I finally made a gui using tkinter. Its a super simple program that takes in an image and then makes it into text art using the braille unicode characters. You can specify the final dimensions of the characters. Also you can control how sensitive it is. Seemed like a fun thing to try!
Not many ive told have been interested or understood so I thought I should try here.
[https://imgur.com/gallery/kMth4Cn](https://imgur.com/gallery/kMth4Cn)
For those curious Ill explain my process
I use tkinter to make a menu with all the settings and when you click generate it runs my image algorithm
The algorithm is pretty simple and uses pillow
Using pillow I get an image and convert it to black and white
Then I use two for loops to go through the grid of data. It starts and the 0,0 pixel. It then grabs a 2 wide and 3 tall chunk of values. If the values are above the contrast value they are then set to a 1, else its a 0.
Then I reorganize the list of values of a chunk into a binary number. This is because the unicode counts up in binary. So once i arrange all the numbers to their binary number. I just convert that number to the unicode character. Then i save that chunk to a list. I do this for ever chunk on that layer. It then moves down and repeats until we have a matrix of braille characters.
Finally it just prints those arrays to a txt file
The image kinda depends on how the text is displayed. On windows its inconsistent based on the zoom, certain levels of zoom cause distortions.
Sorry if this didn't make sense I tried my best to explain for those interested. Thank you for reading! | 0.84 | t3_tpak0x | 1,648,348,186 |
Python | Tools for designing hardware in Python | Any hardware designers here who use Python for designing hardware? There are a bunch of libraries that all seem promising [MyHDL](https://www.myhdl.org/), [PyRTL](https://github.com/UCSBarchlab/PyRTL), [PyVerilog](https://github.com/PyHDI/Pyverilog), [PyLog](https://github.com/hst10/pylog), [PyMTL3](https://github.com/pymtl/pymtl3), ... All seem to work roughly the same. Write code in Python and transpile it to VHDL/Verilog. Which of these are popular and well-maintained? MyHDL looks good but it's last release was 0.10 in 2018 and for hardware design you don't want to rely on 0.x software. Anything like Chisel for Python. | 0.72 | t3_tpa4eo | 1,648,346,641 |
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. | 1 | t3_tp7ye1 | 1,648,339,210 |
Python | Live video to ascii | Hi!
​
First time posting, this is a small passion project which I coded in my free time.
[https://github.com/DSERIOUSGUY/whoami.git](https://github.com/DSERIOUSGUY/whoami.git)
It basically converts Image/live video to ascii art (can save as Image or text) using openCV.
Currently it does not save video and only supports black/white and white/black coloring(my initial goal was to make it look a bit retro - if that makes any sense).
I would love to hear your suggestions on how it could be improved on and what features could be added!
Edit: Attached are samples of all modes (all are captured at different moments)
​
[Video](https://preview.redd.it/19cpror02tp81.png?width=602&format=png&auto=webp&s=dd17430640f30d8c886c6ff79b42551a95de7841)
Since I don't really care about latency for an image, higher resolution is used as compared to video.
[Image](https://preview.redd.it/f5ufsr6g2tp81.png?width=1920&format=png&auto=webp&s=c8a52f4e27abdba583f2001d535e16bc19b6c1f5)
​
A higher resolution image spreads out too much to be viewed as a picture, so had lower the resolution before writing the file
[Text](https://preview.redd.it/9vb45izl2tp81.png?width=1920&format=png&auto=webp&s=ae36fb691f1ca9734b48cc3bdcc7ea36ae5f7f28) | 0.78 | t3_tp684n | 1,648,333,884 |
Python | toolgui: A modular event-driven GUI system for quickly building tools with Python and pyimgui. | 0.86 | t3_tp50ru | 1,648,331,504 |
|
Python | Arcade version 2.6.13 has been released | Arcade, a 2D graphics library, has released version 2.6.13.
[https://api.arcade.academy/en/latest/development/release\_notes.html](https://api.arcade.academy/en/latest/development/release_notes.html)
​
* New Features
* Arcade can now run in headless mode on linux servers **opening more possibilities for users in for example the data science** community ([\#1107](https://github.com/pythonarcade/arcade/issues/1107)). See [Headless Arcade](https://api.arcade.academy/en/latest/advanced/headless.html#headless) for more information.
* Bugfixes
* The random text glitching issue especially affecting users with iGPUs is finally resolved in pyglet. For that reason we have upgraded to the pyglet 2.0a2 release.
* Fixed an issue causing [arcade.draw\_circle\_filled()](https://api.arcade.academy/en/latest/api/drawing_primitives.html#arcade.draw_circle_filled) and [arcade.draw\_circle\_outline()](https://api.arcade.academy/en/latest/api/drawing_primitives.html#arcade.draw_circle_outline) to always render with 3 segments on some iGPUs.
* Fixed an issue causing interactive widgets to unnecessarily re-draw when hovering or pressing them. This could cause performance issues.
* SectionManager’s on\_show\_view
was never called when showing a view
* Various Improvements
* [arcade.load\_font()](https://api.arcade.academy/en/latest/api/text_pyglet.html#arcade.load_font) now supports resource handles
* [PhysicsEngineSimple](https://api.arcade.academy/en/latest/api/physics_engines.html#arcade.PhysicsEngineSimple) can now take an iterable of wall spritelists
* Sprite creation is now \~6-8% faster.
* Removed warning about missing shapely on startup
* Window titles are now optional. If no window title is specified the title will be the absolute path to the python file it was created in. This was changed because of the new headless mode.
* Removed arcade.quick\_run
. This function had no useful purpose.
* Added clear method to UIManager ([\#1116](https://github.com/pythonarcade/arcade/pull/1116))
* Updated from Pillow 9.0.0 to 9.0.1
* Tilemap
* Rectangle objects which are empty(have no width or height) will now be automatically converted into single points.
* The Tile ID of a sprite can be access with sprite.properties\["tile\_id"\]
. This refers to the local ID of the tile within the Tileset. This value can be used to get the tile info for a given Sprite created from loading a tilemap.
* Docs
* Added python version support info to install instructions ([\#1122](https://github.com/pythonarcade/arcade/pull/1122))
* Fixed typo in [append\_texture()](https://api.arcade.academy/en/latest/api/sprites.html#arcade.Sprite.append_texture) docstring([\#1126](https://github.com/pythonarcade/arcade/pull/1126))
* Improved the raycasting tutorial ([\#1124](https://github.com/pythonarcade/arcade/issues/1124))
* Replace mentions of 3.6 on Linux install page ([\#1129](https://github.com/pythonarcade/arcade/pull/1129))
* Fix broken links in the homepage ([\#1139](https://github.com/pythonarcade/arcade/pull/1130))
* Lots of other improvements to docstrings throughout the code base
* General documentation improvements
* OpenGL
* [arcade.gl.Geometry](https://api.arcade.academy/en/latest/gl/geometry.html#arcade.gl.Geometry) now supports transforming to multiple buffers.
* Added and improved examples in experimental/examples
* Major improvements to API docs
Special thanks to [Mohammad Ibrahim](https://github.com/Ibrahim2750mi), [pushfoo](https://github.com/pushfoo), [Alejandro Casanovas](https://github.com/janscas), [Maic Siemering](https://github.com/eruvanos), [Cleptomania](https://github.com/Cleptomania), [pvcraven](https://github.com/pvcraven) and [einarf](https://github.com/einarf) for their contributions to this release. Also, thanks to everyone on the Pyglet team! We depend heavily on Pyglet’s continued development. | 0.88 | t3_tp4o3d | 1,648,330,422 |
Python | Why is Python so popular? | I am sorry if this is provocative to anyone, but personally I can't stand Python. I hate the indentations, Python is slow, no private keyword in OOP, dynamically typed ...
Obviously I can see that it has its reasons to be popular in certain areas like data science. But why in the world in the backend for production level code? Please actually explain to me why you think Python is great from a software engineering perspective. I am coming from C# and simply cannot see any advantages in Python. | 0.28 | t3_tp3od4 | 1,648,327,393 |
Python | Space Science with Python - AI 1-9: A Convolutional Approach | Hey everyone,
the asteroid reflectance spectra project reaches almost its end. There are 5 more videos to come and then I will focus on another topic (Near-Earth Objects).
Anyway, spectra are still amazing and I show in today's session how to conduct an ML multi-class classification experiment using keras and Conv1D layers.
You may thing: "well... creating a Deep Learning architecture is like magic". You are right. A few blueprints help one to get an idea how an architecture may look like. But improving e.g., the number of filters, layers, activations functions etc. is something that MUST be automatized. To tackle this, the next session will show "Keras Tuner" to automatize exactly this!
Hope you still enjoy the combination of Space - Python - ML and I am looking forward to chat with you either here or on [Twitter](https://twitter.com/MrAstroThomas).
GitHub: [https://github.com/ThomasAlbin/Astroniz-YT-Tutorials/blob/main/%5BML1%5D-Asteroid-Spectra/9\_dl\_convnet\_multiclass.ipynb](https://github.com/ThomasAlbin/Astroniz-YT-Tutorials/blob/main/%5BML1%5D-Asteroid-Spectra/9_dl_convnet_multiclass.ipynb)
YouTube: [https://www.youtube.com/watch?v=648XF1o0B3c](https://www.youtube.com/watch?v=648XF1o0B3c)
Cheers,
Thomas | 0.67 | t3_tp0vo1 | 1,648,322,880 |
Python | Show r/python: Sailor - a tiny PaaS to install on your servers/VPS that uses git push to deploy micro-apps, micro-services, sites with SSL, on your own servers or VPS | Hey Pythonistas, here's a tool that I would like to share with y'all that allows you deploy multiple apps on servers/VPS. Let me know what you think and some feedback or what you would like to see in it.
Introducing, Sailor. [https://github.com/mardix/sailor](https://github.com/mardix/sailor)
**Sailor** is a tiny **PaaS** to install on your servers/VPS (DigitalOcean, Hetzner, Linode).
It uses git push to deploy micro-apps, micro-services and sites.
It natively supports Python, Nodejs, Static sites, and any other languages that can use the command line.
Sites deployed with **Sailor** automatically have SSL assigned with LetsEncrypt.
**Sailor** can run long-running background workers and cron jobs.
It allows you to deploy multiple sites/apps using a single repository.
It gives you the option of having testing/staging/production environment deployed from the same codebase.
**Sailor** lets you see some stats about your apps, along with scaling them.
**Sailor** makes deploying apps a smooth sailing.
*Ship it like a* ***Sailor!***
[https://github.com/mardix/sailor](https://github.com/mardix/sailor) | 0.67 | t3_tozhrt | 1,648,318,743 |
Python | Interview with a Postdoc, Junior Python Developer in 2022 | 0.93 | t3_toy9gu | 1,648,315,157 |
|
Python | What is the most pythonic way to limit while loop iterations? | Hi all
Whenever I write a while loop, I always want to limit the number of iterations it can run to avoid infinite loops while developing the program, what would the most pythonic way of doing that?
theres obviously the basic
n = 0
while condition and n < 100:
n += 1
but the `n+=1` can easily get lost or commented out when you are working on the code
Ive also tried
def count_generator():
n = 0
while True:
yield n
n += 1
counter = count_generator()
while condition and next(counter) < 100:
or
class Counter:
def __init__(self):
self.count = 0
def inc(self):
self.count += 1
return self.count
counter = Counter()
while condition and counter.inc() < 100:
both of these feel like a lot of boiler plate for what should be a simple task, is there anything better? | 0.8 | t3_towbf7 | 1,648,311,909 |
Python | Image Processing With the Python Pillow Library – Real Python | 0.82 | t3_tov052 | 1,648,310,781 |
|
Python | oCrypt0r - AES encryption library | Hello everyone!
I have decided to for the first time, try my hand at making an encryption package/library. It uses salted AES encryption.
As of right now, I'm not sure what else to add to it or do as I have everything pretty much covered in terms of what could be encrypted. From just normal messages/strings to files and directories/folders.
I hope you all like it or at least get some use out of it!
Here is my github repo and PyPi link:
- [GitHub - oCrypt0r](https://github.com/therealOri/oCrypt0r)
- [PyPi - oCrypt0r](https://pypi.org/project/oCrypt0r/) | 0.6 | t3_tosyou | 1,648,308,863 |
Python | PIPELY - new lightweight pipeline library | hey there, just released a new version of `pipely` \- a lightweight pipeline library that can trigger any sequence of classes in any order.
# Simple Example:
create `collect.yaml`
steps:
a1_print:
exec: src/file1.py:firstA
a2_print:
exec: src/file1.py:secondA
final_print:
exec: src/file2.py:printDone
depends_on:
- a1_print
- a2_print
`depends_on` parameter sets the following order for pipely:
1. firstly it parallelly executes `firstA` and `secondA` classes (`a1_print` and `a2_print` steps) from file `src/file1.py`
2. and then executes `printDone` class (step `final_print`) from file `src/file2.py`
It also allows **value transformations** between classes and other cool things.
Check out [https://pypi.org/project/pipely/](https://pypi.org/project/pipely/) for more info, and let me know your feedback!
This is just a pet project I had during my free lunch time :) | 0.73 | t3_tosvcq | 1,648,308,584 |
Python | Simple Key Event Sending to an Application Wrapper I made | I made a Python library to send inputs to an executable, useful for scenarios such as having a neural network send decisions to a game. Essentially a wrapper around the win32api.
You can send events to a window in just 2 lines:
hwnd = pyinput.get_handle(window_name) # Gets the handle
pyinput.press_key(hwnd, pyinputkeycodes.VK_RETURN) # Sends Return key
I got annoyed at doing boilerplate over and over for this so I made a quick library!
[https://github.com/GaryFrazier/PyInput](https://github.com/GaryFrazier/PyInput) | 0.71 | t3_toryjt | 1,648,305,770 |
Python | Encrypto - A simple way of complicating/encrypting data | This is a repost I made to fit community guidelines.
*Meet Encrypto, a revolutionary technology that can protect your data from the government **(Joke Intended)** and prevent the Feds from understanding your text.*
The code itself does a simple task. When asked to encrypt data, it will generate two random keys. One till be used for the Caesar Cipher offset and the other defines how many times the symmetric algorithm is run. This will give out a gibberish looking string, which is then converted into a BrainF\*\*k *like* looking code. Wrong keys during decryption will give you the erroneous data.
Note that since each character is encoded with 8-characters, and that the Base64 encryption happens multiple times, file size may skyrocket.
I visualized this concept a long time ago, but spent some months completely understanding Python and the logic required (Encryption types, etc.). This code was designed to mimic the Enigma machine with its separate codes for different encryption types.
Here's the link to the code:
https://github.com/Programmer-X31/Encrypto.git
Please give me your comments and give your ideas for what I should base the *third key* on. | 0.68 | t3_tonad8 | 1,648,296,993 |
Python | Creating mp4 clips with soccer data and Python | Hi Pythonistas! I’ve updated my package to allow users to creat mp4 clips of soccer data. Here is the short tutorial I wrote up on how to use it: https://todofootballclub.com/?p=1056.
I’ve also run into an issue of wanting to use latitude and longitude data in the future but realized there is a learning curve with trans Mercator projections and other things to do it. I’m curious if anyone has ever started a project and realized ‘oh wow, there’s more to this than I thought’? | 0.9 | t3_tomsiv | 1,648,295,093 |
Python | NiceScaler update 1.3.0 | &#x200B;
[GUI](https://preview.redd.it/gogk3hgavop81.png?width=2790&format=png&auto=webp&s=31396204dac0bb003f7ff7920a4c4555bf15109c)
[example upscale](https://preview.redd.it/q9nwpoz8vop81.jpg?width=2486&format=pjpg&auto=webp&s=955eb9817ddc84a6d9392b00cf67d11b35577253)
Itch -> [https://jangystudio.itch.io/nicescaler](https://jangystudio.itch.io/nicescaler)
Github -> [https://github.com/Djdefrag/NiceScaler/releases/tag/1.3.0](https://github.com/Djdefrag/NiceScaler/releases/tag/1.3.0)
&#x200B;
update 1.3.0 (26.03.2022)
OpenCL backend / UX improvement / Speed improvement
New feature
* GPU OpenCL backend (to use GPU horsepower to upscale)
* support for more images and video file types
Improvements
* updated Python (3.7.9 -> 3.9.10)
* bugfix in AI model creation (speed boost \~10% with all models)
* deleted EDSR model (lighter .exe 110Mb -> 70Mb)
* general code cleanup
UX
* deleted EDSR model button
* new colors for left bar
* new button to select OpenCL backend
* removed AI models info under buttons
* removed NiceScaler icon
* added Github button
* drag&drop space cleaning | 0.94 | t3_tok71u | 1,648,283,523 |
Python | The Oregon Trail | How many have ever played The Oregon Trail? I remember playing it in my later days of High School. Not the video game but the teletype version. I just ported over the original version from Fortran to Python.
If you want to read out the different parts of the port or even get the source here are some links:
[https://keithmfoster.com/the-oregon-trail/](https://keithmfoster.com/the-oregon-trail/)
[Github Repository](https://github.com/KeithMFoster/the-oregon-trail)
Happy Trails. | 0.93 | t3_toa6c6 | 1,648,256,653 |
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_to8lbi | 1,648,252,810 |
Python | What's the dumbest, trivial, shoddily-written project you've made that somehow impressed a non-programmer? | I wrote a script that grabs an Overwatch screenshot, tries to recognize whatever hero portraits are present on the tab screen, then copies some text making hero suggestions into your clipboard. I'm 90% certain that the one person in the hiring process that sounded impressed when I mentioned it didn't actually look at it, because I got hired to try automating website tests with Selenium.
(Note: I've long since taken this script down as it's in kind of a grey area with Blizzard's TOS) | 0.93 | t3_to8jhz | 1,648,252,736 |
Python | AI Project Ideas | Hi everyone,
I need to make an AI project with full-fledged programming ... it has to be based on a social issue nd focused mainly on the data science domain. Does anyone have any suggestions for an idea that can be implemented using AI? I'm open to anything as it's a group project and we're mainly putting forth any ideas right now at the start and will start ruling out to a final within a few days | 0.82 | t3_to33to | 1,648,246,367 |
Python | pointers.py - segmentation faults in python | 0.67 | t3_tnz5uw | 1,648,242,515 |
|
Python | Kids Learn to Code in Python with the Raspberry Pi Foundation | 0.85 | t3_tnw8zx | 1,648,234,236 |
|
Python | I've built a wrapper that makes building Telegram Bots a lot easier | It's called **MATE** (*Easy Telegram Application Maker*, but reversed lol) and it automatically handles the boring under the hood stuff, letting you focus on the logic of your app.
It comes with (fairly) complete **documentation** & a **PyPI** release.
check it out here: [https://github.com/SudoOmbro/MATE](https://github.com/SudoOmbro/MATE)
Tell me what you think!
Thank you for your time :\^) | 0.81 | t3_tnsarp | 1,648,229,199 |
Python | I Made a Hangman Game with Music, Light Artwork, and Sound Effects (GitHub Repo Below) | As my first python project, I decided to create a hangman game with music, light artwork, and sound effects.
After completing PY4E on Coursera, I decided to create a program that combined all elements from the course. In all, it uses urllib for web scraping, sqlite3 to create and manage the leaderboard and wordbank, colorama for color, and playsound for sound.
There are also "Classic" and "Hardcore" modes. Classic operates as hangman traditionally works, and hardcore mode gives the user 8 seconds for input before subtracting a life and adding a part to the hangman.
I started python in January, and it feels great to have actually created something!
Here is the Github link: [https://github.com/DaSaltyPancake/Hangman.git](https://github.com/DaSaltyPancake/Hangman.git) | 0.89 | t3_tns9go | 1,648,229,099 |
Python | A free and flexible translation library in python | Hi y all,
*I'm not making this post only to promote the project. I also want to invite contributors and get feedback.*
Feel free to check the GitHub [repo here](https://github.com/nidhaloff/deep-translator)
deep-translator is a flexible and **free** translation library that supports multiple translators.
I tried to make the API as consistent as possible so that it can be updated easily in the future. We fixed some bugs and added new features in the new releases.
Since I don't have much time, I'm looking for maintainers & contributors, who want to join the project. Feel free to contact me if you are interested. You don't have to be a python professional, I want to help people make their first contribution and join the open-source world. | 0.83 | t3_tnp85j | 1,648,224,421 |
Python | GitHub - Rog3rSm1th/Frelatage: The Python Fuzzer that the world deserves | 0.43 | t3_tnovr2 | 1,648,223,456 |
|
Python | Python Selenium Tutorial #6 - Bypass Detection using plugins, settings & proxies | 0.83 | t3_tnmxy8 | 1,648,217,926 |
|
Python | Python - LinkedIn Skill Assessments Quizzes with Answers | MeshWorld | 0.36 | t3_tnljc5 | 1,648,213,623 |
|
Python | Python Pub/Sub | Let's see how far this rabbit hole goes. It's late evening. I started reading up on networking. It's 2am. Let's see how Redis implements pub/sub under the hood. Basically, I ended up writing my own pub/sub implementation in Python:
[https://github.com/Salaah01/py-pub-sub/blob/master/server/server.py](https://github.com/Salaah01/py-pub-sub/blob/master/server/server.py)
&#x200B;
https://i.redd.it/u867y09txip81.gif | 0.6 | t3_tnkxf3 | 1,648,211,635 |
Python | Value objects with Python | Hello r/Python
This is my first post here.
I created a blog post about value objects with Python.
[https://blog.szymonmiks.pl/p/value-objects-with-python/](https://blog.szymonmiks.pl/p/value-objects-with-python/)
&#x200B;
Code examples are available on my GitHub [https://github.com/szymon6927/szymonmiks.pl/tree/master/blog/content/post/06-value-objects-with-python/value-object-examples](https://github.com/szymon6927/szymonmiks.pl/tree/master/blog/content/post/06-value-objects-with-python/value-object-examples).
I hope you will enjoy it. I would love to hear your opinion | 0.6 | t3_tnk6p3 | 1,648,209,000 |
Python | Ethereum Price Email Alerts With Python | 0.11 | t3_tnjf86 | 1,648,206,202 |
|
Python | Reactivex like operators that can be used directly on async iterables | I'm a fan of the [operators](https://rxpy.readthedocs.io/en/latest/reference_operators.html) available in ReactiveX. I'm not a fan of observables, and all the other cruft that comes with using reactivex. I would much rather be writing async generators, and using them in async for loops.
So I've started writing a library that implements the operators typically found in Reactivex libraries, and I'm posting it here for some early feedback.
Source: [https://github.com/garyvdm/aiterx](https://github.com/garyvdm/aiterx)
Example:
>>> from asyncio import run, sleep
>>> from aiterx import debounce
>>>
>>> async def source():
... yield 1
... await sleep(0.2)
... yield 2
... await sleep(0.1)
... yield 3
... await sleep(0.1)
... yield 4
... await sleep(0.2)
... yield 5
...
>>> async def test_debounce():
... async for item in debounce(source(), 0.15):
... print(item)
...
>>> run(test_debounce())
1
4
5
Have I missed some existing library that does what I need? I did looked at these before I started:
* [rxpy](https://rxpy.readthedocs.io/en/latest/)
* [aioreactive](https://github.com/dbrattli/aioreactive)
* [async-rx](https://geronimo-iia.github.io/async-rx/)
Any feedback on the work I have done so far? | 0.88 | t3_tnifu4 | 1,648,202,004 |
Python | Scrape Google Top Carousel Results in Python | Full code:
```python
import requests, lxml, re, json
from parsel import Selector
# https://docs.python-requests.org/en/master/user/quickstart/#custom-headers
headers = {
"User-agent":
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.83 Safari/537.36"
}
params = {
"q": "dune actors", # search query
"gl": "us", # country to search from
}
def parsel_get_top_carousel():
html = requests.get('https://www.google.com/search', headers=headers, params=params)
selector = Selector(text=html.text)
carousel_name = selector.css(".yKMVIe::text").get()
all_script_tags = selector.css("script::text").getall()
data = {f"{carousel_name}": []}
decoded_thumbnails = []
for _id in selector.css("img.d7ENZc::attr(id)").getall():
# https://regex101.com/r/YGtoJn/1
thumbnails = re.findall(r"var\s?s=\'([^']+)\'\;var\s?ii\=\['{_id}'\];".format(_id=_id), str(all_script_tags))
thumbnail = [
bytes(bytes(img, "ascii").decode("unicode-escape"), "ascii").decode("unicode-escape") for img in thumbnails
]
decoded_thumbnails.append("".join(thumbnail))
for result, image in zip(selector.css('.QjXCXd.X8kvh'), decoded_thumbnails):
title = result.css(".JjtOHd::text").get()
link = f"https://www.google.com{result.css('.QjXCXd div a::attr(href)').get()}"
extensions = result.css(".ellip.AqEFvb::text").getall()
if title and link and extensions is not None:
data[carousel_name].append({
"title": title,
"link": link,
"extensions": extensions,
"thumbnail": image
})
print(json.dumps(data, indent=2, ensure_ascii=False))
```
Blog post with more explanation: https://serpapi.com/blog/scrape-google-carousel-results-with-python/ | 0.81 | t3_tngota | 1,648,193,728 |
Python | Build a Word Guessing Game in Python [video + source code] | Here is the link for the video :
[https://youtu.be/M1t4RJ5XRHE](https://youtu.be/M1t4RJ5XRHE)
Here is the link for the source code :
[Word-Guessing-Game/wordgame.py at main · The-Nerdy-Dev/Word-Guessing-Game (github.com)](https://github.com/The-Nerdy-Dev/Word-Guessing-Game/blob/main/wordgame.py) | 0.8 | t3_tngfjr | 1,648,192,532 |
Python | Build your own Feature Rich J.A.R.V.I.S in Python - Python Project | 0.67 | t3_tngd7q | 1,648,192,249 |
|
Python | Meta donates $300,000 to the Python Software Foundation | 0.91 | t3_tnfh9l | 1,648,188,306 |
|
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! | 1 | t3_tn96gz | 1,648,166,410 |
Python | Python for AWS Lambda Functions: A Beginner's Guide and Tutorial | [https://codesolid.com/python-and-aws-lambda-functions](https://codesolid.com/python-and-aws-lambda-functions/)
I just finished this -- it's very much focused on Python developers who may not have written an AWS Lambda function before and are wondering what all the fuss is about. Enjoy! | 0.83 | t3_tn7qfv | 1,648,162,106 |
Python | A simple python3 script to keep 2 folders synced | Hi r/Python, I'm here today to showcase a project that I've developed to experiment with python, github, ci/cd best practices and pytest.I'm not really a beginner, I've been coding in python for a while now (I'm a junior GCP developer). This post is just a request for feedback and/or suggestion on how to improve from more experienced python developers. Here is the repo : [https://github.com/davideolgiati/raidify](https://github.com/davideolgiati/raidify), feel free to open an issue on bug and suggested enhancements. | 0.8 | t3_tn733z | 1,648,160,259 |
Python | Guido van Rossum on Twitter: It's happening! BPO is migrating to GitHub tomorrow. | 0.95 | t3_tn4lyj | 1,648,155,805 |
|
Python | Is Spock-Config the only tool that integrates object-oriented config files and command-line interfaces? | [Spock-Config](https://github.com/fidelity/spock) allows one to create OO configuration files. That's how I roll. I currently use [PYdantic settings](https://pydantic-docs.helpmanual.io/usage/settings/) and it's great. But it does not offer command-line re-configuration of what you have in the OO config file.
Sure you could manually do all the mappings yourself. But that's why I like spock.
What I dont like about Spock is that [there is already another PyPI package with that same top-level-namespace](https://github.com/fidelity/spock/issues/235) ... why does PyPI even allow that? What would I do if I wanted to use both in the same project???
### So somebody rock my world
Tell me about an alternative. [Plumbum](https://plumbum.readthedocs.io/en/latest/cli.html) kinda-sorta fits the bill.... but it really is just OO CLI development. | 0.67 | t3_tmz4yi | 1,648,150,974 |
Python | Performance: SQLAlchemy vs Django vs EdgeDB | 0.66 | t3_tmqev6 | 1,648,143,624 |
|
Python | IDE-style autocomplete that integrates with Python tools (pip, pyenv, etc) | &#x200B;
https://reddit.com/link/tmleui/video/r3kh3f0pycp81/player | 0.82 | t3_tmleui | 1,648,139,283 |
Python | Github - Multiplatform (arm7, arm64, amd64) Docker Image for Celery with precompiled gevent | 0.75 | t3_tmcp8z | 1,648,131,220 |
|
Python | Animating a Sprite Sheet in Python w/ PyGame | 0.8 | t3_tmbg9f | 1,648,129,996 |
|
Python | How to create a digital clock with python easily | This tutorial is about creating a project using python language. I’m going to show you how to create a digital clock with Python. Before reading the article, if you like to know more about Python, you could check out these two important articles:
* [Why should I learn Python?](https://progskillss.com/why-should-i-learn-python)
* [How to learn Python?](https://progskillss.com/how-to-learn-python-programming)
This project is suitable for beginners. To write the code, you need to know how to use modules in Python. Two necessary modules that I use in this project are Tkinter and time. Tkinter is a GUI library that helps you develop a graphical user interface for the digital clock, and using the time module; you could get the current time, date, timezone, etc. Let’s dive deep into these modules.
If you want to read more about this project, you could click on the following link:
[https://progskillss.com/how-to-create-a-digital-clock-with-python](https://progskillss.com/how-to-create-a-digital-clock-with-python) | 0.54 | t3_tmabdm | 1,648,128,741 |
Python | OpenTelemetry and Python: A Complete Instrumentation Guide | A blog post exploring how to instrument a Python application to emit tracing data (metric and log data interfaces are not stable quite yet). It examines:
* How auto-instrumentation of the same codebase works.
* The differences with manual instrumentation.
* How to mix manual instrumentation with auto-instrumentation.
* How to add information about exceptions.
Here's the link: [https://www.timescale.com/blog/opentelemetry-and-python-a-complete-instrumentation-guide/](https://www.timescale.com/blog/opentelemetry-and-python-a-complete-instrumentation-guide/) | 0.92 | t3_tm8jte | 1,648,127,261 |
Python | Web2py Framework in Python | 0.6 | t3_tm3sxx | 1,648,121,398 |
|
Python | Tree Traversal Algorithms in Python-InsideAIML | 0.85 | t3_tm3jvl | 1,648,120,520 |
|
Python | Scientific computation using NumPy library | 0.43 | t3_tm30b4 | 1,648,118,458 |
|
Python | Learn Python yield interactively from your browser! | 0.67 | t3_tm2yyc | 1,648,118,307 |
|
Python | RaViewer: parsing and displaying binary data straight from camera (made with Dear PyGui) | &#x200B;
[RaViewer screenshot](https://preview.redd.it/6e3n26fe7bp81.png?width=1220&format=png&auto=webp&s=9163087922bf30b0038e173e9290d6b56fa9f586)
[RaViewer demo](https://i.redd.it/s4m2bmsa7bp81.gif)
[RaViewer](https://github.com/antmicro/raviewer) is an open-source utility dedicated to parsing and displaying binary data acquired straight from camera. After opening a binary image, you can specify the color format, the image size and append or remove n bytes from the beginning of the image series. The binary image will be processed and shown based on these values. You can control which color channels are displayed and zoom in and out. For detailed information, you can view the hexadecimal pixel values in table format. The resulting image can be exported entirely or just a selected part to more complex formats (JPEG, PNG) or raw data. The source code is available in the project's [GitHub repository](https://github.com/antmicro/raviewer).
You can read more about RaViewer in this [article](https://antmicro.com/blog/2021/11/raviewer-open-source-tool-for-debugging-video-pipelines/) by [antmicro](https://antmicro.com/).
Made with Python and the GUI was created with [Dear PyGui](https://github.com/hoffstadt/DearPyGui/wiki/Dear-PyGui-Showcase). | 0.92 | t3_tm2wb6 | 1,648,118,019 |
Python | httpx worked fine for me... any reason to consider urllib3? | I've found [httpx](https://www.python-httpx.org/) to be very approachable for my API consumption tasks and less wordy than [urllib3](https://urllib3.readthedocs.io/).
Do you have a preference for API consumption (perhaps requests) and why? | 0.73 | t3_tm1grs | 1,648,111,891 |
Python | I created a Python Script to find out Broken links by scanning entire WordPress Website | I created a Python script to check links in all the WordPress posts to find out broken ones. I tried creating this after learning multi-threading based, I had this idea for so long because other broken link checking software such as SiteBulb and ScreamingFrog take very long time (\`24 hours) to crawl a one of my websites (having around 28000 posts). So, instead of crawling, I used WordPress API and this way it is much faster.
I will modify it later to do the same thing for non-WordPress website, by analyzing the sitemap.
It goes through all the posts one by one from WordPress API, extract all the URLs from <a> tag and then checks their status by making a HEAD request.
404 and other status codes are recorded. If the HEAD request fails, then name of the exception class is recorded.
Finally, save the report in CSV file.
[wpbroken script in action](https://preview.redd.it/30t209zd0ap81.png?width=1366&format=png&auto=webp&s=1ad89fc845ee0e77ee20197b0a887301b46f9748)
GitHub Gist: [wpbroken.py](https://gist.github.com/ilovefreesw/fa763e1f84cd9f7101dc4816e293beda) | 0.92 | t3_tlzj7n | 1,648,103,526 |
Python | 5 Python Libraries for Automating OSINT Operations | 0.91 | t3_tlz7q5 | 1,648,102,201 |
|
Python | Tutorial on GPU-based ray-casting with Python |
If you are interested in doing 'shadows' for a 2D game, here's a tutorial:
[https://api.arcade.academy/en/development/tutorials/raycasting/index.html](https://api.arcade.academy/en/development/tutorials/raycasting/index.html)
https://preview.redd.it/fd1dyzmoi8p81.png?width=1200&format=png&auto=webp&s=92fd25296d83102fd08e5d8f21b59d5d07c2e80f | 0.94 | t3_tlsb8q | 1,648,085,480 |
Python | Including packages in project | I've been working on project for a raspberry pi, which I've been writing on my PC in Pycharm, and SSHing over to my pi. What's the best way to move the whole project over, including the dependencies? Been just manually adding them on the pi and realized there has to be a better way.
Thanks! | 0.67 | t3_tlp1vn | 1,648,082,311 |
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.67 | t3_tlmt0a | 1,648,080,009 |
Python | Coin toss probability | import random
from collections import Counter
import itertools
##method for coin toss
def cointoss():
rand_i = random.randint(0, 1)
outcomes = ["Heads", "Tails"]
#outcomes = [0,1]
return outcomes[rand_i]
#create list
list=[]
##Number of coin tosses
n=3
##calls method and adds to the list
for i in range(0, n):
t1 = cointoss()
list.append(t1)
print(list)
Counter(list)
print(Counter(list))
##compare previous coin tosses with the last
for index, i in enumerate(list):
for j in list[index+1:]:
print("list item i "+str(i))
print("list item j " + str(j))
if i==j:
print("Same")
else:
print("Not the same")
&#x200B;
I'm trying to edit this code so that it outputs the number of times a certain side occurs in a row.
&#x200B;
So for example, a person makes ten coin toss, how many times does heads occur three times or two times in a row.
&#x200B;
Any suggestions on how to edit it? | 0.44 | t3_tlkryn | 1,648,077,791 |
Python | Can we get hired just to do EDA’s in Python ? Exploratory Data Analysis using libraries- | I’ve been relatively new to Datascience, spent couple of years with sql, r, python, power BI & tableau.. I’ve specifically loved getting involved with EDA’s - what do you guys think ? | 0.33 | t3_tli7e4 | 1,648,073,230 |
Python | Where will Python be in the Web3 space? | Hi guys, I noticed that there are two prominent libraries for web3 applications: [web3.py](https://web3.py) and web3.js . After doing some searching online, I have found there is some preference for web3.js over [web3.py](https://web3.py). Does this mean that Python might be obsolete in Web3? | 0.32 | t3_tlhee1 | 1,648,072,417 |
Python | Pants 2.10: Multiple Python lockfile support, PyOxidizer, Thrift codegen, and better linter parallelization | 0.8 | t3_tlgwka | 1,648,071,777 |
|
Python | Programming community for freetime team projects | The problem:
I started learning programming 3 year ago, partly in university, partly at home, and built a few larger projects since then. I have a lot of new ideas for projects, which are fun, but could also be profitable if done right. The problem is the scale of these imagined projects is too large to handle them all by myself. Hiring developers doesn't feel like a solution for me. I would love to build projects together with other "advanced" programmers and exchange ideas, learn from each other, inspire each other. But how do I find people who are interested aswell?
The Solution:
A more private, trustbased community of developers, who have time and energy to contribute unpaid work to programming projects. People could share and discuss ideas, group together in teams and start projects. Also if there is an intention to turn projects profitable teams could determine at the beginning how profits will be shared. I imagine this community as a discord server right now, but could be something else of cause.
&#x200B;
\-Does anyone know if a community like this exists somewhere?
\-If no are there people here interested in starting a discord server to fill this purpose?
&#x200B;
Thanks for reading and greetings from Hamburg, Maxim | 0.67 | t3_tlg6u2 | 1,648,070,961 |
Python | Custom BurpSuite extensions in Python: recreating Cloud2Butt | 0.72 | t3_tlg281 | 1,648,070,801 |
|
Python | Text Similarity w/ Levenshtein Distance in Python | 0.67 | t3_tldsug | 1,648,068,506 |
|
Python | Mail merge in python | I have a excel/CSV data where in a single customer has multiple orders in different lines. Can I generate a list of text files in which each customer's multiple orders are present. Much like a invoice copy. Any clues on how to do this is highly appreciated ...
PS ... I am learning python | 0.8 | t3_tl9dbz | 1,648,063,812 |
Python | i created a game controller using Arduino touch sensor and python | 0.5 | t3_tl3raq | 1,648,057,722 |
|
Python | Creating a Python CLI with Go(lang)-comparable startup times | Hi Folks.
I recently put some effort into creating a command line interface (CLI) made with Python.
Background: I started a new project called Gefyra, a tool for local application development directly with Kubernetes. Check it out the website [https://gefyra.dev](https://gefyra.dev) or have a glance at the code [https://github.com/gefyrahq/gefyra/tree/main/client](https://github.com/gefyrahq/gefyra/tree/main/client)
I'd like to have an executable with (almost) the startup performance of `kubectl` (the executable to control a Kubernetes cluster). That means, I need fast startup times (which is crucial for a CLI) and ideally just one file (which is statically-linked) for easy distribution. In addition, I’d like to provide executables for Windows, MacOS and Linux. For those requirements people would usually go for Go (needless to say it's awesome), however I started out with a prototype written in Python and it evolved over time. So I tried to find a way to make this work with Python.
I went the following way:
1. PyInstaller: [https://pyinstaller.readthedocs.io/en/stable/](https://pyinstaller.readthedocs.io/en/stable/)
2. Nuitka: [https://nuitka.net/](https://nuitka.net/)
3. PyOxidizer: [https://pyoxidizer.readthedocs.io/en/stable/](https://pyoxidizer.readthedocs.io/en/stable/)
**PyInstaller**
PyInstaller was quite easy to set up. However, the resulting executable was complained about by Virustotal (see: [https://www.virustotal.com/gui/home/upload](https://www.virustotal.com/gui/home/upload)) because of PyInstaller's bootloader. Somehow the code signature was also found in viruses (lol). To workaround this I compiled a bootloader myself which at least removed the virus issues.
On MacOS I faced startup times of more than 10 s with internet connection and about 3 s without internet connection. Interestingly, the former docker-compose command was also created from PyInstaller and Mac users complained about the startup performance, too: [https://github.com/docker/compose/issues/6956](https://github.com/docker/compose/issues/6956) :)
I didn’t find much to improve. The concept of PyInstaller will potentially always be a problem for fast startup times (which IMHO makes it unsuitable for CLI applications).
**Nuitka**
With Nuitka, I generated very large binaries of about 150 Mb. The startup performance was already much better than PyInstaller for Mac and Linux. However, I was not completely satisfied and very long compile times bothered me a little bit (about 10 min).
**PyOxidizer**
I ended up using PyOxidizer. This well-crafted toolkit compiles Python to Rust code and also includes all dependencies into one handy binary executable. With no special optimizations I saw startup times of about 700 ms. That is almost acceptable, though I wanted to go a little further.
I started to examine the output of `python -X importtime -m gefyra 2> import.log` just to check the imports. There is an awesome tool to analyze the Python imports: tuna (see: [https://github.com/nschloe/tuna](https://github.com/nschloe/tuna)). `tuna` allows analyzing the import times from the log. Run it like so `tuna import.log`. It opens a browser window and visualizes the import times. With that I was able to manually move all imports to the functions in which they are needed (and bring in some other optimizations). This greatly violates PEP 8 ([https://peps.python.org/pep-0008/#imports](https://peps.python.org/pep-0008/#imports)) but leads to very fast startup times.
These are the startup values I finally reached with `gefyra` under average modern Ubuntu:
> python -m timeit "__import__('os').system(gefyra)"
10 loops, best of 5: 33.5 msec per loop
Pretty neat, isn’t it?
In comparison the `kubectl` executable:
> python -m timeit "__import__('os').system('kubectl')"
10 loops, best of 5: 24.9 msec per loop
In addition, I created GitHub actions to run the PyOxidizer builds once a new version is released (see: [https://github.com/gefyrahq/gefyra/blob/main/.github/workflows/dist-build-linux.yaml](https://github.com/gefyrahq/gefyra/blob/main/.github/workflows/dist-build-linux.yaml)). Only Windows is missing at the moment.
Although, PyInstaller and Nuitka did not deliver the best startup times, I would not say it's bad software. They probably shine at other aspects.
I hope these insights can be useful for someone else, too. | 0.82 | t3_tl3jwz | 1,648,057,171 |
Python | “Like it or not, it’s going to be primarily up to Python devs to crush the business side’s dreams AI can magically make their company better.” The CTO of an AI company explains why AI can be a waste of time and resources at most companies primarily because it’s retrofitted onto existing products. | 0.91 | t3_tkyuz8 | 1,648,052,349 |
|
Python | Minos Demo - Stocks Index Wallet with Microservices | 1 | t3_tkv9ax | 1,648,045,935 |
|
Python | Python Timer Functions: Three Ways to Monitor Your Code – Real Python | 0.8 | t3_tkv08a | 1,648,045,223 |
|
Python | The top 5 advanced Python highly rated free courses On Udemy with real-world projects. | Hello,
&#x200B;
[Top 5 Python free courses](https://preview.redd.it/9p3qq8gacbp81.png?width=1024&format=png&auto=webp&s=b225e18de619f201c4aa711d229a72b5a7704aa2)
**The top 5 Python highly rated free courses On Udemy with real-world projects.**
[Course1: Applied Deep Learning Build a Chatbot Theory And Application.](https://www.udemy.com/course/applied-deep-learning-build-a-chatbot-theory-application/)
[Course2: Master Data Analysis with Python Intro to Pandas.](https://www.udemy.com/course/master-data-analysis-with-python-intro-to-pandas/)
[Course3: Machine Learning Crash Course for Beginners.](https://www.udemy.com/course/easy-machine-learning/)
[Course4: The Art of Doing Video Game Basics with Python and Pygame](https://www.udemy.com/course/the-art-of-doing-video-game-basics-with-python-and-pygame/).
[Course5: Master Data Analysis with Python – Selecting Subsets of Data.](https://www.udemy.com/course/master-data-analysis-with-python-selecting-subsets-of-data/)
The Courses List:
[https://netslovers.com/2022/03/17/advanced-python-free-courses-udemy/?feed\_id=277&\_unique\_id=623390a11ddad](https://netslovers.com/2022/03/17/advanced-python-free-courses-udemy/?feed_id=277&_unique_id=623390a11ddad)
I hope you found this post helpful. | 0.87 | t3_tkuqsi | 1,648,044,502 |
Python | (I think) I stress tested matplotlib for real-time graping. | &#x200B;
[Matplotlib Stress Test](https://i.redd.it/x3xvfvmeq4p81.gif)
It can run at 60 FPS if you push it to its limits, which is more than I need.
There are occasional hiccups, but I think it's fine.
I am developing a simple GUI for an open-source DAQ module called [PlainDAQ](https://www.crowdsupply.com/kuncu-teknoloji/plaindaq). Before I start, I decided to stress test it to see if it can handle fast changing waveforms.
I think this is pretty enough for my application
Here is the [code](https://github.com/AlperenAkkuncu/PlainDAQ/blob/main/Development/GUI/sinewave_stress_test.py)
**What more can I do to make it smoother? One guy in eevblog suggested me to look into garbage collection. What are your opinions?** | 0.79 | t3_tkt5v8 | 1,648,039,696 |
Python | Python Generators | 0.72 | t3_tksmex | 1,648,037,852 |
|
Python | Bloxs: display your data in an attractive way in your notebook | Hi, I would like to share with you a small python package that I've created to display data in a notebook in an attractive way. The package is called `bloxs` and is available on GitHub https://github.com/mljar/bloxs
The package can display as a block following data:
- number with the title
- progress bar
- chart (can be a line, stepped line, bar)
What is more, there can be several blocks displayed in one row.
The implementation is very simple, there is only one class, called `B`. It displays a single block or row of blocks. Each object of the `B` class has the `_repr_html_()` method that returns the HTML with a block.
A very basic example:
from bloxs import B
B(1234, "Bloxs in a notebook!)
The package works with Jupyter Notebook, Google Colab, Deepnote, and Kaggle.
I hope you find it useful and it will help you to create beautiful dashboards, reports, and apps directly from the notebook. | 0.74 | t3_tkrlom | 1,648,034,233 |
Python | How To Automate Your Statistical Data Analysis | 0.75 | t3_tkpe69 | 1,648,024,528 |
|
Python | The Right Way to Compare Floats in Python | 0.78 | t3_tkp7wz | 1,648,023,709 |
|
Python | Spotify LED Matrix | I created an LED matrix that takes your currently playing spotify song and displays it to an led panel. It uses a raspi 0w to create one thread to get data from the spotify api, and another to update the board. The code is rough around the edges, but I hope y'all enjoy it!
Demo:
https://reddit.com/link/tkp0xt/video/56ihrzuzb3p81/player
Repo: [https://github.com/Evan-Nishi/spotify-panel-client](https://github.com/Evan-Nishi/spotify-panel-client) (stars would be appreciated :D) | 0.9 | t3_tkp0xt | 1,648,022,796 |
Python | Yet another simple wordle searcher | It is a script that will help narrow down the list of possible solutions to a wordle puzzle. In the end, you still have to use your grey matter, and, depend on luck. It scrapes data from Lou Hevly's website (which provides a regex search functionality). And then it applies some simple filtering algorithms on the results.
Script & docs: [https://gist.github.com/deostroll/6014bd0cf3cc4b0a22894d0981cacddc#file-wordle\_search-py](https://gist.github.com/deostroll/6014bd0cf3cc4b0a22894d0981cacddc#file-wordle_search-py)
[2 minute video](https://www.youtube.com/watch?v=Js2DNbNynw4), where I am thinking a lot, but eventually defer to the script for help...But in the video I had used selenium/msedge. Later decided to use python requests and beautifulsoup...that is whats shared above... | 0.57 | t3_tkoi7q | 1,648,020,431 |
Python | Wednesday Daily Thread: Beginner questions | New to Python and have questions? Use this thread to ask anything about Python, there are no bad questions!
This thread may be fairly low volume in replies, if you don't receive a response we recommend looking at r/LearnPython or joining the Python Discord server at [https://discord.gg/python](https://discord.gg/python) where you stand a better chance of receiving a response. | 0.67 | t3_tkgwne | 1,647,993,608 |
Python | Flask web blog | Some days ago i made a Blog based-on Flask, it lets you add a custom password, username, upload small comments with HTML and it has a basic user authentication system!
I called it "comments" (because of it's feature, it let's you to post small text with custom HTML) [https://github.com/ZSendokame/comments](https://github.com/ZSendokame/comments)
&#x200B;
I wan't ideas and/or feedback about how to improve it!
Bye | 0.87 | t3_tkgecq | 1,647,992,128 |
Python | I Created a Visualization Package for Soccer | I’ve put my package on PyPi. The world of sports analytics, at least for soccer, is restricted. I wanted to learn how to analyze a game but found a large lack of data. Even worse, a lack of applications. I decided to creat my own Python package and help educate the public through my website. I’ve made a YouTube tutorial to help others get started as well.
https://youtu.be/tZlrULiN26E
The PyPi package is todofcpy | 0.57 | t3_tkgccb | 1,647,991,972 |
Python | Meta deepens its investment in the Python ecosystem | 0.95 | t3_tkedpx | 1,647,986,506 |
|
Python | I made bubble slort. I dont think it looks clean but it works. Comments both in Polish and English | Here is image and link
[https://github.com/bibi100101/Bubble-Sort](https://github.com/bibi100101/Bubble-Sort)
https://preview.redd.it/t1oni4fc60p81.png?width=1920&format=png&auto=webp&s=76703d2816371f63a113f7d32130aa0cfaae37de
Showcase
Translation:
\-Lista Wcześniej = list before
\-Lista Pozniej = list after
https://preview.redd.it/cnqeybzq60p81.png?width=1359&format=png&auto=webp&s=e7f108267104423cdcc723689deb5d4b2c4953e9 | 0.5 | t3_tkdp7o | 1,647,984,659 |
Python | Declarative command line parser library [Heated Arguments] | I was trying out a bunch of different command line parser libraries recently and wanted to see if I could take a different approach. I have a proof of concept for a command line parser that let's you define parameters and sub-commands in a declarative way.
I have a repository with a couple demo scripts to show what the interface looks like and I was hoping to get some feedback if it looks interesting enough that I should keep developing it. Thanks!
https://github.com/mjcaley/heated | 0.72 | t3_tkcfmu | 1,647,981,274 |
Python | Today i released a small package called geoiter. Used for web scraping | # geoiter
iterates the planet.
**edit**
A simple tool to iterate coordinates within given boundaries.
The usage is mostly for querying/searching by location.
Geoiter provides many locations within a boundary, like a country.
Let's say Germany has in sum 5000 houses to sell. Then most platforms will only allow you to visit the first 200 houses.
Now to get the others, you need to dissect the big boundary area into smaller ones.
And this is where geoiter provides you with coordinates
you can find the source on
[https://github.com/cloasdata/geoiter](https://github.com/cloasdata/geoiter)
**/ edit**
&#x200B;
https://preview.redd.it/vlzva9z6rzo81.png?width=665&format=png&auto=webp&s=72c8ebf635d7ae8ec3bfcbf1f74217fd53065daf
**geoiter** can be used for web scraping to utilize geo/location queries:
&#x200B;
&#x200B;
https://preview.redd.it/kdypecx8rzo81.png?width=1590&format=png&auto=webp&s=930cb8c7837bb1b1d9a80718b12538c713f229b0
In many cases the web page restrict the result items to a fixed number. With geoiter you can now dissect this one query to a many location queries to relax the result density under the restriction limit.
geoiter has only one additional dependency called [haversine](https://pypi.org/project/haversine/).
## install
pip install geoiter
## usage
import pickle
from geoiter.util.ressource_example import germany
from geoiter import GeoIter
# get you boundary for example
with open(germany, "rb") as file:
germany = pickle.load(file)
# prepare
gi = GeoIter(
boundary=germany,
radius=100,
comp_rate=20
)
if __name__ == "__main__":
# plot them as example
for coordinate in gi:
print(coordinate)
## speed
one may consider that geo data have mb of coordinates. Which may make the this iteration very slow, because it needs to look up coordinates in the boundary often. To accelerate the **geoiter** provides a very simple compressor and uses bisect instead of list iteration. However, it still can be slow.
## extensions
There two extensions which give additional help
pip install geoiter["gpx]
provides you with an gpx exporter.
pip install geoiter["plot"]
provides a plotting function to visualize the grid.
## data
get boundaries from osm or others sources like
* [https://www.geoboundaries.org/](https://www.geoboundaries.org/)
* [https://osm-boundaries.com/](https://osm-boundaries.com/)
* ... | 0.94 | t3_tkbqms | 1,647,979,432 |
Python | Directories in Python |
Directories in Python
https://youtu.be/Qip7MToDr18
\#python #python3 #directories #os #PythonProgramming #tutorial #PythonForResearchers | 0.1 | t3_tkb40y | 1,647,977,755 |
Python | Top 5 Benefits of Python Web Development That You Need to Know | 0.29 | t3_tk9o0p | 1,647,973,886 |
|
Python | I made a tutorial on How to convert Images to ASCII using pygame | Hi everyone! I have been looking at various image filtering libraries, and some of them have image to ASCII filters. So I thought, why not make it using pygame?
Tutorial can be found [here](https://www.youtube.com/watch?v=oEacnqQgE4A)
Source code can be found [here](https://github.com/tank-king/Tutorials/tree/main/Python%20Pygame/image_to_ASCII)
&#x200B;
[Image to ASCII](https://i.redd.it/7zvoo287azo81.gif) | 0.89 | t3_tk9jqo | 1,647,973,579 |
Python | Scrape Google Scholar Profiles from a certain University in Python | 0.75 | t3_tk8itk | 1,647,970,895 |
|
Python | Text editors are stupid, change my mind | WHAT is the point of text editors for Python? Sure, they make you code faster but why not choose the standard IDLE? I mean, PyCharm never helped me. It always made a simple project too complicated to save. SO WHY CHOOSE TEXT EDITORS? | 0.08 | t3_tk7umy | 1,647,969,075 |
Python | Running a live 45-minutes session on the fundamentals of observability, OpenTelemetry, and distributed tracing in Python | Hi everyone, there's a live OpenTelemetry and observability fundamentals session - Wednesday, March 30 at 11 AM PST.
**You will learn how to instrument your apps to capture traces with OpenTelemetry in Python.**
This session is at no cost and vendor-neutral.
You can expect in this session: 45 minutes of core concepts, how to deploy it yourself hands-on + Q&A.
If you are interested in observability, OpenTelemetry, and tracing - this is the place to be!
Register here [https://www.aspecto.io/get-started-with-opentelemetry/](https://www.aspecto.io/get-started-with-opentelemetry/?utm_source=post&utm_medium=reddit&utm_campaign=r-python-opentelemetry-workshop-pyhon-march-30-2022) | 0.72 | t3_tk71j6 | 1,647,966,912 |
Python | We developed a Python tool to generate a map of your embedded or edge distributed system | Hi guys, we recently developed a Python tool that allows you to generate and visualize a map of your embedded or edge distributed system. With the open-source project r/Luos, we are trying to code and make accessible CI/CD for these systems.
Is this feature useful for your needs?
&#x200B;
[Routing Table Luos](https://preview.redd.it/r66ib7hniyo81.png?width=570&format=png&auto=webp&s=d0d8c32b52d368c8d92a2e62e3dca49c77aced25) | 0.77 | t3_tk69zo | 1,647,964,904 |
Subsets and Splits