[Tutor] Python fast enough for ad server?
Hi guys, I need to write an ad-serving application and i'm using Win XP as my dev platform. Naturally, i want it to be as painless as possible and i was thinking of writing it 100% in Python. However, i have not written any big apps in the language and i wonder if Python would have the performance or scale fast enough to a large user base. I also reluctantly think of using Python and Java, but Jython only supports Python 2.2 at the moment (same as my other option, Boost) and i'm using Python 2.5. what does everyone think? Best Regards, -- "The Stupidry Foundry" ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] canvas -> CLASSES
CLASSES: This is where I start getting confused. I've re-written the maze, per the guidance of John Fouhy (by the way, pretty cool!). Wish I had thought of doing it that way to begin with, lol. In any case, I'm trying to put it into a class, and for some reason it all starts to get jumbled here, which it shouldn't because I write in C++. None-the-less, I'm having some issues. I've attached the changes I've made, which worked before I started putting it in a class. I still need to work on the pathways, but figured I would get this into a class format before I go any further. Since I've put it in a class, my design is off because I don't know how to 'call' it, among other issues. Do the point definitions of the walls, boxes and T's get put inside the function? They could also be a file, but I don't think that would be necessary. Right now the function calls itself and I don't think its the best way to do it, mostly because I don't know what to pass it to begin with. Can someone please just stop my mind from going different directions? Well, perhaps not, but point me in the right direction? Thanks T - Original Message - From: "John Fouhy" <[EMAIL PROTECTED]> To: "Python Tutor" Sent: Monday, May 07, 2007 3:22 PM Subject: Re: [Tutor] canvas -> make an object 'seem' to move On 08/05/07, Teresa Stanton <[EMAIL PROTECTED]> wrote: I seem to be stuck again. I've attached my entire file (and the .gif I'm using. My son made this .gif, its our lab). The problem is my xp (the variable I use for my x coordinate) isn't updating after the .gif moves. I think I should probably organize the entire module better, but then again, I've never written anything this big in Python, and nothing like this in Tkinter. So, perhaps someone will have a suggestion? Some general comments: """ #This will build the north (top) wall of the maze canvasOne.create_line(10, 10, 790, 10, width = 3, fill = 'blue') #west to east canvasOne.create_line(20, 20, 395, 20, width = 3, fill = 'blue') #2nd line, west to middle canvasOne.create_line(395, 20, 395, 100, width = 3, fill = 'blue') #middle to south canvasOne.create_line(405, 20, 405, 100, width = 3, fill = 'blue')#2nd middle to south canvasOne.create_line(395, 100, 405, 100, width = 3, fill = 'blue') #short west to east canvasOne.create_line(405, 20, 780, 20, width = 3, fill = 'blue') #2nd line cont, middle to east """ This would be a good opportunity to define some functions. eg, you could do this: canvasOne = Canvas(width = 800, height = 700, bg = 'black') canvasOne.pack() def createWall((x0, y0), (x1, y1), colour='blue', width=3): """ Create a wall from (x0, y0) to (x1, y1). """ canvasOne.create_line(x0, y0, x1, y1, width=width, fill=colour) Then ... hmm, I see from running your code that your lines are all effectively continuous. So you could represent each wall by a series of points. eg: outerWall = [(10,10), (790,10), (790, 360), ...] # etc innerWall1 = [...] # etc walls = [outerWall, innerWall1, ...] Then you could draw them like: for wall in walls: for i in range(len(wall-1)): createWallall(outerWall[i], outerWall[i+1]) Second comment: """ xp = 100 yp = 600 # ... #onClick Vertical moves the .gif based on where the mouse is clicked #newY is new location for yp def onClickVertical(newY, xp, yp): print 'here' for i in range(newY): yp += .8 canvasOne.coords(ph, xp, yp) time.sleep(.001) canvasOne.update() return xp, yp """ I notice you have a statement: yp += .8 in this function. Are you aware that this will _not_ change the value of yp outside the scope of the function? If you want to change yp in the global scope, you need to tell python to treat it as a global variable, by putting the statement 'global yp' near the top of that function. A better course of action (global variables are a bit ugly) might be to encapsulate your maze into a class. eg: class Maze(object): def __init__(self): # initial position of actor self.xp = 100 self.yp = 600 # create maze, etc. def onClickVertical(self, newY, xp, yp): # etc HTH! -- John. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor """ The purpose of this module is to build the maze and pathway that the '.gif's' follow. """ from Tkinter import * import time class Maze(object): def __init__(self): #initial position of .gif self.xp = 100 self.yp = 600 def createWall((x0, y0), (x1, y1), colour = 'blue', width = 3): """ Create a wall from (x0, y0) to (x1, y1). """ canvasOne.create_line(x0, y0, x1, y1, width = width, fill = colour) outerWall = [(450, 640), (475, 640), (475, 640), (475, 690), (475, 690), (790, 690), (790, 690), (790, 530), (790, 530), (660, 530), (660, 530), (660, 360), (790, 360), (790, 10), (790, 10),
Re: [Tutor] Python fast enough for ad server?
Hey OkaMthenbo, OkaMthembo wrote: > Hi guys, > > I need to write an ad-serving application and i'm using Win XP as my dev > platform. Naturally, i want it to be as painless as possible and i was > thinking of writing it 100% in Python. However, i have not written any > big apps in the language and i wonder if Python would have the > performance or scale fast enough to a large user base. Most certainly for some definitions of 'large' :) Most web apps these days are not written in a single language/technology and are often not running on a single piece of hardware. If you search the archives of your favorite Python web application framework I'm pretty sure you'll find a discussion on how to scale your app to handle a 'large' user base. At the risk of oversimplification, but in hopes of avoiding premature optimization, I'd focus first on achieving working code, then benchmark it, then optimize if optimization is still needed. Many others have achieved high volume Python web apps using a mix of all the wonderful open source tools available. If your content doesn't change quickly and the ratio of GETs/POSTs is high, a caching server in front of your python app might be just the trick (memcached, squid,etc). But don't waste your time if you don't need to. Define 'too slow' and then prove to yourself that your app passes that threshold. If so, then figure out why it's slow and optimize the slow parts. Good luck, Eric. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
[Tutor] Type Conversion
I am doing a simple program that takes input from the user (a temp. in degrees Celsius) and converts it to a temperature in Fahrenheit. The following program works: def conversion (): C = input ("Enter the temperature in degrees Celcius:\n") F = (9.0 / 5.0) * C + 32 print F conversion () However, if I try to use the raw_input function, and then convert the variable to an integer, it does not work: def conversion (): C = raw_input ("Enter the temperature in degrees Celcius:\n") int (C) F = (9.0 / 5.0) * C + 32 print F conversion () Am I missing a step on converting the variable C from a string to an integer, or is it not possible to do this? I get the error that it is not possible to concatenate a str and int. Thanks! Jessica Brink Business/Computer Teacher Northland Pines High School Eagle River, WI 715-479-4473 ext. 0701 ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Type Conversion
> -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On > Behalf Of Jessica Brink > Sent: Wednesday, May 09, 2007 12:38 PM > To: Teresa Stanton; Python Tutor > Subject: [Tutor] Type Conversion > > I am doing a simple program that takes input from the user (a > temp. in degrees Celsius) and converts it to a temperature in > Fahrenheit. The following program works: > > def conversion (): > C = input ("Enter the temperature in degrees Celcius:\n") > F = (9.0 / 5.0) * C + 32 > print F > > conversion () > > However, if I try to use the raw_input function, and then > convert the variable to an integer, it does not work: > > def conversion (): > C = raw_input ("Enter the temperature in degrees Celcius:\n") > int (C) > F = (9.0 / 5.0) * C + 32 > print F > > conversion () > > Am I missing a step on converting the variable C from a > string to an integer, or is it not possible to do this? I > get the error that it is not possible to concatenate a str and int. > > Thanks! > > Jessica Brink > Business/Computer Teacher > Northland Pines High School > Eagle River, WI > 715-479-4473 ext. 0701 Instead of int(C), I think you need C = int(C) Mike ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] canvas -> CLASSES
"Teresa Stanton" <[EMAIL PROTECTED]> wrote > CLASSES: This is where I start getting confused. No kidding! :-) > put it into a class, and for some reason it all starts to get > jumbled here, > which it shouldn't because I write in C++. C++ OOP and Python are significantly different and some of those differences may be at work here. > Since I've put it in a class, my design is off because I don't know > how to > 'call' it, among other issues. You need an instance which you don;t have currently. > Do the point definitions of the walls, boxes and T's get > put inside the function? Probably not, probably etter to puut them in a list - as you do - and pass the list into the method. > Right now the function calls itself and I don't think its the best > way to do it, Nor do I, but I'mnot clear exactly what you are doing since the data is all hard coded inside the function so it looks to me like you will you will get into a loop... Some snippets and comments follow: > class Maze(object): >def __init__(self): >#initial position of .gif >self.xp = 100 >self.yp = 600 You don't seem to use selfd.xp/yp anywhere... In fact since you don't initialize any objects this never even gets called! >def createWall((x0, y0), (x1, y1), colour = 'blue', width = 3): >""" Create a wall from (x0, y0) to (x1, y1). """ >canvasOne.create_line(x0, y0, x1, y1, width = width, fill = > colour) You don't have a self parameter in the method. Recall that self is equivalent to this in C++ but needs to be explicitly declared in Python methods. Also you are declaring parameters to be tuples which I don't think you can do. You need to name the tuples, something like: def createWall(self, pt1,pt2, canvas = None, colour='blue', width=3) Also you use the canvasOne global value here which would be better passed in as am parameter as shown above. >outerWall = [(450, 640), (475, 640), (475, 640), >walls = [outerWall] Not sure why the second line is there. The first is static data which means the method never changes what it does. You never use the x0,y0, params passed in after the create line above... > for wall in walls: >for i in range(len(wall)-1): >createWall(outerWall[i], outerWall[i+1]) For each entry draw a kine then come back into this loop using the same data so we very quickly hit the Python recursion limit I suspect. > topLeftBox = [(130, 105), (130, 125), ... > secondTopLeftBox = [(160, 215), (160, 225), ... > ... >boxes = [topLeftBox, secondTopLeftBox, topRightBox, > secondTopRightBox] > >for box in boxes: >for i in range(len(box)-1): >createWall(topLeftBox[i], topLeftBox[i+1]), >createWall(secondTopLeftBox[i], > secondTopLeftBox[i+1]), Sorry, I have no idea how this is supposed to work. I just got confused about the mix of topLefts and box versus boxes etc. But remember that each call to createWall only uses the arguments to draw a single line, then the rest uses the same data over again. Also to acces createWall you should really be using self.createWall since createWall is a method of your Maze class. >x = 40 >for i in range(9): >x += 20 >canvasOne.create_rectangle(x, 610, x+5, 615, fill = > 'white') > >#left path built north to south >y = 290 >for i in range(15): >y += 20 >canvasOne.create_rectangle(220, y, 225, y+5, fill = > 'white') All these bits could be put into a function with the values as parameters, something like:: def buildPath(val1,val2, number, increment, deltax,deltay,orientation, fill='white') for i in range(number): val1 += increment if orientation = 0: x,y = val1,val2 else: x,y = val2,val1 canvas.create_rectangle(x,y,x+deltax,y+deltay,fill) >root = Tk() > root.title("Background") > >canvasOne = Canvas(width = 800, height = 700, bg = 'black') >createWall(450, 640, 475, 640) >canvasOne.pack() > >root.mainloop() Here yuou call createWall which is a method of Maze but you don't instantiate Maze. I'd expect so9mething like: maze = Maze(x,y) maze.createWall() But there's a lot of logic missing between there ared here. Alsoi if thats all you are doing there is no point of having a maze class, just write a createWall function. You need to figure out what a Maze object is for. What are its responsibilities in the program? What data does it manage? What actions do you want it top perform? Unfortunately from your code I can't work out what you were expecting of your Maze instances. HTH, -- Alan Gauld Author of the Learn to Program web site http://www.freenetpages.co.uk/hp/alan.gauld ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Type Conversion
"Jessica Brink" <[EMAIL PROTECTED]> wrote > I am doing a simple program that takes input from the user Please don;t hijack a thread to ask something unrelkated. Start a new threead it helps keep things clear and makkes it easier to find responses later. Mike has answered your question in this case buit please in future start a new subject line. Alan G. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
[Tutor] Assembling multiple strings into one
I have a program producing a list of multiple strings. The amount of strings in the list varies. I want to assemble a string that is: list item 0 + space + list item 1 + space, and so on, going through every string in the list. -- "Computers were the first God-Satan collaboration project." "Blind faith in bad leadership is not patriotism." "One of the most horrible features of war is that all the war-propaganda, all the screaming and lies and hatred, comes invariably from people who are not fighting."-George Orwell, _Homage to Catalonia ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Python fast enough for ad server?
"OkaMthembo" <[EMAIL PROTECTED]> wrote > I need to write an ad-serving application and i'm > using Win XP as my dev platform. The real issue is what are you using for your deployment platform,. If its Win XP then Python is probably fast enough since XP cannot handle huge volumes anyway. If its enterprise scale Windows or some other OS then there are other questions to ask. > i wonder if Python would have the performance or > scale fast enough to a large user base. Define large. Its not normally the number of users that matters but thenumber of concurrent users. Google has probably 10's of millions of users but less than a million at any one time. Are we talking google sizes? > Python and Java, but Jython only supports Python 2.2 Jython will not be significantly faster than Python. And unless you have a good optimising/JIT compiler neither will Java IMHO. But Python 2.2 would be adequate to write a server anyhow so you just lose a few of the latest bells and whistles, no big loss. Given the choice between Python 2.2. and Java 5 I know which I'd prefer... Alan G. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Assembling multiple strings into one
Alan Gilfoy wrote: > I have a program producing a list of multiple strings. > The amount of strings in the list varies. > I want to assemble a string that is: > > list item 0 + space + list item 1 + space, > and so on, going through every string in the list. ' '.join(myList) Kent ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Python fast enough for ad server?
there's also the question of the delivery architecture: if there are multiple machines in a clustered configuration, even something such as DNS round robin, then improving performance is a matter of throwing machines at the front end. On May 9, 2007, at 1:17 PM, Alan Gauld wrote: > > "OkaMthembo" <[EMAIL PROTECTED]> wrote > >> I need to write an ad-serving application and i'm >> using Win XP as my dev platform. > > The real issue is what are you using for your deployment > platform,. If its Win XP then Python is probably fast > enough since XP cannot handle huge volumes anyway. > If its enterprise scale Windows or some other OS then > there are other questions to ask. > >> i wonder if Python would have the performance or >> scale fast enough to a large user base. > > Define large. Its not normally the number of users > that matters but thenumber of concurrent users. > Google has probably 10's of millions of users > but less than a million at any one time. Are we > talking google sizes? > >> Python and Java, but Jython only supports Python 2.2 > > Jython will not be significantly faster than Python. > And unless you have a good optimising/JIT compiler > neither will Java IMHO. > > But Python 2.2 would be adequate to write a server > anyhow so you just lose a few of the latest bells > and whistles, no big loss. Given the choice between > Python 2.2. and Java 5 I know which I'd prefer... > > Alan G. > > ___ > 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] Another string-manipulation question
Given a string, how would I?: 1. Make sure only the first letter string_name[0], is capitalized. This would involve using string_name.lower() to lowercase everything else, but how do I use .upper(), or some other method, to capitalize only the first character? 2. Make sure that there are no symbols (non-letter, non-number) in the string, and, if one is found, remove it. Pseudocode time, as to a potential approach- for each character in the string: if character not in "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ": remove it -- "Computers were the first God-Satan collaboration project." "Blind faith in bad leadership is not patriotism." "One of the most horrible features of war is that all the war-propaganda, all the screaming and lies and hatred, comes invariably from people who are not fighting."-George Orwell, _Homage to Catalonia ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Running and passing variables to/from Fortran
I have access to the source code. And I probably could pass the data to stdout, so maybe .popen would work! I'll have a look... thanks! ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Another string-manipulation question
> -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Alan Gilfoy > Sent: Wednesday, May 09, 2007 2:42 PM > To: tutor@python.org > Subject: [Tutor] Another string-manipulation question > > Given a string, how would I?: > > 1. Make sure only the first letter string_name[0], is capitalized. > This would involve using string_name.lower() to lowercase everything > else, but how do I use .upper(), or some other method, to capitalize > only the first character? There's a string method called capitalize, so you can use string_name.capitalize() In [27]: x = "rakaNishu" In [28]: x = x.capitalize() In [29]: x Out[29]: 'Rakanishu' > > 2. Make sure that there are no symbols (non-letter, > non-number) in the > string, and, if one is found, remove it. > > Pseudocode time, as to a potential approach- > > for each character in the string: > if character not in > "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ": > remove it Someone may have a better idea on this one. Off the top of my head, you can build a new string while checking each character using another string method isalpha. You might want to check the string first before even bothering with the loop. i.e. if not string_name.isalpha()...then enter this loop below... In [38]: x = "rakan345ishu" In [39]: newx = "" In [40]: for chr in x: :if chr.isalpha(): :newx += chr : In [41]: print newx rakanishu Mike ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
[Tutor] Lexer implementation
Hi All, Is there a classical way to implement a lexer in Python without using a parser toolkit? Something like the lexer MJD illustrates in Higher Order Perl, section 8.1.2. It's even better if it can act on a stream instead of a string. Best regards, Jason Doege ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
[Tutor] Alright... I'm new...
I've always been interested in learing to write my own programs but I never new where to start. Now I heard python is not only powerful but easy to use therefor making it good for begginers. So I looked it up, Downloaded python 2.5, I'm just in the middle of the first part of the first chapter ((don't get me wrong. I also looked up tutorials so I know most of what they already mentioned. I'm just stating that that is where I'm at in the book)) in "Python for Dummies" and I'm still lost. I'm understanding what its teaching me. Don't get me wrong. It's simple. Very straight forward. MUCH less confusing than C++. I've learned about, obviously, how to display text. I've learned about variables and having your user input data(such as a password. During the tutorial they taught me how to make a simple password type program thing.) Well!!! I'll get to the point now... I know I'm in the very early stages of programming. I'm just a big newb. But it just isn't clicking. I understand, as stated before, what I've been taught. But I don't understand how it could all come together to create a program. I understand that programs don't HAVE to have a GUI but when I think programs or software I think interactivity. I'm just not sure where this is leading me. I want to creat a fully functional program that actually does something USEFUL. It doesn't have to be big. But it has to actually do something other than add and subtract and display a simple string. Well I suppose I'm asking more for opinions and suggestions on how to go about learning. Thanks for listening to my nonsense. >_< - We won't tell. Get more on shows you hate to love (and love to hate): Yahoo! TV's Guilty Pleasures list.___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
[Tutor] Queueing
Hi Everyone I need to a write a script that would do a queuing job on a cluster running openMosix Linux. I have checked the Queue module and that part I can say it is covered. My problem regards on thecode to check if the process has ended. As some most of the jobs would be run in different nodes I am having difficulties getting some example code to accomplish that. Thanks a lot for any helpful advice. Cheers Paulo ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Alright... I'm new...
> > I want to create a fully functional program that actually does something > USEFUL. And just what would that be? Ask yourself that.. then perhaps folks on the list could guide you in the right direction... -j ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Another string-manipulation question
Alan Gilfoy wrote: > Given a string, how would I?: > 2. Make sure that there are no symbols (non-letter, non-number) in the > string, and, if one is found, remove it. > > Pseudocode time, as to a potential approach- > > for each character in the string: > if character not in > "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ": > remove it A couple of solutions here: http://tinyurl.com/2qqy32 except substitute ascii_letters for printable. Kent ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Alright... I'm new...
"Jeff Molinari" <[EMAIL PROTECTED]> wrote > when I think programs or software I think interactivity. > I'm just not sure where this is leading me. > > I want to creat a fully functional program that actually > does something USEFUL. It doesn't have to be big. > But it has to actually do something other than add > and subtract and display a simple string. You have to start with small steps before you can run. Excel is considered by many to be a useful program but is at heart a program which reads strings and does simple math. It just does that a lot of times - once per cell. A Word Processor is essentially a program to read in strings and reformat them by inserting extra characters. A database stores data in files and searches for it again later. And most user programs (as opposed to servers) are essentially variations on those three themes. If we add manipulation of images and sound (which admittedly are more complex) and some basic networking(email/browsers) then you pretty much have the average PC users ambitions covered. But you have to understand the basics before you can put them together. Its likelearning the chords on a guitar before being able to accompany yourself, or composer a new tune. The better you grasp the basics the easier the more advanced stuff will be later. > Well I suppose I'm asking more for opinions and suggestions > on how to go about learning. Stick with a tutor and adapt the examples as you go. Be sure you understand what your changes did diffeently and why. As you keep going the examples will get bigger and more "real world" -- Alan Gauld Author of the Learn to Program web site http://www.freenetpages.co.uk/hp/alan.gauld ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Queueing
"Paulo Nuin" <[EMAIL PROTECTED]> wrote > I need to a write a script that would do a queuing job on a cluster > running openMosix Linux. I have checked the Queue module and that > part I > can say it is covered. My problem regards on thecode to check if the > process has ended. While you may well get an answer here that is a bit advanced for a beginners mailing list. You will likely get more responses by posting on the main Python newsgroup comp.lang.python. Alan G. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Alright... I'm new...
On Thursday 10 May 2007 00:13, Jeff Molinari wrote: > I know I'm in the very early stages of programming. I'm just a > big newb. But it just isn't clicking. I understand, as stated > before, what I've been taught. But I don't understand how it could > all come together to create a program. I understand that programs > don't HAVE to have a GUI but when I think programs or software I > think interactivity. I'm just not sure where this is leading me. GUI programs are normally written with GUI toolkits (also called application frameworks). This way you don't have to write the drawing code for buttons and text and other standard GUI elements. The toolkits are usually written in C or C++ but many have Python bindings. Two prominent examples which I know of are: QT: http://doc.trolltech.com/4.2/index.html wxWidgets: http://www.wxwidgets.org/ Python however comes with an integrated GUI toolkit: Tkinter. http://www.pythonware.com/library/tkinter/introduction/ To give you an idea, here is a very simplistic example program. It should display a window with the words 'Hello world!' in it. Copy it into a file (for example test.py) and run it. #-- program start- from Tkinter import * widget = Label(None, text='Hello world!') widget.pack() widget.mainloop() #-- program end- I think you should follow the programming book, and when you are done with it you should ask on the list which GUI toolkit you should learn. Regards, Eike. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Queueing
Paulo Nuin wrote: > Hi Everyone > > I need to a write a script that would do a queuing job on a cluster > running openMosix Linux. I have checked the Queue module and that part I > can say it is covered. My problem regards on thecode to check if the > process has ended. As some most of the jobs would be run in different > nodes I am having difficulties getting some example code to accomplish that. I don't think the Queue module will help you with multi-processing, it is useful for inter-thread communication within a single process. There are several Python packages that help with multi-processing; one is here: http://www.parallelpython.com/ and others are referenced in the Links section of the above site. Also http://www.python.org/pypi?%3Aaction=search&term=parallel&submit=search HTH Kent ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Alright... I'm new...
Excuse me, there is one character too much in the example program. This time I send it as an attachment. Eike. test.py Description: application/python ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Alright... I'm new...
The attachment is also wrong! Delete the first character ('>') from the program and it will be syntactically correct. The addition of the '>' character is a bug in my mail program (KMail) I think. It is probably a remnant of the first two characters of a UTF8 file. Eike. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Type Conversion
On 5/9/07, Alan Gauld <[EMAIL PROTECTED]> wrote: > Please don;t hijack a thread to ask something unrelkated. > Start a new threead it helps keep things clear and makkes > it easier to find responses later. What do you mean by hijack a thread? Her subject "Type conversion" is the only occurence in this list, hence it's an original post. -- - Rikard - http://bos.hack.org/cv/ ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Running and passing variables to/from Fortran
John Washakie wrote: > I have access to the source code. Did you tell us why you want to keep the code in FORTRAN? Would converting it to Python solve the issue? -- Bob Gailer 510-978-4454 ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] problems with running IDLE under Windows 95
Hello to All of the Python Community, I'd like to thank all those who replied to my last email about Python not installing under Windows 95. That problem's been overcome. Although, after installing Python 2.5.1 I ran into another difficulty. IDLE wouldn't start. Another thing I did was uninstall Python 2.5.1 and install Python 2.2.3 to see if it would make any difference. It didn't. I'd click on the IDLE icon, the hourglass thing would come up for a few seconds and then it would disappear. What could the problem be there? Thanking you in advance and looking forward to hearing from those of you who may have an answer. Regards, Alexander Kapshuk ISD Education Office ICQ#295-121-606 ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor