Category "python"

Django user authentication fails in selenium tests

I'm writing tests for my djangocms app, first time using selenium to replicate the browser/user. I'm trying to test the login page, user simply fills out the us

What is the syntax for writing txt file with multiple numpy arrays+scalars and how to read it in again?

I have 2 numpy arrays of same length lets call them A and B and 2 scalar values named C and D. I want to store these values into a single txt file. I thought of

What's the difference between `raw_input()` and `input()` in Python 3?

What is the difference between raw_input() and input() in Python 3?

Should you always add list.copy() / dict.copy() when passing a list/dict to a function?

I had a painful experience today that I accidentally passed a list to a function, and took me ages to debug. The function was meant to take in a list and create

Get MRR from Stripe API

I'm trying to build a dashboard to view Stripe data (MRR, daily revenue, etc.) alongside usage metrics. I can't seem to figure out a way to pull MRR, revenue, e

Registry query not working with subprocess command

When I enter this in my CMD, it works fine: reg query "HKLM\Software\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v BackupProductKeyDefault

Why do I get a Conv2D error trying to run Conv1D layer?

I am trying to write a simple 1 dimensional convolution with a regression (1 dimensional float) output. model = Sequential() model.add(Conv1D(filters=1, kernel_

How to verify an email in python without sending an email by verifying records?

import smtplib, ssl import dns.resolver,socket smtp_server= 'smtp.gmail.com' port = 465 sender = '[email protected]' pssword = '' addressToVerify = 'raghavareddy

Issue doing greedy search using Python

This is my input text: "you have a choice between 1, 2 or 3 bedrooms" I want to get the number of bedrooms, so one or more numbers before "bedroom" (allowing: '

Behavior of Python subprocess on django+nginx

I have a simple code like: subprocess.run( ["python3", "action.py", "--options"] ) In action.py I import some packages, perform a small script It

python - aiohttp.ClientSession().post

So, I had this code and it worked perfectly fine: def upload_to_imgur(url): j1 = requests.post( "https://api.imgur.com/3/upload.json", heade

changing dtype in polars

i created a data frame using polars. when datas are inserted, dtype of the coulmn automatically changes to what inserted. (i think its a feature of polars?) but

Scrapy doesnt save data [closed]

I am just learning web scraping and using ScrapiApi for proxy, I followed tutorial here, but not able to save any results Here is the output f

I want to make separated file for telegram bot every commands in python

pytelegrambotapii am making a telegram bot and i want to make every command in separated files i tried to do with this code from run_start import * @bot.message

snakemake warning that code used to generate one or several output files has changed, but they haven't

I'm running into an issue where when I dry-run (or run for real) a rule I get this message... The code used to generate one or several output files has changed:

Get previous values when solving an ODE in Gekko

I'm trying to solve a DAE in Gekko, where some of the components will depend upon the solution to a convolution integral This requires a constant dt, but I'm s

Tensorflow Keras: Dimension/Shape Error when running model.fit

I am trying to use Tensorflow and Keras for a prediction model. I first read in my dataset that has shape (7709, 58), then normalize it: normalizer = tf.keras.l

How I can write an objective function >1 summations in Pyomo

I am trying to model a MILP objective to minimize the total cost. The total cost is a combination of the following variables.[Objective Function Screenshot][1]

ModuleNotFoundError: No module named 'qdarkstyle.colorsystem' in Ubuntu Spyder 5.3.0

I have recently installed Ubuntu to try out its usage and efficiency with Spyder. Currently, after using pip to install the latest version of Spyder(5.3.0), I g

Migrate a "zmq_send" command to Python

I have a c function that publish data to a c++ subscriber, now I want to migrate this c function to Python: void setup_msg_publish() { int r; zmqcontext