Samacheer Kalvi 12th Computer Science Notes Chapter 2 Data Abstraction

Tamilnadu Samacheer Kalvi 12th Computer Science Notes Chapter 2 Data Abstraction Notes

Data abstraction:
Data abstraction is a powerful concept in computer science that allows programmers to treat code as objects.

Abstraction:

  • Abstraction provides modularity (modularity means splitting a program into many modules). Classes (structures) are the representation for “Abstract Data Types”, (ADT).
  • Abstract Data type (ADT) is a type (or class) for objects whose behavior is defined by a set of value and a set of operations.
  • The definition of ADT only mentions what operations are to be performed but not how these operations will be implemented.
  • The process of providing only the essentials and hiding the details is known as abstraction.

Constructors and Selectors:

  • To facilitate data abstraction, we need to create two types of functions: constructors and selectors.
  • Constructors are functions that build the abstract data type.
  • Selectors are functions that retrieve information from the data type.
  • The basic idea of data abstraction is to structure programs so that they operate on abstract data.
  • A concrete data representation is defined as an independent part of the program.

Two parts of a program:
The two parts of a program are, the part that operates on abstract data and the part that defines a concrete representation.

Concrete data type Vs Abstract data type :

  • A concrete data type is a data type whose representation is known
  • In abstract data type the representation of a data type is unknown

Tuple & List:
To enable us to implement the concrete level of our data abstraction, some languages like Python provides a compound structure called Pair which is made up of list or Tuple.

List:

  • List is constructed by placing expressions within square brackets separated by commas.
  • Example: List := [10,20]

Tuple:

  • A tuple is a comma-separated sequence of values surrounded with parentheses.
  • Example: colour= (‘red’, ‘blue’, ‘Green’)

Difference between List & Tuple :
In a list, elements can be changed.

Samacheer Kalvi 12th Computer Science Notes

Samacheer Kalvi 12th Computer Science Notes Chapter 12 Structured Query Language (SQL)

Tamilnadu Samacheer Kalvi 12th Computer Science Notes Chapter 12 Structured Query Language (SQL) Notes

Structured Query Language (SQL):

  • The Structured Query Language (SQL) is a standard programming language to access and manipulate databases.
  • SQL allows the user to create, retrieve, alter, and transfer information among databases.
  • It is a language designed for managing and accessing data in a Relational Data Base Management System (RDBMS).

Relational Data Base Management System (RDBMS):

  • RDBMS is a type of DBMS with a row- based table structure that connects related data elements and includes functions related to Create, Read, Update and Delete operations, collectively known as CRUD.
  • Oracle, MySQL, MS SQL Server, IBM DB2 and Microsoft Access are RDBMS packages.

Different categories of SQL commands:

  • DDL – Data Definition Language
  • DML – Data Manipulation Language
  • DCL – Data Control Language
  • TCL – Transaction Control Language
  • DQL – Data Query Language

Data types used in SQL:

  • char (Character)
  • varchar
  • dec (Decimal)
  • Numeric
  • int (Integer)
  • Smallint
  • Float .
  • Real
  • double

Predetermined set of commands of SQL:
The SQL provides a predetermined set of commands like Keywords, Commands, Clauses and Arguments to work on databases.

Keywords:

  • They have a special meaning in SQL.
  • They are understood as instructions .

Commands :
They are instructions given by the user to the database also known as statements

Clauses:
They begin with a keyword and consist of keyword and argument

Arguments:
They are the values given to make the clause complete.

Data Definition Language:

  • The Data Definition Language (DDL) consist of SQL statements used to define the database structure or schema.
  • It simply deals with descriptions of the database schema and is used to create and modify the structure of database objects in databases.
  • The DDL provides a set of definitions to specify the storage structure and access methods used by the database system.

