Re: [Tutor] My experience on web.py / CherryPy

2008-08-04 Thread Kent Johnson
On Mon, Aug 4, 2008 at 2:58 PM, Patrick <[EMAIL PROTECTED]> wrote:
> Oh oh, I did not mean to slag Django!

I didn't take it that way, no worries!

> I was basing this on the talk given by Jacob Kaplin-Moss(one of the
> developers). He gave a great talk but became a bit evasive when he was
> questioned about Django scaling down to a single developer, specifically
> when he was questioned about the template views portion.

Strange. I can't think of any reason why Django would not be suitable
for a single developer. Of course the developer has to understand HTML
and probably CSS and JavaScript  but that is no different than any
other web development tool.

Googling finds this:
http://www.cmlenz.net/archives/2006/08/the-python-web-framework

which seems to refer to the same talk. I am not a fan of the Django
template language - I think it is too restrictive - but I don't see
how it is harder to use it as a single developer than it would be for
a team...

Kent
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] My experience on web.py / CherryPy

2008-08-04 Thread Patrick

Oh oh, I did not mean to slag Django!

I was basing this on the talk given by Jacob Kaplin-Moss(one of the 
developers). He gave a great talk but became a bit evasive when he was 
questioned about Django scaling down to a single developer, specifically 
when he was questioned about the template views portion.


"IT SEEMED"

I am not qualified to give advice on Django, sorry if I ticked off anyone!

Anyone here using CherryPy? Did anyone consider it and then pass on it?

-Patrick

Kent Johnson wrote:

On Mon, Aug 4, 2008 at 2:22 PM, Patrick <[EMAIL PROTECTED]> wrote:

  

it seemed to me that Django is well suited for a developer team but is a bit
sketchy when you try to scale it down to a single developer.



Why do you say that? Django works fine with a single developer.

Kent

  


___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] My experience on web.py

2008-08-04 Thread Kent Johnson
On Mon, Aug 4, 2008 at 2:04 PM, ammar azif <[EMAIL PROTECTED]> wrote:
> I tried to use django but I found that the framework hides
> alot of things from me and files are generated by the framework
> automaticaly and I felt like I wasnt in control.

I'm surprised to hear this. Django generates a few very simple files
when you start a project but other than that it is your code. I guess
there is a lot that goes on under the hood in the models but I always
felt like the major parts of the app were clearly exposed.

Anyway I have heard good things about web.py too, you should stick
with what works for you.

Kent
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] My experience on web.py / CherryPy

2008-08-04 Thread Kent Johnson
On Mon, Aug 4, 2008 at 2:22 PM, Patrick <[EMAIL PROTECTED]> wrote:

> it seemed to me that Django is well suited for a developer team but is a bit
> sketchy when you try to scale it down to a single developer.

Why do you say that? Django works fine with a single developer.

Kent
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] My experience on web.py

2008-08-04 Thread Emile van Sebille

ammar azif wrote:


... share their thoughts on these matters, 


I haven't tried web.py, but my experience with Django is the opposite of 
yours.  Of course, I came to Django after climbing the learning curve of 
zope, so Django felt easy to deal with in comparison.  It just seemed 
that each time I encountered a behavior that I wanted to change I could 
quickly locate the source, make the changes, and continue moving forward.


Emile

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Any Italian speakers?

2008-08-04 Thread Alan Gauld
"Hansen, Mike" <[EMAIL PROTECTED]> wrote 

Did you find anyone to traslate? 


Yes thanks, Daniele (sp?) replied with a translation.
There are some Italian idiomatic things there so it confused 
Google (and Babelfish!)


"I want chiderti only 1 thing... but according to you qualle 
and better program X to program? thanks "


Exactly what Google said...

It seems the reader wants to know which is the best 
programming language...


Thanks anyway,

Alan G.

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] My experience on web.py / CherryPy

2008-08-04 Thread Patrick
I am in the same situation as you. I was looking at Django and 
Turbogears. I have finally settled on CherryPy, which is also built into 
Turbogears.


Watching this Google talk on Youtube:
http://www.youtube.com/watch?v=p-WXiqrzAf8

it seemed to me that Django is well suited for a developer team but is a 
bit sketchy when you try to scale it down to a single developer.


CherryPy seems to work well as a substitute for all-in-one-page CGI 
scripts without the respawning issues or as a proper MVC web application 
server.


I set up an account at Webfaction. They specialize in Python hosting and 
you can set up Turbogears, Django, CherryPy etc with a click of a button.


I would love to keep this thread going, please feedback as you move 
along, I feedback too


-patrick




ammar azif wrote:

Hi,

I am writing this to tell my experience on web.py. Two weeks ago, I 
was looking for a python web framework that is simple, 
straight-forward, easy to use and powerful at the same time. Django  
stood out as the most popular when I googled. I tried to use django 
but I found that the framework hides alot of things from me and files 
are generated by the framework  automaticaly and I felt like I wasnt 
in control. I know that django is powerful, but the learning curve is 
too steep for me and  I need to develop my app as soon as possible. I 
decided to give web.py a try and I found that the framework is easy to 
use and it gives a lot of control to the developer when handling GET 
and POST request and all these can be done in a single source code and 
using this framework has taught me a lot of low level web application 
programming basics. I might be wrong as I havent try django or any 
other frameworks yet. Hope python gurus here can share their thoughts 
on these matters, 





