/r/Python

Photograph via snooOG

The official Python community for Reddit! Stay up to date with the latest news, packages, and meta information relating to the Python programming language.

If you have questions or are new to Python use r/LearnPython

News about the dynamic, interpreted, interactive, object-oriented, extensible programming language Python

Current Events

Upcoming Events

Full Events Calendar

Please read the rules

You can find the rules here.

If you are about to ask a "how do I do this in python" question, please try r/learnpython, the Python discord, or the #python IRC channel on Libera.chat.

Please don't use URL shorteners. Reddit filters them out, so your post or comment will be lost.

Posts require flair. Please use the flair selector to choose your topic.

Posting code to this subreddit:

Add 4 extra spaces before each line of code

def fibonacci():
    a, b = 0, 1
    while True:
        yield a
        a, b = b, a + b

Online Resources

Online exercices

programming challenges

Asking Questions

Try Python in your browser

Docs

Libraries

Related subreddits

Python jobs

Newsletters

Screencasts

/r/Python

1,229,296 Subscribers

1

Python Script to crawl data of Facebook Ads

Introducing our latest Python script: the Facebook Ads Scraper! 🚀

Here's what this powerful tool can do for you:

- **Effortless Page Extraction**: Quickly read Facebook pages from a list of URLs.

- **Comprehensive Ad Scraping**: Process each page URL to extract all ads being run.

- **Deep Ad Insights**: Dive into each ad to scrape details and download associated media.

- **Easy Data Organization**: Neatly organize all scraped data into an Excel document for streamlined analysis.

With our Facebook Ads Scraper, uncovering valuable insights from Facebook ad campaigns has never been easier. Say goodbye to manual data collection and hello to automated efficiency! 💻📊

Don't forget to leave your feedback in the comment section below. Your thoughts help us improve! 👍

0 Comments
2024/04/28
10:36 UTC

10

I’m making a lightweight python framework for AI App publishing

Hello everyone,

We are excited to share that after considerable development, our new project is nearing completion. This lightweight Python framework is designed to streamline and accelerate the process of launching your AI applications. Once deployed, your app will be accessible via a public link featuring a chat based user interface.

We are eager to gather your input on this framework. Specifically, we would like to understand the features and capabilities you prioritize when choosing a framework for your projects.

If you are interested in early access, we invite you to join our waitlist for the private beta. You can sign up here: https://cycls.typeform.com/waitlist/

We look forward to your feedback and are keen to incorporate your insights as we refine this tool. Thank you for your interest and support.

0 Comments
2024/04/28
09:30 UTC

14

TypeIs does what I thought TypeGuard would do in Python

While it's unfortunate to have two constructs—TypeGuard and TypeIs—with slightly different behaviors, I'm glad that the latter is less surprising.

https://rednafi.com/python/typeguard_vs_typeis/

1 Comment
2024/04/28
03:32 UTC

1

I made Tkinter "DevTools" to inspect and modify widgets in your running app in real-time

What my project does

Formation debugger is a tool in Formation-studio (a cool drag-n-drop Tkinter GUI designer also made by me) that allows one to hook into running Tkinter applications, inspect the widget hierarchy, and modify properties and layouts all in real-time. It even includes a console allowing you to trigger events, monitor logs and just about anything you can think of doing. To put it simply, it's sort off like Chrome DevTools but for Tkinter.

Target Audience

  • Tkinter beginners who want to learn how the framework works through experimentation
  • Tkinter experts trying to figure out why a widget deep in the hierarchy of a complex application isn't acting right
  • Tkinter developers who are tired of having to modify and run code a million times just to get everything looking right

Comparison

I don't think there exists anything else that does this but correct me if I'm wrong.

Usage

It comes bundled with Formation Studio so the installation is as simple as

pip install formation-studio

To use it use the command

formation-dbg /path/to/your/tk/app.py

In the embedded python REPL console you can access a simple debugger API as follows:

# Access all widgets currently selected
widgets = debugger.selected 

# Access the root widget usually a Tk object
root = debugger.root

It is still a work in progress and may be a little buggy.

Technical details

