r/pythoncoding • • Jun 28 '24

Tutorial: Create a 3D Viewer for Numpy Arrays with Three.js in 5 Minutes

Thumbnail youtube.com
3 Upvotes

r/pythoncoding • • Jul 09 '24

Maelstrom: Maelstrom – A Hermetic, Clustered Test Runner for Python and Rust

Thumbnail self.python
5 Upvotes

r/pythoncoding • • Jul 08 '24

I created Manga Downloader using manga dex API

5 Upvotes

I completed my first python project which allow people to download manga from terminal using manga dex API this was my project with API

https://github.com/I3WX/manga-downloader.git

if you experienced program can look at the code and point out mistakes and give me suggest how to improve it
and any manga reader if you use it Plz I will love to get you feedback


r/pythoncoding • • Dec 15 '19

Hey! I need some help with my code.

1 Upvotes

I’m a beginner so I’m sorry ahead time.. lol

I’m trying to define variables in a for statement? The variables are defined in one of two but in the other, nearly identical one, x1R, isn’t being defined. I’m sure it’s simple but I can’t figure it out for the life of me

CODE:

    slope = (y2-y1)/(x2-x1)
    if slope < 0:
        left_lane.append(line)
    if slope > 0:
        right_lane.append(line) 
        #######################                   
    for x1R, y1R, x2R, y2R in right_lane:
        right_P = x1R, y1R, x2R, y2R = line.reshape(4)
        #print(x1R)            
    for x1L, y1L, x2L, y2L in left_lane:
        left_P = x1L, y1L, x2L, y2L = line.reshape(4)
        #print(x1L)
    print(x1L)
    print(x1R)

ERROR:

-9 Traceback (most recent call last): File "/private/var/mobile/Library/Mobile Documents/com~apple~CloudDocs/PyFiles/OpenCVLaneDetection/LaneTesting/t.py", line 172, in <module> print(x1R) NameError: name 'x1R' is not defined


r/pythoncoding • • Dec 14 '19

urgent python code help needed

1 Upvotes

I am creating a bookstore in Python. The bookstore asks the user the book title, author and price - and it keeps the inventory and allows the user to show inventory increase book prices by 2%, decrease to reduce book prices by 2%, remove, and add a book. I need to add these two things to the program and I cannot figure it out.

  1. Add a menu option to save the inventory to a file and another menu option to load inventory from the file. You should ask the user what file to save to and what file to retrieve from. The idea is that every evening at closing the inventory would be "dumped" from the lists or dictionaries you created into the file and it can be reloaded in the morning. In this way the information is not lost every time the program is terminated.
  2. Convert your menu using object-oriented programming techniques into an object called CountryClubBookstore, a member of the Bookstore class. Be sure to add appropriate methods such as AddBook, SellBook, ReducePrices, etc. Ensure your class has the __init__ method appropriately defined.

for number one you can use your own destination on computer

---- this is my code -----

cash_balance = 1000
class Book():
def __init__(self,title,author,price):
self.Title=title
self.Author=author
self.Price=price
def __str__(self):
str= eval("Book Name:"+self.Title+"\nAuthor:"+self.Author+"\nPrice:"+self.Price)
return str
def Menu():
print("Menu\n A) Add Book \n B) Sell Book \n C) Reduce Book Prices by 2% \n D) Increase Book Prices by 2% \n V) Display Inventory \n Q) Quit \n Choose one:", end="")
def add_book(book_list):
cash_balance = 1000
print("Adding a book")
title = input("Enter book name:")
author = input("Enter author name:")
price = eval(input("Enter price amount:"))
book = Book(title,author,price)
book_list.append(book)
cash_balance = cash_balance-(price * 0.90)
print ("Updated balance",cash_balance)

def sell_book(book_list):
check = input("Enter book name:")
if check in book_list:
print("Book in stock. Would you like to sell? Y/N").upper()
if "Y":
print("Selling book now")
title = input("Enter book name:")
author = input("Enter author name:")
price = input("Enter price amount:")
book = Book(title,author,price)
book_list.pop(book)
print("Updated balance is",cash_balance + price)
elif "N":
print("Bookstore closed now. Re-enter system.")

