256 Kilobytes

All Content > Python

Type All Category All Tag Python

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
👁
24
Profile Photo - August R. Garcia

[Solved] How to Get Random Punctuation in Python

Answers in Scripting and Automation | By August R. Garcia

Published 3 days 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
👁
15
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 4 days agoSun, 15 Sep 2019 17:06:46 -0700 | Last update 4 days 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
👁
18
Profile Photo - August R. Garcia

[Solved] Color code HTTP status codes in Python

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

Published 1 month 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 week ago
🗨
1
🐏
0
👁
118
Profile Photo - Some Guy

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

Answers in Scripting and Automation | By Some Guy

Published 9 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 2 weeks ago
🗨
2
🐏
0
👁
363
Profile Photo - August R. Garcia

How to Make a Simple, Automatically-Updating Dashboard for Python Scripts Using HTML, JavaScript, and JSONP

Articles in Scripting and Automation | By August R. Garcia

Published 2 weeks agoThu, 05 Sep 2019 04:39:30 -0700 | Last update 2 weeks agoThu, 05 Sep 2019 05:15:22 -0700

Profile Photo - Hash Brown

Last Reply Hell motherfucking yeah sir Hash Brown,

Hell motherfucking yeah s...

Thu, 05 Sep 2019 06:55:40 -0700 2 weeks ago
🗨
1
🐏
1
👁
136
Profile Photo - August R. Garcia

[Solved] Basic progress bar functionality with Python

Answers in Scripting and Automation | By August R. Garcia

Published 3 weeks agoSun, 25 Aug 2019 12:04:00 -0700 | Last update 3 weeks 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
👁
44
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 1 month agoFri, 16 Aug 2019 06:38:19 -0700 | Last update 3 weeks 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
👁
78
Profile Photo - August R. Garcia

Downloading Bulk Images: ThisPersonDoesNotExist with Python and urllib2

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

Published 6 months agoThu, 14 Mar 2019 06:25:36 -0700 | Last update 6 months agoThu, 14 Mar 2019 08:05:08 -0700

Profile Photo - August R. Garcia

Last Reply Here's a shorter version with cURL and BASH that does basically the same thing: for i in $( seq 1 10 ) ; do curl --user-agent "Some User-Agent St... August R. Garcia,

Here's a shorter version...

Thu, 04 Jul 2019 12:56:36 -0700 2 months ago
🗨
2
🐏
0
👁
2,976
Profile Photo - Some Guy

The Easiest Way to Build a Reddit Bot?

Forum in Scripting and Automation | By Some Guy

Published 9 months agoSun, 16 Dec 2018 09:40:29 -0800 | Last update 2 months agoSun, 30 Jun 2019 14:54:21 -0700

Profile Photo - August R. Garcia

Last Reply Also, see this post. Could probably do something similar, depending on use case: https://www.256kilobytes.com/content/show/10842/the-basics-to-w... August R. Garcia,

Also, see this post. Coul...

Sun, 30 Jun 2019 14:54:58 -0700 2 months ago
🗨
2
🐏
0
👁
199
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 3 months ago
🗨
1
🐏
0
👁
229
Profile Photo - Louis J. V. Cicalese

Jupyter Notebook | The Interactive Coding Application

Articles in Computer Software | By Louis J. V. Cicalese

Published 4 months agoThu, 09 May 2019 18:46:37 -0700 | Last update 4 months agoThu, 09 May 2019 18:48:33 -0700

Profile Photo - Louis J. V. Cicalese

Are notebooks worth your damn time?

MoreWhat is Project Jupyter? Project Jupyter is a non-profit organization that is dedicated to developing open-source software and supporting interacti...
🗨
0
🐏
0
👁
189
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 4 months ago
🗨
1
🐏
0
👁
229
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 4 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 5 months ago
🗨
1
🐏
0
👁
257
Profile Photo - Some Guy

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

Answers in Scripting and Automation | By Some Guy

Published 8 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) or FALSE (for when there are no values) Th... August R. Garcia,

You probably have your&nb...

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

Last Reply It will usually taking 3 months before you get to the point where you can do everything on your own without having to get support from others. Also Se... Graln_of_Truth,

It will usually taking 3...

Sat, 30 Mar 2019 16:09:52 -0700 5 months ago
🗨
1
🐏
0
👁
190
Profile Photo - K. Crezcheezy

[Python] How do global variables work?

Answers in Computer Programming | By K. Crezcheezy

Published 6 months agoTue, 19 Mar 2019 22:44:13 -0700

Profile Photo - KacssPL

Last Reply Basically a global variable is defined and declared outside a function and needed to be used inside of a function. For a good example on how this work... KacssPL,

Basically a global variab...

Sat, 30 Mar 2019 15:57:01 -0700 5 months ago
🗨
1
🐏
0
👁
137
Profile Photo - Some Guy

How to install NumPy on Windows 10?

Answers in Technology | By Some Guy

Published 7 months agoWed, 06 Feb 2019 16:17:32 -0800

Profile Photo - Zhaybib

Last Reply Since you want to install NumPy on Windows 10, I suggest that you watch this video from YouTube to get an idea of how to install https://www.youtube.c... Zhaybib,

Since you want to install...

Sat, 30 Mar 2019 15:56:01 -0700 5 months ago
🗨
1
🐏
0
👁
158
Profile Photo - Some Guy