DDL commands:
i) Create ii) Alter iii) Drop iv) Truncate

  • Create : To create tables in the database.
  • Alter : The ALTER command is used
    to alter the table structure like adding a column, renaming the existing column, change the data type of any column or size of the column or delete the column from the table.
  • Drop : Delete tables from database.
  • Truncate : Remove all records from a table, also release the space occupied by those records.

Data Manipulation Language:
Data Manipulation Language (DML) is a computer programming language used for adding (inserting), removing (deleting), and modifying (updating) data in a database.

Basic types of DML:

Procedural DML
Requires a user to specify what data is needed and how to get it.

Non-Procedural DML
Requires a user to specify what data is needed without specifying how to get it.

DML commands:

  • Insert: Inserts data into a table
  • Update : Updates the existing data within a table.
  • Delete : Deletes all records from a table, but not the space occupied by them.

Data Control Language (DCL):
Data Control Language (DCL) is a programming language used to control the access of data stored in a database.

DCL commands:

  • Grant Grants permission to one or more users to perform specific tasks
  • Revoke: Withdraws the access permission given by the GRANT statement.

Transactional Control Language (TCL):

  • Transactional Control Language (TCL) commands are used to manage transactions in the database.
  • These are used to manage the changes made to the data in a table by DML statements.

TCL commands:
Commit: Saves any transaction into the database permanently.

  • Roll back: Restores the database to last commit state.
  • Save point: Temporarily save a transaction so that you can rollback.

Data Query Language (DQL):

  • The Data Query Language consist of commands used to query or retrieve data from a database.
  • One such SQL command in Data Query Language is “Select ” which is used to display the records from the table.

WAMP:
WAMP stands for “Windows, Apache, MySQL and PHP” It is often used for web development and internal testing, but may be also used to serve live websites.

Constraint:
Constraint is a condition,applicable on a field or set of fields or set of fields.

The different types of constraints are:

  1. Unique Constraint
  2. Primary Key Constraint
  3. Default Constraint
  4. Check Constraint
  5. Table Constraint

Samacheer Kalvi 12th Computer Science Notes

Samacheer Kalvi 12th Computer Science Notes Chapter 1 Function

Tamilnadu Samacheer Kalvi 12th Computer Science Notes Chapter 1 Function Notes

Expression of Algorithm:
Algorithms are expressed using statements of a programming language

Subroutine:
Subroutines are small sections of code that are used to perform a particular task that can be used repeatedly.

Function:

  • A function is a unit of code that is often defined within a greater code structure.
  • A function contains a set of code that works on many kinds of inputs and produces a concrete output.

Definition:
Definitions are distinct syntactic blocks.

Parameters:
Parameters are the variables in a function definition.

Argument:
Arguments are the values which are passed

Object:
An object is an instance created from the class.

Interface:

  • An interface is a set of action that an object can do.
  • Interface just defines what an object can do, but won’t actually do it.

Implementation:
Implementation carries out the instructions defined in the interface.

Pure functions:
Pure functions are functions which will give exact result when the same arguments are passed.

Impure function:
The functions which cause side effects to the arguments passed are called Impure function.

Recursive function:
A function definition which calls itself is called recursive function.

Samacheer Kalvi 12th Computer Science Notes

Samacheer Kalvi 11th Economics Notes Chapter 7 Indian Economy

Tamilnadu Samacheer Kalvi 11th Economics Notes Chapter 7 Indian Economy Notes

→ “India will be a global player in the digital economy”. – Sunder Pichai, CEO Google

→ Meaning of Growth and Development: A country’s economic growth is usually measured by National Income, indicated by Gross Domestic Product (GDP).

→ Demographic trends in India: Scientific study of the characteristics of population is known as Demography.

→ Density of population refers to the average number of persons residing per square kilometer.

→ Literacy ratio refers to the number of literates as a percentage of the total population.

→ Coal and Lignite: India ranks third in the world after China and USA in coal production.

→ Economic infrastructure is the support system which helps in facilitating production and distribution.

