256 Kilobytes

Scripting and Automation Answers

Type AnswersAsk and answer questions, if that is something that you want to do. Category Scripting and AutomationInformation and discussion of scripting of various types.

Profile Photo - August R. Garcia
Profile Photo - August R. Garcia

TFW

MoreSee code. Yeah, it seems like you do in fact have to make a bunch of additional HTTP requests. def resolve_t_co(t_co_url): if t_co_url !...
🗨
0
🐏
0
👁
5
Profile Photo - Some Guy
Profile Photo - August R. Garcia

Last Reply What the fuck is this question. This is like eight different errors. The answer is probably to cast something as something else. Look at this thread:... August R. Garcia,

What the fuck is this que...

Thu, 17 Oct 2019 14:04:45 -0700 2 days ago
🗨
1
🐏
0
👁
93
Profile Photo - Some Guy
Profile Photo - August R. Garcia

Last Reply Cast the integer to be a string. # Probably something like this is causing the error x = 3 text = "whatever" # "TypeError: unsupported op... August R. Garcia,

Cast the integer to be a...

Thu, 17 Oct 2019 14:03:15 -0700 2 days ago
🗨
2
🐏
0
👁
1,077
Profile Photo - August R. Garcia
Profile Photo - August R. Garcia

It's time to post code so that I can fin...

MoreIt's time to post code so that I can find this the next eight times I need to do this: # ##### ##### ################# ##### ##### # # ##### ###...
🗨
0
🐏
0
👁
10
Profile Photo - August R. Garcia
Profile Photo - August R. Garcia

Last Reply Here's a better version that removes the " results" string and then casts the result to a number instead of a string: =VALUE(substitute(importXML... August R. Garcia,

Here's a better version t...

Tue, 08 Oct 2019 09:17:50 -0700 1 week ago
🗨
1
🐏
0
👁
148
Profile Photo - August R. Garcia

[Solved] Python - Getting the remote/server IP address and port from an HTTP response using the requests library?

Answers in Web Scraping, Data Analysis | By August R. Garcia

Published 3 weeks agoWed, 25 Sep 2019 15:54:55 -0700 | Last update 3 weeks agoThu, 26 Sep 2019 13:25:27 -0700

Profile Photo - August R. Garcia

Some edge case what even is this.

MoreThe solution here seems to generally work: https://stackoverflow.com/questions/22492484/how-do-i-get-the-ip-address-from-a-http-request-using-th...
🗨
0
🐏
0
👁
67
Profile Photo - August R. Garcia
Profile Photo - August R. Garcia

Currently: Python, Bash

MoreSee: Correct Horse Battery Staple from XKCD, if somehow you haven't seen this before. There's also a generator that can be used here. How to...
🗨
0
🐏
1
👁
77
Profile Photo - August R. Garcia

[Solved] How to Get Random Punctuation in Python

Answers in Scripting and Automation | By August R. Garcia

Published 1 month agoMon, 16 Sep 2019 19:14:26 -0700

Profile Photo - August R. Garcia

Code:

MoreCode: # string.punctuation contains the following characters: # !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~ import random, string print( rand...
🗨
0
🐏
0
👁
71
Profile Photo - August R. Garcia

[Solved] How to immediately kill all Python threads when working with multithreading

Answers in Scripting and Automation | By August R. Garcia

Published 1 month agoSun, 15 Sep 2019 17:06:46 -0700 | Last update 1 month agoSun, 15 Sep 2019 20:49:11 -0700

Profile Photo - August R. Garcia

why is this answer so hard to find

MoreNormally, to kill a Python script while it is running, pressing CTRL+C will work. However, if there are multiple threads running because the program i...
🗨
0
🐏
0
👁
755
Profile Photo - August R. Garcia

[Solved] Color code HTTP status codes in Python

Answers in Web Scraping, Data Analysis | By August R. Garcia

Published 2 months agoMon, 29 Jul 2019 22:34:12 -0700

Profile Photo - August R. Garcia

Last Reply For Python 3: import http.client [...] try: msg = " " + http.client.responses[status_code] [...] Code is basically th... August R. Garcia,

For Python 3:

Mon, 09 Sep 2019 12:10:10 -0700 1 month ago
🗨
1
🐏
0
👁
162
Profile Photo - Some Guy

Solve "Typeerror: unhashable type: 'list'"?

