Trying to run Flask app gives “Address already in use”

It means there’s another service’s using that port (8080 in this case). Maybe because you forgot close another running Flask app and it’s using 8080 port. However, you could change the port you’re using, for example change it to 4444 like this: But anyways, I think you’d like to know which program is using that … Read more

Python official installer missing python27.dll

At least for the ActiveState Python distribution, and in the official Python distribution: The dll is in where NN is the version number. On a 64-bit, a 32 bit dll will be installed here: and a running 32 bit application will magically translate this to the proper path, http://en.wikipedia.org/wiki/WoW64 When I link againsy Python27, I … Read more

How to clear Tkinter Canvas?

Every canvas item is an object that Tkinter keeps track of. If you are clearing the screen by just drawing a black rectangle, then you effectively have created a memory leak — eventually your program will crash due to the millions of items that have been drawn. To clear a canvas, use the delete method. … Read more

Replacing Pandas or Numpy Nan with a None to use with MysqlDB

@bogatron has it right, you can use where, it’s worth noting that you can do this natively in pandas: Note: this changes the dtype of all columns to object. Example: Note: what you cannot do recast the DataFrames dtype to allow all datatypes types, using astype, and then the DataFrame fillna method: Unfortunately neither this, nor using replace, works with None see this (closed) issue. As an aside, … Read more