r/pythontips • • Jun 25 '20

Module Python Logging: Colorize Your Arguments!

31 Upvotes

r/pythontips • • Apr 26 '20

Module Made a CV library for dummies

31 Upvotes

Hi Guys , Today I present You Visionlib. A wrapper library for most cv necessities.

I created because I wanted to make object detection, face detection etc much more easier

and also I just wanted to do something do till the corona virus passes.

I am open to suggestion, criticism, appreciation.If u find any thing that does not work just create an issue . I will try my best . You can also contribute to the project.

https://github.com/ashwinvin/Visionlib


r/pythontips • • Dec 27 '19

Amazing Python Project on Typing Speed Test – Build your first game in Python!!

31 Upvotes

Project in Python – Typing Speed Test

Have you played a typing speed game? It’s a very useful game to track your typing speed and improve it with regular practice. Now, you will be able to build your own typing speed game in Python by just following a few steps.

About the Python Project

📷

In this Python project idea, we are going to build an exciting project through which you can check and even improve your typing speed. For a graphical user interface, we are going to use the pygame library which is used for working with graphics. We will draw the images and text to be displayed on the screen. Read More


r/pythontips • • May 02 '19

Kite's AI Autocomplete for Python is now on Linux

31 Upvotes

After years of development and a whole lot of anticipation, Kite is now available on Linux! You can download it for free at kite.com/linux.

Kite helps Python developers be more productive with its Line-of-Code Completions, and integrates as a plugin into PyCharm, IntelliJ, VS Code, Atom, Sublime, and Vim. We're thrilled to be providing Kite for free to a broader open source community with this launch.

While we first expected to ship support for Linux about a year and a half ago, it’s taken a bit longer to complete all the necessary improvements to Kite’s core features before expanding the product. On the bright side, this means that Kite for Linux is of much higher quality today than it would have been in 2017 or 2018.

Even since January we've improved our autocompletion engine leading to a 2x increase in the number of times Kite users select one of Kite's Line-of-Code Completions while coding.

We're really looking forward to feedback on this release from all the Linux + Python users out there! We'll be online to answer your questions here today.

full article here


r/pythontips • • Mar 21 '19

Python 3 lib to connect to Bluetooth Device

31 Upvotes

Hi guys, Any idea of some python 3 libraries that would allow me to connect to my Bluetooth Speaker?

Thanks


r/pythontips • • Jan 23 '17

Module The "random" module with the same seed produces a different sequence of numbers in Python 2 vs 3. If reproducibility is important to you, use the "numpy.random" module instead.

31 Upvotes

With the random module

Python 2.7

import random
random.seed(42)
print(random.random())
print(random.random())
print(random.random())
print(random.random())
print(random.random())

Output:

0.025010755222666936
0.22321073814882275
0.6766994874229113
0.08693883262941615
0.029797219438070344

Python 3.5

import random
random.seed(42)
print(random.random())
print(random.random())
print(random.random())
print(random.random())
print(random.random())

Output:

0.025010755222666936
0.24489185380347622
0.7364712141640124
0.5904925124490397
0.029797219438070344

With the numpy.random module

Python 2.7

import numpy as np
np.random.seed(42)
print(np.random.random())
print(np.random.random())
print(np.random.random())
print(np.random.random())
print(np.random.random())

Output:

0.3745401188473625
0.9507143064099162
0.7319939418114051
0.5986584841970366
0.15601864044243652

Python 3.5

import numpy as np
np.random.seed(42)
print(np.random.random())
print(np.random.random())
print(np.random.random())
print(np.random.random())
print(np.random.random())

Output:

0.3745401188473625
0.9507143064099162
0.7319939418114051
0.5986584841970366
0.15601864044243652

r/pythontips • • Jul 27 '26

Python3_Specific Ho 11 anni e ho appena creato il mio primo script di automazione in Python per ripulire la cartella Download!

30 Upvotes

Hi everyone! I've been learning Python step-by-step, focusing on logic, file management, and the os module. Today, I finished my first real automation script: a File Sorter/Folder Cleaner!

It automatically scans my Downloads folder, checks the file extensions (ignoring case sensitivity thanks to .lower()), creates the target folders if they don't exist, and moves everything into the right place (Documents, Images, Installations).
Here is my script:
import os

download_folder = r"C:\Users\YourUsername\Downloads"