Answers in Scripting and Automation | By Some Guy

Published 10 months agoSun, 16 Dec 2018 09:34:42 -0800

Profile Photo - August R. Garcia

Last Reply Ran into this like five minutes ago and found this fucking thread in the SERPs. What a shitty fucking thread that did not answer my question. Anyway,... August R. Garcia,

Ran into this like five m...

Thu, 05 Sep 2019 07:50:44 -0700 1 month ago
🗨
2
🐏
0
👁
420
Profile Photo - August R. Garcia

[Solved] Basic progress bar functionality with Python

Answers in Scripting and Automation | By August R. Garcia

Published 1 month agoSun, 25 Aug 2019 12:04:00 -0700 | Last update 1 month agoSun, 25 Aug 2019 12:06:08 -0700

Profile Photo - August R. Garcia

Commentary is hard. Use your reading ski...

MoreCommentary is hard. Use your reading skills to read this code: #!/usr/bin/env python # -*- coding: utf-8 -*- import time import sys from...
🗨
0
🐏
0
👁
68
Profile Photo - August R. Garcia

[Solved] How to Show Number of Remaining Threads in Python

Answers in Scripting and Automation | By August R. Garcia

Published 2 months agoFri, 16 Aug 2019 06:38:19 -0700 | Last update 1 month agoMon, 26 Aug 2019 01:21:58 -0700

Profile Photo - August R. Garcia

Self explanatory, mostly.

MoreSelf explanatory, mostly. Original Code import Queue from threading import Thread, active_count import time que = Queue.Queue()...
🗨
0
🐏
0
👁
98
Profile Photo - August R. Garcia
Profile Photo - August R. Garcia

The answer is to fucking kill yourself.<...

MoreThe answer is to fucking kill yourself.
🗨
0
🐏
0
👁
119
Profile Photo - August R. Garcia

[Solved, Basically] Nautilus - Open Multiple Tabs from Command Line?

Answers in Shell Scripting | By August R. Garcia

Published 2 months agoSat, 20 Jul 2019 23:22:36 -0700 | Last update 2 months agoSat, 20 Jul 2019 23:22:46 -0700

Profile Photo - August R. Garcia

How to open multiple GUI file manager ta...

MoreThe answer is that there's no built in option to do this in Nautilus, although there are Stack Exchange threads discussing ghetto hack workarounds....
🗨
0
🐏
2
👁
132
Profile Photo - Some Guy
Profile Photo - Univa

Last Reply A simple case that generates this error message: In [8]: [1,2,3,4,5][np.array([1])] --------------------------------------------------------------... Univa,

A simple case that genera...

Sat, 01 Jun 2019 09:14:49 -0700 4 months ago
🗨
1
🐏
0
👁
266
Profile Photo - Some Guy

[Google Sheets] Dollar sign usage? What does it do?

Answers in Spreadsheets | By Some Guy

Published 8 months agoWed, 06 Feb 2019 14:35:22 -0800

Profile Photo - Univa

Last Reply The $ is used in a cell reference to create an absolute reference. An absolute reference is one that will not change when the formula is copied. Th... Univa,

The $ is used in a cell r...

Fri, 31 May 2019 10:47:38 -0700 4 months ago
🗨
2
🐏
0
👁
233
Profile Photo - Some Guy
Profile Photo - Univa

Last Reply In case you get this error it might also be related to how you included the javascript file into your html page. When loading modules you have to expl... Univa,

In case you get this erro...

Sun, 26 May 2019 10:46:17 -0700 4 months ago
🗨
1
🐏
0
👁
219
Profile Photo - Whisky Fren
Profile Photo - Whisky Fren

Now I can use tab completion on my celeb...

MoreThe answer is that you're out of storage space. Possibly because of temporary files, but also possibly your hard drive is close to full. Or your serve...
🗨
0
🐏
0
👁
175
Profile Photo - Some Guy
Profile Photo - Univa