Since the debugger has to hook into an arbitrary application without interfering with it, the debugger UI, also written in Tkinter, runs on a separate process. There is therefore tons of IPC to be conducted to get the whole thing working. The code on this is new and may be unclean but still interesting to look at. The code for this tool is under studio/debugtools in the Formation studio source.

You can also see the demo Video in another Reddit post

1 Comment
2024/04/27
17:07 UTC

0

Share Proejct: NLLB-200 Distill 350M en-ko

Hello ,

I'm excited to share a project that was initially intended to use in my graduating product(Capstone)

What My Proeject Does

I made NLLB-200 Distill 350M model to translating English to Korean

Target Audience

GPU servers are quite expensive, so I made it for university students who can't cost the server (like me.)

Comparison

It's even smaller and faster the other NLLB-200 model. so it can be run with CPU!

more details are in my page

If you know Korean, please give me a lot of feedback

https://github.com/newfull5/NLLB-200-Distilled-350M-en-ko

thank you!!

0 Comments
2024/04/28
01:39 UTC

0

Sunday Daily Thread: What's everyone working on this week?

Weekly Thread: What's Everyone Working On This Week? 🛠️

Hello /r/Python! It's time to share what you've been working on! Whether it's a work-in-progress, a completed masterpiece, or just a rough idea, let us know what you're up to!

How it Works:

  1. Show & Tell: Share your current projects, completed works, or future ideas.
  2. Discuss: Get feedback, find collaborators, or just chat about your project.
  3. Inspire: Your project might inspire someone else, just as you might get inspired here.

Guidelines:

  • Feel free to include as many details as you'd like. Code snippets, screenshots, and links are all welcome.
  • Whether it's your job, your hobby, or your passion project, all Python-related work is welcome here.

Example Shares:

  1. Machine Learning Model: Working on a ML model to predict stock prices. Just cracked a 90% accuracy rate!
  2. Web Scraping: Built a script to scrape and analyze news articles. It's helped me understand media bias better.
  3. Automation: Automated my home lighting with Python and Raspberry Pi. My life has never been easier!

Let's build and grow together! Share your journey and learn from others. Happy coding! 🌟

5 Comments
2024/04/28
00:00 UTC

47

Are PEP 744 goals very modest?

Pypy has been able to speed up pure python code by a factor of 5 or more for a number of years. The only disadvantage it has is the difficulty in handling C extensions which are very commonly used in practice.

https://peps.python.org/pep-0744 seems to be talking about speed ups of 5-10%. Why are the goals so much more modest than what pypy can already achieve?

25 Comments
2024/04/27
21:02 UTC

6

ArchiveFile: Unified interface for tar, zip, sevenzip, and rar files

What My Project Does

archivefile is a wrapper around tarfile, zipfile, py7zr, and rarfile. The above libraries are excellent when you are dealing with a single archive format but things quickly get annoying when you have a bunch of mixed archives such as .zip, .7z, .cbr, .tar.gz, etc because each library has a slightly different syntax and quirks which you need to deal with. archivefile wraps the common methods from the above libraries to provide a unified interface that takes care of said differences under the hood. However, it's not as powerful as the libraries it wraps due to lack of support for features that are unique to a specific archive format and library.

Target audience

Anyone who's using python to deal with different archive formats

Comparison

  • ZipFile, TarFile, RarFile, and py7zr - These are libraries that mine wraps since each of them can only deal with a single archive format
  • shutil - Shutil can only deal with zipfile and tarfile and only allows full packing or full extraction.
  • patool - Excellent library that deals with wider range of formats than mine but in doing so it provides less granular control over each

ArchiveFile falls somewhere between the powerful dedicated library and the far less powerful universal libaries.

Links

Repository: https://github.com/Ravencentric/archivefile Docs: https://ravencentric.github.io/archivefile

3 Comments
2024/04/27
20:14 UTC

50

Pure Python Physics Engine

