3,377 questions
-1
votes
1
answer
38
views
My Code With Openrouter api is not working
I'm trying to automate intraday financial analysis using OpenRouter's free models. My Python script rotates through several LLM endpoints, sending a prompt about a stock's symbol, change, and closing ...
0
votes
1
answer
65
views
Cosmographia not starting in Ubuntu
I recently got Ubuntu in my laptop. I installed the cosmographia version 4.2 for Linux. After installation the cosmographia runs when run using the installer GUI. However after shutting down this ...
0
votes
0
answers
90
views
having application run error with python3 and flask
I am trying to run a simple flask application with python3.5 but getting below error.
SyntaxError: future feature annotations is not defined
i have installed the latest version of flask using below ...
0
votes
0
answers
486
views
How to install object-detection library without downgrading Python version?
I am trying to install object-detection library using cmd but having an issue
I tried
pip install object-detection
I am getting this error
ERROR: Ignored the following versions that require a ...
1
vote
1
answer
289
views
Reading alb logs in python using boto3 and athena
I want to access alb logs in my django code,i am trying to use athena query to get the logs for which i am connecting to athena client using boto3 version 1.3.1 to query into athena using python
This ...
0
votes
2
answers
28
views
* operation in python for 2-d matrix initialization
You init a 2-d matrix like this
board = [[0] * width for _ in range(height)]
Instead of
board = [[0] * width] * height
as it creates the list once and every row references the same list.
Is it not ...
1
vote
2
answers
7k
views
I can't install or run beautifulsoup
I was trying to install beautifulsoup using pip and then there was a message that asked me to update pip so i did then when i run the code with beautiful soup it gives me a syntax error here is the ...
0
votes
1
answer
868
views
Get file knowing its specific name/string using Python
I would like to get the excel file whose name ends with"_updated" string in my current working directory. For this I am running below code. However, since I have 3 xlsx file, below code is ...
0
votes
2
answers
279
views
Python3 cgi.FieldStorage parses file name but not contents between boundary tags
I inherited a python3 project where we are trying to parse a 70 MB file with python 3.5.6 . I am using cgi.FieldStorage
File (named: paketti.ipk) I'm trying to send:
kissakissakissa
kissakissakissa
...
1
vote
0
answers
523
views
cl.exe' failed with exit status 2
I am trying to pip install tensorflow but I keep getting this error, it works fine with python 3.7 but doesn't on this version of python. Does anyone know why?
File "c:\users\user\appdata\local\...
1
vote
1
answer
410
views
Developing (e.g. pylint) for older (python 3.5) target
I have code being written for python3.5 target. I have no control of my development environment and it was recently upgraded to 3.8. Now the pylint spits out 100s of messages for features that are not ...
4
votes
1
answer
3k
views
Map function over values of dict in ansible jinja template
I want to convert the values of a dictionary into strings and lowercase them, then map over the dict to join each item pair with an =, and then join the items with a ,.
Example input:
{"A": &...
-1
votes
1
answer
128
views
How do I get my list to read certain values?
I am a beginner at python. I have a code that reads a text file from my computer and converts all the text to int. I am struggling with the last few lines in the analyze golf scores function.
I need ...
0
votes
1
answer
1k
views
I need to create a python script which calls SOAP GET method using ZEEP or REQUEST modules
I am new to python. I need to fetch data from Oracle fusion cloud. I want to run a BI publisher report on Oracle fusion cloud instance using SOAP API call and get the data into CSV file.
I have tried ...
0
votes
1
answer
21
views
Accessing variables from a method in class A and using it in Class B in python3.5
I have a BaseClass and two classes (Volume and testing) which inherits from the BaseClass. The class "Volume" use a method "driving_style" from another python module. I am trying ...
1
vote
1
answer
2k
views
I got error like NameError: name 'df_clean' is not defined
Counting Handset Manufacturers
top3 = df_clean.info()['Handset Manufacturer'].value_counts().head(3)
top3
2
votes
2
answers
11k
views
How to upgrade to Python 3.5 in a Docker container that has already installed Python 3.4? (I'm running Docker containers on Ubuntu 20.04)
I am using Docker on Ubuntu 20.04. A Docker container has already Python 3.4.2 installed on it.
Now, I'm gonna upgrade it to Python 3.5 or later. I didn't find anything useful on the web to do that. ...
1
vote
3
answers
647
views
How to append lists in nested dictionary in Python
I have 2 nested dictionaries:
grouped1 ={'LabelStat': { 'Carrier': ['1', '1'],
'FormID': ['0201', '0430']},
'McAfee': {'DatDate': 'Not Available',
...
1
vote
1
answer
4k
views
Python dictionary keys changed during iteration [duplicate]
I have a dict like this:
d={
'McAfee': {'DatDate': '123','DatVersion': '456'},
'AntiVirus': {'AVName': ['Mac Defender', 'Windows Defender'],'AVVersion': ['262144', '393472']}
...
0
votes
1
answer
26
views
Using variables for simple python commands
Im sorry I know this is really stupid question, but I'm having a hard time passing a variable through simple python commands. I'm coming from BASH so I would simply use $ to solve this.
module = input(...
2
votes
1
answer
2k
views
Pymysql failing to import into python3
I am working with a LAMP install from GCP on a debian 9 machine.
Default GCP Lamp settings https://cloud.google.com/solutions/web-hosting
I am having some dependency error trying to import pymysql ...
2
votes
0
answers
173
views
How to use Python3.5 in Pycharm or Spyder for Windows 10
I am using Anaconda on Windows. Pycharm and Spyder work well when I use python 3.8. However, I need python3.5 to install Orfeo Toolbox(remote sensing image processing software). When I tried to open ...
0
votes
1
answer
2k
views
SyntaxError: invalid syntax when trying to import networkx in Python3 (Ubuntu 16.04)
I use a DigitalOcean server running Ubuntu 16.04, and I have used networkx before with Python3. But when I tried to import networkx today, I received a syntax error.
$ python3
Python 3.5.2 (default, ...
6
votes
2
answers
1k
views
How to define implied imports in mypy?
I'm trying to typecheck notebooks exported out of Databricks. The notebooks are plain *.py files with a special comment format to indicate where cells begin and end. There's no reason why mypy shouldn'...
0
votes
1
answer
47
views
Inherit from a Python tkinter Frame screw up pack functionality
Here is code below:
import tkinter as tk
def click(event):
print (event.widget.winfo_name())
sq=250
win = tk.Tk()
topFrame = tk.Frame(win)
middleFrame = tk.Frame(win)
bottomFrame = tk.Frame(win)...