• Complain

Philip Joyce - C and Python Applications: Embedding Python Code in C Programs, SQL Methods, and Python Sockets

Here you can read online Philip Joyce - C and Python Applications: Embedding Python Code in C Programs, SQL Methods, and Python Sockets full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. year: 2021, publisher: Apress, genre: Computer. Description of the work, (preface) as well as reviews are available. Best literature library LitArk.com created for fans of good reading and offers a wide selection of genres:

Romance novel Science fiction Adventure Detective Science History Home and family Prose Art Politics Computer Non-fiction Religion Business Children Humor

Choose a favorite category and find really read worthwhile books. Enjoy immersion in the world of imagination, feel the emotions of the characters or learn something new for yourself, make an fascinating discovery.

Philip Joyce C and Python Applications: Embedding Python Code in C Programs, SQL Methods, and Python Sockets
  • Book:
    C and Python Applications: Embedding Python Code in C Programs, SQL Methods, and Python Sockets
  • Author:
  • Publisher:
    Apress
  • Genre:
  • Year:
    2021
  • Rating:
    3 / 5
  • Favourites:
    Add to favourites
  • Your mark:
    • 60
    • 1
    • 2
    • 3
    • 4
    • 5

C and Python Applications: Embedding Python Code in C Programs, SQL Methods, and Python Sockets: summary, description and annotation

