r/pythoncoding • • Jul 10 '23

Now we can upload post to META- THREADS via API(unofficial)

5 Upvotes

Same repo : https://github.com/Danie1/threads-api, upload available in latest versionInstall : pip install threads-api

Check out my threads profile : https://www.threads.net/@74rut

Upload script I used:

from threads_api.src.threads_api import ThreadsAPI
import asyncio
import os
from dotenv import load_dotenv


load_dotenv()


async def post():
    threads_api = ThreadsAPI()
    await threads_api.login(os.environ.get('USERNAME'), os.environ,get('PASSWORD'))
    result = await threads_api.post("I am posting this from the threads api!")

    if result:
        print("Post has been successfully posted")
    else:
        print("Unable to post.")

async def main():
    await post()

# Create an event loop and run the main function
loop = asyncio.get_event_loop()
loop.run_until_complete(main())

ScreenShot


r/pythoncoding • • Jul 08 '23

I made a ML Web App Project in Streamlit and shared it on YouTube

5 Upvotes

Hello everyone, I published a Streamlit Machine Learning Web App video on my YouTube channel, you can visit the video from the link that I’ll leave in this post. Have a great day!

https://www.youtube.com/watch?v=HQdCSbu1BSU


r/pythoncoding • • Jun 10 '23

Running Shell Commands via Text (Made in Python)

5 Upvotes

Hello Everyone,

I recently posted a video about how I built this program in python which allows you send commands to your system via text messages

It’s purely built in python Here’s the link: https://youtu.be/PU75M0QkwTQ


r/pythoncoding • • Apr 06 '23

Algebraic Data Types in (typed) Python

Thumbnail threeofwands.com
5 Upvotes

r/pythoncoding • • May 16 '22

/r/PythonCoding bi-weekly "What are you working on?" thread

5 Upvotes

Share what you're working on in this thread. What's the end goal, what are design decisions you've made and how are things working out? Discussing trade-offs or other kinds of reflection are encouraged!

If you include code, we'll be more lenient with moderation in this thread: feel free to ask for help, reviews or other types of input that normally are not allowed.

This recurring thread is a new addition to the subreddit and will be evaluated after the first few editions.


r/pythoncoding • • May 04 '22

Overcoming the GIL - Cython vs Slackless vs Coroutines

5 Upvotes

So basically, Cython - requires heavy code modification, complex Slackless - Python with coroutines, also dead project Coroutines - somewhat limited(only 1 depth level of calls can be made)

So, most of the time use Coroutines. If need more functionality use Cython.

Thoughts?


r/pythoncoding • • Feb 22 '22

Google Cloud Python Logging Library Improves Serverless Support With Version 3.0 Release

5 Upvotes

Hey Folks,

The Google Cloud Python logging library has been updated to version 3.0.0. Enhancements to Cloud Run and Cloud Functions, as well as support for string JSON payloads and automated metadata attachments, are also included in this release.

I have created a short summary of this blog from Google. You can read it here

If you wanted to read the Google Blog and further details, you can check out the Google article here

Please don't hesitate to share your thoughts in the comments.


r/pythoncoding • • Nov 15 '21

/r/PythonCoding bi-weekly "What are you working on?" thread

5 Upvotes

Share what you're working on in this thread. What's the end goal, what are design decisions you've made and how are things working out? Discussing trade-offs or other kinds of reflection are encouraged!

If you include code, we'll be more lenient with moderation in this thread: feel free to ask for help, reviews or other types of input that normally are not allowed.

This recurring thread is a new addition to the subreddit and will be evaluated after the first few editions.


r/pythoncoding • • Oct 10 '21

CPU Performance Monitor desktop app with modern web-based GUI

5 Upvotes

I've used a combination of Flask (a web framework), HTML, CSS, JS and PyInstaller to create a native desktop application that shows the current CPU usage in real-time.
I primarily made this to familiarize myself more with HTTP polling of hardware information and packaging Flask-based web code as desktop software for production-level deployments.
This approach might be suitable for IoT-based software applications or any other kind of app requiring a GUI.

This project demonstrates a couple advanced principles:

  1. How to create Electron-like desktop applications using Python

  2. How to create UIs for desktop applications powered by HTML, CSS and JavaScript

  3. Compile a real-world application as an executable for desktop via PyInstaller and fix all issues related to this

  4. Gain access to machine-level data with Python even in packaged environments

Feel free to use this project to learn how to make applications similar to Electron apps without relying on JavaScript too much.

This approach is suitable for production-level applications as well.

Source Code: https://github.com/Zenahr/CPU-Meater
Video Guide: https://youtu.be/nNQGmO2RLe4


r/pythoncoding • • Aug 09 '21

/r/PythonCoding bi-weekly "What are you working on?" thread

5 Upvotes

Share what you're working on in this thread. What's the end goal, what are design decisions you've made and how are things working out? Discussing trade-offs or other kinds of reflection are encouraged!