file_list = os.listdir(download_folder)

for file_name in file_list:

lowercase_name = file_name.lower()

if (lowercase_name.endswith(".pdf") or

lowercase_name.endswith(".txt") or

lowercase_name.endswith(".docx") or

lowercase_name.endswith(".xlsx") or

lowercase_name.endswith(".csv") or

lowercase_name.endswith(".doc")):

doc_folder = fr"{download_folder}\Documents"

if not os.path.exists(doc_folder):

os.mkdir(doc_folder)

old_path = fr"{download_folder}\{file_name}"

new_path = fr"{doc_folder}\{file_name}"

os.rename(old_path, new_path)

elif (lowercase_name.endswith(".jpg") or

lowercase_name.endswith(".jpeg") or

lowercase_name.endswith(".gif") or

lowercase_name.endswith(".png") or

lowercase_name.endswith(".mp4") or

lowercase_name.endswith(".kml") or

lowercase_name.endswith(".gpx")):

img_folder = fr"{download_folder}\Images"

if not os.path.exists(img_folder):

os.mkdir(img_folder)

old_path = fr"{download_folder}\{file_name}"

new_path = fr"{img_folder}\{file_name}"

os.rename(old_path, new_path)

elif (lowercase_name.endswith(".exe") or

lowercase_name.endswith(".zip") or

lowercase_name.endswith(".rar") or

lowercase_name.endswith(".dll") or

lowercase_name.endswith(".msi") or

lowercase_name.endswith(".msix")):

exe_folder = fr"{download_folder}\Installations"

if not os.path.exists(exe_folder):

os.mkdir(exe_folder)

old_path = fr"{download_folder}\{file_name}"

new_path = fr"{exe_folder}\{file_name}"

os.rename(old_path, new_path)
I'm really proud of this milestone. Let me know what you think or if you have any tips for a young programmer!


r/pythontips • • Apr 22 '23

Module [DISCUSSION] What's your favorite Python library, and how has it helped you in your projects?

30 Upvotes

Hello fellow Coders!

I hope everyone is doing well and coding up a storm. Today, I wanted to start a discussion about Python libraries that have helped you in your projects, made your life easier, or just plain impressed you with their capabilities.

There are so many amazing libraries out there, and I'm sure we all have our favorites. Here are a few questions to get the conversation started:

  1. What's your favorite Python library, and why?

  2. How has it helped you in your projects?

  3. Are there any unique or lesser-known libraries you've found helpful or interesting?

  4. What's your go-to library for a particular task or problem?

  5. Have you ever contributed to a Python library? If so, which one, and what was your experience like?

I'll kick things off by sharing my favorite library, Pandas! 🐼 I love how it simplifies data manipulation and analysis, especially when working with large datasets. It's saved me countless hours and made my projects more efficient.

Looking forward to hearing about your favorite Python libraries and the impact they've had on your work. Let's share, learn, and grow together as a community!

Happy coding!

For more discussions : Coder Corner


r/pythontips • • Mar 17 '23

Standard_Lib Why do people write web servers in python ?

30 Upvotes

In my current organisation, we are writing the backend servers in python using FastAPI framework which uses bunch of other things like Uvicorn, Asyncio… etc My question why to take this headache and not write this in languages like Go where the same we achieve with standard libraries. IMO, its too much for writing a simple web-server.


r/pythontips • • Dec 25 '22

Meta I need to become really really good at coding

30 Upvotes

I will have to be really good at coding for an internship. Mainly optimizing a code and Monte Carlo. What resources can I use to practice please? I already have the coding basics but I need to be advanced.


r/pythontips • • Jul 29 '22

Module I’m taking a Python class in August on campus

30 Upvotes

This is the class I’m taking the second time and I want to know how can I understand Python and some videos that will help me on YouTube that helped you guys?


r/pythontips • • Mar 12 '22

Module Are there any Python modules to create gibberish words

30 Upvotes

I want to create a program that creates gibberish words that are fake but sound like they could be real any modules for this?


r/pythontips • • Feb 11 '22

Long_video Secrets of MicroPython: How to read a keypad passcode

30 Upvotes

For all you python fans curious about hardware! How do keypads work? And how do you secure your keypad's passcode so that a hacker can't steal it? I've published my latest tutorial on reading matrix keypads and securely checking the passcode, all in MicroPython. The best part is - it can be done entirely online on a simulated Raspberry Pi Pico - no physical hardware needed! I hope you like this tutorial; please comment below or message me if you have any questions or feedback :)

