Questions tagged [python-2.7]
Python 2.7 is the last major version in the 2.x series, and is no longer maintained since January 1st 2020. Use the generic [python] tag on all Python questions. Do not add this tag simply to convey the version of Python you're using, unless the question concerns an issue specific to Python 2.7.
python-2.7
95,162
questions
0
votes
3
answers
15k
views
Why do I get Python IOError: [Errno 13] Permission denied on writing to a file?
I cannot figure out what I am doing wrong. I am running some tests and writing the results to a file. The portion of the code which writes to a file is the following (in a class called Tester):
@...
-4
votes
0
answers
30
views
line 6 else print('not good') ^^^^^ SyntaxError: expected ':' [closed]
salary = int (input('enter your salary: \n'))
hours = int (input('enter your hours: \n'))
total_salary = salary * hours
if total_salary<200000:
print('good')
else print('not good')
I want to ...
28
votes
4
answers
45k
views
Parse a single CSV string?
Is there a way that I can parse a single comma delimited string without using anything fancy like a csv.reader(..) ? I can use the split(',') function but that doesn't work when a valid column value ...
1
vote
2
answers
955
views
python request url with user ip
I'm running this script in server trying to request m3u8 file but i have to request m3u8 file with user IP address i know how to get user IP with os.environ["REMOTE_ADDR"] but struggling where to put ...
0
votes
2
answers
82
views
Saving results to list from a for loop?
url = 'http://www.millercenter.org/president/speeches'
conn = urllib2.urlopen(url)
html = conn.read()
miller_center_soup = BeautifulSoup(html)
links = miller_center_soup.find_all('a')
for tag in ...
0
votes
0
answers
13
views
Could not find py4J jar at
I am trying to run my PMML pre-trained model in Python 3.9, but no matter what I do I have this error Could Not find py4j jar at.
None of the solutions provided on the blogs are working. And, even if ...
4
votes
2
answers
10k
views
Pandas: can't drop columns: ValueError: labels [<colName>] not contained in axis
I have a df created from a simple CSV. When I try to reference columns by their names, to merge into a new df or to drop, I am getting a
ValueError: labels [<colName>] not contained in axis
I ...
3
votes
3
answers
4k
views
Flask desktop application file chooser
I'm trying to use Flask to build the GUI for a desktop application (i.e. a web app running on a server running locally bundled with an embedded browser). Things mostly seem to work for now, but I'd ...
6
votes
1
answer
9k
views
Neural Network converging to zero output
I am trying to train this neural network to make predictions on some data.
I tried it on a small dataset (around 100 records) and it was working like a charm. Then I plugged the new dataset and I ...
0
votes
2
answers
34
views
Can I set up autocomplete in VS Code for Revit API stubs without having Revit installed?
In my office, I have a PC that does not meet the minimum requirements to install Revit. I want to use it just for writing my API codes in VS Code, so I can use them later on another PC with Revit ...
-1
votes
5
answers
1k
views
Python: TypeError: 'str' object is not callable with if statement
I've read over 50 posts with similar 'title' and have yet to answer my question.
If this question is a duplicate please link the [SOLVED] post. Using Python 2.7.7
count = 0
playerChoice = str(...
0
votes
3
answers
9k
views
How to read csv without header in pandas
I use
Adj = pd.read_csv('xxxxxx.csv', usecols=["Adj Close"])
to read my csv file and result is looks like:
Adj Close
0 0.007427
1 0.002013
2 0.008874
my csv file look like:
...
2
votes
2
answers
7k
views
How to fix python pip Segmentation fault (core dumped) response from virtualenv after installing python3.5 from source
Background
Hi, my main goal is to create a virtualenv for a number of projects that use older versions of Python, which are separate from the system version (3.10.x). I'm using PopOS 22.04, with all ...
0
votes
0
answers
30
views
Authenticate with SharePoint REST API using Azure AD not Azure ACS
With Python 2.7, I am currently trying to authenticate with the SharePoint REST API i.e. https://[tenant]/sites/[site_collection]/_api/web/lists, etc. I am able to generate, from what I can tell is, a ...
1
vote
2
answers
2k
views
Python 3rd party modules cannot be found in Squish
I am using "Squish for Web 6.3.1" for web application automation testing on Windows 10 platform. Inside the squish testing script, I need to use some 3rd party modules, such as requests, urllib3, etc....