Python and Linux Config Flashcards

1
Q

Characteristics of Python?

A
  • High Level Programming Language
  • Open Source and Community Driven
  • Dynamically typed ( no need for variable declaration)
  • Object Orientated
  • Just-in-time compilation or interpreted language
    • Choose Deployment that suits you best.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Why use Python?

A
  • Designed to be easy to learn and to master. (Clean and Clear Syntax)
  • Highly Portable
  • Extensible
    (easy access to C++ to add functionality)
  • Coherent
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are Python’s Features?

A
  • High-level data types and operations
    • Faster development
  • Automatic memory management
  • Built in garbage collection
  • No pointers
  • Limitations for low-level coding and real-time control software.
  • No type declarations
    • Simpler, shorter, more flexible code
    • Advantageous for writing small programs
  • No compiling or linking
    • Rapid prototyping and development
  • Object Orientated
    • Good code design, structure and reuse
    • C++/ Java are more powerful for large-scale
  • Translation to bytecode
    • Portability while protecting source code
  • Use whitespace to delimit blocks
    • Avoids need for curly braces or begin/end statements
    • Easier to read - indenting required
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are the uses of Python

A
  • Rapid prototyping and development
  • Scripting Language
    • Shell tools
    • System admin, command line programs
    • Config tools
    • Easy to read and process text-based config files.
  • GUI’s
  • Database access
  • Internet Scripting
  • Extension language
  • Data Science (Stats)
  • Free
  • Good libraries
  • Easy to learn
  • Convenient for cleaning up data sets in stats.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are the uses of Python in Embedded Systems?

A
  • Easier to learn than C++
  • Hardware Abstraction allows for fast prototyping
  • Ideal for scripting automated hardware/software unit tests
  • Ideal middle layer of software between user and low-level control software.
  • Python is supported by many libraries for data analysis
  • Quick dev time suits agile process models
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

When not to use Python

A
  • Slow compared to C/C++
  • Writing OS calls is hard as it is quite a high level programming language.
  • Don’t use for performance critical tasks.
    • Control Systems with Real-Time Constraints
    • Image Processing
    • High-throughput calculations should be replaced by function calls to libraries written in C/C++
  • Version Complication
  • Don’t use for large-scale projects, java and c++ are better for that.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is Linux?

A

It is a secure open source operating system

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is a distro?

A

A set of software components assembled into a working whole that are distributed to the community

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is a Window Manager?

A

A system software that controls placement and appearance of windows within a windowing system in a GUI

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is a Shell?

A

It is a program that is a command-line interpreter that lets users control their OS via a command line interface.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is a package manager?

A

A collection of software tools that automate the process of installing, upgrading, configuring and removing computer programs in a consistent manner.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What are shell commands to list/change directories or display manuals?

A

To list directories you can use ls -al or ls -d*/ for only directories.

To change directories use cd directory

To display manuals use man followed by the program you want to learn about.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How is the Linux file system organised?

A

The file system is designed to manage data by organising them into files and directories, which are accessed and modified by users and applications.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

List the steps to setup the raspberry pi (incl remote)

A
  1. Power on the raspberry pi
  2. Remote into the pi using Virtual Network Computing which requires the IP address of the PI.
  3. Use rpi credentials to login into the pi.
  4. Check if camera, ssh, vnc and spi are enabled on the pi.
  5. Use linux commands to update software packages and so the date and time is accurate.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What are some software you can use to remote into a rpi?

A

Putty with SSH

RealVNC - 3B+

TigerVNC - 4B

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What would would be an example of a python list:

A

L1 = [‘micro’, ‘software’, 1990, 99.8 ]

17
Q

Given a list L1 = [‘micro’, ‘software’, 1990, 99.8 ],

What would L1(2:4) Represent ->

A

1990, 99.8

18
Q

What is a Python Dictionary

A

It is python’s take on hashtables which store key-value pairs. Key being the identifier and value being the element being stored.