Python floor division: Difference between '/' and '//' ?

Answers in Computer Programming | By Some Guy

Published 7 months agoWed, 06 Feb 2019 13:49:08 -0800

Profile Photo - Zhaybib

Last Reply For python floor division questions, I recommend that you check out Stack Overflow, as there are many answers such as this one, https://stackoverflow.... Zhaybib,

For python floor division...

Sat, 30 Mar 2019 15:25:48 -0700 5 months ago
🗨
1
🐏
0
👁
147
Profile Photo - chkdf8

What are some good Python interview questions?

Answers in Local and Offline Businesses | By chkdf8

Published 6 months agoTue, 19 Mar 2019 11:15:11 -0700

Profile Photo - __wesistdas

Last Reply 1.What is the difference between list and tuples? 2.What are the key features of Python? 3.What is the difference between deep and shallow copy? 4.How... __wesistdas,

1.What is the difference...

Sat, 30 Mar 2019 15:05:05 -0700 5 months ago
🗨
1
🐏
0
👁
156
Profile Photo - Some Guy

How to clear the screen in Python?

Answers in Computer Programming | By Some Guy

Published 7 months agoWed, 06 Feb 2019 16:18:12 -0800

Profile Photo - SiteIessVagrant

Last Reply I do not know how to do this. I have not had much experience with python and coding. SiteIessVagrant,

I do not know how to do t...

Sat, 30 Mar 2019 14:48:00 -0700 5 months ago
🗨
1
🐏
0
👁
203
Profile Photo - Edgelady43069

R vs. Python for data science?

Answers in Computer Programming | By Edgelady43069

Published 6 months agoTue, 19 Mar 2019 14:26:39 -0700

Profile Photo - -alxl_

Last Reply Short version - R is probably better for short term project. Long term learning Python may open more doors. R is nice because there are a lot of prema... -alxl_,

Short version - R is prob...

Sat, 30 Mar 2019 14:27:59 -0700 5 months ago
🗨
1
🐏
0
👁
104
Profile Photo - Some Guy

Urllib.error.httperror: http error 403: forbidden?

Answers in Computer Software | By Some Guy

Published 7 months agoWed, 06 Feb 2019 14:18:41 -0800

Profile Photo - Graln_of_Truth

Last Reply It would appear you're trying to open up a document that leads to a link on thepiratebay that is facing an error with Python 3. More information regar... Graln_of_Truth,

It would appear you're tr...

Sat, 30 Mar 2019 14:26:40 -0700 5 months ago
🗨
1
🐏
0
👁
157
Profile Photo - Some Guy
Profile Photo - masshoIe3

Last Reply Range () returns the values in a limited list, and is an iterable. Xrange is a generator. Xrange can handle a huge list and uses the process of 'yield... masshoIe3,

Range () returns the valu...

Sat, 30 Mar 2019 14:25:29 -0700 5 months ago
🗨
1
🐏
0
👁
150
Profile Photo - Some Guy

Write() argument must be str, not bytes?

Answers in Computer Software | By Some Guy

Published 7 months agoWed, 06 Feb 2019 14:19:21 -0800

Profile Photo - -alxl_

Last Reply When working with data it can be encoded in text (string/characters) or bytes (binary). You may need to convert from binary to strings so it is readab... -alxl_,

When working with data it...

Sat, 30 Mar 2019 13:56:41 -0700 5 months ago
🗨
1
🐏
0
👁
133
Profile Photo - Some Guy

How to print without a newline in Python?

Answers in Scripting and Automation | By Some Guy

Published 7 months agoWed, 06 Feb 2019 13:47:28 -0800

Profile Photo - Zhaybib

Last Reply Since you say that you are curious as to how to print without a newline in Python, I suggest that you look here, https://stackoverflow.com/questions/4... Zhaybib,

Since you say that you ar...

Sat, 30 Mar 2019 13:39:40 -0700 5 months ago
🗨
1
🐏
0
👁
112
Profile Photo - Edgelady43069

[Python] How to unpack a tuple?

Answers in Computer Programming | By Edgelady43069

Published 6 months agoTue, 19 Mar 2019 05:06:14 -0700

Profile Photo - Zhaybib

Last Reply When you are learning Python, you will learn about how to unpack a tuple. The way to unpack a tuple is to follow the steps that are outlined in this w... Zhaybib,

When you are learning Pyt...

Thu, 21 Mar 2019 00:52:27 -0700 5 months ago
🗨
1
🐏
0
👁
134
Profile Photo - Your Dad
Profile Photo - Edgelady43069

Last Reply Selenium actually supports Python. There are many questions that may be asked, but understanding how they work together is the first topic you should... Edgelady43069,

Selenium actually support...

Thu, 21 Mar 2019 00:20:40 -0700 5 months ago
🗨
1
🐏
0
👁
114
Profile Photo - GulfWar

How to become a freelance Python programmer?

Forum in Local and Offline Businesses | By GulfWar

Published 6 months agoTue, 19 Mar 2019 08:09:41 -0700

Profile Photo - Zhaybib

Last Reply If you want to become a freelance Python programmer, it is important to first take some online classes to make sure you brush up. Once you feel you ar... Zhaybib,

If you want to become a f...

Thu, 21 Mar 2019 00:13:03 -0700 5 months ago
🗨
1
🐏
0
👁
123