Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3309856
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T21:41:26+00:00 2026-05-17T21:41:26+00:00

I am trying to use IronPython in the browser and attempting to import external

  • 0

I am trying to use IronPython in the browser and attempting to import external python scripts:

<script src="http://gestalt.ironpython.net/dlr-latest.js" type="text/javascript">
</script>
...
<script type="application/python" src="test.py" defer="true"></script>
<script type="application/python">
import test
test.Hello()
</script>

The import statement appears to run successfully (it will fail if test.py doesn’t exist). However, it doesn’t appear to load the contents of the file. test.py contains the following code:

document.testing1.innerHTML = 'Hello from test.py'

def Hello():
   window.Alert('Hello from test.py')

In fact, it doesn’t appear to make any difference what is in test.py. It won’t complain at syntax errors.

In the IronPython console you can access from within the browser, the same issue happens:

>>> import test
>>> dir(test)
['__builtins__', '__doc__', '__file__', '__name__', '__package__']
>>> test.Hello()
Traceback (most recent call last):
  at <module> in <string>, line 1
  at <module> in <string>, line 0
AttributeError: 'module' object has no attribute 'Hello'

What am I doing wrong?

Update: It works with the new IronPython 2.7 beta 1 VS2010 integration which kicks off the “Chiron” test web server, but not when I use WebMatrix. I’m wondering if it is an issue with the mime-type configured for .py files being wrong on WebMatrix?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T21:41:27+00:00Added an answer on May 17, 2026 at 9:41 pm

    I’ve finally got it working. It was MIME types that caused the problem. I was using WebMatrix for testing. I added a web.config file with the following xml to fix the issue:

    <configuration>
        <system.webServer>
            <staticContent>
                <mimeMap fileExtension=".py" mimeType="text/python" />
            </staticContent>
        </system.webServer>
    </configuration>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to take a python class (in IronPython), apply it to some data
I am trying to build a web application with an interactive console for IronPython.
I'm trying use rich:suggestionbox . I went through the tutorial provided by the Richfaces.
I revieving the following error when trying use mysql_real_escape() function Fatal error: Call to
I'm trying to create a script that will delete all user properties for a
I have one question, I have such code this._engine = Python.CreateEngine(); ScriptSource source =
I'm trying wrap my head around all of the different scripting technologies for Windows
I have a Perl script that replaces any Us or Ns at the end
I looked through the related questions, there were quite a few but I don't
How would you send long text from jquery to mysql becuase i have been

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.