Click here to Skip to main content
15,891,943 members
Everything / Programming Languages / Python

Python

Python

Great Reads

by Thomas Weller
Demonstrates how to run Python scripts from C#
by Clark Fieseln
Protect your privacy against malicious network activity and policy violations
by Akhil Mittal
Creating a real-time chatbot using Amazon Lex Services and deploying the bot over Facebook messenger
by Marc Clifton
My adventure with hardware and communicating between a BeagleBoneBlack and a C# app on Windows.

Latest Articles

by Azim Zahir
This article is a demonstration of some of the capabilities of the OpenCV library of Python.
by Oliver Li 2024
Java Code Change Impact Analysis
by Chris Maunder
Learn how to process a video file offline using CodeProject.AI Server
by Matthew Dennis
Create a ChatGPT-like AI module for CodeProject.AI Server that handles a long-running process.

All Articles

Sort by Updated

Python 

U 29 Apr 2024 by Member 16235801
I'm encountering an issue while trying to execute a packaged Python application (using PyInstaller) that relies on the shape_predictor_68_face_landmarks.dat file for face recognition. What I have tried: Despite manually including the file in...
N 29 Apr 2024 by Amarnath S
Looks like you should use Particle analysis/detection within each of those tablets. Firstly, to identify the tablets, you should again use particle analysis/detection. The open source software ImageJ has code for this - see Particle Analysis[^] ...
N 26 Apr 2024 by OriginalGriff
The most likely solution is that the WHERE clause failed: either use the debugger or add logging code to find out exactly what is in selected_item when that code executes, and compare it against the actual DB content. Unless they match exactly no...
N 26 Apr 2024 by Member 15783420
I have created a custom tkinter app and allow the user to update their data. Even thought the message popup the Record Updated, but the SQLite database seem did not change. Where am I go wrong? How am I fix it? What I have tried: def update(): ...
N 25 Apr 2024 by Pete O'Hanlon
I'm going to have to make assumptions that you have circular tablets with circular spots. Off the top of my head, you would use something like HoughCircles to detect all circles in the image; once you have the list of all circles, you would look...
N 25 Apr 2024 by 01fe20bec297
I have a frame which consist of many tablets. There are spots on the tablets. I want to detect those spots which are on tablet. The spots are of random color, random shape and random size. How can i detect these spots using image processing? ...
N 25 Apr 2024 by Azim Zahir
This article is a demonstration of some of the capabilities of the OpenCV library of Python.
N 23 Apr 2024 by M-Badger
As mentioned already, you need to use a different algorithm. Someone might point you towards something specific but it's unlikely that they will give you a course in graph theory or algorithm optimisation. You're going to have to do some reading....
N 22 Apr 2024 by k5054
You need to find a better algorithm. I'm not versed in algorithm complexity analysis, but it would seem you've got something that takes exponential or perhaps, more likely, factorial time based on the number of nodes and edges in the graph. Not...
N 22 Apr 2024 by Mahfoudh Haythem
I wrote a code that lists kplexes in a given graph, the problem is that it is slow on large graphs like these two: jazz.txt karate.txt Is there any way to improve running time on large graphs, it is fast enough on small graphs like this one...
20 Apr 2024 by OriginalGriff
actually running does not mean your code is right! :laugh: Think of the development process as writing an email: compiling successfully means that you wrote the email in the right language - English, rather than German for example - not that the...
18 Apr 2024 by MarkBarry
I create problems/questions in excel and transfer the questions to MS Word. I use MathType for Word. For nice math expressions I write the expression in Excel in Latex and copy and paste to Word. The you can "toggle" all Latex code and MathType...
18 Apr 2024 by Pete O'Hanlon
Your use of & is trying to perform a bitwise operation, which is not supported on tuples. What you seem to be looking for is the and keyword. Replace & with and.
18 Apr 2024 by Elizabeth farriell
I keep getting this error in my code and I don't know how to fix it: line 27, in Northeast_Analysis light_count = np.count_nonzero((5, northeast_packages) & (northeast_packages, 50)) TypeError: unsupported operand type(s) for &: 'tuple'...
16 Apr 2024 by Oliver Li 2024
Java Code Change Impact Analysis
9 Apr 2024 by Chris Maunder
Learn how to process a video file offline using CodeProject.AI Server
4 Apr 2024 by Member 1131834
Hi, I know this is old but maybe it will help someone. I used the following code and it worked as expected. internal class Program { static void Main(string[] args) { ProcessStartInfo start = new ProcessStartInfo(); ...
4 Apr 2024 by Matthew Dennis
Create a ChatGPT-like AI module for CodeProject.AI Server that handles a long-running process.
3 Apr 2024 by Member 15783420
row_id = content.lastrowid new_row_values = [row_id, my_name, my_class, my_mark, my_gender, my_hostel, my_address] table.add_row(new_row_values)
2 Apr 2024 by Richard MacCutchan
You have your parameters in the wrong order in the call to add_row as shown in the source code at CTkTable/CTkTable/ctktable.py at main · Akascape/CTkTable · GitHub[^]: table.add_row(END, my_data) The data dictionary must be the...
2 Apr 2024 by Pete O'Hanlon
You shouldn't need to specify END in add_row. As far as I can tell, from the documentation, you should be able to do this to add the data to the end.table.add_row(my_data) Having looked at your code, you're trying to add a dictionary to something...
2 Apr 2024 by Member 15783420
I need to create a Custom Tkinter app with CTK table, I have an errored when I insert data. I want to insert the data at the end of each row of table, but I didn't know what is the row number should be. My code is as below: What I have tried: ...
31 Mar 2024 by k5054
You bash script already seems to print out the URL it sends in send_request(), but I can't see that your python script does the same. The first thing I would do, is get the python script to print out the URL and compare. If you want to see...
31 Mar 2024 by GiulioRig
Hi i have this script in bash for huobi exchange (https://www.htx.com/en-us/opend/newApiPages/?id=419[^]) #!/bin/bash # Set API keys access_key="" secret_key="" host="api.huobi.pro" path="/v1/account/accounts" method="GET" # Generates a...
28 Mar 2024 by Andre Oosthuizen
Your issue lies within the message - Quote: TypeError: object of type 'TarInfo' has no len() Your 'iter_wrapper' function in your 'swiftclient.utils' module is trying to read the length of a chunk of data, but it's encountering a 'TarInfo'...
25 Mar 2024 by Darshan Vyas 2022
This code should give you the desired output format. Now, you can use this value variable to display your data in a Tkinter GUI, such as with a CTKtable widget. You'll need to integrate it into your Tkinter application accordingly. from...
25 Mar 2024 by Member 15783420
I need to build a Tkinter desktop app with Sqlalchemy as a database. If I read the SQLite database, and print both the header and content of database as show as below: What I have tried: from sqlalchemy import text,...
25 Mar 2024 by Jo_vb.net
Here you find a guide about ThreadPoolExecutor ThreadPoolExecutor in Python: The Complete Guide - Super Fast Python[^]
25 Mar 2024 by Member 13554627
urls = list of urls with concurrent.futures.ThreadPoolExecutor(max_workers=5) as executor: futures = [executor.submit(process_url, url) for url in urls] for future in concurrent.futures.as_completed(futures): result =...
22 Mar 2024 by Alexander del piero
# Function to extract information about 'Abstract heading Font Style' from the document def abstract_heading_font_style(word_file): doc = Document(word_file) font_styles = set() for paragraph in doc.paragraphs: if...
21 Mar 2024 by Hanginium2412
I wrote a Python script which included the python-swiftclient module to connect to the OpenStack Object Storage and upload some files to the container after reading the python-swiftclient documentation:...
21 Mar 2024 by Ege Öztaş
I am trying to understand python's capability to use Windows Messages with pywin32 library. For this I have created 2 scripts that are supposed to run parralel to each other. One is a client that is supposed to send messages the other is a server...
14 Mar 2024 by Pete O'Hanlon
You're very close with this. Your while loop condition needs to be extended so that it doesn't just look at whether the number matches the guess. It also needs to check to see whether you have gone past the maximum number of allowed tries....
14 Mar 2024 by Member 16222767
The code is meant to be able to produce a random number and tell you if you are higher or lower. I want to be able to limit the amount of guesses made to find it. import random MAX_NUM = 100 max_tries_allowed = 10 print("\tWelcome to 'Guess My...
14 Mar 2024 by Member 16222767
count = 0 sum = 1 while (count 100): print (sum) What I have tried: I have tried many different options but nothing seems to be working correctly. I am still a beginner coder, so my coding is...
14 Mar 2024 by OriginalGriff
This isn't a complex problem, it's designed so a beginner can get it done fairly easily - and learn how to start coding; building the skills he needs. You need to do this for yourself because the next task will be more complex - it assumes that...
14 Mar 2024 by 0x01AA
You did not explain what you excpect and what you get. Anyway... 1. What is the aim of continue_flag? I don't see a reason for that. Remove it. 2. Sum of 1 up to xyz: Ok starting with zero is not critical because adding 0 does not change...
13 Mar 2024 by Peter Huber SG
Read my article, which explains in detail how emails are encoded, the different parts they have, how to deal with HTML and pure text, attachments, pics and much more POP3 Email Client with full MIME Support (.NET 2.0)[^]
5 Mar 2024 by Claudia Rodrima
This is the model #!/usr/bin/env python import math import numpy as np import ipdb as pdb import torch import torch.nn as nn import torch.nn.functional as F from modules.pointpillars import PillarFeatureNet, PointPillarsScatter from...
4 Mar 2024 by Oliver Kohl
This article provides a comprehensive guide to TensorFlow 2.x, covering its execution modes, model building APIs, and insights for choosing the right approach for machine learning projects.
21 Feb 2024 by Azim Zahir
Visualizing a Binary Search Tree using Python, Tkinter and Graphviz
21 Feb 2024 by P. Erward
How to put the AWS Lambda C++ Runtime into a Lambda layer and how to use it
19 Feb 2024 by OriginalGriff
Quote: You may not use Python lists anywhere, except in the initializer and the to_list() method. Your LinkedList class may not store a Python list in any attribute. Also, generators are not allowed in this assignment. It's pretty clear: you...
19 Feb 2024 by SAM SAMI 2024
Write a class LinkedList that holds a linked list of values. Your class should be in a source file named linked_list.py, and should support the following operations: LinkedList(list) - create a LinkedList that initially holds the values in the...
16 Feb 2024 by Andre Oosthuizen
You have basically answered your own question without knowing it - Quote: Then I made my consumers.py (here I'm a little bit confused, isn't it better to refer to my room unique_id instead of name, since the ID is unique and not the name in my...
16 Feb 2024 by Apoorva666
I'm working on building a semantic search engine using 'Azure Cognitive Search'. I uploaded my Excel dataset programmatically using Python. To search & run the queries, each field/column in the Excel dataset can be associated with features like...
16 Feb 2024 by gsemerdz
I'm trying to establish a connection with my Django backend and Flutter code using WebSockets, but unfortunately I'm unable to do so, went through many articles and videos and everyone is basically doing the same without receiving an error.....
15 Feb 2024 by Chris Maunder
The full walkthrough of a bare bones module for CodeProject.AI using Python
13 Feb 2024 by Wessel Beulink
You're facing an issue where only the 'retrievable' attribute can be selected for the fields in your Azure Cognitive Search index, while other attributes like 'searchable', 'sortable', 'filterable', and 'facetable' are disabled. This might be...
13 Feb 2024 by OriginalGriff
Answered only to remove from unanswered queue: OP routed to CPAI forum.
13 Feb 2024 by Richard Deeming
You have a column called date of birth, which always needs to be escaped using backticks: MySQL :: MySQL 8.0 Reference Manual :: 11.2 Schema Object Names[^] INSERT into tblpet (name, breed, price, color, age, `date of birth`, gender_id, cat_id,...
13 Feb 2024 by Hanshima AUCKLE
pet cannot be added 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'of birth, gender_id, cat_id, picture, instock) values...
13 Feb 2024 by epc002
My CodeProject.AI is apparently using an old python version ( C:\Program Files\CodeProject\AI\runtimes\bin\windows\python37 ), while I also have Python 3.11.8 installed in windows. How can I, or should I, get CodeProject.AI to use a current...
5 Feb 2024 by Clark Fieseln
Protect your privacy against malicious network activity and policy violations
29 Jan 2024 by Ștefan-Mihai MOGA
Implementation of Producer-Consumer problem in C++ and Python
24 Jan 2024 by Richard MacCutchan
I notice that you have a;ready posted this question at Identify a boolean in large datasets in Python[^], and received a response. Please do not repost the same question.
24 Jan 2024 by Dave Kreskowiak
Is there a function that will comb through a dataset and automatically append data for you based on columns values? No. You have to write the functionality yourself.
24 Jan 2024 by PARISEZINNE12
Please is there a python function to identify a boolean in large dataset ? with 30+ column ? The beneficiary summary file has several chronic illness columns for each member. These are Boolean fields. 1)Convert these columns into a single...
22 Jan 2024 by Feysa Aurelia Chairunnisa
I am doing pushover analysis using Opensees in Spyder. But I only get a linear performance curve. Could you help me find out where the problem is? What I have tried: print("==========================") from openseespy.opensees import * ...
21 Jan 2024 by Ștefan-Mihai MOGA
Design and implementation of a Web Search Engine using Text Mining techniques
17 Jan 2024 by Apoorva666
Fixed the issue by creating a new Conda Environment & installing Spacy.
17 Jan 2024 by Richard MacCutchan
You need to ask at spaCy · Industrial-strength Natural Language Processing in Python[^].
17 Jan 2024 by Apoorva666
When I tried importing the NLP library 'Spacy' using import spacy I'm getting the following error: ImportError: cannot import name 'COMBINING_DIACRITICS' from 'spacy.lang.char_classes' Here are my versions: spacy==3.7.2 spacy-legacy==3.0.12 ...
13 Jan 2024 by pravin kumar sinha
Python GUI non-blocking with timer events, 'select' API, Blender example
12 Jan 2024 by Richard MacCutchan
# Create falling blocks every 2 seconds root.after(2000, create_falling_block) You only do this once, at the beginning. You need to do it more often.
12 Jan 2024 by Member 16181346
import tkinter as tk import random # Create the Tkinter window root = tk.Tk() root.title("Character Movement") canvas = tk.Canvas(root, width=400, height=400) canvas.pack() # Create the character (rectangle) character =...
11 Jan 2024 by Richard MacCutchan
The message is clear, pip could not find that version of a package that you are asking it to load. Check the product's web page (or the PyPI · The Python Package Index[^] lists) to see which version is available.
11 Jan 2024 by HassaN G
hey, guys, I get these errors when I try to install python -m pip install -r r.txt on Cpanel. ERROR: Could not find a version that satisfies the requirement cloud-init==23.1.2 (from versions: none) ERROR: No matching distribution found for...
4 Jan 2024 by Richard MacCutchan
If you examine the text returned from that web site you will note two things: 1. There are no items of type "span" with the class "authors". 2. There are items of type "small" with the class "author".
4 Jan 2024 by Mohammed bilal from Durham
when I am executing the code , i think that the code has mistake but when I I am executing any code the terminal was like this example 01: import requests from bs4 import BeautifulSoup url = "https://quotes.toscrape.com/" response =...
2 Jan 2024 by OriginalGriff
It doesn't quite work like that. We do not do your work for you. If you want someone to write your code, you have to pay - I suggest you go to Freelancer.com and ask there. But be aware: you get what you pay for. Pay peanuts, get monkeys. The...
30 Dec 2023 by Maciej Los
Check this out: Python Program to Check Prime Number - GeeksforGeeks[^]
28 Dec 2023 by windrider 2023
you shoud first ping and telnet ip 22 , make sure network and secrity is ok
27 Dec 2023 by Member 4201813
Imaginary coding interview using Fibonacci numbers as single showcase for a surprising variety of programmers' skills.
27 Dec 2023 by Miguel Angel Cabrera Miñagorri
Learn to create real-time computer vision applications with a couple of Python functions and a model URI.
27 Dec 2023 by Richard MacCutchan
Python will do the work for you: email.parser: Parsing email messages — Python 3.12.1 documentation[^].
26 Dec 2023 by Shivani 2
i am confused how can i start parsing an email What I have tried: still haven't tried anything because i am confused at the very starting .
26 Dec 2023 by OriginalGriff
Firstly, start by finding out where it's printing "Current position: None" - there are two places that explicitly print that, and one that could print that if the valuer of current._element was None. You can use the debugger to step through your...
26 Dec 2023 by User204
# Snake_ladder game using doubly linked list class Empty(Exception): """ Error attempting to access an element from an empty container.""" pass class DoublyLinkedBase: """Queue implementation using circularly linked list for...
21 Dec 2023 by deangi
A DIY digital picture frame application in Python
18 Dec 2023 by Intel
Leverage Intel® Software Guard Extensions on Virtual Machines to Deploy Secure, Accelerated Machine Learning Pipelines
18 Dec 2023 by Intel
Optimizing Large Language Models on Intel® Xeon® Processors with Intel® Advanced Matrix Extensions (Intel® AMX)
18 Dec 2023 by Intel
Transfer Learning on a CPU Is an Efficient Way to Build Accurate Image Classifiers
18 Dec 2023 by Intel
Fast and Easy Training and Inference Using Intel® Consumer GPUs and Windows* Subsystem for Linux 2
18 Dec 2023 by Oliver Kohl D.Sc.
Step-by-step guide on data-cleaning
17 Dec 2023 by v87
Farmer John's cows have quite the sweet tooth, and they especially enjoy eating candy canes! FJ has N total cows, each with a certain initial height and he wants to feed them M candy canes, each also of varying height (1≤N,M≤2⋅10^5 ). FJ plans...
17 Dec 2023 by Dave Kreskowiak
I stopped reading at "PLEASE HELP NOW!". Such demands are exceptionally rude. The only thing I will say is for performance problems, you do NOT want to put loops inside of loops, which are again, inside another loop. That's all I'm going to say.
17 Dec 2023 by Evgeny Pereguda
This article presents my project for capturing of video and audio sources on Windows OS by Microsoft Media Foundation.
14 Dec 2023 by Arcadegame frame
Is there any effective way to prevent a process from spawning children and revoke its permissions? I am seeking a robust approach to entirely block a process's ability to generate subprocesses and, if possible, restrict its permissions and...
14 Dec 2023 by Member 16163045
Idea not answer trying to block a proccess from creating you can either try killing all of its subproccesses repeatedly. note: add a delay so the users computer doesn't have a bsod (bluescreen of death). if that doesn't work or you still want...
13 Dec 2023 by Naveen Negi Dec2023
You need help with your Seaborn plots. Let's address them one by one: 1. Overlapping x-ticks in `sns.countplot`: This usually happens when too many unique values are in the 'age' column. To make the plot more readable, you can either increase...