https://bhave.sh/micropython-keypad/


r/pythontips • • Jan 10 '22

Module Noob looking to get into coding

30 Upvotes

So I just made a ‘guess the number’ game with a YouTube tutorial and coding looks really interesting to learn but it’s a little overwhelming. Do you guys have any tips on where to start when someone is really new to this. Like I even have to learn the language etc. Any tips would help!


r/pythontips • • Dec 31 '21

Module PyProgramming Beginner

30 Upvotes

Hey y’all, I’m getting started in learning Python and would like to know the best way to get started and how to understand/use Python. I have a deck of “101 Python flash cards” that I bought as well as an app called “Sololearn” that I plan on using. I was wondering if there was any books, videos or anything else that y’all would recommend beginners using to get a good foundation and grasp on Python.

Thanks in advance!


r/pythontips • • Jul 04 '21

Standard_Lib Our first turtle program in python

30 Upvotes

In computer graphics, turtle graphics are vector graphics utilizing a relative cursor (the "turtle") upon a Cartesian plane (x and y-axis). Turtle graphics is a vital component of the Logo programming language. Our first turtle program in python

MethodParameterDescription
Turtle()NoneCreates and returns a new tutrle object
forward()amountMoves the turtle forward by the specified amount
backward()amountMoves the turtle backward by the specified amount
right()angleTurns the turtle clockwise
left()angleTurns the turtle counterclockwise

Continue reading.....


r/pythontips • • Jun 25 '21

Long_video Core Python Introspection Full Course | In 30 Mins

30 Upvotes

r/pythontips • • Apr 30 '21

Python3_Specific Python bot for ADB android

30 Upvotes

Whats up Reddit,

Ive been working on a script to automate certain tasks on various social media/games and retail sites.

Currently I have been working with pyautogui and it works fine but still has issues with finetuning the click mechanics (image recognition/screenshot tool) Even when I add [confidence=0,8/0,9] And proceed to call the locateCenterOnScreen(), the printed results show coordinates way out of my screen proportions.

My question is if this is the right GUI to work with on a script like this? At the moment I am running my script on scrcpy connected to ADB with my android phone. Which works okay. I’m fairly new to the subject so sometimes I don’t know where to begin searching which is why I’m asking it here.

Could anyone help me out sharing some knowledge? What should I use to create bots to automate certain/complicated tasks on a phone. If its convenient I could post parts of my code on here.

Thanks for taking the time to read!


r/pythontips • • Apr 22 '21

Python3_Specific How to document multiple python projects in single project

30 Upvotes

I have multiple projects hosted on GitHub and I want to create a sphinx project that pulls docs from all those projects to a centralized location. Any ideas on how to go about this or examples?


r/pythontips • • Aug 31 '20

Short_Video Python Penetration testing and Security Analysis with Security onion Wir...

30 Upvotes

In this video walkthrough, I set up an analysis environment composed of security onion with Wireshark actively listening on incoming traffic and kali machine with python script used that launches a Denial of Service or DDOS to test the capability of a web server. You can use the illustration to test multiple kinds of servers in your environment. The whole process is called Servers Stress Testing

Video is here


r/pythontips • • Aug 11 '20

Data_Science Data Visualization using python | Seaborn| Part-III

30 Upvotes

r/pythontips • • Jul 12 '20

Long_video The final part in Dr. Henley 's Teeny Tiny Compiler series. It's been a joy to follow along, and frankly, I think I learned more than in my university compilers course.

30 Upvotes

The last video in our compiler series. We now have our own toy programming language!

https://youtu.be/ARm9OEXAj7g


r/pythontips • • Aug 01 '19

Introduction to GraphQL in Python

30 Upvotes

r/pythontips • • Aug 04 '16

Run scripts in virtualenvs without activating them first

30 Upvotes

If you have a virtualenv in env for example and you want to run a script from it (youtube-dl for example), usually you would activate it and then run it:

source env/bin/activate
youtube-dl ...

However you can run it directly without needing to activate the virtualenv first!

./env/bin/youtube-dl ...

This works for everything from the virtualenv (for example ./env/bin/pip ... to install something into the given env without activating it) and you can run arbitrary python scripts using the env python like this: ./env/bin/python myscript.py