Click to See Complete Forum and Search --> : Can Pythin do this?


joelmon
11-30-2001, 08:46 AM
Hello. I was wondering if Python can create (With fonts I select, not just default font)
dynamic images, and text created dynamically on those buttons

Do I need python versoin of imagemagick? Anything built in that comes with installation? And do I need freetype?

Just curious.

Also, quickly, is python recommended for database queries and display? I know other languages that do this, just curious about python's ability itself. It is a bit new to me, using it for the web

Thanks

Aragorn
12-01-2001, 03:54 AM
Originally posted by joelmon:
Hello. I was wondering if Python can


Yes, Yes it can....now on to the question! :)


create (With fonts I select, not just default font)dynamic images, and text created dynamically on those buttons


I think the links you are looking for are here....
http://www.pythonware.com/products/pil/ http://java.sun.com/products/java-media/2D/ http://www.boutell.com/gd/



Do I need python versoin of imagemagick?
Anything built in that comes with installation? And do I need freetype?


Err....don't think so to all of the above...


Just curious.

Also, quickly, is python recommended for database queries and display? I know other languages that do this, just curious about python's ability itself. It is a bit new to me, using it for the web
Thanks


Python is INCREDIBLE with database access...just goto their site, you'll find oogles and oogles of info about it! ;)

joelmon
12-01-2001, 08:09 PM
lol, I have gone and I will go again. I was just so eager to ask :)

Seriously, I wasn't quite sure from the python versoin of image magick and the libraries if they did what php/gd can do and create the images. Java is funky and slow and I am stupid, so I ignore it

As for db connections and display and input with mysql, I really didn't see info on it. I must do a better job looking then and shall join that python list. See, to me I knew asp/php were for dynamic sites. I thought python was just for making little games and windows apps that run behind the scenes I never really grasped the idea that it can do almost what perl/php does. IF this is the case, why would php benefit a web desginer creating dynamic pages more than python? I guess that is my $10000000 question ;)

Thanks a ton, man (or lady)

Aragorn
12-02-2001, 03:36 AM
Originally posted by joelmon:
<STRONG>lol, I have gone and I will go again. I was just so eager to ask :)

Seriously, I wasn't quite sure from the python versoin of image magick and the libraries if they did what php/gd can do and create the images. Java is funky and slow and I am stupid, so I ignore it

One of the biggest hurdles I faced with Python is that I thought it was VERY limited in its ability, I was VERY VERY wrong. You'd be amazed!


As for db connections and display and input with mysql, I really didn't see info on it. I must do a better job looking then and shall join that python list.
http://www.zope.org/Members/adustman/Products/MySQLdb
http://sourceforge.net/projects/mysql-python/
http://www.bel-epa.com/pyapache/Python/MySQL-python/

hehe, just to name a few...Google Search
Searched the web for +Python +MySQL. Results 1 - 10 of about 294,000. Search took 0.26 seconds.



See, to me I knew asp/php were for dynamic sites. I thought python was just for making little games and windows apps that run behind the scenes I never really grasped the idea that it can do almost what perl/php does.

Almost? Almost? Surely you jest! They can do all and more! But of course there is a catch, but that will be in response to the next section.


IF this is the case, why would php benefit a web desginer creating dynamic pages more than python? I guess that is my $10000000 question ;)


Well since I am in need of funds, and am able to answer the question, here goes.

Python can do as much if not more than PHP/Perl, some will fight me on this, but it is true in ability. Now comes the catch, which of course is being worked on! PHEW!

Speed....Perl and PHP are both faster than Python....although if you keep your code streamlined and efficient the difference is minimal and rarely noticeable. The big difference in what you ask is the ability to embed Python within html pages. Zope is your answer, but it only serves a moderate purpose. Try and get your host to switch to zope....g'luck! If you are hosting your own you are set, if not, like I said, g'luck, mine would laugh at me if I even thought of asking. Python can not be currently embedded within html as perl and php can...but this is being worked on....many developers are working on patches, there is one out for apache somewhere....don't know how well it works as I know it is in the early stages. There are of course work arounds for this...you can run almost a completely cgi based website....but you better know your security, and do a lot of checking on input and such, as cgi leaves HUGE security holes in your website...Python is an incredible language, give it time with the web development stuff, it will get there...I just wish it would get there sooner myself! ;)

Aragorn
Admin of GetLinuxOnline.Com


Thanks a ton, man (or lady)</STRONG>

Last time I checked man! :)


P.S. Errr hmm....I had a brain fart with remember the apache module...of course it is Mod_Python, and now there is Mod_snake that is compliant with 2.0 this will allow you to embed python into html documents, so hopefully the host is running apache and is willing to install this mod for you! :)

[ 02 December 2001: Message edited by: Aragorn ]

joelmon
12-02-2001, 05:24 AM
Hey, thanks for the reply

YOu mention python can do more. Do you mean for web development, or just in general, such as building apps and games?

I am glad you mention python runs a little slower. I also would assume mod_python is what I would need to run .py files. I run python through .cgi extensions now, just fine. So I guess it's not such a big deal either way. Or is it? (You mentioned security)

I am just trying to decipher the best language for dynamic websites and creating images and system calls. I guess php would be it. Though I am eager to test db connections with python. I would like to test python/perl/php/asp and see how they compare with x # of records, for ex, and flexibility

Thanks a lot

Joel

Aragorn
12-02-2001, 09:42 AM
Originally posted by joelmon:
<STRONG>Hey, thanks for the reply

Hehe, anytime, as long as it is about Python! ;)


YOu mention python can do more. Do you mean for web development, or just in general, such as building apps and games?

All of the above. As far as web development it can do a lot, apps and games it has few boundaries, just speed really...and it seems(I think I would have the agreement of most coders here) that companies and such are not so much worried about speed anymore, but to what quality of software is being produced and such. Which makes sense to me.


I am glad you mention python runs a little slower.

Yes, unfortunately that is a true fact ATM. Yet I do feel very safe in saying that this problem will be reduced exponentially over the 2.x series.

I also would assume mod_python is what I would need to run .py files. I run python through .cgi extensions now, just fine. So I guess it's not such a big deal either way. Or is it? (You mentioned security)

Well by cgi I don't just mean extension I mean the actual cgi program a .py or .pl program would be a cgi program if it was ran that way. As far as a security risk that depends on your code, you should NEVER make a system call in your code, and if you are reading input from a form you need to make sure they only have a certain amount of space to insert their input, as some programs if written badly can run CLI commands. As far as running .py files, no, you don't need mod python for that, you just have to edit your .htaccess file and do the

AddType application/x-httpd-cgi .py

and it will then run as a cgi file....


I am just trying to decipher the best language for dynamic websites and creating images and system calls. I guess php would be it. Though I am eager to test db connections with python. I would like to test python/perl/php/asp and see how they compare with x # of records, for ex, and flexibility</STRONG>

As am I. I currently think PHP is on the top of the list as do you. You will very much enjoy database interaction between Python and whichever db you decide, it is very simple. Out of the ones you listed Python will be the slowest, but it will be the fastest to learn and code, also it will be the easiest to go back and debug and add features to later on. This is the PRIMARY reason I have chosen to stick with Python as my cgi langauge...If you have worked with cgi scripts before you know that you are constantly going back and adding a feature that a user requests, or some guy was able to find a bug by clicking a certain button at a certain time,blah blah blah, Python is much easier to do this with. Although I do need and embeded language and I am going to start learning PHP here soon, I think the combination of Python and PHP is going to be awesome!

Aragorn