Last Reply Create sheets by clicking the "+" button at the bottom of your browser window. In Sheet1, type this formula into any cell in column A: =INDIRECT("... Univa,

Create sheets by clicking...

Thu, 16 May 2019 08:10:10 -0700 5 months ago
🗨
1
🐏
0
👁
211
Profile Photo - Some Guy
Profile Photo - Univa

Last Reply Run print(os.environ['PATH']) in the system terminal using the same interpreter Copy the result and add as a PATH environment variable to your Ru... Univa,

Sun, 05 May 2019 03:19:56 -0700 5 months ago
🗨
1
🐏
0
👁
251
Profile Photo - Some Guy
Profile Photo - Univa

Last Reply Typeerror This Constructor Takes No Arguments Python Error error codes are caused, in one way or another, by misconfigured system files in your Window... Univa,

Typeerror This Constructo...

Fri, 26 Apr 2019 08:18:20 -0700 5 months ago
🗨
1
🐏
0
👁
226
Profile Photo - Some Guy

How to use the Quick Analysis tool in Excel 2016?

Answers in Spreadsheets | By Some Guy

Published 10 months agoSun, 16 Dec 2018 09:31:51 -0800

Profile Photo - Univa

Last Reply Select the cells of data that you want to analyze Notice the Quick Analysis Tool icon that is displayed at the bottom of the data. Click it Rol... Univa,

Mon, 22 Apr 2019 08:09:47 -0700 5 months ago
🗨
1
🐏
0
👁
222
Profile Photo - Some Guy

Finding outliers in Excel?

Answers in Spreadsheets | By Some Guy

Published 10 months agoSun, 16 Dec 2018 09:37:00 -0800

Profile Photo - Univa

Last Reply By using Box and Whisker charts, you can easily identify outliers of your data, and it shows you where the data lies in and outside your inner quartil... Univa,

By using Box and Whisker...

Mon, 22 Apr 2019 07:37:10 -0700 5 months ago
🗨
1
🐏
0
👁
196
Profile Photo - Some Guy

How to round number to nearest 5 in Excel?

Answers in Spreadsheets | By Some Guy

Published 10 months agoSun, 16 Dec 2018 09:35:18 -0800

Profile Photo - Univa

Last Reply For rounding numbers to the nearest 5, you can use the formula =MROUND(number,5) Let's take an example that in cell B contains number 17 in Row 6 a... Univa,

For rounding numbers to t...

Sat, 20 Apr 2019 09:03:37 -0700 6 months ago
🗨
1
🐏
0
👁
216
Profile Photo - Some Guy
Profile Photo - August R. Garcia

Last Reply dhcpd.conf Should be located at: /etc/dhcp/dhcpd.conf August R. Garcia,

dhcpd.conf

Wed, 17 Apr 2019 17:25:05 -0700 6 months ago
🗨
1
🐏
0
👁
206
Profile Photo - Some Guy

How to split cells in Google Sheets?

Answers in Spreadsheets | By Some Guy

Published 10 months agoSun, 16 Dec 2018 09:33:30 -0800

Profile Photo - Univa

Last Reply In Google Sheets, paste your data into a column. You’ll see a little clipboard icon appear in the lower right-hand corner of your data. Click on... Univa,

In Google Sheets, paste y...

Tue, 16 Apr 2019 07:58:40 -0700 6 months ago
🗨
1
🐏
0
👁
203
Profile Photo - Some Guy
Profile Photo - Univa

Last Reply Before posting any codes try using the formatting tools, sometimes it solves the problem.  You can also try pasting this code:  a_str,... Univa,

Before posting any codes...

Sun, 14 Apr 2019 03:06:36 -0700 6 months ago
🗨
1
🐏
0
👁
279
Profile Photo - Some Guy

[Python] Fix for "TypeError: 'bool' object is not iterable?"

Answers in Scripting and Automation | By Some Guy

Published 9 months agoSun, 13 Jan 2019 05:39:20 -0800

Profile Photo - August R. Garcia

Last Reply You probably have your code set up where some value can either be: An array (or whatever) iterable object or FALSE (for when there a... August R. Garcia,

You probably have your&nb...

Sun, 07 Apr 2019 12:14:43 -0700 6 months ago
🗨
1
🐏
0
👁
1,017
Profile Photo - Some Guy

How to find and replace in Excel?

Answers in Spreadsheets | By Some Guy

Published 10 months agoSun, 16 Dec 2018 09:43:56 -0800

Profile Photo - roxblade

Last Reply Go to the Home tab on the ribbon. Here, click on the Find and Select button. In the drop-down that appears, choose Replace. Find and Replace was al... roxblade,

Go to the Home tab on the...

Thu, 04 Apr 2019 04:37:24 -0700 6 months ago
🗨
1
🐏
0
👁
210