→ Education in India: Imparting education on an organized basis dates back to the days of ‘Gurukul’ in India.

→ Education in India until 1976 was the responsibility of the State governments.

→ Health in India is a state government responsibility.

→ Thiruvalluvar: The economic ideas of Thiruvalluvar are found in his immortal work, Thirukkural, a book of ethics.

→ Mahatma Gandhi: Gandhian Economics is based on ethical foundations.

→ Jawaharlal Nehru, one of the chief builders of Modem India, was the first Prime Minister of Independent India and he was there in that post till his death in 1964.

→ B R Ambedkar (1891-1956) was a versatile personality.

→ Joseph Chelladurai Kumarappa was bom on 4 January 1892 in Tanjavur, Tamil Nadu. A pioneer of rural economic development theories, Kumarappa is credited for developing economic theories based on Gandhism – a school of economic thought he coined “Gandhian Economics”.

→ Economic Growth: Transformation of an economy from a state of under
development to a state of development which is measured by Gross Domestic Product (GDP).

→ Economic Development: An improvement in citizens quality of life and well being of a country which is measured by per capita income along with several other development indicators.

→ Gross Domestic Product: Total monetary value of the goods and services produced by that country over a specific period of time, normally a year.

→ Per Capita Income: Average national income per head of population. It is obtained by dividing the National Income by population size.

→ Natural Resources: Goods and services provided by the nature. In other words, any stock or reserve that can be drawn from nature.

→ Renewable Resources: Resources that can be regenerated in a given span of time.

→ Non-Renewable Resources: Resources that are exhaustive and cannot be regenerated.

→ Deforestation: Clearing of forests, trees and thereby forest land is converted to
a non-forest use.

→ Energy Crisis: Situation in which energy resources are less than the demand
and there is shortage of energy.

→ Doctrine of Trusteeship: Doners who act as the trustees of their property or business.

Samacheer Kalvi 11th Economics Notes

Samacheer Kalvi 11th Economics Notes Chapter 6 Distribution Analysis

Tamilnadu Samacheer Kalvi 11th Economics Notes Chapter 6 Distribution Analysis Notes

→ Distribution Analysis: “Distribution accounts for the sharing of wealth produced by a community among the agents or owners of the factors which have been active in its production” – Chapman

→ Meaning of Distribution: Distribution means division of income among the four factors of production in terms of rent to landlords, wage to labourer, interest to capital and profit to entrepreneurs.

→ Functional Distribution: Functional Distribution means the distribution of income among the four factors of production namely land, labour, capital and organization for their services in production process.

→ Assumptions: “Rent is that portion of the produce of the earth which is paid to the landlord for the use of the original and indestructible powers of the soil”. – David Ricardo

→ Quasi-Rent: “Quasi-Rent is the income derived from machines and other appliances made by man”, – Alfred Marshall,

→ The Modern Theory of Rent / Demand & Supply Theory of Rent: “The essence of the conception of rent is the conception of surplus earned by a particular part of a factor of production over and above the minimum earnings that is necessary to induce it to do work” – Joan Robinson

→ Meaning: “A sum of money paid under contract by an employer to a worker for the services rendered”. -Benham

→ Wage fund Theory of Wages: According to Mill “every employer will keep a given amount of capital for payment to the workers”. It is a known as “Wage Fund

→ Meaning: “Interest is the price paid for the use of capital in any market” – Alfred Marshall.

→ Keynes’ Liquidity Preference Theory of Interest or the Monetary Theory of Interest: Keynes propounded the Liquidity Preference Theory of Interest in his famous book, “The General Theory of Employment, Interest and Money” in 1936.

→ Meaning of Liquidity Preference: Liquidity preference means the preference of the people to hold wealth in the form of liquid cash rather than in other non-liquid assets like bonds, securities, bills of exchange, land, building, gold etc.

→ Determination of Rate of Interest: According to Keynes, the rate of interest is determined by the demand for money and the supply of money.