What My Project Does The Physics Engine Called PhysEng, provides an easy to use environment and visualization combo in which to try out different physics or even provide a template to design your own accelleration/velocity fields. Besides the visualization aspect and numpy the basic functions of the Engine are written completely in 100% python. The features included in the Engine are:

  • Particles, Soft Bodies, Anchor points
  • Built in Fields: Drag, Uniform Force Fields, Gravity Between Particles, Octree Gravity etc
  • Make your own: There are standard templates included in the Examples to design your own fields
  • Springs - Construct Soft Bodies using Springs. (Built in soft bodies: Cloth and ball

Target Audience PhysEng is made for people who just want to try out different simple simulations or want to design their own physics.

Comparison Looking through github I could never really find a simple and easy-to-use library that did not require me to install some weird libraries or that felt like it was hiding some process from me through using packages. This package is a solution to this since everything is written in python nothing is a secret and can be directed easily.

Get PhysEng There is full documentation available in the Github repo: https://github.com/levi2234/PhysEng

4 Comments
2024/04/27
19:24 UTC

1

Cross platform python3 shebang

There is no shebang line that actually works across platforms for python 3.

I would like one that works on unmodified :

  • Debian shell (Dropped python2, falls under PEP 394)
  • Older Linux shells that still have python pointing to python2 (PEP 394)
  • Windows cmd.exe shell (this really just means one that will work with PEP 397)
  • Gitbash for Windows (sort of a weird half sibling that respects shebangs)

The best work around I have found is:

  • use #!/usr/bin/env python3
  • on Windows copy python.exe to python3.exe
    • Then make sure both are in your path for unix-like shells.
  • Debian make sure python-is-python2 or python-is-python3 is installed, in case you come upon a #!/usr/bin/env python.

As Windows adopts more and more Unix-like behavior, and more distros drop python2, having completely different "portability" rules is going to become a larger problem.

A significant compatibility enhancement would be if the official python packages for Windows just included a python3.exe to comply with PEP 394. This could be a copy of python.exe like my workaround, or one could be a minimal executable that just hands off to the other or to py.

An alternative would be adding py and pyw from PEP 397 to PEP 394. and having people move to the shebang #!/usr/bin/env py -3.

The belt and suspenders compatibility approach is all platforms should have a py, pyw, and python3 executable that can launch python3 scripts if requested. And python should be an executable than runs some version of python.

I am curious what others are using out there? Do others launch python scripts from inside gitbash? do you have a seperate window for running the script and git actions? Are you manually choosing the python executable on the command line?

3 Comments
2024/04/27
18:44 UTC

54

In what way do you try out small things when developing?

I've noticed at work that my coworkers and I try out small things in different ways. Small things like if you want to try that adding two datetimes together behaves in the way you expect. Some people use jupyter notebook for this and others run python interactively in a separate command prompt.

I usually run debug in whatever IDE I'm using and then letting it stop at the code I'm currently developing and then using the debug console to test things out. Sometimes this means just leaving the debugger at a breakpoint for half an hour while I continue writing code. Is my way of doing it weird or does it have any disadvantages? How do you usually test out things on the go in a good way?

54 Comments
2024/04/27
15:03 UTC

37

I made an easy and secure data lake for Pandas

What My Project Does Shoots is essentially a "data lake" where you can easily store pandas dataframes, and retrieve them later or from different locations or in different tools. Shoots has a client and a server. After choosing a place to run the server, you can easily use the client to "put" and "get" dataframes. Shoots supports SQL, allowing you to put very large dataframes, and then use a query to only get a subset. Shoots also allows you to resample on the server.

# put a dataframe, uploads it to the server  
df = pd.read\_csv('sensor\_data.csv')  
shoots.put("sensor\_data", dataframe=df, mode=PutMode.REPLACE)  


# retrieve the whole data frame  
df0 = shoots.get("sensor\_data")  
print(df0)  

# or use sql to retrieve just some of the data  
sql = 'select "Sensor\_1" from sensor\_data where "Sensor\_2" < .2'  
df1 = shoots.get("sensor\_data", sql=sql)

Target Audience Shoots is designed to be used in production by data scientists and other python devs using pandas. The server is configurable to run in various settings, including locally on a laptop if desired. It is useful for anyone who wants to share dataframes, or store dataframes so they can be easily accessed from different sources.

Comparison To my knowledge, Shoots is the only data lake with a client that is 100% pandas native. The get() method returns pandas dataframes natively, so there is no cumbersome translations such as required from typical databases and data lakes. The server is build on top of Apache Arrow Flight, and is very efficient with storage because it uses Parquet as the storage format natively. While the Shoots client does all of the heavy listing, if desired, the server can be accessed with any Apache Flight client library, so other languages are supported by the server.

Get Shoots There is full documentation available in the Github repo: https://github.com/rickspencer3/shoots

It is packaged for Pypi as well: (https://pypi.org/project/shoots/) ```pip install shoots"

7 Comments
2024/04/27
12:40 UTC

2

RDD lookup operation performing weirdly

Hey there,

I'm currently exploring PySpark and attempting to implement Dijkstra's algorithm using it. However, my query doesn't pertain to the algorithm itself; it's regarding the unexpected behavior of the lookup operation in PySpark. To aid in understanding what's happening, I've added print statements and comments throughout the code. This issue seems to be independent of Dijkstra's algorithm, so even if you're not familiar with it, your insights could still be valuable.

Here is my code:

def dijkstra(graph_dict, source_node):
    sc = spark.sparkContext
    
    # Initialize distances with infinity for all nodes
    distances = sc.parallelize([(node, float('inf')) for node in graph_dict])
    
    # Set the distance of the source node to 0
    distances = distances.map(lambda x: (x[0], 0) if x[0] == source_node else x)
    
    print(distances.collectAsMap())
    
    # Initialize priority queue with source node and distance 0
    pq = sc.parallelize([(0, source_node)])

    while not pq.isEmpty():
        # Get the node with minimum distance from the priority queue
        current_distance, current_node = pq.min()
        print(f'Current Node: {current_node}; Current Distance: {current_distance}')
        
        # Remove the current node from the priority queue
        pq = pq.filter(lambda x: x != (current_distance, current_node))

        # Iterate over neighbors of the current node
        for neighbour, weight in graph_dict[current_node].items():
            print(f'neighbour: {neighbour}; weight: {weight}')
            
            # Calculate the distance to the neighbor through the current node
            distance = current_distance + weight
            print(f'Distance: {distance}')
            
            # Lookup the current distance to the neighbor
            lookup_result = distances.lookup(neighbour)[0]
            print(f'lookup result for neighbour {neighbour}: {lookup_result}')
            
            # If the new distance is smaller, update the distance and add to priority queue
            if distance < lookup_result:
                print('True')
                distances = distances.map(lambda x: (x[0], distance) if x[0] == neighbour else x)
                pq = pq.union(sc.parallelize([(distance, neighbour)]))

    return distances.collectAsMap()

The input graph_dict is a python dictionary looks like this:

{'0': {'1': 7, '2': 1, '3': 4},
 '1': {'0': 7, '2': 1, '3': 1},
 '2': {'0': 1, '1': 1, '3': 10},
 '3': {'0': 4, '1': 1, '2': 10}}

Function is called as:

dijkstra(graph_dict, '0')

And this is the output (logs), I am getting when running it:

{'0': 0, '1': inf, '2': inf, '3': inf}
Current Node: 0; Current Distance: 0
neighbour: 1; weight: 7
Distance: 7
lookup result for neighbour 1: inf
True
neighbour: 2; weight: 1
Distance: 1
lookup result for neighbour 2: 1
neighbour: 3; weight: 4
Distance: 4
lookup result for neighbour 3: 4
Current Node: 1; Current Distance: 7
neighbour: 0; weight: 7
Distance: 14
lookup result for neighbour 0: 14
neighbour: 2; weight: 1
Distance: 8
lookup result for neighbour 2: 8
neighbour: 3; weight: 1
Distance: 8
lookup result for neighbour 3: 8
{'0': 0, '1': inf, '2': inf, '3': 8}

From the output, whats weird, is that the lookup result for neighbour 2 should be 'inf' and not 1 and same for all other neighbours. Only for the first time, that is for neighbour 1, its correct as 'inf'.

1 Comment
2024/04/27
11:44 UTC

0

milkcow - First package/library

Excited to share milkcow, my first python package. I'd love any feedback, and to continue to build out the parts of this package that show potential.

https://pypi.org/project/milkcow/ https://github.com/SamReynoso/milkcow

###What MilkCow Does Milkcow automates database creation and offers in-memory key-value mapping for data handling. Whether you're building middleware, local storage, or multiprocessing scripts.

###Target Audience MilkCow is designed for developers looking to streamline the development process. It caters to those who want to simplify data.

###Comparison Milkcow aims for simplicity. Milkcow offers a way for making it easier for developers to get started. Additional functionalities, including database creation and the in-memory datastore, enhancing its usability.

from milkcow import ObjectCow

oc = ObjectCow(Record)
oc.push('Bob', records)
objs = oc.new('Bob')
k, v = oc.items()
for k in oc.keys()
new = oc.new(k)
from milkcow import MilkCow

mc = MilkCow(Record)
mc.pull('Bob')
mc.push('Alice', list[Record])
sender = mc.sender.new_sender()
sender = mc.sender.all_sender()
sender = mc.sender.keyed_sender('Alice')
sender.send()
1 Comment
2024/04/27
11:35 UTC

29

ASCII plot backend package for matplotlib

Hi

I've made a package called mpl_ascii which is a backend for matplotlib. You can find it here: https://github.com/chriscave/mpl_ascii

I would love to share it with others and see what you guys think

What it is

It is a backend for matplotlib that converts your plots into ASCII characters.

At the moment I have only made support for: bar charts, scatter plots and line plots but if there's demand for more then I would love to keep working on it.

Target Audience:

Anyone using matplotlib to create plots who might also want to track how their plots change with their codebase (i.e. version control).

Comparison:

There are a few plotting libraries that produce ASCII plots but I have only come across this one that is a backend for matplotlib: https://github.com/gooofy/drawilleplot. I think it's a great package and it is really clever code but I found it a little lacking when you have multiple colours in a plot. Let me know if you know of other matploblib backends that does similar things.

Use case:

A use case I can think of is for version controlling your plots. Having your plot as a txt format means it can be much easier to see the diff and the files you are committing are much smaller.

Since it is only a backend to matplotlib then you only need to switch to it and you don't need to recreate your plots in a different plotting library.

Thanks for reading and let me know what you think! :)

20 Comments
2024/04/27
08:06 UTC

57

American Airlines scraper made in Python with only http requests

Hello wonderful community,

Today I'll present to you pyaair, a scraper made pure on Python https://github.com/johnbalvin/pyaair

Easy instalation

` ` `pip install pyaair ` ` `

Easy Usage

` ` ` airports=pyaair.airports("miami","") ` ` `

Always remember, only use selenium, puppeteer, playwright etc when it's strictly necesary

Let me know what you think,

thanks

About me:

I'm full stack developer specialized on web scraping and backend, with 6-7 years of experience

37 Comments
2024/04/27
00:54 UTC

0

Saturday Daily Thread: Resource Request and Sharing! Daily Thread

Weekly Thread: Resource Request and Sharing 📚

Stumbled upon a useful Python resource? Or are you looking for a guide on a specific topic? Welcome to the Resource Request and Sharing thread!

How it Works:

  1. Request: Can't find a resource on a particular topic? Ask here!
  2. Share: Found something useful? Share it with the community.
  3. Review: Give or get opinions on Python resources you've used.

Guidelines:

  • Please include the type of resource (e.g., book, video, article) and the topic.
  • Always be respectful when reviewing someone else's shared resource.

Example Shares:

  1. Book: "Fluent Python" - Great for understanding Pythonic idioms.
  2. Video: Python Data Structures - Excellent overview of Python's built-in data structures.
  3. Article: Understanding Python Decorators - A deep dive into decorators.

Example Requests:

  1. Looking for: Video tutorials on web scraping with Python.
  2. Need: Book recommendations for Python machine learning.

Share the knowledge, enrich the community. Happy learning! 🌟

0 Comments
2024/04/27
00:00 UTC

253

I made a Python app that turns your Figma design into code

Link: https://github.com/Axorax/tkforge

Hey, my name is Axorax. I have been programming for a few years now. I started making a lot more projects in Python recently and this is one of them. I decided to call the project TkForge.

What My Project Does TkForge allows you to turn your Figma design into code. So, you can make the UI for an app in Figma and add input fields, buttons and much more and name them properly then you can run TkForge to convert your Figma design into code. The names need to be the element that you want. For example; if you want a button element then you can name it "button" or "button Hello World!". The "Hello World!" portion will just get ignored. All of the text after the first space is ignored. However, for some elements, they matter. Like, if you want a textbox element with the placeholder text of "Hello" then you need to name it "textbox Hello".

Target Audience It is meant for anyone who wants to create a GUI in Python easily. Dealing with Tkinter can be a pain a lot of times and it also takes a long time. Using TkForge, you can make better UI's and also get a lot of work done in a short amount of time. Anyone who is new to Python or even an expert can use TkForge to speed up their development times and get a better result. You can TkForge in your production app or for a demo app and really anywhere if you are also using Python.

Comparison There is another project called TkDesigner that does the same sort of thing. But TkForge is able to generate better code. TkForge also supports a lot more elements. Placeholder text for textbox and textarea are not built-in to Python. But TkForge has support for those even though using them requires you to handle a lot of situations by yourself (TkForge provides functions for these situations to be handled correctly, you need to implement them were needed yourself).

Thank you for reading! <3

21 Comments
2024/04/26
15:26 UTC

10

Python Quality Standards

Hey, happy Friday (don't push to prod). Me and some friends are building a no-code platform to run code improvement agents (really in BETA) .

We want to have a quality agent for each language, and I would really appreciate your feedback on python best practices and standards. The agents are created by defining the steps that you want to apply in natural language. Right now our Python agent has the following steps:

  • Use descriptive naming for functions and variables.
  • Add Type Hints.
  • Add proper docstrings.
  • Make docstrings follow PEP-257 standard.
  • All variables and functions should be snake_case.
  • Add proper input validation that checks for type and not null. If the input validation fails raise an Exception.
  • Add useful logs for debugging with the logging library.

In case you want to check our tool, we have a free playground right now at GitGud and are working on github PR integrations.
Happy coding and thank you in advance for your help!

Edit: Of course the steps are really basic right now, we are still testing the POC, so any feedback would be really appreciated

11 Comments
2024/04/26
14:18 UTC

1

How To Build a Social Media Sentiment Analysis Pipeline With FastAPI And Generative AI

Social media like Reddit, Hacker News, Twitter, etc. contain tons of genuine discussions that you might want to analyze automatically with sentiment analysis. For example you might want to monitor what people say about you, your product, your competitors, etc.

I made a technical article that shows how to implement such a sentiment analysis pipeline using the following steps:

  1. Implement social media listening
  2. Integrate the data in your system with an API webhook processed in Python/FastAPI
  3. Analyze the sentiment thanks to generative AI models like GPT-4, LLaMA 3, ChatDolphin, etc.

Here it is: https://kwatch.io/how-to-build-a-social-media-sentiment-analysis-pipeline

I hope you will find it useful. If you have some comments about how to improve this pipeline I would love to hear them!

Arthur

0 Comments
2024/04/26
09:03 UTC

61

Python for backend? Please enlighten me

I have finished my front-end web dev part. I'm confident in my skills and want to move to the backend section. But the problem is, most influencers promote MERN stack for the backend, and since it's easy to promote as both front end and back end use the same language.

While researching, I found Java, but it's been on a constant decline since 2017, with a 1 percent yearly fall. And languages like Golang and Python are on the rise.

In online debate threads on Reddit, people often mention Python as not scalable and secure, and being very slow. Is that true?

Also, there aren't many Golang courses online.

145 Comments
2024/04/26
04:16 UTC

6

Friday Daily Thread: r/Python Meta and Free-Talk Fridays

Weekly Thread: Meta Discussions and Free Talk Friday 🎙️

Welcome to Free Talk Friday on /r/Python! This is the place to discuss the r/Python community (meta discussions), Python news, projects, or anything else Python-related!

How it Works:

  1. Open Mic: Share your thoughts, questions, or anything you'd like related to Python or the community.
  2. Community Pulse: Discuss what you feel is working well or what could be improved in the /r/python community.
  3. News & Updates: Keep up-to-date with the latest in Python and share any news you find interesting.

Guidelines:

  • All topics should be related to Python or the /r/python community.
  • Be respectful and follow Reddit's Code of Conduct.

Example Topics:

  1. New Python Release: What do you think about the new features in Python 3.11?
  2. Community Events: Any Python meetups or webinars coming up?
  3. Learning Resources: Found a great Python tutorial? Share it here!
  4. Job Market: How has Python impacted your career?
  5. Hot Takes: Got a controversial Python opinion? Let's hear it!
  6. Community Ideas: Something you'd like to see us do? tell us.

Let's keep the conversation going. Happy discussing! 🌟

3 Comments
2024/04/26
00:00 UTC

1

Sensor-App: A Sensor Data Displaying/Streaming Android App written in Python

Sensor-App is an Android App that's main focus is to help create a real-time mobile sensor data stream for computer applications, data collection, AR, VR, etc.

Github: SensorApp

Features of Sensor-App

  • Real-Time Sensor Data display
  • Faster Real-Time Sensor Data Streaming via TCP Sockets
  • Simple and Easy setup of Data Streaming Server

What my Project Does

My project is aimed to help provide a Real-Time Mobile Sensor data streaming service.

Target Audience

Computer Programmers, Data Scientists, AR and VR enthusiasts

Remarks

  • This Application was made with help of Beeware Tools.
  • I made this Application to test out abilities of Beeware Tools, and get Experience in Android App develpoment with python
  • Currently the Project only contains Accelerometer, and I will update it soon to support other sensors too.
  • I am always open hear advice, constructive criticism about my project.
  • I would like to hear your opinion of my project :}

Thanks for Reading, hope you try out my project :)

