r/pythontips • • Sep 11 '20

Python3_Specific Have you missed amazing offers from amazon? Then this project helps you to track the price of any product & whenever the price goes down it will automatically notify you.

32 Upvotes

r/pythontips • • Jun 21 '20

Long_video Space Invaders in Python Part 3 - Enemy and Background

32 Upvotes

r/pythontips • • Feb 21 '20

Searching for a tool to visualize code relationship between functions and classes

32 Upvotes

I am looking for a tool that visualizes all the connections between functions, classes and objects as a graph or something like a class diagram.

For example, in VScode or any modern IDE you can right-click on a function, class, etc name and see all its references or its definition. I want a tool that visualizes these connections so if F1 is calling F2 in its body I see a F1 as a graph node that points to F2 or something similar to this. Does such a tool exist?


r/pythontips • • Nov 01 '19

Learning python advice

32 Upvotes

I’m a stay at home mom. Who was previously an engineer. Retraining at home with python.

Anyone got any good advice?


r/pythontips • • Oct 27 '18

Use Gmail with Python to send mails. Automate it!

32 Upvotes

r/pythontips • • Mar 27 '24

Standard_Lib Using the 'collections.namedtuple' class to create lightweight and immutable data structures with named fields

31 Upvotes

Suppose you want to create a data structure to represent a person, with fields for their name, age, and occupation.

import collections

# Create a namedtuple for a person
Person = collections.namedtuple('Person', ['name', 'age', 'occupation'])

# Create an instance of the Person namedtuple
p = Person(name='Alice', age=25, occupation='Software Engineer')

# Access the fields of the namedtuple using dot notation
print(p.name)  # Alice
print(p.age)   # 25
print(p.occupation)  # Software Engineer

# Output:
# Alice
# 25
# Software Engineer

The collections.namedtuple class is used to create a lightweight and immutable data structure with named fields.

This trick is useful when you want to create lightweight and immutable data structures with named fields, without having to define a full-fledged class.


r/pythontips • • Feb 04 '24

Meta I am 19 years old? Should I start?

31 Upvotes

Hello to everyone reading!!!! My name is Andrew I am 19 years old, and I am considering learning python software engineering.

I have couple of doubts about it….

  1. I really connecting to the AI thing nowadays and wanted to know more about AI implementation and software engineering (because all the videos you see about software engineering is someone eating and working in some fancy office.) I really want to understand what is to be qsoftware engineer and what’s is the job.

  • How much takes to learn Python if I can learn each day 2 hours at minimum.

  1. I was nearly all my life starting it age 4 in computer. And starting from 2020 and until now I were interested in coding but never really started(maybe tried couple YouTube videos). And now I see many startups around AI niche and software development, and my question - - How much hard is to make those applications and if possible to do it all alone?

  2. And last I and the least important. Now I learning finance and company evaluation. If I have enough time, maybe I should consider learning both or focus on one of them


r/pythontips • • Apr 08 '23

Python3_Specific Combine Two Dictionaries in Python Using the Union Operator (|)

31 Upvotes

Are you tired of using the `update()` method or the `{**dict1, **dict2}` syntax to combine two dictionaries in Python? If you're using Python 3.9 or later, there's a new and more elegant way to merge dictionaries using the union operator (|)!

Here's an example of how to use the | operator:

dict1 = {'a': 1, 'b': 2}
dict2 = {'c': 3, 'd': 4}

combined_dict = dict1 | dict2
print(combined_dict)  # Output: {'a': 1, 'b': 2, 'c': 3, 'd': 4}

This new dictionary contains all the key-value pairs from both dictionaries. Very easy and elegant to use. I hope you found this tip helpful! If you have any questions or comments, feel free to share them below. Happy coding!

Subscribe to my Youtube Channel for tips such as this


r/pythontips • • Feb 16 '23

Short_Video Beginner Tip - Use Dictionary .get() method to Improve Code Readability When Using Dictionaries

31 Upvotes

Many times in coding interviews we work with simple dictionaries with structure as follows:

my_dict = {"key1": 10, "key2": 20, "key3": 30}

In many scenarios, we want to check if a key exists in a dictionary, and if so, do something with that key, and reassign it. Example...

key = 'something'
if key in my_dict:
    print('Already Exists')
    value = my_dict[key]
else:
    print('Adding key')
    value = 0
my_dict[key] = value + 1

This is a common workflow seen in many leet code style questions and in practice.

However it is not ideal and is a little noisy, we can do exactly this with the .get() method for python dictionaries

value = my_dict.get(key, 0)
my_dict[key] = value + 1

It does the same thing as above with fewer lines of code and fewer accesses to the dictionary itself!

So I recommend beginners be aware of this.

I have a Youtube video on how to use it as well, with more details :) https://www.youtube.com/watch?v=uNcvhS5OepM

If you are a Python beginner and enjoy learning simple ways to help you improve your Python abilities please like the video and subscribe to my channel! Would appreciate it, and I think you can learn some useful skills along the way!


r/pythontips • • Sep 05 '22

Python3_Specific My first project

31 Upvotes

