Skip to main content

Python + network [One]

Already installed Pycharm community edition. Now writing my first script.
It is saved as first.py in Pycharm Projects...
I already know how to program and have some experience in python so i'm pretty much up and running for this course.
next i did how to run scripts from command line to run from command line one must have to set the executable bit 'on' of the file...
here's how to do it
chmod +x first.py
then we can run first.py by simply typing "' ./"' in front of the file to be exected....

Now what does "." means....
"." Dot represent current directory in Linux and Unix
".." Double Dot represent the upper working directory

Now for the second program i wrote was on variable...(simple basic stuff)
but had to get hands on so i wrote it and no errors at all...
it is saved as var.py


Next program is loops.py

All i wrote was some for statements and some while statements.....
for "FOR" i used multiplication table and for "WHILE" i just asked it to say "you are awesome".... :D
and also created mylist variable to create a list and it also worked flawlessly

this is it... :)

I started with a script called scoping.py

to say the truth these starting scripts are shit....
i'll finsh them off and after that i'll start writing again...

One thing i've learned "DO NOT REPORT EVERYTHING THAT YOU LEARN!"
it's tedious and when you over do it, It becomes worthless... :/

So i've learned something good "The OS library"
it lets you to explore the os via program itself!!
https://docs.python.org/3.1/library/os.html
it is worth exploring :)
You should look what i've done in systemcalls.py, it is a mixture of both system(function [subprocess as in python]) form os library... and call[subprocess from "subprocess" library!!]
i will surely use that in my future programs...

Comments

Popular posts from this blog

Von Neumann machine

Von Neumann Machine is the basic architecture of the modern computer as it laid the foundation for same memory usage for program and data. The Von Neumann Machine consists of three main components : Main Memory C.P.U I/O devices There is already a caption As you can see the C.P.U is also sub divided into two parts : Arithmetic Logic Unit Program Control Unit This allowed the architecture designers to work on different capabilities of the C.P.U. separately. Now we have the control unit and ALU different.. We need to get some instructions to work and some data to work upon. We can get all that data and instructions from Common Memory. Since the processing is fast compared to data retrieval. We need some device to hold data and instructions from memory for processing at the same speed the Processor works... Thus Registers came into play... A processor register is a quickly accessible location available to a digital processor 's central processin

Basic Linux Links and usefull stuff

Hey guys You  might be looking for Basic Linux stuff then you are at the right place... :D I started using Linux about 5 years ago but got into it (seriously!) 1 and a half year before , on going through the basics which i learned from many documentation provided by THE AWESOMELY GREAT ~# TLDP #~ -->The documents it provided me : <<Download PDF if possible because it is formatted nicely in it compared to others (Not compulsory Totally Ur call) >> %  Introduction to Linux - A Hands on Guide   : It provided me real one on one interaction with THE GREAT OS EVER :D It gave me total overview of Linux and awesomely cool tricks. It also contains exercise at the end of each lesson or chapter. You should give it a look (serious advice :P) % Bash Guide for Beginners : Before starting with bashing you should know bare minimum concepts of Linux <which includes placement of files, commands interaction with term and much more> which you can take from t