Category "python-3.x"

Odoo : How to clear a many2many field when a many2one field change?

Im new to odoo. Im using odoo 13 and I have a many2one field and a many2many field with domain on the many2one field. What I need is that if the user changes th

Getting error Bad File Descriptor while installing pip

whenever i try to install pip i always get this error. pls help . i dont know how to fix this i tried doing it using the default python executable using the mod

Implement constrained optimization problem in Mystic

Is it possible to implement the following problem in mystic? The problem minimizes a sum of squares between two (10000 by 40) matrices: Σ(X-A)^2 where X i

Python program works only from pycharm, not somewhere else

The script works fine when I run it in pycharm, but if I run it from somewhere else it just doesn't work. When I run it via cmd it gives me this error: Tracebac

How to convert input arguments to program as json in python

Here is my code import json import sys def main(): payloads=sys.argv[2] payloads=payloads.replace(",",",\"") payloads=payloads.replace(":","\":")

How to add a word in the list of Alphabetical order in python programming language without repeating letters from the alphabet?

How to add a word in the list of Alphabetical order in python programming language without repeating letters from the alphabet? Here's my code: key=input("Enter

how to apply ModelCheckpoint in a custom training loop for tensorflow 2.0?

we can set tf.keras.callbacks.ModelCheckpoint(), then pass a callbacks argument to fit() method to save the best modelcheckpoint, but how to make the same thing

Unable to exit tkinter app when using "wait_variable()"

I have a python code that includes tkinter window and other running tasks. I've been trying to bind "WM_DELETE_WINDOW" event to a function that exits my python

Encounter an Error in Python for Variational Autoencoder

I encounter an error while implementing Variational Autoencoders, the code I actually get from coursera course but it didn't run. the whole code run smoothly,

Calling a REST API with Api Id and key using Python

I am trying to send a request to get a token to an API. curl -X POST "https://base_url/token" -H "accept: application/json" -H "Content-Type: applicatio

Why static files are not loading? | Django

I'm trying to load static files, but it's showing following error: GET http://127.0.0.1:8000/static/css/user/style.css net::ERR_ABORTED 404 (Not Found) - home:2

Improving exception handling of Netmiko script to SSH into Cicso devices

I'm trying to improve the exception handling of a netmiko script that successfully runs commands on Cisco devices listed in a text file and saves a list of the

How to call same start_urls for different search codes in scrapy

Apologies in advance, if my question sounds pretty lame. As per my crawling requirements, I need to hit 1 url and search for 1 item at a time in the search box

File not found error in Jupyter lab using python

I using online jupyterlab which can be accessed through this link below if not then use the second link This is the second link So the problem is i have uploade

python service access to ajax call , CORS error

I'm getting lost with this problem, i have a service written in python that i need to access from a web page with an ajax call the python code is as follows: im

Missing val_acc after fitting sequential model

I am missing information about the 'val_acc' attribute when I fit a compiled sequential model. I have a sequential model that is compiled with 'accuracy' metr

Unformatted date time in response from step function execution history

I am calling below method to get the execution's history of a step function as mentioned in AWS Docs . https://docs.aws.amazon.com/step-functions/latest/apirefe

Counting valleys question from hacker rank

Gary is an avid hiker. He tracks his hikes meticulously, paying close attention to small details like topography. During his last hike he took exactly steps. F

Streamlit time input function doesn't support each single time

Is there any way to show the time menu like above on streamlit? This menu should show every single hour and minute. Other hand streamlit time input provides on

Update a local python dictionary using mongo syntax, without mongo

I have a codebase that uses mongo. I want to add a caching layer in between where the persistence code is called and the actual mongo db, primarily so that I ca