This is my first project can you please tell me your opinions:

https://github.com/khmdvjamshid/Tic-tac-toe-game/blob/main/tic-tac-toe


r/pythontips • • Feb 14 '22

Standard_Lib New to Python. Any youtube video suggestion to properly learn how to use python?

31 Upvotes

I'm italian, so I'm trying to learn how to use Python watching italian videos, but apart from a small youtuber there aren't any good videos. Any suggestion?


r/pythontips • • Feb 02 '22

Short_Video Processing Iterables Without a Loop

31 Upvotes

Hi everyone!

My most recent video demonstrates how you can process iterables without a for-loop by making use of some convenient (and efficient) built-in Python functions.

You can view it here.

Hopefully the presented information is useful to someone on this subreddit!

Best,

Thijmen


r/pythontips • • Nov 27 '21

Syntax Automatizing Boring Stuff

31 Upvotes

Hello guys. This is my first post. I am total beginner in Python and coding. But I really want to automatize my work. My work us about to get data from goverment sites, such as degrees, taxes, and all that kind of Stuff. So, I only do ctrl+C and ctrl+V in a spreadsheet, one by one, like a robot. All Day. Can I use python to do this work? I'll realy apreciate every help. Like subjects to investigate or where the f* can I start Sorry for my Bad english


r/pythontips • • Nov 26 '21

Short_Video Write Shorter Conditionals (Using Dictionaries)

31 Upvotes

Hi everyone!

My most recent video demonstrates a concise alternative to the classic If-Else statement and the recently introduced Match-Case statement. Although it is not always applicable, there are plenty of situations where this can improve your code's readability and decrease the amount of lines needed.

You can view it here.

Hopefully the presented information is useful to someone on this subreddit.

Best,

Thijmen


r/pythontips • • Aug 05 '21

Python3_Specific 10 Best Python IDEs To Help in Python Programming

31 Upvotes

Using Python Is Easier With These 10 Python IDEs.


r/pythontips • • Jun 27 '21

Python2_Specific Learn python

31 Upvotes

I want to start learn python.. Could Any one help how to start and learn from basics..


r/pythontips • • Jun 15 '21

Data_Science COVID Vaccine Dashboard | Graphics, web-scraping, databases

31 Upvotes

r/pythontips • • Jun 09 '21

Python2_Specific Python IDE

31 Upvotes

What is all of your recommended IDE's you use for Python? What is the BEST IDE for Python????


r/pythontips • • May 24 '21

Long_video Kivy App Full Tutorial - (Part 1) | Debug Mode | kivy android apk | kivy android app tutorial 2021

31 Upvotes

Yesterday I had just released a video where I am teaching on how to make Kivy App to run on Android.

Made this video after a long time since there is lockdown and covid still on. But any ways thats ... that...

In this video I am teaching on how to make Python App using Kivy but just showing plane simple app like hello world and stuff. That everyone does and youtube has tons of it.

Here I made a nice functioning app running in Python but.... to compile ... I am not using any software from my computer.
I am using Google Colab.

Check out and have fun:- https://youtu.be/k12E5jbWqQQ


r/pythontips • • Apr 19 '21

Python3_Specific Username and password program

31 Upvotes

I am making a program where I have one file that has usernames, a comma and then passwords. I am making a program where it will output all of them to another file and then add to the end of the line the strength for each one

I know how to open files but could I use a for loop for reading each line and writing it to the other file and adding text to the right of it?

Edit: note: security will not be a requirement for my project so I am fine with working with plain text. I am not using this for a major production situation


r/pythontips • • Mar 31 '21

Long_video How To Write First UI Test Using PyTest And Pylenium

31 Upvotes

This video is a part of PyTest Tutorial, and in this video, Carlos Kiddman has explained how to write your first UI test using PyTest with respect to Web automation with LambdaTest and PyTest.


r/pythontips • • Jan 25 '21

Syntax From your experience, how easy is Python to learn and apply for data analysis if your main coding backround is SQL?

31 Upvotes

Hello all,

From your experience, how easy is Python to learn and apply for data analysis if your main coding backround is SQL?

I mainly write "querying" data type SQL statements, and ocassionally have to utilise Update, Delete, Insert type commands.

How easy is it to pick-up Python with that type of SQL background? I also do some software specific coding.

Appreciate this may be a stupid question and "it depends" but I am trying to gauge the level of effort that may be required.

Ultimately I want to be able to use Python when necessary for data projects.

Thank you.


r/pythontips • • Dec 09 '20

Meta Job offers and developers

31 Upvotes

Hi!,

I found out that it is really hard to find a good discord server where I can find job offers or post an offer for developers... Because of that I decided to create a new discord server only for that. I would like to create a nice, friendly community to help each other finding new projects or developers to develop new incredible things! I would like to invite you there, here is a link https://disboard.org/server/785944707582656513 I am also looking for mods and people that would like to help me to grow it so please feel free to write to me and ask for joining our admins!

Kind regards


r/pythontips • • Aug 21 '20

Data_Science Data Visualization using Plotly & Cufflinks | Python| Data Science

31 Upvotes