www.enkognedo.com

  • Increase font size
  • Default font size
  • Decrease font size
Home Web & Internet Get More Python and 1&1 Shared Hosting

Python and 1&1 Shared Hosting

E-mail Print PDF
User Rating: / 1
PoorBest 

I almost gave up when I took a nap and had a vision of what was happening.  Over the last several days, I have been trying to get python scripts to run on my shared 1&1 hosting service.

Being shared was one thing, being 1and1 yet another.  I want to share my plight and, ultimately, my success in getting a python script to run.  

Most important to consider in your troubleshooting:  If you're getting an "HTTP error 500 Internal Server Error", then this will probably help you!


I use Dreamweaver as my IDE (Integrated Development Environment); it is a great tool that provides a host of visual queues and nice file manipulation in one program.

Dreamweaver is set to use the default Windows CR/LF.  So, when you upload your file via FTP and you have the Windows CR/LF setting enabled, all your files end up with CR/LF instead of the wanted /LF for Unix/Linux hosts.  

What does it matter?  Well, your python scrips WILL NOT execute if you have CR/LF's in your script!  Period!  A couple of options to correct this:  The first and most obvious is to simply change your settings in Dreamweaver or whatever program you use to write your scripts, to use Unix LF's rather than Windows/DOS CR/LF's (carriage return/line feed).  The second option is to use a simple Perl command to strip out CR/LF's (which show up as /r) from your script.

The perl command is:  (remember, case is important on a Unix/Linux system)

perl -i -pe's/\r$//;' filename

...say from your ssh command prompt.  If you have 1&1, you can use Putty with your FTP username and password to access it.  

Permissions are a big thing.  To make your script executable, you will need to issue the following command in your ssh session:

chmod 755 filename

Then, just to make sure the script will work and debug errors, type the name of the script to execute it from the command prompt; for example:

test.py

or...

./test.py

Ensure you are either in the directory containing the file or specify the files path to execute it from a different directory, i.e. /cgi-bin/test.py or ./cgi-bin/test.py

Another big deal is putting in the hashbang "#!" (the first line of your script:  #!/usr/bin/python) for your "interpreter".  The interpreter is your python executable.  Maybe located at /usr/bin/python.  I found that this path works fine, as it is in the Unix path, but does drive you to use python 2.4.4 (as of the writing of this post).  They also have python 2.5 installed.  If you wish to install a later version, i.e. 2.6.2, then you're on your own, though it is pretty easy; I may address that in another post.

Banner

Resources





Last Updated on Saturday, 05 December 2009 21:42  

Design Center Tips

Adobe Design Center RSS Feed
Learn how to use and integrate Adobe products with step-by-step tutorials on new features, key workflows, and advanced techniques.

Inside Gaming

  • I recently received the Mass Effect 2 game for Xbox 360 as a gift!  I've got to say, this is one hell of a sequel game to Mass Effect!  The storyline is as intense and involved as ever and the graphics and sound are unsurpassed!

    If I could complain at all, I'd complain about the time it takes to load a game.  Only take about a second to save one, but loading is more like 30 seconds - maybe more.  So, needless to say, moving around from the main screen to in-game can be quite time cumbersome and annoying.

    Read more...
  • Flashpoint just didn't get the high marks it deserved.  For those who like local, campaign play, this is the game for you.  It is intense, very difficult and will keep you on the edge of your seat figuring and carrying out that perfect strategy.

    There is a lot of evasive or eluding type play - meaning that you don't always have to engage the enemy just because you can see them.  If you want to survive in this game, you have to be tactically sound in your decisions, well disciplined, and patient.

    Read more...
  • The graphics were great, the individual scenes awesome, the length of play...   HIGHLY disappointing!  

    I played this game for just over 11 hours.  I don't consider myself a "gamer".  I've always thought of gamers as those who buy every new game as it becomes available to buy and play it straight through to the finish.  Some of these people even use the system to quickly play it, take it back or trade it in for another, or whatever.

    Read more...
  • Never go into battle alone! EA's Montreal development studio is changing the face of how people will play games. Delivering a groundbreaking strategic 3rd person co-op shooter unparalleled in the action genre, EA Montreal's ARMY OF TWO focuses on gameplay centered around TWO man missions, TWO man strategies, TWO man tactics and a TWO man advantage

    Fight along side your team-mate to become the deadliest two-man military outfit a government can buy. The breakthrough gameplay in ARMY OF TWO, with a live or adaptive AI partner, enables you to take advantage of two-man strategies like customizable weapons, vehicles, and tactical shooting.

    From TWO man sniping to parachuting, players will experience action-packed scenarios where they will have to use their wit, strength and a deadly arsenal of shared customizable weapons to successfully defeat their enemies and complete the mission at hand.

    Gamers will fight their way through war, turmoil and a conspiracy so vast it threatens the entire world. When one man is not enough, it's going to take an army of two to save us.

    Key Features

  • "Two Man" Gameplay-Co-op is no longer a mode, it's the game. Team up with a live or AI partner on two-man missions using two-man tactics to ultimately create an advantage that no enemy can withstand.
  • Partner AI-ARMY OF TWO delivers intelligent partner AI (PAI) that interacts, adapts, collaborates and learns from their human partner. The PAI will also react and adjust to the gamer's ability and how they play the game by taking the lead or following, driving strategy or taking orders. It is the dream of the human machine.
  • Customizable Weapons-Customize and upgrade dozens of deadly weapons and share them with your partner off or online.
  • Dynamic
Read more...
  • You are Commander Shepard of the starship Normandy and you are the last hope for all life in the Galaxy. Saren, a rogue member of the elite and untouchable Spectre agents, has discovered the secret to unleashing an apocalyptic force on the galaxy, and only you stand in his way.

    To save the lives of billions, you must do whatever it takes to stop Saren and prevent the return of an ancient force bent on the destruction of all organic life.

    • Experience a rich and engrossing story where your choices decide the fate of galaxy
    • Engage in emotionally charged interactions with the most realistic Digital actors ever seen in a Video game, using an innovative new dialog system
    • Immerse yourself in an incredible new adventure from world-famous masters of the RPG: BioWare
    • Dominate the battlefield with new individual squad member command system-Optimized controls designed specifically for the PC
    • High Resolution visuals - highly detailed textures, characters and environments
    • Fully customizable controls - you can re-map the control scheme any way you like
    • Run & Gun Control - You can assign biotic powers or skills to 'hot keys' allowing you to play Mass Effect with a heavier Focus on action
    • Decryption mini-game
    • New inventory screen GUI and functionality - The enhanced inventory system makes it easier for you to equip and modify your weapons and armor
    Read more...
  • Sponsored Links

    Advertisement