Interfacing Python with C and Fortran


Course Number: PYTH-266
Duration: 2 days (13 hours)
Format: Live, hands-on

Python with C and Fortran Training Overview

Python is a popular programming language used to develop diverse applications. But what if you have legacy code written in C or Fortran and want to leverage Python's power in your project? The good news is that Python supports interfacing with C and Fortran.

This Interfacing Python with C and Fortran training course teaches attendees how to link their Python code with C or Fortran functions, opening a new world of possibilities while achieving seamless integration with legacy code.

Location and Pricing

Accelebrate offers instructor-led enterprise training for groups of 3 or more online or at your site. Most Accelebrate classes can be flexibly scheduled for your group, including delivery in half-day segments across a week or set of weeks. To receive a customized proposal and price quote for private corporate training on-site or online, please contact us.

In addition, we offer some courses as live, instructor-led online classes for individuals.

Objectives

  • Work with Visual Studio code extensions for Python, C, and Fortran
  • Review C programming and Fortran programming
  • Interface Python with C and Fortran
  • Call C Code in a Shared Library File
  • Use NumPy Arrays

Prerequisites

All students must be able to write simple Python scripts using basic data types, program structures, and the standard Python library.

Outline

Expand All | Collapse All

Introduction
Development Environment Overview
  • Visual Studio Code Extensions for Python, C, and Fortran
  • Code Reformatting with Black
  • Debugging Python Scripts with VS Code
Quick Review of C Programming
  • Data Types
  • Data Structures
  • Functions
Quick Review of Fortran Programming
  • Data Types
  • Data Structures
  • Functions
Interfacing Python with C
  • C Extensions overview
  • CTypes
  • CFFI Package
C Structs
  • Python Structure Class
  • Python Binary Formatted Strings
CFFI
  • Calling C Code in a Shared Library File
  • ABI vs. API Modes
  • In-Line vs. Out-of-Line
Interfacing Python with Fortran
  • Using CTypes
  • Using CFFI
NumPy
  • Using NumPy Arrays with C Code
  • Using NumPy Arrays with Fortran Code
Conclusion

Training Materials

All Python training students receive comprehensive courseware.

Software Requirements

  • Any Windows, Linux, or Mac OS X operating system
  • Standard Python 3.x or Anaconda Python 3.x
  • Visual Studio Code (other editors may be used)
  • GCC and GFortran


Learn faster

Our live, instructor-led lectures are far more effective than pre-recorded classes

Satisfaction guarantee

If your team is not 100% satisfied with your training, we do what's necessary to make it right

Learn online from anywhere

Whether you are at home or in the office, we make learning interactive and engaging

Multiple Payment Options

We accept check, ACH/EFT, major credit cards, and most purchase orders



Recent Training Locations

Alabama

Birmingham

Huntsville

Montgomery

Alaska

Anchorage

Arizona

Phoenix

Tucson

Arkansas

Fayetteville

Little Rock

California

Los Angeles

Oakland

Orange County

Sacramento

San Diego

San Francisco

San Jose

Colorado

Boulder

Colorado Springs

Denver

Connecticut

Hartford

DC

Washington

Florida

Fort Lauderdale

Jacksonville

Miami

Orlando

Tampa

Georgia

Atlanta

Augusta

Savannah

Hawaii

Honolulu

Idaho

Boise

Illinois

Chicago

Indiana

Indianapolis

Iowa

Cedar Rapids

Des Moines

Kansas

Wichita

Kentucky

Lexington

Louisville

Louisiana

New Orleans

Maine

Portland

Maryland

Annapolis

Baltimore

Frederick

Hagerstown

Massachusetts

Boston

Cambridge

Springfield

Michigan

Ann Arbor

Detroit

Grand Rapids

Minnesota

Minneapolis

Saint Paul

Mississippi

Jackson

Missouri

Kansas City

St. Louis

Nebraska

Lincoln

Omaha

Nevada

Las Vegas

Reno

New Jersey

Princeton

New Mexico

Albuquerque

New York

Albany

Buffalo

New York City

White Plains

North Carolina

Charlotte

Durham

Raleigh

Ohio

Akron

Canton

Cincinnati

Cleveland

Columbus

Dayton

Oklahoma

Oklahoma City

Tulsa

Oregon

Portland

Pennsylvania

Philadelphia

Pittsburgh

Rhode Island

Providence

South Carolina

Charleston

Columbia

Greenville

Tennessee

Knoxville

Memphis

Nashville

Texas

Austin

Dallas

El Paso

Houston

San Antonio

Utah

Salt Lake City

Virginia

Alexandria

Arlington

Norfolk

Richmond

Washington

Seattle

Tacoma

West Virginia

Charleston

Wisconsin

Madison

Milwaukee

Alberta

Calgary

Edmonton

British Columbia

Vancouver

Manitoba

Winnipeg

Nova Scotia

Halifax

Ontario

Ottawa

Toronto

Quebec

Montreal

Puerto Rico

San Juan