r/pythontips • • Dec 15 '21

Module Creating Games in Python

40 Upvotes

Thanks to the ursina module, making simple games becomes quite easy. In most cases, 50 lines of code are enough to create a prototype of your game idea.

I also made some popular games in python, maybe it’s an inspiration for some of you: https://youtube.com/playlist?list=PLp0VWjYTx3ErmBbqWU94ikwilvmB1Grf8

Would you give ursina a chance, or stick with pygame :)


r/pythontips • • Dec 04 '21

Algorithms Tips on web scrapping without getting banned?

40 Upvotes

I want to write a web scrapper for instagram, I was just wondering how much i can push the limits. What’s the maximum capacity for request rate without getting banned and how can you achieve it?


r/pythontips • • Jul 09 '21

Module Learn SymPy - Symbolic Manipulation in Python

40 Upvotes

Hi,

We've just finished the first and second video in a series on SymPy. The library is a lifesaver for anyone working with symbolic mathematics (either in university courses or otherwise). Want to calculate an integral? Simplify some equations? SymPy got you covered!

You can find the playlist for the videos here: https://www.youtube.com/playlist?list=PLSE7WKf_qqo1T5VV1nqXTj2iNiSpFk72T

There are two videos so far. All the videos and the supplementary material will be free.


r/pythontips • • May 23 '21

Python3_Specific A beginner advice

40 Upvotes

I want to learn python with a book. I want a book with has the basics and should contain some mcqs regarding that basics and some coding in it. Please suggest me a book which has all these three aspects I am not able to decide which book to buy.


r/pythontips • • Feb 02 '21

Data_Science I’m a beginner who wants to use spotifyAPI to gather data for exploratory analysis

40 Upvotes

Hello everyone. I’m new to using APIs. I’ve learnt a few basics of web scraping in the recent couple of days. I Have to do an assignment where I need to collect data from a website using any API. I connected to spotifyAPI But i couldn’t figure out how to gather data using it. I’ve never coded in python before so this is all new to me. Spent hours googling this but no use. Is there anyplace I can learn the basics to gather data using API. any help is appreciated


r/pythontips • • Sep 13 '20

Standard_Lib Text2Code: A Jupyter extension to convert English text to python code

40 Upvotes

Kartik Godawat and Deepak Rawat have developed a ready to install Project Jupyter extension, Text2Code, which converts English queries into relevant python code. OpenAI’s GPT-3 inspires it. GPT-3 has Natural Language processing capabilities, can also generate React code and simplify command-line commands. All of these initiated the idea for something that produces ready-to-execute code for many human queries.

Article: https://www.marktechpost.com/2020/09/13/text2code-a-jupyter-extension-to-convert-english-text-to-python-code/

Github: https://github.com/deepklarity/jupyter-text2code


r/pythontips • • Jun 28 '20

Syntax Comprehensions: Why are they faster? A deep dive.

40 Upvotes

I've asked this question to Python developers - beginners and advanced Python devs alike. Their answer, however, more often than not disappoints.

This vast ignorance around one of the basic features of a language, which is often touted as advanced, made me write this post. I'm sharing a short summary of how you can use them and why are they faster, but if you want to deep dive, feel free to learn more at this link.

What are comprehensions?

In short, comprehensions can help you shorten your code while giving a performance boost to your code. As an example, if you have a list of integers le_ints and you want to add 1 to all, you can simply write:

la_ints = [i+1 for i in le_ints]

Why are they faster?

You might already know that Python itself is built on top of C - which is much faster than Python when it comes to handling data. When you're using a list comprehension, the evaluation logic of the loop is taken care of by the lower level implementation which is much faster.

In my blog post Comprehensions in Python: The hard way, I deep dive into how comprehensions behave behind the scenes (including sweet sweet bytecodes), and how to manage when you're hitting your memory limits. Would love to know how it helped you today!


r/pythontips • • Feb 16 '20

This Code takes 25 url's in a array named urls and returns the status code of each url in the array. The thing is that it takes 100 seconds to return the status code of these 25 urls, is there any changes to be done ? Please suggest !

40 Upvotes