1 Comment
2024/04/25
18:14 UTC

2

How to create a Discord Bot to launch a Minecraft server automatically

Hi y'all,

This might be off topic a bit from the normal stuff that gets posted here, but a while back I was messing around on a Minecraft server that I was hosting on Aternos (a free online Minecraft server host).

Now since the server wasn't running on my computer (and since Aternos has a timeout policy to save server resources) it became annoying for my buddies to hop on the server if I was busy. They'd have to ask me to manually start the server from the webpage.

So I had a free Saturday a couple of months ago and decided to remedy this problem.

My source code is hosted on a GIGO Dev environment if y'all wanna check it out:
https://www.gigo.dev/challenge/1732810200471044096

But to summarize it quickly... I used Playwright and the Discord API in Python to simulate a browser navigating to an Aternos server and starting it. For this tutorial you will need to make an Aternos acct, but their platform is free and very useful if you want to spin up a Minecraft server quickly without using your own resources.

You simply need to configure a trigger command or @ the bot and set up a webhook for the the discord server you want to use.

There's a full tutorial on how I set it up in the link along with the project structure, but truth be told the basic implementation is pretty simple and can be tweaked to work really however you want.

Just wanted to share this to see if anyone had done something similar before, or if I'm just insane and made this mundane problem into a way bigger endeavor than it should be

