Is this correct?

122 views
Skip to first unread message

Sayth Renshaw

unread,
Aug 5, 2012, 11:24:52 PM8/5/12
to pylons-...@googlegroups.com
Hi

I am new to web development and have been using asp and visual studio at college. Wanting to swap over to an open source format.

Want to clarify a perception/s would an advantage of Pyramid over say Symfony/Drupal is that I can utilize numpy & matplotlib directly iny data driven web page.  Is that correct?

What attracted me to Pyramid is that it seemed from my i initial reading that it doesn't force decisions upon the user and leave database and template packages etc up to the user. I also liked that it supported python3 fully.

What would the disadvantage be of using Pyramid over a PHP framework ?

Just making sure my newbie perceptions are valid .

Sayth

Chris Rossi

unread,
Aug 6, 2012, 9:03:57 AM8/6/12
to pylons-...@googlegroups.com
On Sun, Aug 5, 2012 at 11:24 PM, Sayth Renshaw <flebbe...@gmail.com> wrote:
> Hi
>
> I am new to web development and have been using asp and visual studio at
> college. Wanting to swap over to an open source format.
>
> Want to clarify a perception/s would an advantage of Pyramid over say
> Symfony/Drupal is that I can utilize numpy & matplotlib directly iny data
> driven web page. Is that correct?
>

Yes.

> What attracted me to Pyramid is that it seemed from my i initial reading
> that it doesn't force decisions upon the user and leave database and
> template packages etc up to the user.
>

Me too. ;)

>
> What would the disadvantage be of using Pyramid over a PHP framework ?
>
I don't know. The only one I can think of is if you know PHP but not
Python, you have to learn the programming language.

Chris

Malthe Borch

unread,
Aug 6, 2012, 9:20:35 AM8/6/12
to pylons-...@googlegroups.com
> --
> You received this message because you are subscribed to the Google Groups "pylons-discuss" group.
> To post to this group, send email to pylons-...@googlegroups.com.
> To unsubscribe from this group, send email to pylons-discus...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en.
>

Malthe Borch

unread,
Aug 6, 2012, 9:24:04 AM8/6/12
to pylons-...@googlegroups.com
On 6 August 2012 05:24, Sayth Renshaw <flebbe...@gmail.com> wrote:
> What would the disadvantage be of using Pyramid over a PHP framework ?

PHP was created specifically to create simple, dynamic web sites.
Python is a general-purpose language and much more capable.

If you have simple needs and little programming experience, then PHP
is a lot easier to get started with.

But if you have at least some programming experience, or you're
willing to learn, you'll be *much* happier with Python.

And Pyramid's a great way to get started with web programming – and as
a bonus, you probably won't ever outgrow it.

\malthe

Jonathan Vanasco

unread,
Aug 6, 2012, 10:16:35 AM8/6/12
to pylons-discuss
> > What would the disadvantage be of using Pyramid over a PHP framework ?

First, the disadvantage:

PHP is ubiquitous - it's on nearly every web hosting plan, and has
great support with simple installers for most linux distros. It also
rarely requires extra modules , and they can almost always just be
dropped-in to a folder.

With Pyramid, you need to have Python and install a bunch of modules
( preferably into a virtualenv ). It also often run daemonized on
another port or socket with port80 traffic being directed to it
somehow ( proxypass, uwsgi, etc).

Those are both broad generalizations.


In terms of the advantages ( adding to what others have said ):

You shouldn't consider Drupal at all. While it can be used as a
framework, it's a CMS -- so you'd be building modules for a CMS and
having to interface with all it's internal functions. You will get
frustrated.

Symfony is a fine framework, but it's a framework. I've generally had
this experience:

- A "framework" like Symfony, CakePHP, Rails, Django, etc will get you
up & running very quickly -- but your ability to innovate and iterate
quickly decreases as you start to code more for the framework ( and
getting around it ) than for your app.

- A "library" like Pyramid makes it a little harder to get off the
ground, but once you're up and running you can generally iterate
faster and faster -- slowly changing the model and request processing
into something that works for your teams scaling and product needs.


That being said, I want to address this line:

> I can utilize numpy & matplotlib directly iny data driven web page. Is that correct?

You could - and it's fine for development, but in production you
probably shouldn't. They're kind of intense packages and can take up
a bit of CPU and RAM. When dealing with stuff like that, I generally
do one of the following:

- Set up a daemon in Twisted or similar
- Build a separate Pyramid app that *only* handles those requests

By taking that stuff out of your app and pushing it elsewhere, you can
better control how memory and cpu are used ( by adjusting the
connections, etc for the other server ). The same strategy holds true
for PHP -- anything that touches PDF generation or 'mathy' things is
best put into another cgi/apache config where it won't affect the main
app

Mike Orr