import requests
urls = [

'https://www.blackwoods.com.au/power-tools/cordless-power-tools/cordless-rotary-hammer-drills/hammer-rotary-18v-li-ion-skin-24mm/p/02726043',
'https://www.blackwoods.com.au/safety-personal-protective-equipment/miner-s-belts/miner-s-belts-and-braces-buckaroo/belt-all-rounder-buckaroo-tmar-38/p/03061810',
'https://www.blackwoods.com.au/hygiene-cleaning/vacuum-cleaners/vacuum-cleaners-karcher-wet-and-dry/vacuum-wet-and-dry-karcher-nt30-1-tact-l/p/04106477',
'https://www.blackwoods.com.au/power-tools/cordless-power-tools/outdoor-power-equipment/makita-line-trimmer-18v-dur181z/p/00066559',
'https://www.blackwoods.com.au/tools-hand-measuring-precision/rules-steel/metric-and-imperial-rules-two-sided-four-edges-one-round-end/rule-steel-toledo-1000-1000mm-36/p/07491706',
'https://www.blackwoods.com.au/power-tools/cordless-power-tools/cordless-saws/saw-band-compact-18v-dewalt-dcs371n-xj/p/03691898',
'https://www.blackwoods.com.au/power-tools/cordless-power-tools/cordless-combo-kits/kit-18v-6pce-bosch-18vdb6-xgsec5-0-c/p/03680236',
'https://www.blackwoods.com.au/power-tools/accessories/sds-plus-drill-bit/bit-drill-sds-plus-milw-4cut-5x110mm/p/03647766',
'https://www.blackwoods.com.au/power-tools/cordless-power-tools/cordless-multi-tools/multitool-max-makita-tm30dz-skin-12v/p/03682106',
'https://www.blackwoods.com.au/tools-hand-measuring-precision/pliers-circlip/straight-and-bent-circlip-pliers-internal-and-external-knipex/plier-circ-ext-str-knipex-46-11-a4-320mm/p/01303117',
'https://www.blackwoods.com.au/tools-hand-measuring-precision/pliers-electronics-fine-mechanical/electronics-pliers-knipex/knipex-electronics-diagonal-cutter-esd-115-mm-7702115esd/p/00754464',
'https://www.blackwoods.com.au/tools-hand-measuring-precision/pliers-combination-linesmans/combination-pliers-elmako/plier-fencing-milwaukee-48226410/p/04287578',
'https://www.blackwoods.com.au/power-tools/cordless-power-tools/other/milwaukee-drop-head-drain-snake-cable-7-9mm-x-7-6m-48532572/p/00179490',
'https://www.blackwoods.com.au/power-tools/cordless-power-tools/lighting/bosch-torch-300-lumens-gli-12v-300-skin-06014a1000/p/00334394',
'https://www.blackwoods.com.au/power-tools/cordless-power-tools/radios/radio-site-makita-dmr107-skin/p/03681800',
'https://www.blackwoods.com.au/power-tools/cordless-power-tools/cordless-grease-caulking-gun/gun-caulking-skin-makita-dcg180xz/p/03675459',
'https://www.blackwoods.com.au/tools-hand-measuring-precision/detectors/cable-detectors-and-receivers-bosch/scanner-wall-bosch-d-tect-120-12cm/p/04048575',
'https://sydneytools.com.au/product/makita-dhr400pg2u-36v-18v-x-2-li-ion-cordless-brushless-aws-40mm-sds-max-rotary-hammer-combo-kit-with-wireless-unit',
'https://www.blackwoods.com.au/adhesives-sealants-fillers/adhesives-sealants-fire-fire-barrier/fire-rated-sealant-bostik/firecaulk-bostik-limestone-600ml-ssg/p/04193262',
'https://www.blackwoods.com.au/power-tools/cordless-power-tools/cordless-saws/saw-recip-dcs380n-xe-skin-dewalt-18v/p/00988167',
'https://www.blackwoods.com.au/power-tools/cordless-power-tools/cordless-drills/milwaukee-m12bid-202c-12v-2-0ah-li-ion-cordless-1-4-quot-impact-wrench-kit/p/03683228',
'https://www.blackwoods.com.au/tools-hand-measuring-precision/plier-sets/plier-sets-knipex/plier-set-in-tool-roll-4-pce-knipex-0035/p/00814648',
'https://www.blackwoods.com.au/tools-hand-measuring-precision/wrenches-pipe/aluminium-pipe-wrenches-straight-ridgid/wrench-pipe-straight-alum-ridgid-18/p/07066704',
'https://www.blackwoods.com.au/power-tools/electric-power-tools/other/mixer-power-1300w-makita-ut1400/p/03693955',
'https://www.blackwoods.com.au/ladders-and-platforms/mobile-scaffolding-systems/supa-lite-mobile-scaffolding-systems/scaffold-base-pack-bailey-alum-225kg/p/03889880'

]
for url in urls:
response = requests.head(url, headers={'Connection': 'close'})
statuscode = response.status_code
print(statuscode,end='')


r/pythontips • • Dec 30 '19

This Tool Shows the Full Dependencies of Python Modules as Collapsible Trees

40 Upvotes

Tool: https://www.thrum.engineering/python-module-dependency-trees