6 Comments
2024/04/25
18:02 UTC

4

What is your best Tkinter project that you put a lot of effort into creating?

I want to hear your description of the project you are most proud of. I was just trying to find something on the Internet, but I didn't find much of interest. The only difficult project was CustomTkinter, which, as far as I know, was done entirely in Tkinter. Since it is possible to create something this complex, I'm sure you have something cool too.
Note: I am expecting to hear projects more complex than a calculator :)

4 Comments
2024/04/24
22:05 UTC

12

Python Test 219: Building Django Apps & SaaS Pegasus - Cory Zue

Listen at podcast.pythontest.com/219

When starting a SaaS project using Django, there are tons of decisions. I've asked Cory Zue, creator of SaaS Pegasus, to help me sift through some common SaaS/Django decisions.

9 Comments
2024/04/25
14:38 UTC

15

🔭 OpenTelemetry Architecture: Python SDK Overview

Hey folks,
I have just posted an article for those who want to go a little bit beyond the basic usage of OTEL and understand how it works under the hood. The post quickly touches on:
- 🔭 History and the idea of OpenTelemetry
- 🧵 Distributed traces & spans. How span collection happens on the service side
- 💼 Baggage & trace ctx propagation
- 📈 Metrics collection. Views & aggregations. Metrics readers
- 📑 OTEL Logging integration
- 🤝 Semantic conventions and why that is important
Blog Post: https://www.romaglushko.com/blog/opentelemetry-sdk/
Let me know what do you think and hope this is helpful for someone 🙌

