Featured
-
No Featured Found!
Tags
python Blockchain code hashes transfer
Hi, I am a beginner in python. I am working on blockchain and I am trying to transfer hashes through socket programming but on the client-side, I am receiving nothing. Can anyone please help me if this work can be done through a database like i c...
is there a way to insert specific event dates and other info in a calendar date cell
I am trying to select data from the sqllite3 database and insert them into the tkcalendar so the user can insert his event info (registration_check_date, car_type) and view them by clicking on the calendar specific colored date cell, I had conver...
How to get id ("not name") of a radio button via POST request in Django?
<div class="form-check">
<input class="form-check-input" type="radio" name="q1" id="q1a">
<label class="form-check-label" for="q1a">
A story te...
Web Scraping Code Bug- Returning Empty List
hi i want to scrap all the pairs that kucoin support from the webpage but the code that i wrote just return a empty list. how should i correct it?
from bs4 import BeautifulSoup
from selenium import webdriver
driver = webdriver.Chrome(e...
Why I am getting this error in the code ''int' object is not callable'. Thanks for help!
Here is my Code:
class Account:
def __init__(self, owner, balance, deposit, withdraw):
self.owner=owner
self.balance=balance
self.deposit=deposit
self.withdraw=withdraw
def __str__(self):
return f'Ac...
sqlite3.OperationalError: near group: syntax error in sqlite3
I use sqlite3 library for using database in python. When I want to make a table, I get this error:
sqlite3.OperationalError: near "group": syntax error
My function that does this:
def connect():
conn = sqlite3.connect(dbpath)
...
How to save modification of a file in original file not a new one?
Dear all,
I have a code to modify a file. This code make changes on my file and save it to a new file. But, I want to have changes(modifications) on my original file not a new one. I made attempts to change the code but it didn't work. How...
How can I give a 3D dimension of a layer with Python?
I need your help with a problem regarding the 3d plot. I have created a layer T2 with the below code, and what I what it to do is to give this layer a volume with a third dimension. That means to be raised it, let's say 2 or 3 units, and from...
Python Programming Task Help
Hi please could you someone help me with this python question. Part of my uni course!!! Only have an hour till submission and totally lost. Thank you so much! Any help at this point would be appreciated.
TASK
A virus is ...
Help with Python Drills
// Have several things that you want to change into something else? Reduce it
const fullNames = [["s", "peter"], ["p", "athena"]]; // -> ["Peter S", "Athena P"]
const scores = [34, 33, 1, 0, 99, 123]; // 48.33
// with full names (from abo...
Error can't understand
#NiceHexSpiral.py
import turtle
colours=['red','purple','blue','green','yellow','orange']
t=turtle.pen ()
turtle.bgcolor ('black')
for x in range (360):
t.pencolor (colors[x%6])
t.for...
Rewrite hit_target() function
Rewrite hit_target() function
Existing hit_target() function uses a primitive algorithm to get the target coordinates. Your task is to rewrite hit_target() function with the most optimal algorithm to make as ...
Copying file content to other file
Hi,
I have two files file1 an file2. I want to take each line from two files and compare with a keyword if the keyword matches in both the files. The complete line which matches from file1 should be written to file2 at the position below the m...
Using own Python classes with the runtime type and range checking feature of the library Pyadaaah
I am currently trying out pyadaaah - which works quite fine - until I try to use own classes in a vardef line. I then get the error message:
Fatal error in VarDef.__init__: Fatal error in VarDef.__processTypeSection: evaluating type section ...
How to create a program in python that will auto-fill forms?
Here is my HTML code:
html
<html>
<div class="echo-chat-body" dir="ltr">
<div class="new-chat-form">
<div>
<h1 class="echo-title desktop-only">
Topic?
...
numpy array: Python statement to find the sum of the eight array elements in the cube center
Consider the following Python code that generates a three-dimensional array. This array has 1,000 elements. Imagine that this array is a cube as shown blow.
np.random.seed(7) a = np.random.randn(10, 10, 10)
I need a Python statement to fin...
How to Convert Parallel Loop in Matlab to Python?
T = 10
N = 100 % number of tasks
parfor i = 1:N
% initialize "t" for each "i"
t(i) = 2;
% keep track of t(i) for each "i"
while t(i) < T
...
help with minimax tic tac toe ai
hello i am creating a minimax tic-tac-toe ai. i finished my program but it doesn't work it keeps choosing the next available spot
this is my got repo https://github.com/adam-kabbara/tic-tac-toe-ai
example of choosing...
Help please
You are given the following data for agents
agent
is_available
available_since (the time since the agent is available)
roles (a list of roles the user has, e.g. spanish speaker, sales, support etc.)
When an...
SQLite query of SELECT is not working on jupyter notebook.
""" INSERT INTO ACTOR VALUES (
{ aid = '1', fname = "fname1", lname = "lname1", gender = "male" },
&nb...
how to generalize this by changing the line I have specified?
I have created a SQLite database in a folder which if I move somewhere else from the location which I have specified below is not going to work as only one location is specified in the code not all in general. I cannot use the database after copy...
What went wrong in my simple code?
# A very simple python program to compare two numbers using functions
from sys import exit
def main():
check()
compare(x, y)
def check():
# prompt user for two numbers
x = input("x: ")
y = input("y: ")
...
Which one would be faster in Python I = I + 1 or I += 1 ?
I know these two expressions produce same results but I would like to know which one is faster and why. If I were to use them in two different loops with each loop iterating about hundred times, which loop will finish executing first and by what ...
How to Combine Stochastic Hodgkin Huxley Model Code with Voltage Dependent Calcium Channel
I have written a python script for Hodgkin huxley model as well as for a voltage dependent calcium channel. I want to combine both the code together and want that the voltage given by hodgkin huxley model should be the input for voltage dependent...
How to Communicate with an IOT Device in Python Program
Hi, I have an IoT device which I connected via websockets. Once the two way communication is set up, I would like to send a command to the device via my IT admin site (For Example shutdown IoT).
How do I accomplish that?
&nbs...
Help Me Understand Hangman Game Breakdown in Python
My question is with regards to the below code its a hangman game. I got this code online and trying to reverse engineer it so i can understand it better. My question is specifically regarding two lines , i need to understand the individual line...
How to Correct or Get The Mistake in This Python Code?
def greedy_cow_transport(cows,limit=10):
train = []
while sum(cows.values()) > 0:
cart = []
total = 0
for cow, value in sorted(cows.items(), key=lambda x:x[1], reverse=True):
if cows[cow] != ...
How to Multiply Custom Weight to TFIDF Value Created by Word Vectors from Tweet Text in Python
How to Multiply Custom Weight to TFIDF Value Created by Word Vectors from Tweet Text in Python
Need a lil help with Python coding.
I have a data frame as:
Tweet Text word1 word2 word3 word4
Tweet1 &nbs...
How to Display Power Set of 2 Sets of Fibonacci Series n and m?
Firstly the Fibonacci series is 1,2,3 not 5,8,2 it is not getting corrected. Secondly the correct power set is not getting generated. In the last is I want to generate two Fibonacci series of n and m (they can be same) and generate the power set ...
Can You Please Spot the Error in the Following Python Code?
How to display a powerset using the following code? what is the mistake and where? why the output is not getting displayed? What to do to display the output?
def power_set(items):
N = len(items)
# enumerate the 2 ** N pos...
How to Write Python Code (2.7 version) for the following Problem?
Write python code(2.7 version) for the following and also explain the logic because i am not understanding please explain.
Eight houses ,represented as cells , are arranged in a straight line.Each day every cell competes with its adj...
Why Validation Accuracy Doesn't Change in Classification Using Stateful LSTM - Python
I am trying to classify some video into 3 different classes. Each video has different length of frame. The training data has the shape of (104, None, 528) where:
- 104 = Number of videos
- None = number of frames f...
I"m Getting Memory Error When Permutations/Combinations Exceeded 10 Elements
Hi
I am new to python coding but would like to use it to generate all the permutations and combinations of a slot car track layout given a list of pieces of track. I figure each piece of track is a block that connects at each end. Curved pie...
How to Find Maximum Sum in Array so That No 2 Combination Elements Have Common Digit?
Hello,
I want to know How to find the maximum sum in an array given that no two elements of the combination have a common digit?
Yesterday, I was asked a question in the interview where I have to make an algorithm that will...
How to Solve Optimization in scpy.optimize.minimize Problem?
I have a problem with optimizing of a function that contains loops. I start with paricular lista=[0.002,0.006,0.003,0.02,0.008,0.006,0.05] of floats and the intervals `(0,k*0.0025),(0.005,k*0.005),(0.005,k*0.0125), where upper border de...
How to Write Image to Excel File in Same Workbook but Different Sheet in Python
I can write all other filed to excel sheet, but not having any luck with writing image to excel sheet.
I am trying to grab image file name from setimage function and that is where i am stuck.
I am not sure how i can use ...
How to Write Code in Recursive Version in Python for My Code
def sub_lists(list1):
sublist = [[]]
for i in range(len(list1) + 1):
for j in range(i + 1, len(list1) + 1):
sub = list1[i:j]
sublist.append(sub)
return sublist
l1 = [1, 2, 3, 4]
print(sub_lists(l1))
How to Implement Tweets Live Streaming Using Tweepy and Save Tweets in .csv file
I am a newbie to python, after reading streaming with Tweepy and going through this example I am just trying to write tweepy app to crawl live stream data with the tweepy Api and save it to .csv file but I &nb...
How to Make a Server and Client with Python Socket
I am trying to make a server and client which sends a file from client to server and the server saves it to hard then the server asks for another file and if the answer of the client is yes then the client sends the second file then the server ag...
How to Code Guess Number Game in Python
How to Code Guess Number Game in Python.
I need a code what ask to continue the game if the user wins.
How to Resolve "Unhashable Type: Index" Error Code in Python3?
I'm getting "Unhashable Type: index" error in python code. Can you please help to resolve this? I'm using python3.
df_temp_cns = pd.read_excel(r"/nsmnt/NS_Exec_DSHBD/IS_IT_Demad_Perf/cns_weekly/SrcFile/JnJ_CNS_Wee...
How to Merge Two Tables on Coded Columns Using Python
Hi guys!
I have two tables and I need to merge these two tables on columns left_on='A', right_on='B'. The problem is that 'A' column is coded 'B' column.
What would be the best optio...
How to Insert Data Contained in Entry Widgets on a GUI Correctly into SQL DB Created in Python?
In the code below the str entry widgets that I use the get method to retrieve data from, have been created earlier in the code.
I have tried the following ways to solve the problem:
turning the list into a tuple
using a list ...
Please Help Me With the Sensors Management Code in Python
Hi
I want someone make a code using python, this code relating to sensors management, read order, show the result, save the result and arrangement the results, that for 6-20 sensors at the same time.
If there is a programmer can d...
Remove Function Not Working in Code That Solves Sudoku in Python
I have been trying to write a code to solve sudoku. This method basically involves finding the empty elements in the list of input, then filling the empty elements with the possible values that can be used in that box by deleting the values prese...
String Passing in Python Class Methods - Output Error
My input string from a file is ANG 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 My required output should be 0.0 0.0 0.0 0.0 0.0 0.0 100 0.3 But Now my input is same as output .The last two zeroes under ANG string to be replaced as 100.0 and 0.3 respectively....
How to Call Background Function Using Linking Tkinter GUI to a separate Python File
I am having problem with having a GUI interface to be implemented via a second file which just contains the file to read, plots made and some new functions to be evaluated based on that.
I am trying to create a GUI application using Tki...
How to Get My Data of Output File Sorted in Python Program?
I want writing function for sorted_average() . I calculated average of data in input file and write them in my output file. then i want sort data of out put file. but my cod not working...
my out put file is :
manda...
How to Fix Parameters & Return Function in Python Program Code?
How do I code the following program in Python?
[![program I have doubts in][1]][1]
(forget the third point)
This is what I've tried:
def bookstore(price,book):
...