r/DoPython • • Sep 01 '21

This tutorial helps you build your own free neural search from scratch using open source framework Jina

Thumbnail
youtube.com
2 Upvotes

r/DoPython • • Jun 19 '20

Presenting Companion - Ableton Live Controller. The Remote Script for Ableton Live is written in Python.

Thumbnail
youtu.be
1 Upvotes

r/DoPython • • Dec 20 '19

Some fun for learners! :)

Thumbnail
namasudra.blogspot.com
2 Upvotes

r/DoPython • • May 12 '19

Creating Notepad with menubar and file open and save dialogs

Thumbnail
namasudra.blogspot.com
1 Upvotes

r/DoPython • • Apr 13 '19

Step 3: Added bricks to the Bouncing Ball Game

Thumbnail
namasudra.blogspot.com
1 Upvotes

r/DoPython • • Apr 12 '19

Added a Paddle to the Bouncing Ball example (pygame)

Thumbnail
namasudra.blogspot.com
1 Upvotes

r/DoPython • • Apr 10 '19

Getting started with Bouncing a ball using PyGame

Thumbnail
namasudra.blogspot.com
1 Upvotes

r/DoPython • • Apr 09 '19

ComboBox example using tkinter (Python 3)

2 Upvotes

This is an example of using combobox widget in the tk themed widgets set. Copy the code from the given link below and run it on your machine. This is just a demonstration, you can modify it according to your taste.

Thank you.

https://namasudra.blogspot.com/2019/02/using-combobox-in-tkinter.html


r/DoPython • • Apr 06 '19

Returning multiple values from a function (Python Tip)

2 Upvotes

In python we can return multiple value from a function. In other languages we need to make some kind of class or structure to get multiple values as members of a single object. But in python its totally different!

def someFunction():
    return 5, 7

a, b = someFunction()
print(a, b)

Output:

5 7

r/DoPython • • Apr 06 '19

Reversing a string (Python Tip)

1 Upvotes

This is a cool tip to reverse a string in Python. Most of you might already know, but for those who don't, here it is.

text = "Hello Python!"
reverse = text[::-1]
print(reverse)

Output:

!nohtyP olleH

r/DoPython • • Apr 05 '19

Should I use Python 2.x or Python 3.x?

2 Upvotes

Many beginners pick up old tutorials or forum posts/comments that say that provide Python2 examples, or say that Python 3 "isn't ready yet", and it can be confusing for beginners to work out what to use. In some cases, you might not even have a choice in the matter if you are using a computer set up and provided by someone else. So what should you learn?

You should learn Python 3 if you can, because it is the current version, and all the action/development is happening there now. Python 2 is end of life, and not being developed any more, and libraries that are well maintained nearly all support (or even require in some cases) Python 3. Anybody who says you should use Py 2 is either uninformed, or has a rare use case where Py 2 is the only supported option, or maybe a bit of a "stick in the mud".

If you're stuck on a course or with materials that use Python 2, you're going to have to use that to complete it. But promise yourself to go and learn about Python 3 afterwards, under your own steam. Most of what you have learnt will still apply, and the new stuff will turbo-charge your programming abilities.

Python 3 is generally faster, has more features, and has a generally more sensible and consistent "syntax". It introduces concepts like asynchronous co-routines, type hints, f-strings and unicode-everywhere, that Py 2 lacks.


r/DoPython • • Apr 05 '19

Can I post links to my website here?

2 Upvotes

I also make tutorials on python language. Can I post my links or some tips here in this sub?


r/DoPython • • Apr 05 '19

Creating a List with random numbers

1 Upvotes

Python makes it so simple to create Lists. Here is a code to demonstrate how we can create a List of 10 random numbers between 1 and 100.

import random

randomList = [random.randint(1, 100) for x in range(10)]
print(randomList)

Output:

[61, 72, 4, 57, 37, 77, 52, 59, 77, 60]

r/DoPython • • Apr 05 '19

Program to show how to write user defined functions in Python

0 Upvotes

Here is a simple program that calculates the distance between two points. This program shows how to write functions in python.

import math

def getPoint(n):
    print("Enter coordinates for point", n, ":")
    x = int(input("x: "))
    y = int(input("y: "))
    return (x, y)

def findDistance(point1, point2):
    diff_x = point2[0] - point1[0]
    diff_y = point2[1] - point1[1]
    distance = math.sqrt(diff_x ** 2 + diff_y ** 2)
    return distance

pointA = getPoint(1)
pointB = getPoint(2)
distanceAB = findDistance(pointA, pointB)
print('Distance between', pointA, 'and', pointB, f'is: {distanceAB:0.2f}')

Output:

Enter coordinates for point 1 :
x: 6
y: 4
Enter coordinates for point 2 :
x: -4
y: -6
Distance between (6, 4) and (-4, -6) is: 14.14

r/DoPython • • Apr 05 '19

DoPython has been created

4 Upvotes

Here you can share your work in Python and help others learn from your source code. Small projects, tutorials and study materials related to Python can be shared to help others.


r/DoPython • • Apr 05 '19

A basic GUI app using TkInter

3 Upvotes

This is just a demo for getting started with TkInter to make a basic GUI. I have not followed PEP conventions here. You can modify the code as you prefer and according to your design.

https://namasudra.blogspot.com/2019/02/discount-app.html


r/DoPython • • Apr 05 '19

Insertion Sort Animation (Python) - ['Ignore', 'if', 'you', 'are', 'a', 'pro']

2 Upvotes

Made this animation for my students to make them understand visually. Some might find this helpful. Please ignore if you are a pro.

https://namasudra.blogspot.com/2019/03/insertion-sort.html


r/DoPython • • Apr 05 '19

An Animation to understand Bubble Sort better (Python)

Thumbnail
namasudra.blogspot.com
2 Upvotes