___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
  


___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] My experience on web.py

2008-08-04 Thread ammar azif
Hi,

I am writing this to tell my experience on web.py. Two weeks ago, I was looking 
for a python web framework that is simple, straight-forward, easy to use and 
powerful at the same time. Django  stood out as the most popular when I 
googled. I tried to use django but I found that the framework hides alot of 
things from me and files are generated by the framework  automaticaly and I 
felt like I wasnt in control. I know that django is powerful, but the learning 
curve is too steep for me and  I need to develop my app as soon as possible. I 
decided to give web.py a try and I found that the framework is easy to use and 
it gives a lot of control to the developer when handling GET and POST request 
and all these can be done in a single source code and using this framework has 
taught me a lot of low level web application programming basics. I might be 
wrong as I havent try django or any other frameworks yet. Hope python gurus 
here can share their thoughts on these
 matters,  




  ___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Output never stops

2008-08-04 Thread bob gailer

David wrote:

[snip]

#!/usr/bin/python

person = {'Lary':43,'Joan':24}

choice = 0
while choice != '-1':
   if choice == '':
   print "You must enter Lary or Joan to continue! (-1 to quit): "
   choice = raw_input(
   "Who's age do want to know, Lary or Joan? (-1 to quit): ")
   if choice == 'Lary':
   print "Lary's age is:", person.get('Lary')

   elif choice == 'Joan':
   print "Joan's age is:", person.get('Joan')

   else:
   print "Goodbye!"


Consider leveraging the dictionary (and some other"Pythonic" 
refinements). Separate the logic from the data. Now you can add more 
names and ages without changing the logic.


#!/usr/bin/python

person = {'Lary':43, 'Joan':24, 'Bob':68}
keys = person.keys()
names = ', '.join(keys[:-1]) + ' or ' + keys[-1]
while True:
  choice = raw_input("Who's age do want to know, %s? (-1 to quit): " % 
names)

  age = person.get(choice, None)
  if age is not None:
 print choice + "'s age is:", age
  elif choice == "-1":
 print "Goodbye!"
 break
  else:
 print "Invalid choice "  + choice

 



--
Bob Gailer
919-636-4239 Chapel Hill, NC

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Any Italian speakers?

2008-08-04 Thread Hansen, Mike

> -Original Message-
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of Alan Gauld
> Sent: Sunday, August 03, 2008 4:55 PM
> To: tutor@python.org
> Subject: [Tutor] Any Italian speakers?
> 
> I received this message which Google tells me is Italian but then 
> only gives a partial translation...
> 
> Can anyone help?
> 
> ---
> voglio chiderti solo 1 cosa ... ma secondo te qualle e il 
> miglior programma X programmare???
> grazie ...
> 
> da Cristian
> -
> 
> Alan G.

Alan,

Unfortunately, I only speak and read/write English.

Did you find anyone to traslate? I plugged it into Bablefish and tried Italian 
to English and here's what I got.(Probably the same as you.).

"I want chiderti only 1 thing... but according to you qualle and better program 
X to program? thanks "

I also tried Spanish, Potuguese, and Greek, but the Italian one came out the 
best.

Mike
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Does unittest slow down code

2008-08-04 Thread Kent Johnson
On Mon, Aug 4, 2008 at 11:32 AM, Tomaz Bevec <[EMAIL PROTECTED]> wrote:
>
> Is code executed within a unit test significantly slower than code executed 
> outside of a unit test?  Does code executed within a unit test take up more 
> memory?

Assuming you are asking about the unittest module...No, not unless you
do something specific in the unit test, e.g. testing on a large data
set would take more memory.

Unittest just runs the code you tell it to and looks at the result. It
doesn't instrument the code in any way. You do have to load the actual
unittest module but I don't think it has any great memory
requirements.

Are you seeing this behaviour or just asking about it?

Kent
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] Does unittest slow down code

2008-08-04 Thread Tomaz Bevec

Is code executed within a unit test significantly slower than code executed 
outside of a unit test?  Does code executed within a unit test take up more 
memory?

--TJB


  
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Firstrade Authentication: Form Management

2008-08-04 Thread Kent Johnson
On Mon, Aug 4, 2008 at 8:05 AM, Federo <[EMAIL PROTECTED]> wrote:
> Kent THANKS! It works great also on real account ..
>
> Two important Sub-QUESTIONS:
>
> 1.) Look attached word file. It describes form fields I would like to fill in
> and read server resoult..

You just have to mimic what the browser does. Use a Firefox plugin
that shows you what is being submitted; TamperData is one. Then set
the same fields in your code.

> 2.) Could you do the same login logic also with MECHANIZE plagin. There are
> some very usefull function in this plagin I might use. However I have

No, I'm not familiar with mechanize.

Kent
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor