pyopengl-Python3.5.1 PyopenGL模块调用出错

问题描述

Python3.5.1 PyopenGL模块调用出错

测试PyopenGL模块的源代码来自网上:

 from OpenGL.GL import *
from OpenGL.GLU import *
from OpenGL.GLUT import *

def drawFunc():
    glClear(GL_COLOR_BUFFER_BIT)
    #glRotatef(1, 0, 1, 0)
    glutWireTeapot(0.5)
    glFlush()

glutInit()
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGBA)
glutInitWindowSize(400, 400)
glutCreateWindow("First")
glutDisplayFunc(drawFunc)
#glutIdleFunc(drawFunc)
glutMainLoop() 

运行错误提示如下:

 ============= RESTART: F:Python35-32CodePyOpenGLCodeTest.py =============
Traceback (most recent call last):
  File "F:Python35-32CodePyOpenGLCodeTest.py", line 11, in <module>
    glutInit()
  File "F:Python35-32libsite-packagesOpenGLGLUTspecial.py", line 333, in glutInit
    _base_glutInit( ctypes.byref(count), holder )
  File "F:Python35-32libsite-packagesOpenGLplatformbaseplatform.py", line 407, in __call__
    self.__name__, self.__name__,
OpenGL.error.NullFunctionError: Attempt to call an undefined function glutInit, check for bool(glutInit) before calling
>>>

解决方案

你是否没有调用初始化 看看错误提示

解决方案二:

已解决,请看我的博客http://blog.csdn.net/u013166622/article/details/50831467

时间: 2024-08-30 23:55:57

pyopengl-Python3.5.1 PyopenGL模块调用出错的相关文章

sublime-python为何导入模块调用函数出错

问题描述 python为何导入模块调用函数出错 我在sublime和editplus里写python,如下几句: -*- coding: utf-8 -*- import shutil shutil.copyfile('hello.txt', 'hello2.txt') 提示错误: Traceback (most recent call last): File "F:Pythonexercise文件处理shutil.py", line 2, in import shutil File

openwrt-OpenWrt上运行python3的bottle模块运行出错

问题描述 OpenWrt上运行python3的bottle模块运行出错 python3的相关模块都已安装,相关python代码如下: # -*- coding: utf-8 -*- from bottle import Bottle, run app=Bottle() @app.route('/hello') def hello(): return '<strong>Hello world!</strong>' run(app,host='localhost',port=81) 以

destoon文章模块调用企业会员资料的方法_php实例

本文实例展示了destoon文章模块调用企业会员资料的方法,对于destoon开发来说非常具有实用价值. 一般来说,为吸引企业会员发布企业文章,当企业会员发布文章后文章底部自动调出该企业会员的企业信息,这样企业会员就比较喜欢发布一些文章.这一功能的具体实现方法如下: 主要代码如下: {if $username} {php $user_status=3;} {php $member = userinfo($username);} {template 'contact', 'chip'} {/if}

wsdl-xfire 客户端调用出错,求高人指点

问题描述 xfire 客户端调用出错,求高人指点 根据wsdl用myeclipse 生成的客户端,这个类为什么报错,后面的这些代码什么意思,求高人指点 props.put("annotations.allow.interface", true); AnnotationServiceFactory asf = new AnnotationServiceFactory( new Jsr181WebAnnotations(), tm, new AegisBindingProvider( ne

在python中用ctypes模块调用Windows API的问题

问题描述 在python中用ctypes模块调用Windows API的问题 用python做一个windows平台的工具,纯python缺乏接口,因此想用ctypes模块调用Windows API来实现,碰到了下列问题: 用python封装Windows 中的SystemTimeToFileTime,调用过程中提示参数不对. Windows API 原型 BOOL WINAPI SystemTimeToFileTime( __in const SYSTEMTIME* lpSystemTime,

oracle存储过程调用出错

问题描述 oracle存储过程调用出错 create procedure proc_update_typeASbegin update t_train_place set place_type = 2 where rent_end_date < sysdate;end; exec proc_update_type; 创建存储过程之后,不能成功调用,而且会报错,我想知道为啥出错了,有哪位大神能告诉我,谢谢! 解决方案 oracle调用存储过程和函数返回结果集Oracle存储过程的调用调用db2存储

brophp-Brophp中模型调用出错

问题描述 Brophp中模型调用出错 最近出学PHP,我在user控制器中调用自定义的fromuser模型,报了一个循环调用的错误,如果改为调用自定义的user模型就没问题了,求帮助,此外我还想问一下Brophp的D()方法在哪定义的 解决方案 http://www.lampbrother.net/php/html/2013/php_brophp_1011/259.html 解决方案二: CRYTOAPI 库调用出错

python使用ctypes模块调用windowsapi获取系统版本示例_python

python使用ctypes模块调用windows api GetVersionEx获取当前系统版本,没有使用python32 复制代码 代码如下: #!c:/python27/python.exe#-*- coding:utf-8 -*- "通过调用Window API判断当前系统版本"# 演示通过ctypes调用windows api函数.# 作者已经知道python32能够实现相同功能# 语句末尾加分号,纯属个人习惯# 仅作部分版本判断,更详细的版本判断推荐系统OSVERSION

nginx 配置cxf webservice代理,客户端调用出错

问题描述 nginx 配置cxf webservice代理,客户端调用出错 在windows上,使用nginx 配置了cxf webservice的代理,但是在代码中使用JaxWsProxyFactoryBean方式去调用的时候无法调用通,但是若使用实际的地址可以调通.配置如下: upstream local_tomcat{ server 10.10.13.142:8550; server 10.1.241.182:8550 weight=5; } server { listen 8083; s