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 265129
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T22:44:35+00:00 2026-05-11T22:44:35+00:00

I am trying to learn web programming in python. I am converting my old

  • 0

I am trying to learn web programming in python. I am converting my old php-flash project into python. Now, I am confused about how to set param value and create object using python.

FYI I used a single php file, index.php to communicate with flash.swf. So, my other php files like login.php, logout.php, mail.php, xml.php etc used to be called from this.

Below is the flash object call from index.php-

<object classid="clsid:XXXXXXXXX-YYYY-ZZZZ-AAAA-BBBBBBBBBB" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="100%" height="100%" id="main" align="middle">
<param name="allowScriptAccess" value="all" />
<param name="flashvars" value= />
<param name="movie" value="flash.swf?<?=substr($_SERVER["REQUEST_URI"],strrpos($_SERVER["SCRIPT_NAME"],"/")+1);?>" />

<param name="loop" value="false" />
<param name="quality" value="high" />
<param name="bgcolor" value="#eeeeee" />
<embed src="flash.swf?<?=substr($_SERVER["REQUEST_URI"],strrpos($_SERVER["SCRIPT_NAME"],"/")+1);?>" loop="false" quality="high" bgcolor="#eeeeee" width="100%" height="100%" name="main" align="middle" allowScriptAccess="all" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>

Can any geek help me out with examples how I can convert this into python? Or, any reference on how it can be done?

Cheers 🙂

  • 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-11T22:44:36+00:00Added an answer on May 11, 2026 at 10:44 pm

    Python is a general purpose language, not exactly made for web. There exists some embeddable PHP-like solutions, but in most Python web frameworks, you write Python and HTML (template) code separately.

    For example in Django web framework you first write a view (view — you know — from that famous Model-View-Controller pattern) function:

    def my_view(request, movie):
        return render_to_template('my_view.html',
                                  {'movie': settings.MEDIA_URL + 'flash.swf?' + movie})
    

    And register it with URL dispatcher (in Django, there is a special file, called urls.py):

    ...
    url(r'/flash/(?P<movie>.+)$', 'myapp.views.my_view'),
    ...
    

    Then a my_view.html template:

    ...
    <object classid="clsid:XXXXXXXXX-YYYY-ZZZZ-AAAA-BBBBBBBBBB" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="100%" height="100%" id="main" align="middle">
    <param name="allowScriptAccess" value="all" />
    <param name="flashvars" value= />
    <param name="movie" value="{{ movie }}" />
    <param name="loop" value="false" />
    <param name="quality" value="high" />
    <param name="bgcolor" value="#eeeeee" />
    <embed src="{{ movie }}" loop="false" quality="high" bgcolor="#eeeeee" width="100%" height="100%" name="main" align="middle" allowScriptAccess="all" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
    </object>
    ...
    

    While this may seem like a lot of work for such a tiny task, when you have to write something bigger than simple value-substituting script, the framework pays back. For example, you may actually write a simple blog application in less than 100 lines of code. The framework will automatically take care of URL parsing (somehow like Apache’s mod_rewrite for PHP), complex templating, database access, form generation, processing and validation, user authentication, debugging and so on.

    There are a lot of different frameworks, each having its own good and bad sides. I recommend spending some time reading introductions and choosing one you like. Personally, I like Django, and had success with web.py. I’ve also heard good things about Pylons and TurboGears.

    If you need something really simple (like in your example), where you don’t need almost anything, you may just write small WSGI application, which then can be used, for example, with Apache’s mod_python or mod_wsgi. It will be something like this:

    def return_movie_html(environ, start_response):
        request_uri = environ.get('REQUEST_URI')
        movie_uri = request_uri[request_uri.rfind('/')+1:]
        start_response('200 OK', [('Content-Type', 'text/html')])
        return ['''
                <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
                                      "http://www.w3.org/TR/html4/strict.dtd">
                <html>
                ...
                <object ...>
                <param name="allowScriptAccess" value="all" />
                <param name="flashvars" value= />
                <param name="movie" value="%(movie)s" />
                <param name="loop" value="false" />
                <param name="quality" value="high" />
                <param name="bgcolor" value="#eeeeee" />
                <embed src="%(movie)s" loop="false" ... />
                </object>
                ...
                </html>
                ''' % {'movie': movie_uri}]
    

    To sum it up: without additional support libraries, Python web programming is somehow painful, and requires doing everything from the URI parsing to output formatting from scratch. However, there are a lot of good libraries and frameworks, to make job not only painless, but sometimes even pleasant 🙂 Learn about them more, and I believe you won’t regret it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 225k
  • Answers 225k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Try this: var claimNum = $("#ctl00_DefaultContent_txtClaimNumber").val(); var claimant = $("#ctl00_DefaultContent_lblClaimClaimant").text();… May 13, 2026 at 12:59 am
  • Editorial Team
    Editorial Team added an answer Goal forall (f:bool -> bool) (b:bool), f (f (f b))… May 13, 2026 at 12:59 am
  • Editorial Team
    Editorial Team added an answer You have a few options: If you know the Integer… May 13, 2026 at 12:59 am

Related Questions

I am trying to learn java web programming. I come from a perl scripting
I'm testing out the PostgreSQL Text-Search features, using the September data dump from StackOverflow
As developer, I am often interested in new language feature that can make your
The reason I am asking this question is because I have landed my first

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.