cython error compiling with print function parameters

前端 未结 3 587
别那么骄傲
别那么骄傲 2021-01-04 01:00

when use cython to create helloworld.c from helloworld.pyx , this error occured:

    error compiling Cython file:
-------------------------------------------         


        
3条回答
  •  天命终不由人
    2021-01-04 01:40

    It looks like cython treats all prints as python 2 statements by default. In order to use the python 3 print function you need to import it from the future module:

    from __future__ import print_function
    
    print('hello world',end='')
    

提交回复
热议问题