6 Comments
2024/04/25
09:01 UTC

4

UXsim 1.2.0 released with support for (self-driving) taxis and shared mobility

Version 1.2.0 of UXsim is released, which allows simulating taxis, shared mobility and self-driving taxis!

Main Changes in 1.2.0

  • Add taxi (aka. shared mobility) functions
    • A standard vehicle in UXsim just travel from A to B and disappear. This is like a private owned vehicle.
    • From this update, a Vehicle with mode="taxi" behave like a taxi. Specifically, they travel through a network by passing through specific nodes that are dynamically updated, simulating passenger pickup and drop-off.
    • New sub-module uxsim.TaxiHandler handles these matters.
    • Built-in vehicle-to-passneger matching methods are also available.
    • This addresses Issue #41
  • From now on, we follow the Semantic Versioning rigorously.

UXsim

UXsim is a free, open-source macroscopic and mesoscopic network traffic flow simulator written in Python. It simulates the movements of car travelers and traffic congestion in road networks. It is suitable for simulating large-scale (e.g., city-scale) traffic phenomena. UXsim is especially useful for scientific and educational purposes because of its simple, lightweight, and customizable features, but users are free to use UXsim for any purpose.

1 Comment
2024/04/25
08:44 UTC

59

Python Interview Cheat Sheet Website!