→ Concepts of profit: Gross Profit is the surplus which accrues to a firm when it subtracts its Total Expenditure from its Total Revenue.

→ Risk Bearing Theory of Profit: Risk bearing theory of profit was propounded by the American economist F.B.Hawley in 1907.

→ Uncertainty Bearing Theory of Profit: Uncertainty theory was propounded by the American economist Frank H.Knight.

→ Distribution: Distribution of wealth among agents or the owners of the factors of production.

→ Rent: is reward for the use of land.

→ Wages: are the reward for labour.

→ Interest: is the price paid for the use of capital.

→ Profit: is the reward for organization or entrepreneurship.

→ Quasi-Rent: is the surplus earned by man-made appliances and instruments
of production in the short-period.

→ Transfer earnings: Transfer earnings refer to minimum payment payable to a factor to retain it in its present use. „

→ Money wage: Money wage is the remuneration received by a labourer in terms of money.

→ Real wage: Real wage is the purchasing power of the money wages in terms of goods and services.

→ Loanable fund: Loanable fund is that part of capital meant for loan.

→ Innovation: Invention put into commercial practice.

Samacheer Kalvi 11th Economics Notes

Samacheer Kalvi 11th Economics Notes Chapter 5 Market Structure and Pricing

Tamilnadu Samacheer Kalvi 11th Economics Notes Chapter 5 Market Structure and Pricing Notes

→ “Marketing is not the art of finding clever ways to dispose of what you make. It is the art of creating genuine customer value”. – Philip Kotler

→ Meaning of market : In the ordinary sense, the word ‘market’ refers to a physical place, where commodities and services are bought and sold.

→ In Economics, the term ‘market’ refers to a system of exchange between the buyers and the sellers of a commodity.

→ On the basis of Time: Alfred Marshall classifies market on the basis of time.

→ Firm and Industry:
A firm refers to a single production unit in an industry, producing a large or a small quantum of a commodity or service, and selling it at a price in the market.
An industry refers to a group of firms producing the same product of service in an economy.
→ Perfect Competition : According to Joan Robinson, “Perfect competition prevails when the demand for the output of each producer is perfectly elastic”.

→ Imperfect Competition: Imperfect competition is a competitive market situation where there are many sellers, but they are selling heterogeneous (dissimilar) goods as opposed to the perfect competitive market scenario.

→ Monopoly:
Meaning: The word monopoly has been derived from the combination of two words, i. e., ‘Mono’ and ‘Poly’. Mono refers to a single and “Poly” to seller.
Definition: Monopoly is a market structure characterized by a single seller, selling the unique product with the restriction for a new firm to enter the market. .

→ Dumping: Dumping refers to practice of the monopolist charging higher price for his product in the local market and lower price in the foreign market

→ Monopolistic Competition: Monopolistic competition refers to a market situation where there are many firms selling a differentiated product.

→ Monopsony: Monopsony is a market structure in which there is only one buyer of a good or service.

→ Bilateral Monopoly: Bilateral monopoly refers to a market situation in which a single producer (monopolist) of a product faces a single buyer (monopsonist) of that product.

→ Oligopoly: Oligopoly is a market situation in which there are a few firms selling homogeneous or differentiated products.

Equilibrium : A situation or a state at which a firm seeks to rest.

Equilibrium Price: The price at which the quantity demanded of a good equals quantity supplied.

Firm: A single organization which employs factors of production to produce goods and sells.

Long run: The period of time during which all factors of production are variable.

Marginal cost: Addition made to total costs already incurred by producing one more unit of the commodity.

Marginal revenue: Addition made to total revenue already incurred by selling one more unit of the commodity.

Monopolist: A single-seller who controls entire or major part of output, which has no close substitutes.

Price-maker: The power in the firm to set the price for goods in the market.

Price-taker: The feature of a firm to accept the price fixed in the industry.

Samacheer Kalvi 11th Economics Notes

