Category:
Python
Having to write your own Python extensions in C can be caused by different circumstances. You might need to use a library, which is available only from the C level, for example OpenSSL bignum. Sometimes, performance requirements for a certain fragment of the codebase make an implementation in C the only possible solution. Other times you need to use a system call which is unavailable from Python and writing C code is the only way to get to it.
In this training we will show you how to write Python extensions, how to easily call functions from libraries without Python interfaces and how to connect code written in high level languages (like Python) with bits of low level code in C. We will take a closer look at Python’s garbage collection system and the ways in which our code can cooperate with it. We will describe the most common problems and how to solve them.
Our trainers are seasoned Python developers, with many years of experience in creating applications in Python, including writing custom C extensions.
Duration
1 day
Agenda
- Python interfaces for C
- Defining functions
- Fetching and returning data
- Cooperation with the garbage collector
- Defining classes and exceptions
- Working with the GIL
- Compilation
- the _setup.py_file, defining extensions
- Linking dynamic libraries
- Writing portable code
- Other methods of mixing Python and C
- the ctypes library
- Loading shared libraries
- Calling functions, passing arguments
- Writing programs in Pyrex
- Embedding the Python interpreter in C programs
During our courses we use the latest Python version (branch 2). In case of on-demand courses, it’s possible to use any version required by the Client, according to his needs.
Download as PDF
Audience and prerequisites
Good knowledge of Python, solid knowledge of C, experience in compiling software on Linux.
Certificates
Course participants receive completion certificates signed by ALX.
Our locations
- Online (EN) – your home, office or wherever you want
- Warsaw (EN) – Jasna 14/16A
- any other location (London, UK, EU) on request
Group size
Open training groups are no larger than 8 participants.
Private training can be conducted for groups of any size, according to the Customer's preference. To assure high quality and good learning environment, the group size should not exceed 12.
On-demand training costs and registration
The prices provided in the general tables cover the cost of an open (public) training for one person in London.
In case of on-demand training at Customer's premises, you provide the necessary facilities (room, computers, projector), we send a trainer to conduct the training, and the cost of a session is calculated for the whole group.
The cost does not vary significantly with the number of participants. There is no minimum number of participants. We recommend no more than 10-12 participants, as above this number, the training becomes much less effective.
The cost of an on-demand training consists of:
- the base training cost, plus
- trainer travel and accommodation charges.
The base price of on-demand training varies on case-by-case basis, but it is usually about the price of an open training for 3-5 persons (regardless of your group size).
The typical travel and accommodation charge for the EU/Schengen zone is under 1250 GBP (1500 EUR) for a 5 day session. We do our best to keep it as low as possible in your location.
The payment can be in GBP or EUR whichever you prefer. When we send you a quotation with the exact amount in your currency, that amount will be valid for 3 months, regardless of any changes in the exchange rate.
For more information, or to register a group, please contact us at groups@alx-training.co.uk and tell us:
- the course(s) that you are interested in,
- your location,
- your preferred dates,
- the number of people you wish to train,
And any other questions that you may have.
Customized training
We can also customize the training program of any of our trainings (or create a new one) according to your needs – whether you want to focus on particular solution used in your company, include material concerning a technology we do not usually cover, or create a tailor-made training.
Read more about customized training here or contact us at groups@alx-training.co.uk.
Individual consultation
For individual persons for whom all scheduled open training is inconvenient, we offer individual consultation. Virtually all of our training courses are available as such.
During individual consultations, while it can be a direct equivalent of a group training in terms of subject covered, we can also provide more than that – we can solve problems, help choose appropriate solutions and provide advice on the most effective use of chosen tools.
More information about individual consultations can be found on the separate Consulting page. In case of any question, we encourage you to contact us.
Price
590 EUR
The price includes:
- course materials,
- meals,
- snacks, coffee, tea and soft drinks,
- course completion certificate,
- one-time consultation with the instructor after course completion.
Discounts and allowances
- 7% - a discount for return customers
- applicable for all courses and training
- for any individual who already has participated in any of our courses or training and any employee of a company which previously delegated at least one employee to one of our courses or training
- 5% - for European Youth Card (EURO<26) card holders
- applicable for all courses and training
- 3% - for all students
- applicable for all courses and training
- 3% - allowance for early enrolment (does not apply to short courses)
- applicable for enrolments which occurred at least 30 days before the start of the course
- discounts apply only in case of upfront payment made at least 7 days before the start of the course and only in case of standard application form being sent or standard training contract being signed
- discounts, reductions and promotions cannot be combined
- discounts, reductions and promotions do not apply to:
- closed trainings and training on demand
- group offers
- participants delegated by third parties