Get up to 40 % extra points for free! More info
Save up to 80 % on our Swift e-learning courses. Only this week!

Discussion: Run python file on the TM4c1294XL board

Activities (3)
vivitern:12/28/2017 22:48

I have a python file that I want to run on the board. Hence I want to embed the python interpreter (written in C) in the board. I managed to write separate C project that runs the Python file. It compiles and runs as I want to. Here's the makefile for same. TM4c1294XL;…C1294XL.html

CFLAGS=-I python3.5 -I config -I . -c -w
LDFLAGS= -lpython3.5m -lpthread -ldl -lutil -lm -Xlinker -export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions

all: classifier trainer test link

$(CC) $(CFLAGS) test.c

trainer: Trainer.c
$(CC) $(CFLAGS) Trainer.c
$(CC) Trainer.o $(LDFLAGS) -o Trainer

classifier: Classifier.c
$(CC) $(CFLAGS) Classifier.c
# $(CC) Classifier.o $(LLFLAGS) -o Classifier

$(CC) test.o Classifier.o $(LDFLAGS) -o test

rm -f Trainer.o Trainer Classifier.o Classifier is my entire directory of project "hello" (It is not the one from the examples).

I included "Classifier.h" in my "hello.c" and I am getting the following errors:"":

Compiler include options (No preincludes):

Linker file search paths:


Am I wrong with some of my configurations? Or is this some problem with python interpreter? Any help is greatly appreciated

As @KevinDTimm suggested, the problem is that there is no pyconfig.h for my environment. This file is required by python to define important variables like source of system clock. I tried removing safety checks in existing pyconfig.h. The first error I am getting is in pytime.h as :

"_PyTime_t need signed 64-bit integer type"
Which was further because of the following code block:

#ifdef PY_INT64_T
/* _PyTime_t: Python timestamp with subsecond precision. It can be used to
store a duration, and so indirectly a date (related to another date, like
UNIX epoch). */
typedef PY_INT64_T _PyTime_t;
#define _PyTime_MIN PY_LLONG_MIN
#define _PyTime_MAX PY_LLONG_MAX
# error "_PyTime_t need signed 64-bit integer type"
It appears to me that it needs a variable that stores time. I need help in assigning that variable.

12/28/2017 22:48
User has been banned:27. February 4:47

I can understand your concern. Python is an interpreted, object-oriented programming language. Python is a high-level programming language. It is a dynamically typed language. It’s high-level built-in data structures, combined with dynamic typing and dynamic binding, make it very attractive and useful for Rapid Application Development.It is very difficult to choose to go for which course. After completing studies or while learning through the programming language which course you should go for. There are different programming languages to learn so there can be confusion, whether to go.
Python classes in Kolhapur
Python classes in solapur
Python classes in Sangli Python classes in Sangli

Up Reply
27. February 4:47
To maintain the quality of discussion, we only allow registered members to comment. Sign in. If you're new, Sign up, it's free.

2 messages from 2 displayed.