Samacheer Kalvi 11th Economics Notes Chapter 4 Cost and Revenue Analysis

Tamilnadu Samacheer Kalvi 11th Economics Notes Chapter 4 Cost and Revenue Analysis Notes

→ “The big hurdle is going out and raising the revenue” – Tyler Cowen

→ Cost and revenue analysis refers to examining the cost of production and sales revenue of a production unit or firm under various conditions.

→ Cost Analysis : Cost refers to the total expenses incurred in the production of a commodity.

→ Money Cost: Production cost expressed in money terms is called as money cost.

→ Real Cost: Real cost refers to the payment made to compensate the efforts and sacrifices of all factor owners for their services in production.

→ Explicit Cost: Payment made to others for the purchase of factors of production is known as Explicit Costs.

→ Implicit Cost: Payment made to the use of resources that the firm already owns, is known as Implicit Cost.

→ Sunk Cost: A cost incurred in the past and cannot be recovered in future is called as Sunk Cost.

→ Floating Cost: Floating cost refers to all expenses that are directly associated with business activities but not with asset creation.

→ Total Cost Curves : Total Cost means the sum total of all payments made in the production.

→ Average Fixed Cost (AFC): Average fixed cost refers to the fixed cost per unit of output. It is obtained by dividing the total fixed cost by the quantity of output.

→ Revenue Analysis : The amount of money that a producer receives in exchange for the sale of good is known as revenue.

→ Revenue Concepts: The three basic revence concepts are:
Average Revenue: Average Revenue is the revenue per unit of the Commodity sold.
Total Revenue: Total revenue is the amount of income received by the firm from the sale of its products.
Marginal Revenue : Marginal revenue (MR) is the addition to the total revenue by the sale of an additional unit of a commodity.

→ TR, AR, MR and Elasticity of Demand : The relationship between the AR curve and MR curve depends upon the elasticity of AR curve (AR = DD = Price.)

→ Cost: It refers to expenses incurred on production

→ Revenue: It refers to sales revenue

→ Explicit Cost: It refers to out of pocket expenses of money cost or accounting costs. They are the payments made to others.

→ Implicit Cost: The cost imputed for the resources provided by the owner.

→ Fixed Costs: The costs that remain constant at all levels of output. They do not vary with output.

→ Variable Cost: The cost that varies with the level of output.

→ Total Costs: The sum of total fixed cost and total variable costs.

→ Marginal Cost: The additional cost incurred for producing one more unit of output.

→ Average Cost: Cost per unit of output produced. It is obtained by dividing total cost by output.

→ Average Variable Cost: Variable Cost per unit of output, obtained by dividing total variable cost by output.

→ Average Fixed Cost: Fixed cost per unit of output, obtained by dividing total fixed cost by output.

→ Average Revenue: Average revenue refers to revenue per unit of output sold. It is obtained by dividing the total revenue by quantity sold.

→ Marginal Revenue: The additional revenue obtained by selling one more unit of output.

Samacheer Kalvi 11th Economics Notes

Samacheer Kalvi 11th Economics Notes Chapter 3 Production Analysis

Tamilnadu Samacheer Kalvi 11th Economics Notes Chapter 3 Production Analysis Notes

→ “Production is any activity diverted to the satisfaction of other people’s wants through exchange” -J R Hicks.

→ Production is a process of using various material and immaterial inputs in order to make output for consumption.

→ Features of the Factors of Production: Factors of production means resources used in the process of production of commodities.

→ Land: In ordinary sense ‘land’ refers to the soil or the surface of the earth or ground.

→ Financial Capital means the assets needed by the firm to provide goods and services measured in term of money value.

→ An entrepreneur is a person who combines land, labour and capital in the production process to earn a profit.

→ Production Function: Production function refers to the relationship among units of the factors of production (inputs) and the resultant quantity of a good produced (output).