unread,
Aug 6, 2012, 1:31:43 PM8/6/12
to pylons-...@googlegroups.com
On Mon, Aug 6, 2012 at 7:16 AM, Jonathan Vanasco <jona...@findmeon.com> wrote:
> - A "framework" like Symfony, CakePHP, Rails, Django, etc will get you
> up & running very quickly -- but your ability to innovate and iterate
> quickly decreases as you start to code more for the framework ( and
> getting around it ) than for your app.
>
> - A "library" like Pyramid makes it a little harder to get off the
> ground, but once you're up and running you can generally iterate
> faster and faster -- slowly changing the model and request processing
> into something that works for your teams scaling and product needs.

Er, but we call Pyramid a web framework.

There has been much discussion about what a framework is, and I'd say
there isn't complete consensus. Pyramid is called a web framework
because it falls in a tradition of earlier products that were called
web frameworks.

The best distinction I've heard between a framework and a library is
that with a library, "You call it", while with a framework, "It calls
you". ("In Soviet Union, a job works you!") A framework provides a
structure to insert your code into. A library provides services you
can invoke. Pyramid's dual nature is that it can be used several
different ways. Django is a "high-level" framework, meaning it has
made a lot of decisions for you, and you just fill in the blanks. If
you use Pyramid out of the box, you'll end up using it in a similar
way, although Pyramid essentially forces you to make some decisions
that Django chooses for you. But there are two other levels of
Pyramid usage which are uncommon with Django. One is to use the
lower-level code and override the front-end features. The other is to
write a higher-level framework on top of Pyramid. That's where Pyramid
starts looking more like a library, or what we sometimes call a
"meta-framework" (tools to build a framework with).

--
Mike Orr <slugg...@gmail.com>

Jonathan Vanasco

unread,
Aug 6, 2012, 6:56:58 PM8/6/12
to pylons-...@googlegroups.com
All libraries are frameworks and vice versa.  it's a dicey thing.

I wasn't meaning to confuse, but to illustrate that Pyramid is so low-level in comparison to "Frameworks" like Django, Rails, Cake, etc - that its not really a framework by comparison.  

Sayth Renshaw

unread,
Aug 6, 2012, 9:57:30 PM8/6/12
to pylons-...@googlegroups.com
So the only limitation isn't of pyramid but that currently python has less hosting available currently.

Pyramid from the discussion above is more a library than a framework. This is it's strength and while I initially may have a little bigger learning curve ultimately I get more flexibility, sort of like vim/emacs over a normal text editor.

On a real tangent would this also mean if I wanted to use Pyramid to build a desktop app I could pull in PyQt and off I go?

PS thank you for taking the time to help me.

Sayth

Chris Rossi

unread,
Aug 7, 2012, 12:56:46 AM8/7/12
to pylons-...@googlegroups.com
You wouldn't use Pyramid to build a desktop app. Everything in pyramid is geared for web applications.
> --
> You received this message because you are subscribed to the Google Groups "pylons-discuss" group.
> To view this discussion on the web visit https://groups.google.com/d/msg/pylons-discuss/-/y1KKUc04Uj0J.

Krishnakant Mane

unread,
Aug 7, 2012, 2:21:23 AM8/7/12
to pylons-...@googlegroups.com, Malthe Borch
I think Both pyramid and Pylons have their own advantage.
Python users would obviously use a framework in that language while php
users will prefer some thing like Symfony.
Python seemingly is more powerful in terms of builtin functionality
(batteries included as they say ), while php is tuned for working on the
web and blends better with HTML.
That is not to say that templating In Python is any bad, mako is really
great and I have been working with it for last 3 years.
It is just that Python is an allrounder and php is a web specialist.
I am very much used to Pylons and have an app front end developed in it
for production use on a large scale.
I am addicted to Python and the said framework.
But after learning php, I see it is not bad at all.
May be I will develop another big application this time with Symfony and
PHP.
Happy hacking.
Krishnakant
.

Mike Orr

unread,
Aug 7, 2012, 1:19:28 PM8/7/12
to pylons-...@googlegroups.com
We actually are using Pylons in a desktop app. We needed both a web
version and a desktop version (because some of the deployments would
be on fire trucks in places that didn't always have Internet access),
and we didn't want to write two separate user interfaces. So we embed
the web app in a wxPython application. We're currently using the
platform's native browser (Windows: IE, Mac: Safari), but we've been
experimenting with WebKit and waiting till its wxPython binding has
enough features. The application is then wrapped in py2exe or py2app
as a one-click installer. The effective UI has some flaws and doesn't
behave totally like a desktop app, but it has been good enough to be
usable. We haven't had time to port the application to Pyramid but
will probably do so next year or the year after.
--
Mike Orr <slugg...@gmail.com>

Krishnakant Mane

unread,
Aug 8, 2012, 12:14:53 AM8/8/12
to pylons-...@googlegroups.com, Mike Orr
One thing to note is that if we were exclusively talking about a web
app, then php is better in that it blends perfectly with html because it
is ment for that kind of work.
I was just looking at the twig engine for Php and found it a bit more
powerful than mako which I have been using for last 3 years for my app.
the advantage with Python lies in its all round power and for a core
service based app, it is a strict no-no for php from me.
Happy hacking.
Krishnakant.
Reply all
Reply to author
Forward
0 new messages