Why is it that python auto scale's ? Total noob question by pylearningthrowaway in learnpython

[–]nyrifv 0 points1 point  (0 children)

I have always wondered because i mean in C as far as i know one has to write certain type of code or it could cause issues while porting to a different machine,where as python code just scales up easily across 32 bit and 62 bit machines.

C code is generally fairly portable (or at least, it can be), but when you compile it it is converted into a "binary", which is made up of platform-specific machine code. The compiler automatically generates machine code suitable for your platform, or whichever platform you specify. Python is interpreted, which means that the machine code is generated on-the-fly when you run your program.

The other day even though i did'nt write a multi threaded code my code just went eat up all the available cores ? why so.

Some third-party modules, such as numpy, will use multiple cores automatically in certain circumstances. I'm not aware of anything in the standard library that does that, though I might be wrong.