→ Economies of Scale: “Scale of production’ refers to the ratio of factors of production.

→ External Economies of Scale: External Economies of scale refer to changes in any factor outside the firm causing an improvement in the production process.

→ External Dis economies of scale : The term “External dis economies of scale” refers to the threat or disturbance to a firm or an industry from factor lying outside it.

→ Definition of Iso-quant : According to Ferguson, An iso-quant is a curve showing all possible combinations of inputs physically capable of producing a given level of output”.

→ Properties of Iso-quant curve:
The iso-quant curve has negative slope: If more of one factor is used, less of the other factor is needed for producing the same level of output. In the diagram combination A refers to more of capital K5and less of labour L2 As the producer moves to B, C, and D, more labour and less capital are used.

Convex to the origin: This explains the concept of diminishing Marginal Rate of Technical Substitution (MRTSLK). For example, the capital substituted by 1 unit of labour goes on decreasing when moved from top to bottom. If so, it is called diminishing MRTS. Constant MRTS (straight line ) and increasing MRTS (concave) are also possible. It depends on the nature of iso-quant curve.

→ Producer’s Equilibrium: Producer equilibrium implies the situation where producer maximizes his output. It is also known as optimum combination of the factors of production.

→ Elasticity of Supply: Elasticity of supply may be defined as the degree of responsiveness of change in supply to change in price on the part of sellers.

→ Production: An activity that transforms input into output.

→ Factors of Production: Four factors are Land, Labour, Capital and Organisation. Factor services are used in the process of production.

→ Land: All gifts of Nature.

→ Labour: Physical or mental effort of human being in the process of production.

→ Capital: Man-made material source of production.

→ Organisation: which takes decisions and bears risk.

→ Production function: Technological relationship between inputs and output.

→ Supply: The quantity of output which producers are willing and able to offer to the market at various prices.

→Elasticity of Supply: Responsiveness of the quantity supplied of a good to a change in its price.

→ Iso-quant: All the combination of two inputs which are capable of producing same level of output.

→ Iso-cost: All combination of two inputs shows that a firm can purchase with the same amount of money.

→ Short-run Production Function: Relationship between inputs and output, when there is at least one fixed factor in the production process.

→ Long-run Production Function: Relationship between inputs and output when all factors are variable.

→ Economies of Scale: A proportionate saving in costs gained by an increased level of production.

Samacheer Kalvi 11th Economics Notes

Samacheer Kalvi 12th Computer Science Notes Chapter 13 Python and CSV Files

Tamilnadu Samacheer Kalvi 12th Computer Science Notes Chapter 13 Python and CSV Files Notes

CSV file:
A CSV file is a human readable text file where each line has a number of fields, separated by commas or some other delimiter

Two ways to read a CSV file:
The two ways to read a CSV file are using csv.reader() function and using DictReader class.

Python File Modes:

Mode

Description

‘r’Open a file for reading, (default)
‘w’Open a file for writing. Creates a new file if it does not exist or truncates the file if it exists.
‘x’Open a file for exclusive creation. If the file already exists, the operation fails.
‘a’Open for appending at the end of the file without truncating it. Creates a new file if it does not exist.
‘t’Open in text mode, (default)
‘b’Open in binary mode.
‘+’Open a file for updating (reading and writing)
  • The default mode of csv file in reading and writing is text mode
  • Binary mode can be used when dealing with non-text files like image or exe files.

Garbage collector:
Python has a garbage collector to clean up unreferenced objects

Skip initial space:
“skip initial space” is used for removing whitespaces after the delimiter

CSV library:
The ŒV library contains objects and other code to read, write, and process data from and to CSV files.

csv.reader, csv.writer,csv.ÐictReader, csv.DictWriter:

  • csv.reader and csv.writer work with list/tuple.
  • csv.DictReader and csv.Dict Writer work with dictionary.
  • csv.DictReader and csv.Dict Writer take additional arguments fieldnames that are used as dictionary keyš.
  • The csv.writer() method returns a writet object which converts the user’s data into delimited strings.
  • DictReader() class of csv module creates an object which maps data to a dictionary.