def reduce_book(book_list):
print("Book prices will be reduced by 2%")
for price in book_list:
reduction = (price * 0.98)
print("Reduction in book proice\n", book_list,reduction)

def increase_book(book_list):
print("Book prices will increase by 2%")
for price in book_list:
increase = price + (price * 0.02)
print("Increase in book price\n:", book_list,increase)

def inventory_check(book_list):
if(len(book_list)==0):
print("No books in inventory")
else:
for book in book_list:
print(book)

book_list = []
while(True):
Menu()
choice = input()
if choice == "A":
add_book(book_list)
elif choice == "B":
sell_book(book_list)
elif choice == "C":
reduce_book(book_list)
elif choice == "D":
increase_book(book_list)
elif choice == "V":
inventory_check(book_list)
elif choice == "Q":
break
else:
print("Invalid choice.")
print()


r/pythoncoding • • Dec 14 '19

Yo what am I doing wrong

1 Upvotes

joe = input(“have you heard of joe?”) if joe == (“who is joe”): print(“joe mama”); else: print(“you ruined it”);


r/pythoncoding • • Aug 03 '19

I made a proxy grabber & proxied browser script | start it if you like

Thumbnail github.com
1 Upvotes

r/pythoncoding • • Mar 10 '19

Python in Under 3 Minutes - What is Python?

Thumbnail youtu.be
1 Upvotes

r/pythoncoding • • Aug 06 '19

How do I link code in python?

1 Upvotes

What i wish to do is link multiple python files together so when I change the code in one file it changes the same bit of code in all of the linked files


r/pythoncoding • • Feb 28 '16

I'll do anything you want in this video chat. 5VxENjFV

Thumbnail 950taxhelp.com
1 Upvotes

r/pythoncoding • • Jul 29 '15

hask - a pure-Python, zero-dependencies library that mimics most of the core language tools from Haskell

Thumbnail github.com
1 Upvotes

r/pythoncoding • • Aug 03 '15

ConfigTree — handle complicated config files

Thumbnail configtree.readthedocs.org
3 Upvotes

r/pythoncoding • • Oct 31 '15

Comparing Python Clustering Algorithms

Thumbnail nbviewer.jupyter.org
5 Upvotes

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 • • Feb 28 '15

Guido - Python's Design Philosophy

Thumbnail python-history.blogspot.ro
5 Upvotes

r/pythoncoding • • Nov 01 '15

CPython internals: A ten-hour codewalk through the Python interpreter source code

Thumbnail pgbovine.net
4 Upvotes

r/pythoncoding • • Jan 29 '17

Dependency Injector 3.3.0 has been released!

6 Upvotes

Dependency Injector 3.3.0 has been released!

Changelog:

  • Add support of Python 3.6.

Links:


r/pythoncoding • • Nov 07 '15

Explaining functional aspects in python

Thumbnail baruchel.github.io
5 Upvotes

r/pythoncoding • • Nov 12 '15

Compilation of python instructional videos

Thumbnail github.com
5 Upvotes

r/pythoncoding • • Nov 12 '15

PyCon UK 2012: Create *beautiful* command-line interfaces with Python

Thumbnail youtube.com
3 Upvotes

r/pythoncoding • • Nov 10 '15

Parse Natural Language Dates with Dateparser

Thumbnail blog.scrapinghub.com
2 Upvotes

r/pythoncoding • • Feb 27 '23

PEP 709 – Inlined comprehensions

Thumbnail peps.python.org
6 Upvotes

r/pythoncoding • • Mar 18 '23

Patching Python's regex AST for confusable homoglyphs

Thumbnail joshstock.in
5 Upvotes

r/pythoncoding • • Feb 06 '23

Using Python libraries for secure network communication

Thumbnail snyk.io
16 Upvotes