Hey everyone,

I’ve recently launched a new website aimed at helping fellow programmers ace their Python interviews. It’s not just limited to Python though; it also covers essential topics like big-O notation, object-oriented programming, design patterns, and more!

I’d love to hear your thoughts and feedback on the content, layout, and anything else you think could be improved.

Check it out here https://hlop3z.github.io/interviews-python/ and let me know what you think. Your input is invaluable in making this resource the best it can be. Thanks in advance for your time and insights! 🚀🐍

Note: It’s mainly to be used in a computer or tablet. You can see it in your mobile, but some sections won’t look as intended.

15 Comments
2024/04/25
05:50 UTC

1

Thursday Daily Thread: Python Careers, Courses, and Furthering Education!

Weekly Thread: Professional Use, Jobs, and Education 🏢

Welcome to this week's discussion on Python in the professional world! This is your spot to talk about job hunting, career growth, and educational resources in Python. Please note, this thread is not for recruitment.


How it Works:

  1. Career Talk: Discuss using Python in your job, or the job market for Python roles.
  2. Education Q&A: Ask or answer questions about Python courses, certifications, and educational resources.
  3. Workplace Chat: Share your experiences, challenges, or success stories about using Python professionally.

Guidelines:

  • This thread is not for recruitment. For job postings, please see r/PythonJobs or the recruitment thread in the sidebar.
  • Keep discussions relevant to Python in the professional and educational context.

Example Topics:

  1. Career Paths: What kinds of roles are out there for Python developers?
  2. Certifications: Are Python certifications worth it?
  3. Course Recommendations: Any good advanced Python courses to recommend?
  4. Workplace Tools: What Python libraries are indispensable in your professional work?
  5. Interview Tips: What types of Python questions are commonly asked in interviews?

Let's help each other grow in our careers and education. Happy discussing! 🌟

0 Comments
2024/04/25
00:00 UTC

Back To Top