We offer to read an annotation, description, summary or preface (depends on what the author of the book "C and Python Applications: Embedding Python Code in C Programs, SQL Methods, and Python Sockets" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.

Solve problems by embedding Python code in a C programs, SQL methods, Python sockets. This book uses rudimentary mathematics and basic programming to create practical Python applications for embedding. Youll start with an introduction to C and Python, assuming a fundamental understanding of what programming is. You will also review the basics of the database management language, SQL. You will learn how to use SQL from a C program and from a Python program. C and Python have different programming strengths, and you will learn how to write a Python program embedded within a C program to profit from the strength of each, in one program. Finally, you will explore how socket programs enable two computers to communicate with each other. Here the book covers basic server-client, basic threaded, and basic chat programs.

Philip Joyce: author's other books


Who wrote C and Python Applications: Embedding Python Code in C Programs, SQL Methods, and Python Sockets? Find out the surname, the name of the author of the book and a list of all author's works by series.

C and Python Applications: Embedding Python Code in C Programs, SQL Methods, and Python Sockets — read online for free the complete book (whole text) full work

Below is the text of the book, divided by pages. System saving the place of the last page read, allows you to conveniently read the book "C and Python Applications: Embedding Python Code in C Programs, SQL Methods, and Python Sockets" online for free, without having to search again every time where you left off. Put a bookmark, and you can go to the page where you finished reading at any time.

Light

Font size:

Reset

Interval:

Bookmark:

Make
Contents
Landmarks
Book cover of C and Python Applications Philip Joyce C and Python - photo 1
Book cover of C and Python Applications
Philip Joyce
C and Python Applications
Embedding Python Code in C Programs, SQL Methods, and Python Sockets
1st ed.
Logo of the publisher Philip Joyce Crewe UK ISBN 978-1-4842-7773-7 - photo 2
Logo of the publisher
Philip Joyce
Crewe, UK
ISBN 978-1-4842-7773-7 e-ISBN 978-1-4842-7774-4
https://doi.org/10.1007/978-1-4842-7774-4
Philip Joyce 2022
Apress Standard
The use of general descriptive names, registered names, trademarks, service marks, etc. in this publication does not imply, even in the absence of a specific statement, that such names are exempt from the relevant protective laws and regulations and therefore free for general use.
The publisher, the authors and the editors are safe to assume that the advice and information in this book are believed to be true and accurate at the date of publication. Neither the publisher nor the authors or the editors give a warranty, expressed or implied, with respect to the material contained herein or for any errors or omissions that may have been made. The publisher remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

This Apress imprint is published by the registered company APress Media, LLC part of Springer Nature.

The registered company address is: 1 New York Plaza, New York, NY 10004, U.S.A.

Introduction

The C and Python programming languages are important languages in many computer applications. This book will demonstrate how to use the C and Python languages to write applications in SQL. It will demonstrate how to embed a Python program within a C program. Finally, the reader will learn how to create Python socket programs which can communicate with each other on different computers (these are called sockets).

A basic familiarity with mathematics is assumed along with some experience of the basics of computer programs. The first two chapters review the basics of C and Python. The chapters following these are grouped into SQL techniques, embedded Python, and sockets applications. There are exercises in each chapter with answers and suggested code at the end of the book.

Any source code or other supplementary material referenced by the author in this book is available to readers on GitHub via the books product page, located at www.apress.com/9781484277737. For more detailed information, please visit http://www.apress.com/source-code.

Acknowledgments

Thanks to my wife, Anne, for her support, my son Michael, and my daughter Katharine. All three have mathematics degrees. Thanks to everyone on the Apress team who helped me with the publication of this, my third book.

Table of Contents
About the Author
Philip Joyce

has 28 years of experience as a software engineer, working on control of steel production, control of oil refineries, communications software (pre-Internet), office products (server software), and computer control of airports. He programs in Assembler, COBOL, Coral 66, C, and C++ with SQL. He served as a mentor to new graduates in the Ferranti Company. He obtained an MSc in computational physics (including augmented matrix techniques and Monte Carlo techniques using Fortran) from Salford University in 1996. He is also a chartered physicist and a member of the Institute of Physics (member of the Higher Education Group).

About the Technical Reviewer
Swathi Sutrave
is a self-professed tech geek She has been a subject matter expert for several - photo 3
is a self-professed tech geek. She has been a subject matter expert for several different programming languages, including Python, C, and SQL, for corporations, startups, and universities.
The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2022
P. Joyce C and Python Applications https://doi.org/10.1007/978-1-4842-7774-4_1
1. Python Programming
Philip Joyce
(1)
Crewe, UK

This is the first of two chapters in which youll review both Python and C programming languages. A basic understanding of computing and what programs are about is assumed although no prior knowledge of either Python or C is needed.

In this chapter, we will start with the basics of Python. This will include how items used in a program are stored in the computer, basic arithmetic formats, handling strings of characters, reading in data that the user can enter on the command line, etc. Then we will work up to file access on the computer, which will lead us up to industrial/commercial-level computing by the end of the book.

If you dont already have a Python development environment on your computer, you can download it and the Development Kit, free of charge, from www.python.org/downloads/ . Another way you can access Python is by using Visual Studio. Again, a version of this can be downloaded.

Definition of Variables

This section looks at the different types of store areas that are used in Python. We refer to these store areas as variables . The different types can be numbers (integers or decimals), characters, and different types of groups of these (strings, arrays, dictionaries, lists, or tuples).

In these examples, you can go to the command line and enter Python which starts up the Python environment and produces >>> as the prompt for you to enter Python code.

In Python, unlike C, you dont define the variable as a specific type. The different types are integer, floating point, character, string, etc. The type is assigned when you give the variable a value. So try the following code:
>>> a1 = 51
>>> print(type(a1))
We get the output
>>>

Here we are defining a variable called a1 and we are assigning the integer value 51 to it.

We then call the function print with the parameter type and a1 and we get the reply class int. type means that we want to display whether the variable is an integer, floating point, character, string, etc.

We can now exit the Python environment by typing quit().

We will now perform the same function from a program.

Create a file called typ1a.py.

Then enter the following two lines of Python code:
a1=51
print(type(a1))

Now on the command line, enter python typ1a.py.

And you should get the output

which is the same as our first example.

This is just demonstrating the equivalence of the two methods.

Obviously, if you want to run a program with many lines of code and possibly run it many times, then having the code in a file is more efficient.

We can demonstrate different data types being stored in the same variable using the following code:
a1=51
print(type(a1))
a1=51.6
print(type(a1))
a1='51'
print(type(a1))
When we run this, we get

The 51 entered is an int. The 51.6 is a float (decimal) type, and 51 is a string.

We can make the results a little clearer if we use print(a1 is, type(a1)).

Next page
Light

Font size:

Reset

Interval:

Bookmark:

Make

Similar books «C and Python Applications: Embedding Python Code in C Programs, SQL Methods, and Python Sockets»

Look at similar books to C and Python Applications: Embedding Python Code in C Programs, SQL Methods, and Python Sockets. We have selected literature similar in name and meaning in the hope of providing readers with more options to find new, interesting, not yet read works.


Reviews about «C and Python Applications: Embedding Python Code in C Programs, SQL Methods, and Python Sockets»

Discussion, reviews of the book C and Python Applications: Embedding Python Code in C Programs, SQL Methods, and Python Sockets and just readers' own opinions. Leave your comments, write what you think about the work, its meaning or the main characters. Specify what exactly you liked and what you didn't like, and why you think so.