Skip to content

Tag: python

How to turn on shell hints in python? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 5 months ago. Improve this question Is there something like hints in python’s shell? For example I type…

Creating Bricks with Turtle Python

i’m very new to programming and in here i’m supposed to create a pyramid shape of bricks where the edge of the pyramid is filled with one color and the inside of it is filled with random colors, but i can’t seem to figure it out how to move the bricks to create a new row, column and the rand…

Change value every nth iteration python

How can I change a value inside a loop every 10th iteration? Say I have a list with 30 properties I would like to change the value of x by a factor of 10 every 10th time. Desired outcome ** Answer Modulo is a nice way of doing that: Edit: you should probably initialize x outside the loop.

Connection timeouts as a protection from site scraping?

I am new to Python and Web scraping but it’s been two weeks that I periodically scrape one website and successfully download images from it. I use different proxies and sometimes change them. But starting yesterday all my proxies suddenly stopped working with a timeout error. I’ve tried a whole li…

how to use fromiter and ndnumerate together

I’m currently trying to manually implement a function to represent the KNN graph of a set of points as an incidence matrix, and my idea was to take the rows of an affinity matrix(n x n matrix representing the distance between the n points), enumerate and sort them, then return indices for the first K el…