operator.itemgetter():
operator.itemgetter can be used to sort by more than one column operator.itemgetter()

itemgetter():
itemgetter() with multiple indices is used to sort by more than one column.

writerow() Vs Writerows():
The writerowQ method writes one row at a time. WriterowsQ method is used to write all the data at once.

csv.register_dialect():
CSV file having custom delimiter is read with the help of csv.register_dialect().

close() method:
close() method will free up the resources that were tied with the file

Line Terminator:
A Line Terminator is a string used to terminate lines produced by writer.

Dialect:
A dialect is a class of csv module which helps to define parameters for reading and writing CSV.

Ordered Diet:
An Ordered Diet is a dictionary subclass which saves the order in which its contents are added.

Samacheer Kalvi 12th Computer Science Notes

Samacheer Kalvi 12th Computer Science Notes Chapter 14 Importing C++ Programs in Python

Tamilnadu Samacheer Kalvi 12th Computer Science Notes Chapter 14 Importing C++ Programs in Python Notes

Scripting language Vs Other programming language:
A scripting language requires an interpreter while a programming language requires a compiler.

Compiler Vs Interpreter:

CompilerInterpreter
Scans the entire program and translates it as a whole into machine code.Translates program one statement at a time.
It takes large amount of time to analyze the source codeIt takes less amount of time to analyze the source code
The overall execution time is comparatively faster.The overall execution time is slower.
Programming language like C, C++ use compilersProgramming language like Python, Ruby use interpreters.

Python Vs C++

PYTHONC++
Python is typically an “interpreted” languageC++ is typically a “compiled” language
Python is a dynamic- typed languageC++ is compiled statically typed language
Data type is not required while declaring variableData type is required while declaring variable
It can act both as scripting and general purpose languageIt is a general purpose language

Applications of Scripting Language :

  • To automate certain tasks in a program
  • Extracting information from a data set
  • Less code intensive as compared to traditional programming language.
  • can bring new functions to applications and glue complex systems together

Module:
Modules refer to a file containing Python statements and definitions.

Modular programming:

  • Modular programming is a software design technique to split your code into separate parts.
  • These parts are called modules. The focus for this separation should have modules with no or just few dependencies upon other modules.

Wrapping:
Importing C++ program in a Python program is called wrapping up of C++ in Python.

Importing C++ Files in Python:

  • Importing C++ program in a Python program is called wrapping up of C++ in Python.
  • Wrapping or creating Python interfaces for C++ programs are done in many ways.

The commonly used interfaces are

  • Python-C-API (API-Application Programming Interface for interfacing with C programs)
  • Ctypes (for interfacing with c programs)
  • SWIG (Simplified Wrapper Interface Generator- Both C and C++)
  • Cython (Cython is both a Python-like language for writing C-extensions)
  • Boost. Python (a framework for interfacing Python and C++)
  • MinGW (Minimalist GNU for Windows)

g++:
g++ is a program that calls GCC (GNU C Compiler) and automatically links the required C++ library files to the object code.

MinGW Interface:
MinGW refers to a set of runtime header files, used in compiling and linking the code of C, C++ and FORTRAN to be run on Windows Operating System.

Importing modules in Python:

Python’s sys Module:
sys module provides access to some variables used by the interpreter and to functions that interact strongly with the interpreter.

Python’s OS Module:

  • The OS module in Python provides a way of using operating system dependent functionality.
  • The functions that the OS module allows you to interface with the Windows operating system where Python is running on.

Python getopt module:

  • The getopt module of Python helps you to parse (split) command-line options and arguments.
  • This module provides two functions to enable command-line argument parsing.

_name_ :
name is one such special variable which by default stores the name of the file

Samacheer Kalvi 12th Computer Science Notes