Re: [Tutor] threads and webpy

2006-08-17 Thread emilia12
> I just looked at web.py. > It's not a webserver. It's a toolkit you use to write > your own webserver. > Why are you under the impression that it's a webserver? > Did you just google for 'web server in Python' and find > this? you are right, i mean that it is the core of the webserver > If you

Re: [Tutor] Actual code that illustrates problem

2006-08-17 Thread Danny Yoo
> #def strongfac(z,w): [function body cut] Ok, let's go through this step by step. * What is the intent of strongfac? * What are the inputs? What is 'z', and what is 'w'? * What are the outputs? What is the return value of strongfac? Same questions for fermat(). What are th

Re: [Tutor] [whitelist] Re: regular expressions question

2006-08-17 Thread nimrodx
Hi Alan, I found a pretty complicated way to do it (Alan's way is way more elegant). In case someone is searching the archive, maybe they will find something in it that is useful. It uses the regular experessions module. import re def dehexlify_websites(fle): # get binary data inpt = open

Re: [Tutor] (no subject)

2006-08-17 Thread Danny Yoo
> hello is there a way if a condition is not met to restart the whole > program? for example if and if statement returns true then re start the > whole program? Question before we go on: why are you trying to do this? It's possible to do this, but it sounds so unusual that I want to know more

Re: [Tutor] threads and webpy

2006-08-17 Thread anil maran
did u try os.spawnv()to spawn other unix commands[EMAIL PROTECTED] wrote: > Hi!Hi !> I don't know what web.py is.> Is it something you wrote?no, this is a simple webserver, (http://webpy.org/)> You'll have to write multi-threaded code if you want it> to run multiple> threads :)> (Unless, of course,

Re: [Tutor] threads and webpy

2006-08-17 Thread anil maran
hi likeyour post about how to make it listen on one ip and then on two ips isnt this general python, can you please explain how to go about this, this would be very usefulthanks then show us your code and we'll tell youhow to make it into a class that listens on a single IP and how tostart two list

Re: [Tutor] about threads

2006-08-17 Thread anil maran
you can configure lighttpd virtual hosts to spawn new webpy instances for each of your ip addressEmilia can you explain your problem a little more I have spent quite some time using and asking questions abt the problems ur posting...[EMAIL PROTECTED] wrote: Hi all,my question is probably about the

Re: [Tutor] about threads

2006-08-17 Thread anil maran
You'll have to write multi-threaded code if you want it to run multiple threads :)(Unless, of course, Web.py supports threads?)Luke, what is the easiest way to run multithreaded programs from webpyis there a page that has common gotchas and pitfalls for doing the same.Luke Paireepinart <[EMAIL PROT

[Tutor] Low level socket and threading code in python in HUGE websites -

2006-08-17 Thread anil maran
What kind of low-level socket and threading code is necessary for a db intensive site such as yahoo. How do we use it from python? does anyone  have experience using it http://redditblog.blogspot.com/2005/12/on-lisp.html >From moving to python by the founders of reddit Because of the low-leve

[Tutor] server push

2006-08-17 Thread anil maran
Hi guys i was wondering if someone has successfuly used server push for apps such as meebo etc using webpy if so can you share some guidelines on using them I have a continuously running python webserver and a website, if there is a new mail or message, how do i ping and let the website or the u

[Tutor] web application and database caching technique

2006-08-17 Thread anil maran
i m trying to build a webapplication, i need to cache db records as it has become very slow the sql queries and retrivalcan you guys helpe me out in designing cache structures/ hash tables for these cases 1. Scenario One:    * Huge number of reads    * Few writes    * One row accessed from db pe

Re: [Tutor] (no subject)

2006-08-17 Thread Kent Johnson
Amadeo Bellotti wrote: > hello is there a way if a condition is not met to restart the whole > program? for example if and if statement returns true then re start > the whole program? You can probably achieve what you want just by structuring the program correctly. My guess you need to use nest

[Tutor] Communicating with Win2000 runas.exe

2006-08-17 Thread Barnaby Scott
I have a problem which I was hoping that Python could solve for me, but I have become stuck for days now after only 2 lines of code. My son has a Microsoft game on a shared family computer, which Microsoft in its infinite wisdom requires you to run as 'administrator'. Call me old-fashioned but I d

Re: [Tutor] Communicating with Win2000 runas.exe

2006-08-17 Thread Tim Golden
[Barnaby Scott] | So I'm thinking along these lines: | | import subprocess | sp = subprocess.Popen(r'C:\WINNT\SYSTEM32\runas.exe | /user:administrator | C:\Program Files\Microsoft Games\Age of Mythology\aom.exe') | #some sort of code to send the password here... | #help! I *think* -- and I'm ha

Re: [Tutor] (no subject) (fwd)

2006-08-17 Thread Danny Yoo
-- Forwarded message -- Date: Thu, 17 Aug 2006 09:44:40 -0400 From: Amadeo Bellotti <[EMAIL PROTECTED]> To: Danny Yoo <[EMAIL PROTECTED]> Subject: Re: [Tutor] (no subject) Mr. Yoo im working on a program to write a sudoku puzzle and if something is wrong with the last row i need

Re: [Tutor] (no subject)

2006-08-17 Thread Danny Yoo
> Mr. Yoo im working on a program to write a sudoku puzzle and if > something is wrong with the last row i need to re make the whole puzzle > over again. Hi Amadeo, In the future, please use the "Reply to All" feature of your email client, so that we can keep the conversation on the mailing li

Re: [Tutor] (no subject)

2006-08-17 Thread Amadeo Bellotti
Yes I can Mr. Yoo, but i dont really want to make my whole program a loop.On 8/17/06, Danny Yoo <[EMAIL PROTECTED] > wrote:> Mr. Yoo im working on a program to write a sudoku puzzle and if > something is wrong with the last row i need to re make the whole puzzle> over again.Hi Amadeo,In the future,

Re: [Tutor] (no subject)

2006-08-17 Thread Danny Yoo
>> > Mr. Yoo im working on a program to write a sudoku puzzle and if >> > something is wrong with the last row i need to re make the whole puzzle >> > over again. >> Here's a separate question that's related to the first: can you write a >> function that asks the user to enter a word, and contin

Re: [Tutor] All of Kermit's E-Mails

2006-08-17 Thread Kermit Rose
From: Luke Paireepinart Date: 08/17/06 02:29:01 To: Kermit Rose Cc: tutor@python.org Subject: Re: [Tutor] All of Kermit's E-Mails [was: Global Variables] >>> I really dislike the way you reply. Follow the standard format! Leave all the greater-than signs before the previous person'

Re: [Tutor] Actual code that illustrates problem

2006-08-17 Thread Kermit Rose
>>> From: Danny Yoo Date: 08/17/06 04:02:35 To: Kermit Rose Cc: Tutor Subject: Re: [Tutor] Actual code that illustrates problem > # def strongfac(z,w): [function body cut] Ok, let's go through this step by step. * What is the intent of strongfac? *** To try to find factors

Re: [Tutor] All of Kermit's E-Mails

2006-08-17 Thread Danny Yoo
> Suggest an alternative way of transmitting code. Hi Kermit, Try sending the code as a file attachment. It's large enough that we want to make sure it goes through without being messed up, but small enough that it can still be posted to the list. Alternatively, post the code on the web somew

[Tutor] Which Book

2006-08-17 Thread Nagendra Singh
Hi All, I have very little programming experience, I have decided to learn Python..there are tons of material and refernces on the web-pages, can you guys please suggest what is the best way to start or which ONE book which I should follow to start. thanks.. Nagendra

Re: [Tutor] Which Book

2006-08-17 Thread jim stockford
i think it's a mistake to concentrate on one book. Cull responses and pick three books to start with. The benefit is that where one book presents a poor explanation, another will do a good job (and one book will omit certain things that another presents). Also, you'll probably find you

Re: [Tutor] Actual code that illustrates problem

2006-08-17 Thread Danny Yoo
> To try to find factors of z, using w. > > > * What are the inputs? What is 'z', and what is 'w'? > > ** > > z is the number to be factores. > > w is a "witness", a number that may help find the factors of z. [My apologies in advance; this message is a bit long.] Hi Kermit, Ok, goo

Re: [Tutor] (no subject)

2006-08-17 Thread Kent Johnson
Amadeo Bellotti wrote: > Mr. Johnson i was hoping i didnt have to make my whole program into a > loop because its about 900 lines of code and tabbing that would take a > long time If your whole program is 900 lines without a subroutine then you have more problems than just tabbing...really, a pr

Re: [Tutor] (no subject)

2006-08-17 Thread Amadeo Bellotti
thank you Mr. Johnson this is my first program so its a little sloppy. I'm using gedit ill check out the other editors that u have thank youOn 8/17/06, Kent Johnson <[EMAIL PROTECTED]> wrote: Amadeo Bellotti wrote:> Mr. Johnson i was hoping i didnt have to make my whole program into a > loop becaus

Re: [Tutor] All of Kermit's E-Mails

2006-08-17 Thread Brian van den Broek
Danny Yoo said unto the world upon 17/08/06 12:16 PM: >> Suggest an alternative way of transmitting code. > > Hi Kermit, > Just as a side note: you may want to investigate a good email client such > as Thunderbird if you have spare time. > > http://www.mozilla.com/thunderbird/ > > Much

Re: [Tutor] (no subject)

2006-08-17 Thread Danny Yoo
> thank you Mr. Johnson this is my first program so its a little sloppy. I'm > using gedit ill check out the other editors that u have thank you More fundamentally, spend some time to learn about functions; they'll address much of the original concerns you had. See any of the tutorials on:

[Tutor] Making it easier to discuss programs (fwd)

2006-08-17 Thread Danny Yoo
Kermit accidently added a typo to the tutor@python.org address; I'll forward this message to the list for him. -- Forwarded message -- Date: Thu, 17 Aug 2006 13:38:10 -0400 From: Kermit Rose <[EMAIL PROTECTED]> To: [EMAIL PROTECTED], "Luke Paireepinart; tutor"@python.org Subject

Re: [Tutor] Undeliverable Mail

2006-08-17 Thread Kermit Rose
> From" Danny Yoo > /*Date:*/ 08/17/06 12:16:16 > To: Kermit Rose > /*Cc:*/ Luke Paireepinart ; > tutor@python.org > /*Subject:*/ Re: [Tutor] All of Kermit's E-Mails > > > > > > Hi Kermit, > > > Try sending the code as a file attachment.

Re: [Tutor] (no subject)

2006-08-17 Thread Amadeo Bellotti
Thank you again i no im a newbie and really inexperianced but thank youOn 8/17/06, Danny Yoo <[EMAIL PROTECTED] > wrote:> thank you Mr. Johnson this is my first program so its a little sloppy. I'm > using gedit ill check out the other editors that u have thank youMore fundamentally, spend some time

Re: [Tutor] (no subject)

2006-08-17 Thread Amadeo Bellotti
thank you again but i think i found a way to fix itOn 8/17/06, Danny Yoo <[EMAIL PROTECTED] > wrote:>> > Mr. Yoo im working on a program to write a sudoku puzzle and if >> > something is wrong with the last row i need to re make the whole puzzle>> > over again.>> Here's a separate question that's r

Re: [Tutor] Which Book

2006-08-17 Thread Brian van den Broek
Nagendra Singh said unto the world upon 17/08/06 12:14 PM: > Hi All, > > I have very little programming experience, I have decided to learn > Python..there are tons of material and refernces on the web-pages, can > you guys please suggest what is the best way to start or which ONE > book which I s

Re: [Tutor] Actual code that illustrates problem

2006-08-17 Thread Kermit Rose
Danny Yoo wrote: > > > Hi Kermit, > > Ok, good. You should add this as a comment to the function's header, > so that other people can see this. Here is an example: > > def strongfac(z, w): > """z is the number to be factored. >w is a witness that may help find the factors of z. >

Re: [Tutor] All of Kermit's E-Mails

2006-08-17 Thread Kermit Rose
Brian van den Broek wrote: > > > Hi Kermit, > > I'd like to second Danny's suggestion of Thunderbird. It is a very > nice client by the same people that produce firefox. > > I spent a few minutes trying to find out how to set IncrediMail to > quote properly. Unfortunately, there is no downloadabl

Re: [Tutor] Actual code that illustrates problem

2006-08-17 Thread Danny Yoo
# face = [x,y,0] >>> [some code cut] # face[0] = x # face[1] = y # face[2] = 0 > > I agree. I reasoned as follows. > > The root cause is that Python is not returning the correct value of a list. > > So before I return the list, I will remind Python what's in the list. Hi Kermi

[Tutor] banners

2006-08-17 Thread josip
Hi, I want to solve thi question, but I don't know how Can someone help?   When dot matrix printers were at the height of hi- tech fashion, university students used to create banners with words on them using special characters (e.g. a banner with a student’s initials on it formed out of # ch

Re: [Tutor] banners

2006-08-17 Thread Danny Yoo
On Thu, 17 Aug 2006, josip wrote: > Hi, I want to solve thi question, but I don't know how [homework question cut] This is homework; our policy is not to give much help on this, as it's your work to do. Do you have any specific questions? Otherwise, all I can do here is point you toward i

Re: [Tutor] Which Book

2006-08-17 Thread Mike Hansen
> > Hi All, > > I have very little programming experience, I have decided to learn > Python..there are tons of material and refernces on the web-pages, can > you guys please suggest what is the best way to start or which ONE > book which I should follow to start. > > thanks.. > > Nagendra http

Re: [Tutor] Low level socket and threading code in python in HUGEwebsites -

2006-08-17 Thread Alan Gauld
Anil, I don't know if this is the kind of thuing they did on reddit, but a few years ago I was working on a large network management system (in C++ FWIW). It was monitoring a network of around 100,000 nodes.To ensure a timely flow of alarm traffic the server had 4 network cards and the code used m

Re: [Tutor] web application and database caching technique

2006-08-17 Thread Alan Gauld
>i m trying to build a webapplication, i need to cache db records > as it has become very slow the sql queries and retrival > can you guys helpe me out in designing cache structures/ hash > tables for these cases Which database? Most relational databases have caching as a feature that you can

Re: [Tutor] web application and database caching technique

2006-08-17 Thread Danny Yoo
On Thu, 17 Aug 2006, Alan Gauld wrote: >> i m trying to build a webapplication, i need to cache db records as it >> has become very slow the sql queries and retrival can you guys helpe me >> out in designing cache structures/ hash tables for these cases I second Alan's suggestion: talk to you

Re: [Tutor] Which Book

2006-08-17 Thread Alan Gauld
> I have very little programming experience, I have decided to learn > Python..there are tons of material and references on the web-pages, > can > you guys please suggest what is the best way to start or which ONE > book which I should follow to start. Despite the fact that my tutor is available

Re: [Tutor] (no subject)

2006-08-17 Thread Alan Gauld
> thank you Mr. Johnson this is my first program so its a little > sloppy. I'm > using gedit ill check out the other editors that u have thank you If you have Python you will have either IDLE or Pythonwin (or both) Both of these will allow block indent/unindent so simply load the code into IDLE t

Re: [Tutor] All of Kermit's E-Mails

2006-08-17 Thread Alan Gauld
> gave no results :-( So, IncrediMail doesn't quite seem so Incredi > to me ;-) I'll second that! I have an elderly friend who loves the net and is on lots of non techie mailing lists. She was waxing lyrical about incredimail to me and was amazed that I didn't use it, it was so good. So I do

Re: [Tutor] Actual code that illustrates problem

2006-08-17 Thread Alan Gauld
While others have made good suggestions to clarify the code I thought I'd try to tackle the question of whether we had a bug in Python. Unfortunately the debug output does not come from the code that's posted so its difficult to figure out what's been happening. For example, one apparently good a

Re: [Tutor] banners

2006-08-17 Thread Alan Gauld
> As far as I can tell, you should be able to solve this problem after > reading the first section of any Python tutorial. I'm not so sure Danny, figuring out how to draw the letters in the banner is not obvious after having read a hello-world program example. There are some tricky-ish aspects to

Re: [Tutor] banners

2006-08-17 Thread Danny Yoo
> I'm not so sure Danny, figuring out how to draw the letters in the > banner is not obvious after having read a hello-world program example. > There are some tricky-ish aspects to this one. Hi Alan, It's simpler than that: the homework states that the message is hardcoded to show either josip

Re: [Tutor] Actual code that illustrates problem

2006-08-17 Thread Kermit Rose
Alan Gauld wrote: > > While others have made good suggestions to clarify the code I thought > I'd try to tackle the question of whether we had a bug in Python. > > Unfortunately the debug output does not come from the code that's > posted so its difficult to figure out what's been happening. > > Fo

Re: [Tutor] All of Kermit's E-Mails

2006-08-17 Thread R. Alan Monroe
> my email program does not insert the > sign like the standard email > program does. "The Bat" mail client does a great job of it, but it's not free. http://www.ritlabs.com/ You might try Pegasus Mail, although I don't remember how well it does it. http://www.pmail.com/ If you were desperate

Re: [Tutor] Which Book

2006-08-17 Thread Amadeo Bellotti
A good book is Practical Python by Magnus Lie Hetland.On 8/17/06, Alan Gauld <[EMAIL PROTECTED] > wrote:> I have very little programming experience, I have decided to learn > Python..there are tons of material and references on the web-pages,> can> you guys please suggest what is the best way to st

Re: [Tutor] All of Kermit's E-Mails

2006-08-17 Thread Brian van den Broek
Kermit Rose said unto the world upon 17/08/06 02:38 PM: > Now if I can only get Thunderbird to quit treating the up and down arrow > as a page up or page down, > whenever it's at the top line or bottom line of what it thinks is a page. Hi Kermit, I'm glad you've given Thunderbird a try and tha

Re: [Tutor] (no subject)

2006-08-17 Thread Amadeo Bellotti
thank you but IDLE doesnt seem to work on Suse 9.2 do you know a way to fix it?On 8/17/06, Alan Gauld <[EMAIL PROTECTED] > wrote:> thank you Mr. Johnson this is my first program so its a little > sloppy. I'm> using gedit ill check out the other editors that u have thank youIf you have Python you wi

Re: [Tutor] Communicating with Win2000 runas.exe

2006-08-17 Thread Barnaby Scott
Tim Golden wrote: > [Barnaby Scott] > > | So I'm thinking along these lines: > | > | import subprocess > | sp = subprocess.Popen(r'C:\WINNT\SYSTEM32\runas.exe > | /user:administrator > | C:\Program Files\Microsoft Games\Age of Mythology\aom.exe') > | #some sort of code to send the password here.

Re: [Tutor] (no subject)

2006-08-17 Thread John Fouhy
On 18/08/06, Amadeo Bellotti <[EMAIL PROTECTED]> wrote: > thank you but IDLE doesnt seem to work on Suse 9.2 do you know a way to fix > it? Why not -- what goes wrong? Is there an error message? -- John. ___ Tutor maillist - Tutor@python.org http://

Re: [Tutor] (no subject)

2006-08-17 Thread Dave Kuhlman
On Thu, Aug 17, 2006 at 01:28:56PM -0400, Amadeo Bellotti wrote: > thank you Mr. Johnson this is my first program so its a little sloppy. I'm > using gedit ill check out the other editors that u have thank you > I'd also encourage you to look at other editors, as others on this list have. Howeve

Re: [Tutor] (no subject)

2006-08-17 Thread Amadeo Bellotti
Mr. Kuhlman it says python is not configured for tk. but on another note does anyone know how to make a 2d array? On 8/18/06, John Fouhy <[EMAIL PROTECTED]> wrote: On 18/08/06, Amadeo Bellotti <[EMAIL PROTECTED]> wrote:> thank you but IDLE doesnt seem to work on Suse 9.2 do you know a way to fix>

Re: [Tutor] (no subject)

2006-08-17 Thread John Fouhy
On 18/08/06, Amadeo Bellotti <[EMAIL PROTECTED]> wrote: > Mr. Kuhlman it says python is not configured for tk. > > but on another note does anyone know how to make a 2d array? Are you in charge of your machine, or does someone else administer it? I don't know SUSE very well, but I expect that you