This tool show the dependencies and sub-dependencies of every module on PyPI (Python Package Index) as a collapsible tree along with a summary of the module. Viewing the dependency tree gives an immediate understanding of the sorts of features that a module includes, and helps make it clear what sorts of problems that a given module can solve.

Tooltips (desktop version only) show summaries of each module in the tree.

Data Source: http://pypi.org/pypi/

Enjoy!


r/pythontips • • May 29 '19

Python and git on your Android device

40 Upvotes

Everybody told you that " to improve your python skill you need to practice" but you do not always have your laptop with you. Hold on, here is something that can be done.

The purpose of this small tutorial is to give you the ability to install and run python and git on your Android device.

Disclaimer : I have no affiliation with any applications I will present.

Introduction

First thing first, you do not need to root your phone in order to follow this tuto. All application are free, of cource. Applications we will use are :

  • pydroid 3 a pretty good application. It's free, prenium version give you access to autocompletion and some intelisense, it's not the same level as pycharm but is pretty usefull.

  • Termux your Linux shell on your mobile, with this you will have access to git.

  • git, the most famous version control system for all your project

Installation

From the play store install :

From Termux

Ok, now you have it, open Termux and run the following command.

apt-get update 
apt-get upgrade

Then we can install git.

apt-get install git

Setup

It's time to be organize and hack a little bit pydroid3.

First create a folder where all your application will site. Mine is called programming and I add it under /storage/emulated/0. This path is the same as your document and download folders.

When it's done, copy the path in your clipboard and open pydroid3. On the right, click on folder icon and then open. Follow this path Home, accomp_files, iiec_run and finally open iiec_run.py. (Home/accomp_files/iiec_run/iiec_run.py)

Now, right under import sys add the following.

PATH ="/storage/emulated/0/programming/" #the path of your programming folder

# A tuple with all your package folders in it, at start you will have nothing, but with time it may look like mine
APPs = (
"kbase", 
"RemoveMedia", 
"pyAnalysis", 
"BioPlate", 
"appPharma", 
"pytexu", 
"Tools", 
"Dilution",
"BioPlateWeb",
"pythontex-command")

# Finally we append all path to system
for app in APPs:
    sys.path.append(PATH + app)

This little hack will alow you to import your package, those you created, not those that you will install using built in pip.

Your first start

Take your favorite web hosting service, create a package in it. Copy the link to clone it. Then go on your device and open Termux. run the command cd /emulated/storage/0/programming/, your are now in your programming folder. Clone your repo with the following git clone https://web-hosting.com/myRepo (replace the link with the one you copied). When it's done, open your pydroid3 app, and open your cloned repo. Don't forget to add your package in the iiec_run.py.

Happy coding

Fun fact

I written 90 % of my package BioPlate using this setup. When you have, like me, more than one hour and half of common transportation a setup like this is really cool.


r/pythontips • • May 27 '19

Build algorithmic stock trader with python [Beginner - How to video]

40 Upvotes

Just like the title says, I made a video that covers building your very own first algorithmic stock trader in python.

At the end of the video you will have a script that you can use to start automatically trading stocks with python your self.

Link - https://youtu.be/fVl1ld58xxo

In addition to the script, you will learn about the history of algorithmic trading and where it stands today.

Hope you guys like the video! Let me know if you have any questions in the comments.


r/pythontips • • Apr 09 '25

Meta NVIDIA Drops a Game-Changer: Native Python Support Hits CUDA

39 Upvotes

Alright, let’s talk about something big in the tech world—NVIDIA has finally rolled out native Python support for its CUDA toolkit. If you’re into coding, AI, or just geek out over tech breakthroughs, this is a pretty exciting moment. Python’s been climbing the ranks like a champ, and according to GitHub’s 2024 survey...
https://frontbackgeek.com/nvidia-drops-a-game-changer-native-python-support-hits-cuda/


r/pythontips • • Jun 29 '22

Module What are some amazing, great python external modules, libraries to explore?

39 Upvotes

Just completed my python course and started exploring new modules and libraries. Found and Explored some like selenium, Colorama, Pandas, etc.


r/pythontips • • Aug 09 '21

Short_Video Build a restful API in under 60 seconds

39 Upvotes

Hey guys,

In this video I want to introduce you guys to FastAPI, which is an high-performant web framework for building APIs with Python. With this spinning up an API is super simple.

here is the link to the video: https://youtu.be/MsT2I08bzA0

Thank you :)


r/pythontips • • Apr 12 '21

Python3_Specific What is the simplest way to make transactions between credit cards with python?

39 Upvotes

When we have the necessary information of a credit card and a bank account, what is the simplest way to transfer a specific amount of money from one to another.

Edit: I changed the wording of the question to make more sense


r/pythontips • • Mar 18 '21

Meta real life python tip

39 Upvotes

I know this might not be the right subreddit but i dunno where to ask.

I'm a pharmacist, and where i live its currently the worst profession ever. i always had at thing for programming, tried alot of languages c++ , java, http, php, rust, flutter, android development and i hated almost every one of em except for java. finally i started learning python, got a governmental scholarship for udacity professional data analysis nanodegree which i passed.

My eyes are on the first prize after the scholarship ends.

not the udacity full nanodegree but at least its a boost for me since i was self learning on free courses and books.

part of the program is to apply for freelancer sites and start working which i did, linkedin, freelance, guru, upwork and fiverr.

i quit my job 3 months before that scholarship. depleted all my savings and kinda broke with some major fights with wife bc of that.

i know how to use pandas, matplotlib, numby and some other modules to manipulate csv and json.

cant do web scraping at all with requests or apis or bs4 or anyother way.

i know that a lot of reading.

just give me some advice to where to go or what to do , or just some words of encouragement would be fine.

TL,DR: need advice with web scraping, excel manipulation and freelancing.

edit:

here is my submission:

https://github.com/DrWildPixie/Udacity_bikeshare_TMDB

i dont mind criticism. its an opportunity to learn


r/pythontips • • Jan 13 '21

Short_Video Selenium Python Tutorial Series

39 Upvotes

In this tutorial series (https://youtu.be/RwmCAHQSnPE), we will be learning Web Automation using Python and SeleniumBase framework. We will be covering everything from setting up your project from scratch to all the way to integrate it with CI/CD.

Some of the topics that we will be covering in this series -

  • SeleniumBase Introduction

  • Setup and Installation

  • Write tests using SeleniumBase and Python

  • Learning the APIs for SeleniumBase

  • Building a test automation framework

    • Implement the Page Object Model

    • Learning various wait methods

    • Setting up reporting and logging

  • Cross-browser and Parallel testing

  • CI/CD integration using Jenkins

By the end of the series, you will hopefully be able to set up your own Test Automation framework in Python and automate any website you prefer.

If you like my content, you can also check out my other tutorial series here –

Would appreciate it if you can support my work by Subscribing to my channel as well as liking and sharing my videos!

Thank you :)


r/pythontips • • Aug 20 '20

Python3_Specific Build your first REST API with Django Rest Framework.

39 Upvotes

Recently tried developing REST API with the help of Django Rest Framework and it was as easy as creating new methods in python. Sharing this blog with a hope that it will help the starters

http://thequickblog.com/restapi-with-python-djangorestframework/


r/pythontips • • Feb 27 '20

We've learned a lot from this subreddit about Python and wanted to share a video we made recently.

39 Upvotes

Most recent video - https://youtu.be/qEr9iRX4K0o

A bit background - we make a tool for developers (many of whom are beginners and just starting out) and recently started making videos on Youtube for them. The topics we've covered so far are fairly general, but we want to get better at this over time.

Would love to get anyone's feedback on how we can do better or what topics we could cover in the future!


r/pythontips • • Dec 14 '19

Python Game Project Tic Tac Toe – Coz it's never too late to have a happy childhood!

39 Upvotes

Since the last few days, I was continuously thinking why Python is one of the most used programming language on this planet? Then I started researching on it at different different platforms and can you guess what I found after my research?

Python is the most versatile language in the programming world and it has applications in various domains. It helps us in taking care of our current programming task as well as lets us focus on the core functionality of Python programming languages.

Learn the steps to creat your cool Python Game project Tic Tac Toe


r/pythontips • • Jan 04 '26

Python3_Specific I finally finished my website for learning Python in the age of generative AI :-)

38 Upvotes

I made this website (free, no ads or anything) and I am desperate for some feedback... :-)

https://computerprogramming.art/

I am particularly proud of my visualizations of loops, hash tables, linked lists, etc.


r/pythontips • • Nov 14 '25

Module is this how you say hello in python?

38 Upvotes

i don't know if this is how you say hello


r/pythontips • • Jan 07 '22

Module Secrets of MicroPython 3: How to measure temperature

38 Upvotes

If you are curious about hardware programming, I just published the 3rd tutorial in the Secrets of MicroPython series. This time it shows how to measure temperature 🌡 As with all my tutorials, this can be completed entirely online in an awesome simulator called Wokwi - no hardware needed! We'll be simulating the code on a Raspberry Pi Pico. Jump in and let's get coding!

https://bhave.sh/micropython-measure-temperature/


r/pythontips • • Oct 05 '21

Syntax Python 3.10 main feature: Structural Pattern Matching (Match Statement)

38 Upvotes

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

Follow @tutobase and checkout tutobase.com for similar python and machine learning posts 🚀.