If you include code, we'll be more lenient with moderation in this thread: feel free to ask for help, reviews or other types of input that normally are not allowed.

This recurring thread is a new addition to the subreddit and will be evaluated after the first few editions.


r/pythoncoding • • Jul 06 '21

Automatically find, convert and mail downloaded books to your Kindle

5 Upvotes

Pykinder benefits: Minimal intervention, it figures out where your download folder is and which of your files are books, converts and mail them, all in the background (job scheduling included)

If you find it lacking, feel free to ask for features (Repo)


r/pythoncoding • • Jun 14 '21

A step-by-step on implementing passwordless authentication on any website or app using Python

5 Upvotes

Open documentation that lays out API credential creation, adding SDKs through GitHub or PIP, and creating an SDK instance.

https://docs.loginid.io/Server-SDKs/Python/python-get-started


r/pythoncoding • • May 12 '21

PEP 658 -- Static Distribution Metadata in the Simple Repository API

Thumbnail
python.org
5 Upvotes

r/pythoncoding • • Mar 21 '21

Machete mode: tagging frames

Thumbnail nedbatchelder.com
5 Upvotes

r/pythoncoding • • Mar 09 '21

Python and type hints

5 Upvotes

As we all know, Python is a dynamic language. This provides many strengths, and offers a lot of flexibility, but in larger code bases it can also become a hindrance. Type hints are often considered a solution to keep large code bases manageable.

A trend towards more and more type information - such as type hints (PEP 484) and their postponed evaluation (PEP 563), easier writing of union types (PEP 604), or TypedDicts (PEP 589) just to name a few- enables developers and their tools to have more information available about the types of objects they're working with. Linters catch more errors, and developers can stay sane.

However, this also requires discipline. Take the following example:

from random import random, seed
seed(2)

class MyClass:
    def __init__(self, arg):
        self.val = arg
        

def my_func(x: MyClass):
    print(x.val)


a = MyClass(10)
b = MyClass(10)

x = random()
if x > 0.5:
    del a.val
    
print(type(a) is type(b)) # True, even though we potentially modified the instance!
my_func(a) # 50/50: succesful print or AttributeError

In other words, type hints are demonstrably fallible. If you use the object model's flexibility, the type hints will no longer be reliable.

What are your thoughts on this trend? On the trade off between extra information during development, versus the loss of flexibility?


r/pythoncoding • • Nov 24 '16

Dependency Injector - Dependency injection microframework for Python

5 Upvotes

Hello everybody,

Let me present you my pet project about dependency injection - Dependency Injector - dependency injection microframework for Python!.

I know that dependency injection frameworks topic is not so popular topic as it is in other languages, but I still believe that if you love well-structured applications, Dependency Injector will be your good friend on the way to Inversion of Control.

Keep calm and enjoy Python! :)


r/pythoncoding • • Nov 07 '15

Explaining functional aspects in python

Thumbnail
baruchel.github.io
5 Upvotes

r/pythoncoding • • Sep 23 '15

Volume of intersecting cubes (see bottom for python implementation)

Thumbnail averylaird.com
5 Upvotes

r/pythoncoding • • Apr 26 '15

Pure Python Vim clone (github.com)

Thumbnail
github.com
5 Upvotes

r/pythoncoding • • Feb 28 '15

Guido - Python's Design Philosophy

Thumbnail
python-history.blogspot.ro
5 Upvotes

r/pythoncoding • • Jan 27 '15

10 awesome features of Python that you can't because you refuse to upgrade to Python 3

Thumbnail asmeurer.github.io
5 Upvotes

r/pythoncoding • • May 17 '26

nbpipe: A Lightweight Workflow Runner for Jupyter Notebooks

Thumbnail
reddit.com
4 Upvotes

r/pythoncoding • • May 13 '26

A faster, aria2 enabled pip wrapper

4 Upvotes

Installing large packages like torch or tensorflow has always been a pain in the ass for me. Although i have optimal internet connection, the download speeds i get for these packages is abysmal.

I then started to download the whl files through download managers then install them manually, and so to automate that workflow i created Zipip. It's just pip but with slight modifications to use aria2 for the downloads. And i dont mean it in any fancy sense, it literally is just pip in all other regards. And so likewise it is a drop in alternative.

Source code : https://github.com/STRTSNM/zipip

PyPI : https://pypi.org/project/zipip/

PS : I know pip is supposed to have no other dependencies, but the slow downloads just kill me, and i wanted to share what i thought of. Do let me know what you people think. Thanks in advance.


r/pythoncoding • • May 04 '26

/r/PythonCoding monthly "What are you working on?" thread

4 Upvotes

Share what you're working on in this thread. What's the end goal, what are design decisions you've made and how are things working out? Discussing trade-offs or other kinds of reflection are encouraged!

If you include code, we'll be more lenient with moderation in this thread: feel free to ask for help, reviews or other types of input that normally are not allowed.