Skip to content

Tag: python

A copy of image array not working in python

So I am working on Image Encryption and using a chaotic map for diffusion. So I have been trying to rearrange pixels of an image and made a rearranging code. It works fine for normal arrays but when I use it on image, without any rearranging, just a simple copy, the new array doesn’t make any image, in …

Chunking – regular expressions and trees

I’m a total noob so sorry if I’m asking something obvious. My question is twofold, or rather it’s two questions in the same topic: I’m studying nltk in Uni, and we’re doing chunks. In the grammar I have on my notes the following code: What is the “$” symbol for in thi…

Issue installing python bcrypt in Cygwin

I’m trying to install paramiko in Cygwin and one of the build dependencies is bcrypt. I have rustc installed and I believe all of the supporting build libraries. Pip is also updated to the latest. I use the following pip command: And I get the following error output: I check my python installation (pyth…

Django – Retrieve a session value to a form

I have a Django aplication and need to get a value from the session and put it in a HiddenInput. I have this code in my view: When I have some value on ‘obra_aberta_id’ I need to put this value on a HiddenInput: But I’m getting an error on ‘request’: name ‘request’ is…

Scroll bars not working correctly with canvas

The scroll bars move the canvas but they always snap back to the top or the left. What am I doing wrong? Answer Scrollbars require two-way communication with the widgets they are controlling. You’ve properly configured the scrollbars but haven’t configured the canvas to update the scrollbars. To d…

How should I validate this correctly?

”’ This is a function which asks the user to input two values and then gives the longer word if the user inputs two words or gives the bigger number when the user enters two numbers. It returns can’t compare if the user enters a word and a number, however the problem I am facing is I am unab…