Feb-06-2021, 07:05 PM
(Feb-06-2021, 12:33 AM)bytecrunch Wrote: Thanks Jeff900,
Sorry, I am a beginner. What do you mean exactly when you say "just" Python scripts? To me, a script is how we call a Python program.
And you said, everything is an object which seems to be one of the hallmarks of OOP. But coding in Python does not imply OOP.
With scripting I basically mean you will just run some code at once. To analyse data for example, or do something with a bunch of files etc. It has a specific beginning and an end, unlike programs that will be kept alive one way or another. But I realise this is my opinion and kind of subjective...
But to give an example for the fact that even in a simple 'script' you're using objects, take a look at the following code.
>>> number = 1 >>> type(number)
Output:<class 'int'>
In this example you can see a simple integer is not just an integer. It is a class (object) which is used to define integers. You can create your own classes in Python to create your own specific objects. Creating your own classes may feel more like OOP, but in fact with using Python you're working with objects all the time.