Python/.htaccess help

Status
Not open for further replies.

*Face

New Member
Messages
62
Reaction score
0
Points
0
Alright, so I have two problems with this hosting (although all other features work quite well).

Number one is with Python. What modules are installed? How do I access a MySQL DB using Python? Do I have to upload the MySQL Python module from here and work with that?. I'm new to Python, so I really don't have any idea what to do, except writing basic scripts and the like.

Number two is with .htaccess, and specifically, search engine friendly URLs.

I'm using this:

Code:
<Files filename>
 ForceType application/x-httpd-php
</Files>

It works perfectly for me on my previous host, but here for PHP throws a "premature end of script headers" error, and works with Python (application/x-httpd-cgi). What am doing wrong?
 

DefecTalisman

Community Advocate
Community Support
Messages
4,148
Reaction score
5
Points
38
Is there not a command in Python to check for modules ?

Isn't Python similar to perl ?
 

*Face

New Member
Messages
62
Reaction score
0
Points
0
Is there not a command in Python to check for modules ?
I found a script that does that - there was no module with "mysql" in the name, but I'm still a bit confused on using my own modules and stuff.

And... no one knows anything about the other problem?
 

DefecTalisman

Community Advocate
Community Support
Messages
4,148
Reaction score
5
Points
38
still new to web development, will get to .htaccess sooner or later, sorry.

But you still didn't answer my question, is Python similar to Perl?

What does a python script start with?
 

*Face

New Member
Messages
62
Reaction score
0
Points
0
Not knowing Perl (except that the code looks crappy and has the same variable declarations as PHP) I would have no idea whether or not Python is similar to Perl or not.

Python code (at least for the web) starts like this:
Code:
#!/usr/bin/python
This is just #!<pathtopython>
 

DefecTalisman

Community Advocate
Community Support
Messages
4,148
Reaction score
5
Points
38
Perl's shebang is:

Code:
#!/usr/bin/perl

You would declair scalar, array & hash as follows:
Code:
my $scalar = '';
my @array = ('','');
my %hash = ('key'=>'value');

Just curiouse, cause Python is in ActivestatePerl .
Edit:
The variables are no way near the same as php, alot of the code structure and syntax is though (similar anyway).
 
Last edited:

Corey

I Break Things
Staff member
Messages
34,553
Reaction score
204
Points
63
I don't have ANY experience with Python so I'm not sure how to help you there.

Regarding .htaccess, we have Override set to none.

-Corey
 
Status
Not open for further replies.
Top