python: sys is not defined?

I have a piece of code which is working in Linux, and I am now trying to run it in windows, I import sys but when I ...

Matplotlib (pyplot) savefig outputs blank image?

I am trying to save plots I make using matplotlib; however, the images are saving blank. Here is my code: plt.subp...

Matplotlib (pyplot) savefig outputs blank image?

I am trying to save plots I make using matplotlib; however, the images are saving blank. Here is my code: plt.subp...

AttributeError: 'int' object has no attribute 'isdigit'?

numOfYears = 0 cpi = eval(input("Enter the CPI for July 2015: ")) if cpi.isdigit(): while cpi < (cpi * 2): ...

AttributeError: 'int' object has no attribute 'isdigit'?

numOfYears = 0 cpi = eval(input("Enter the CPI for July 2015: ")) if cpi.isdigit(): while cpi < (cpi * 2): ...

How to detect bullet holes on the target?

I want to know how to detect the bullet holes on the target using Python and OpenCV. I'm not able to draw the cont...

change figure size and figure format in matplotlib?

I want to obtain fig1 exactly of 4 by 3 inch sized, and in tiff format correcting the program below: import matplo...

Assigning specific colors to circles surrounding one random circle?

I am coding for a project which requires me to draw a grid of 15x15 black circles. The program will then randomly c...

Importing installed package from script raises “AttributeError: module has no attribute” or “ImportError: cannot import name”?

I have a script named requests.py that imports the requests package. The script either can't access attributes from...

Reading multi-dimensional arrays from text file and storing the data in multi-dimensional arrays?

I am trying to read multi-dimensional arrays from file HD.txt and store the data in arrays for computation. HD.txt ...

Draw points connected by spiral on a sphere with Matplotlib?

I would like to draw a sphere with points on its surface using Matplotlib. These points shall be connected by a spir...

draw a circles target using python?

This my program using turtle to draw the circle target: import turtle def origin_circle(turtle, radius): tur...

How to make Bootstrap file browse button using django-crispy-forms?

Here is my Django forms.py script, using django-crispy-forms #!/usr/bin/env python from django import forms from .m...