Re: [IronPython] Compilation and ipy.exe

2008-02-15 Thread Michael Foord
Pigneri, Rocco wrote:
 Dear all,
  
 Is there a way to make IronPython import module files with extensions 
 other than py?  For example, I would like to be able to name a file 
 foo.ipy to indicate that it's an IronPython file that is dependent 
 upon .NET.  I would then like to import it using import foo without 
 having to override __import__--that sounds like a lot of work just to 
 add an extension :-(.
  
 The goal of this is to be able to easily differentiate files that are 
 pure-CPython but used by IronPython from those are cannot run without it.

You can install import hooks to customize the import process. This is 
just as much work (more) as overriding '__import__' but looks 'seamless' 
in code that uses it.

Unfortunately import hooks don't seem to work very well in IronPython 1 
but I think they work better in IronPython 2. There is an example of an 
import hook in FePy for using C extensions from IronPython - it installs 
a hook that lets you import '.pyd' files.

Michael
http://www.manning.com/foord

  
 Thank you,
  
 Rocco
 

 ___
 Users mailing list
 Users@lists.ironpython.com
 http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
   

___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


[IronPython] OpenGL with IronPython

2008-02-15 Thread jane janet


Hi all,

I need help again.
I don't know how to use OpenGL in IronPython.
I want to draw the line in IronPython application.
Please teach me clearly.

All the best,
Jane

Jane
_
Connect and share in new ways with Windows Live.
http://www.windowslive.com/share.html?ocid=TXT_TAGHM_Wave2_sharelife_012008___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] OpenGL with IronPython

2008-02-15 Thread Jon Cooper
Perhaps you should use Processing instead? http://www.processing.org/

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of jane janet
Sent: Friday, February 15, 2008 11:10 AM
To: users@lists.ironpython.com
Subject: [IronPython] OpenGL with IronPython


Hi all,

I need help again.
I don't know how to use OpenGL in IronPython.
I want to draw the line in IronPython application.
Please teach me clearly.

All the best,
Jane
[cid:image001.jpg@01C86FC5.E6007810][cid:[EMAIL PROTECTED]:[EMAIL 
PROTECTED]:[EMAIL PROTECTED]:[EMAIL PROTECTED]


Connect and share in new ways with Windows Live. Get it 
now!http://www.windowslive.com/share.html?ocid=TXT_TAGHM_Wave2_sharelife_012008


Arrowgrass Capital Partners (US) LP is a limited partnership registered in the 
State of Delaware.

This message is for the named person's use only. It may contain confidential, 
proprietary or legally privileged information. No confidentiality or privilege 
is waived or lost by any transmission errors. If you receive this message in 
error, please immediately delete it and all copies of it from your system, 
destroy any hard copies of it and notify the sender. You must not, directly or 
indirectly, use, disclose, distribute, print, or copy any part of this message 
if you are not the intended recipient.
inline: image001.jpg___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Compilation and ipy.exe

2008-02-15 Thread Pigneri, Rocco
Michael,

Ironically, I actually saw that example yesterday, but I wasn't sure if
I should use it since FePy is another implementation of CPython.  I'll
give that another look today.  Do you know if it will work in IronPython
unchanged?

Thank you,

Rocco

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Michael Foord
Sent: Friday, February 15, 2008 6:32 AM
To: Discussion of IronPython
Subject: Re: [IronPython] Compilation and ipy.exe

Pigneri, Rocco wrote:
 Dear all,
  
 Is there a way to make IronPython import module files with extensions 
 other than py?  For example, I would like to be able to name a file 
 foo.ipy to indicate that it's an IronPython file that is dependent 
 upon .NET.  I would then like to import it using import foo without 
 having to override __import__--that sounds like a lot of work just to 
 add an extension :-(.
  
 The goal of this is to be able to easily differentiate files that are 
 pure-CPython but used by IronPython from those are cannot run without
it.

You can install import hooks to customize the import process. This is
just as much work (more) as overriding '__import__' but looks 'seamless'

in code that uses it.

Unfortunately import hooks don't seem to work very well in IronPython 1
but I think they work better in IronPython 2. There is an example of an
import hook in FePy for using C extensions from IronPython - it installs
a hook that lets you import '.pyd' files.

Michael
http://www.manning.com/foord

  
 Thank you,
  
 Rocco
 --
 --

 ___
 Users mailing list
 Users@lists.ironpython.com
 http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
   

___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Compilation and ipy.exe

2008-02-15 Thread Douglas S. Blank
On Fri, February 15, 2008 11:38 am, Pigneri, Rocco said:
 Michael,

 Ironically, I actually saw that example yesterday, but I wasn't sure if
 I should use it since FePy is another implementation of CPython.  I'll
 give that another look today.  Do you know if it will work in IronPython
 unchanged?

Rocco,

FePy is *not* another implementation of CPython. There isn't much text on
http://fepy.sourceforge.net/ but it does say:

FePy project aims to provide enhancements and add-ons for IronPython, an
implementation of Python programming language.

-Doug


 Thank you,

 Rocco

 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of Michael Foord
 Sent: Friday, February 15, 2008 6:32 AM
 To: Discussion of IronPython
 Subject: Re: [IronPython] Compilation and ipy.exe

 Pigneri, Rocco wrote:
 Dear all,

 Is there a way to make IronPython import module files with extensions
 other than py?  For example, I would like to be able to name a file
 foo.ipy to indicate that it's an IronPython file that is dependent
 upon .NET.  I would then like to import it using import foo without
 having to override __import__--that sounds like a lot of work just to
 add an extension :-(.

 The goal of this is to be able to easily differentiate files that are
 pure-CPython but used by IronPython from those are cannot run without
 it.

 You can install import hooks to customize the import process. This is
 just as much work (more) as overriding '__import__' but looks 'seamless'

 in code that uses it.

 Unfortunately import hooks don't seem to work very well in IronPython 1
 but I think they work better in IronPython 2. There is an example of an
 import hook in FePy for using C extensions from IronPython - it installs
 a hook that lets you import '.pyd' files.

 Michael
 http://www.manning.com/foord


 Thank you,

 Rocco
 --
 --

 ___
 Users mailing list
 Users@lists.ironpython.com
 http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


 ___
 Users mailing list
 Users@lists.ironpython.com
 http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

 ___
 Users mailing list
 Users@lists.ironpython.com
 http://lists.ironpython.com/listinfo.cgi/users-ironpython.com



-- 
Douglas S. Blank
Associate Professor, Bryn Mawr College
http://cs.brynmawr.edu/~dblank/
Office: 610 526 6501

___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


[IronPython] Save Assemblies without Running Script

2008-02-15 Thread Pigneri, Rocco
Dear all,
 
When I try to save an assembly using -X:SaveAssemblies, the script that
I am compiling is also run.  Is there a way to save the assemblies
without running the script as well?
 
Thank you,
 
Rocco
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Save Assemblies without Running Script

2008-02-15 Thread Dino Viehland
The pyc sample available here: 
http://www.codeplex.com/IronPython/Release/ProjectReleases.aspx?ReleaseId=47 
should enable you to do that.

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Pigneri, Rocco
Sent: Friday, February 15, 2008 9:57 AM
To: Discussion of IronPython
Subject: [IronPython] Save Assemblies without Running Script

Dear all,

When I try to save an assembly using -X:SaveAssemblies, the script that I am 
compiling is also run.  Is there a way to save the assemblies without running 
the script as well?

Thank you,

Rocco
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] OpenGL with IronPython

2008-02-15 Thread Sylvain Hellegouarch
Hi there,

You might want to use Tao [1].

The example below works fine with the latest stable release of Tao 
(2.0.0) and Mono 1.2.6
Note that I'm using Glfw [2] here but you could use FreeGlut instead of 
course.
That example simply renders a spinning triangle onto a window.

- Sylvain
[1] http://taoframework.com/
[2] http://glfw.sourceforge.net/


import clr
clr.AddReference('Tao.Glfw')
clr.AddReference('Tao.OpenGl')
from Tao.Glfw import Glfw
from Tao.OpenGl import Gl, Glu

def run():
Glfw.glfwInit()
   
if not Glfw.glfwOpenWindow(640, 480, 0, 0, 0, 0, 0, 0, 
Glfw.GLFW_WINDOW):
Glfw.glfwTerminate()
return 2
   
Glfw.glfwEnable(Glfw.GLFW_STICKY_KEYS)
Glfw.glfwSwapInterval(0)

running = True
frame_count = 0
start_time = Glfw.glfwGetTime()

while running:
current_time = Glfw.glfwGetTime()
coordinates = Glfw.glfwGetMousePos()

#Calculate and display FPS (frames per second)
if (current_time - start_time)  1 or frame_count == 0:
frame_rate = frame_count / (current_time - start_time);
Glfw.glfwSetWindowTitle(Spinning Triangle (%d FPS) % 
frame_rate)
start_time = current_time
frame_count = 0
   
frame_count = frame_count + 1

window_dim = Glfw.glfwGetWindowSize()
if window_dim[1]  0:
height = window_dim[1]
else:
height = 1

# Set viewport
Gl.glViewport(0, 0, window_dim[0], height)

# Clear color buffer
Gl.glClearColor(0, 0, 0, 0)
Gl.glClear(Gl.GL_COLOR_BUFFER_BIT)

# Select and setup the projection matrix
Gl.glMatrixMode(Gl.GL_PROJECTION)
Gl.glLoadIdentity()
Glu.gluPerspective(65, window_dim[0]/height, 1, 100)

# Select and setup the modelview matrix
Gl.glMatrixMode(Gl.GL_MODELVIEW)
Gl.glLoadIdentity()
Glu.gluLookAt(0, 1, 0, 0, 20, 0, 0, 0, 1)

# Draw a rotating colorful triangle
Gl.glTranslatef(0, 14, 0)
Gl.glRotatef(1/3 * float(coordinates[0]) + float(current_time) * 
100,
 0, 0, 1)
Gl.glBegin(Gl.GL_TRIANGLES)
Gl.glColor3f(1, 0, 0)
Gl.glVertex3f(-5, 0, -4)
Gl.glColor3f(0, 1, 0)
Gl.glVertex3f(5, 0, -4)
Gl.glColor3f(0, 0, 1)
Gl.glVertex3f(0, 0, 6)
Gl.glEnd();

Glfw.glfwSwapBuffers()
running = ((Glfw.glfwGetKey(Glfw.GLFW_KEY_ESC) == 
Glfw.GLFW_RELEASE) and
   Glfw.glfwGetWindowParam(Glfw.GLFW_OPENED) == Gl.GL_TRUE)

   
Glfw.glfwTerminate()

if __name__ == '__main__':
run()



jane janet a écrit :

 Hi all,

 I need help again.
 I don't know how to use OpenGL in IronPython.
 I want to draw the line in IronPython application.
 Please teach me clearly.

 All the best,
 Jane

 *Jane*


 
 Connect and share in new ways with Windows Live. Get it now! 
 http://www.windowslive.com/share.html?ocid=TXT_TAGHM_Wave2_sharelife_012008 

 

 ___
 Users mailing list
 Users@lists.ironpython.com
 http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
   

___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com