[Tutor] web development

2005-09-27 Thread Don Jennings
Earlier this month, Kent posted that Jython and Velocity are a good way to develop dynamic web sites. After a little searching, it seems that there are quite a few options for web development in Python (perhaps too many?). So, rather than ask for recommendations of which one to use, what I woul

Re: [Tutor] Embedding

2005-09-27 Thread Kent Johnson
Michael Sparks wrote: > On Tuesday 27 September 2005 23:16, Kent Johnson wrote: >>Sounds like a bit of a hash to me. Show them pygame and convince them to >>learn Python :-) > > If you tell them to drop the type declarations, braces {}, semicolons, and > make their code a touch simpler, then they

Re: [Tutor] Embedding

2005-09-27 Thread R. Alan Monroe
> Well we are three programmers. I know python, another knows Java and the > other C++. We are trying to figure out how to combine all three > langauges to make a game. I checked out this book from the local library: MUD Game Programming by Ron Penton http://www.amazon.com/exec/obidos/tg/detail/-

Re: [Tutor] File mode r+

2005-09-27 Thread Shitiz Bansal
--- "Michael P. Reilly" <[EMAIL PROTECTED]> wrote: > On 9/24/05, Shitiz Bansal <[EMAIL PROTECTED]> wrote: > > > > Hi, > > > > How do i proceed if i am not sure about the number > of characters in the > > fist two lines and want to write in the third > line.is there a way to skip

Re: [Tutor] Embedding

2005-09-27 Thread Michael Sparks
On Tuesday 27 September 2005 23:16, Kent Johnson wrote: > Joseph Quigley wrote:... > > Well we are three programmers. I know python, another knows Java and the > > other C++. We are trying to figure out how to combine all three > > langauges to make a game. > > Sounds like a bit of a hash to me. Sh

Re: [Tutor] Embedding

2005-09-27 Thread Kent Johnson
Joseph Quigley wrote: >>From: Kent Johnson <[EMAIL PROTECTED]> >>Subject: Re: [Tutor] Embedding >> >>Not easily. You can embed C in Java with JNI. >> > Thanks, that just migh be perfect... or is there a program that will > embedd Java into C/C++? Yes, that is supported by Sun. I'm not sure if it

Re: [Tutor] Quick way to find the data type

2005-09-27 Thread Bernard Lebel
Fair enough Danny, I made the changes. Thanks for the input. Still, regarding this comment. On 9/27/05, Danny Yoo <[EMAIL PROTECTED]> wrote: > The assumptions you make, about controlling the input, and being the only > source of the xml output, sound fine. But you're assuming that the > env

Re: [Tutor] Quick way to find the data type

2005-09-27 Thread Danny Yoo
> >Let say I have a string. The value of the string might be 'False', > >'True', '3', '1.394', or whatever else. Is there a quick way to convert > >this string into the appropriate data type other than with try/except? > > eval()? Gaaa, don't say that word! *grin* (Sorry, I know I'm sounding l

Re: [Tutor] Quick way to find the data type

2005-09-27 Thread Danny Yoo
On Tue, 27 Sep 2005, Bernard Lebel wrote: > Well I understand all the security issues but unless I'm missing > something, I don't see anything wrong here. Hi Bernard, The other major problem with it, besides security, is that it can introduce certain error messages that will look inscrutable

Re: [Tutor] Embedding

2005-09-27 Thread Joseph Quigley
>From: Kent Johnson <[EMAIL PROTECTED]> >Subject: Re: [Tutor] Embedding > > >Not easily. You can embed C in Java with JNI. > Thanks, that just migh be perfect... or is there a program that will embedd Java into C/C++? > You can access the result from Jython. But the original requirement seems

Re: [Tutor] Quick way to find the data type

2005-09-27 Thread bob
At 12:08 PM 9/27/2005, Bernard Lebel wrote: >Hello, > >Let say I have a string. The value of the string might be 'False', >'True', '3', '1.394', or whatever else. Is there a quick way to >convert this string into the appropriate data type other than with >try/except? eval()?

Re: [Tutor] Tutor Digest, Vol 19, Issue 82

2005-09-27 Thread Andrei
sanjay sinha wrote: > I am sanju sinha just started python from the last one month . I have > gone through all basic programming of with python and also use Tkinter > for window . I want to know from you all experience person in python > that weather i move to wx or tkinter is sufficient for GUI

Re: [Tutor] HTTP GET Request

2005-09-27 Thread Kent Johnson
Jerl Simpson wrote: > The only piece I don't have going the Python route is actually > getting the GET Which pieces do you have so far? If it is just Python, then you don't have all the pieces yet. If you already have a server, which one are you using? > Sorry, accidentally sent the last

Re: [Tutor] Quick way to find the data type

2005-09-27 Thread Bernard Lebel
Well I understand all the security issues but unless I'm missing something, I don't see anything wrong here. This is in order to read some XML data and transfer its content to the parameters of a 3D animation software. Since I wrote the XML writer, I always know how the XML will be formatted. Also

Re: [Tutor] Quick way to find the data type

2005-09-27 Thread Bernard Lebel
Thanks a lot Chris. Bernard On 9/27/05, Christopher Arndt <[EMAIL PROTECTED]> wrote: > Bernard Lebel schrieb: > > Hello, > > > > Let say I have a string. The value of the string might be 'False', > > 'True', '3', '1.394', or whatever else. Is there a quick way to > > convert this string into t

Re: [Tutor] Quick way to find the data type

2005-09-27 Thread Danny Yoo
> A quick way, yes. But also secure? No. > > >>> l = ['false', 'True', '3', '1.394'] > >>> l = [eval(x) for x in l] > >>> print l > [False, True, 3, 1.3939] > > but this fails when it encounters a string that eval can't handle, for > example 'false'. Also eval will evaluate any valid

Re: [Tutor] Linking with C programs

2005-09-27 Thread Michael Sparks
On Tuesday 27 September 2005 14:49, Matt Williams wrote: > Could someone explain how, in very general terms, one would use python > to wrap some C libraries/ API. > > I ask because there are a few bits of C software that look quite > interesting, and I know that Python can be used to wrap the C - b

Re: [Tutor] Quick way to find the data type

2005-09-27 Thread Christopher Arndt
Bernard Lebel schrieb: > Hello, > > Let say I have a string. The value of the string might be 'False', > 'True', '3', '1.394', or whatever else. Is there a quick way to > convert this string into the appropriate data type other than with > try/except? A quick way, yes. But also secure? No. >>> l

Re: [Tutor] HTTP GET Request

2005-09-27 Thread Mike Hansen
> Subject: > Re: [Tutor] HTTP GET Request > From: > paul brian <[EMAIL PROTECTED]> > Date: > Tue, 27 Sep 2005 17:04:46 +0100 > To: > Jerl Simpson <[EMAIL PROTECTED]> > > To: > Jerl Simpson <[EMAIL PROTECTED]> > CC: > tutor@python.org > > >>Basicall, what I need is a stand alone CGI. Instead of

Re: [Tutor] Quick way to find the data type

2005-09-27 Thread Kent Johnson
Bernard Lebel wrote: > Hello, > > Let say I have a string. The value of the string might be 'False', > 'True', '3', '1.394', or whatever else. Is there a quick way to > convert this string into the appropriate data type other than with > try/except? There is a nice solution here: http://groups.go

Re: [Tutor] HTTP GET Request

2005-09-27 Thread Jerl Simpson
Sorry, accidentally sent the last one before I was finished. I was saying, I just lack getting the GET URI into a variable, and then finding out the best way to parse it into it's components using Python. Thanks again, JerlOn 9/27/05, Jerl Simpson <[EMAIL PROTECTED]> wrote: I don't think I explai

Re: [Tutor] HTTP GET Request

2005-09-27 Thread Jerl Simpson
I don't think I explained my situation clearly enough. Let me tell you what I'm doing. First, I'm looking for an excuse to learn Python. Second, I'm running a server that takes request from a remote server.  This request is an HTTP GET request.  I used to have (lost the source) a C program I wrot

[Tutor] Quick way to find the data type

2005-09-27 Thread Bernard Lebel
Hello, Let say I have a string. The value of the string might be 'False', 'True', '3', '1.394', or whatever else. Is there a quick way to convert this string into the appropriate data type other than with try/except? Thanks Bernard ___ Tutor maillist

Re: [Tutor] find data in html file

2005-09-27 Thread Kent Johnson
lmac wrote: > Hi there, > i have a base-question. If i want to read some kind of data out of a line > which i know the start-tag and the end-tag in an html-file how do i > recognize > if it's more than one line ? > > Example: > > Some textlinktext . DATA etc. > > I would use >text as t

Re: [Tutor] find data in html file

2005-09-27 Thread Don Arnold
--- lmac <[EMAIL PROTECTED]> wrote: > Hi there, > i have a base-question. If i want to read some kind > of data out of a line > which i know the start-tag and the end-tag in an > html-file how do i > recognize > if it's more than one line ? > > Example: > > Some textlinktext . DATA > e

Re: [Tutor] Embedding

2005-09-27 Thread Kent Johnson
Joseph Quigley wrote: > hi, > I'm working on a game with other friends who don't use python. However > they'd like to use Java Python and C/C++. I was wondering if I could > embedd C in a Python program in Jython and lastly in java (or the other > way arround). My goal is: Can these for language

[Tutor] Embedding

2005-09-27 Thread Joseph Quigley
hi, I'm working on a game with other friends who don't use python. However they'd like to use Java Python and C/C++. I was wondering if I could embedd C in a Python program in Jython and lastly in java (or the other way arround). My goal is: Can these for languages be used to make one program?

Re: [Tutor] HTTP GET Request

2005-09-27 Thread Kent Johnson
Jerl Simpson wrote: > Hello, > > I have been looking through some of the HTTP projects and haven't quite > found what I'm looking for. > Basicall, what I need is a stand alone CGI. Instead of the program > passing the data off to a CGI, I want it to parse and handle the request > directly. >

Re: [Tutor] HTTP GET Request

2005-09-27 Thread paul brian
> Basicall, what I need is a stand alone CGI. Instead of the program passing > the data off to a CGI, I want it to parse and handle the request directly. instead of which program ? Http requests are served by a web server (ie Apache), which depending on the type of request passes the request to

Re: [Tutor] Linking with C programs

2005-09-27 Thread Kent Johnson
Matt Williams wrote: > Dear List, > > Could someone explain how, in very general terms, one would use python > to wrap some C libraries/ API. The "Extending and Embedding" document is the official doc: http://docs.python.org/ext/ext.html In addition to SWIG I have heard good things about SIP: h

Re: [Tutor] Linking with C programs

2005-09-27 Thread Gabriel Farrell
You can read some of what Guido has to say about Python and C at http://python.org/doc/essays/omg-darpa-mcc-position.html and see SWIG documentation (a few pertain to Python) at http://www.swig.org/doc.html gsf On Tue, Sep 27, 2005 at 08:41:31AM -0600, Eric Walker wrote: > There is a program cal

[Tutor] HTTP GET Request

2005-09-27 Thread Jerl Simpson
Hello, I have been looking through some of the HTTP projects and haven't quite found what I'm looking for. Basicall, what I need is a stand alone CGI.  Instead of the program passing the data off to a CGI, I want it to parse and handle the request directly. The part I'm having trouble with is act

Re: [Tutor] ICMP checksum

2005-09-27 Thread the taloner
Thanks Kent, It worked for the checksum. Only thing that i am still confused with is the part where sequence numbers are concerned. In the tcpdump o/p I still see seq as 0 over multiple packets. RegardsOn 9/27/05, Kent Johnson <[EMAIL PROTECTED]> wrote: the taloner wrote:> Hi list,>> I was just

[Tutor] find data in html file

2005-09-27 Thread lmac
Hi there, i have a base-question. If i want to read some kind of data out of a line which i know the start-tag and the end-tag in an html-file how do i recognize if it's more than one line ? Example: Some textlinktext . DATA etc. I would use >text as the starting tag to localize the be

Re: [Tutor] Linking with C programs

2005-09-27 Thread Eric Walker
There is a program called swig. this generates python interfaces to external C/C++ libraries. I never used it as I am a very new python programmer but I took the Mark Lutz class and he pushes it. Python Newbie On Tuesday 27 September 2005 07:49 am, Matt Williams wrote: > Dear List, > > Cou

Re: [Tutor] ICMP checksum

2005-09-27 Thread Kent Johnson
the taloner wrote: > Hi list, > > I was just playing around with one of the examples given in Python > cook-book. This examples show you how to send data using ICMP packets. > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/439224 > > While running the script I encountered a problem whi

[Tutor] ICMP checksum

2005-09-27 Thread the taloner
Hi list,I was just playing  around with one of the examples given in Python cook-book. This examples show you how to send data using ICMP packets. http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/439224While running the script I encountered a problem which was with the statement icmp.set_i

[Tutor] Linking with C programs

2005-09-27 Thread Matt Williams
Dear List, Could someone explain how, in very general terms, one would use python to wrap some C libraries/ API. I ask because there are a few bits of C software that look quite interesting, and I know that Python can be used to wrap the C - but how does it work? Thanks, Matt

Re: [Tutor] encode question!

2005-09-27 Thread 铁石
tutor-request Thanks Ziyad.You answer is exactly the realson it is! I am missdirect by the coding of the html. the %25 in the url is the '%' char in file name. after urllib.unquote('xvg_h%25202.jpg') 'xvg_h%202.jpg' That's the real filename I want! thanks too, Danny Yoo! >This has n

Re: [Tutor] Simulating case statement

2005-09-27 Thread Jan Eden
Kent Johnson wrote on 27.09.2005: >Jan Eden wrote: >>The problem is that the __init__ methods of the respective classes >>take a different number of parameters - this is why I pass the >>whole safe_parameters dictionary. > >I think if you pass the dictionary as keyword arguments rather than >as a

Re: [Tutor] Simulating case statement

2005-09-27 Thread Kent Johnson
Jan Eden wrote: > Hi, > > I used to use an extended if...elif sequence to instantiate an object and > call this object's display method afterwards: > > if safe['type'] == pages: > page = Show.Page(id=safe['id'], start=safe['start'] ...), > elif safe['type'] == pages: > author = Show.

Re: [Tutor] Challenge [was Re: Why won't it enter the quiz?]

2005-09-27 Thread Adam
There's one more problem as well Nathan. Most if not all of the programs you have made have been made by other people as well albeit implemented slightly differently and you could probably get a replacement for any of your programs for free on sourceforge. If you want to make any serious money you'

Re: [Tutor] Challenge [was Re: Why won't it enter the quiz?]

2005-09-27 Thread Adam
Well Nathan you said you wanted an honest opinion so here goes. All the program seems to do is create a clear text file that is world readable. I personally wouldn't even use it if it was free because it would be a lot easier to use a text editor. Now for improvements that would make it a worthwhil

Re: [Tutor] 2 questions......novice but not beginner

2005-09-27 Thread R. Alan Monroe
> I need to know how to render graphics without the windowed enviroment.I > know with pygame you can have a windowless enviroment but I need to be able > to have only the graphics i choose displayed on the screen without pygame > filling the rest of the screen with black if thats possible. No

Re: [Tutor] 2 questions......novice but not beginner

2005-09-27 Thread Liam Clarke
> I need to know how to render graphics without the windowed enviroment.I > know with pygame you can have a windowless enviroment but I need to be able > to have only the graphics i choose displayed on the screen without pygame > filling the rest of the screen with black if thats possible. I b

[Tutor] Simulating case statement

2005-09-27 Thread Jan Eden
Hi, I used to use an extended if...elif sequence to instantiate an object and call this object's display method afterwards: if safe['type'] == pages: page = Show.Page(id=safe['id'], start=safe['start'] ...), elif safe['type'] == pages: author = Show.Author(id=safe['id']...) ... pag

Re: [Tutor] 2 questions......novice but not beginner

2005-09-27 Thread Danny Yoo
On Mon, 26 Sep 2005, Mike Pippin wrote: > I need to know how to allow the user to search their local drives and > directories in order to load a file...or if there are any pre-written > opensource functions that will also be well appreciated.. Second Hi Mike, This is not completely obvious

Re: [Tutor] encode question!

2005-09-27 Thread ZIYAD A. M. AL-BATLY
On Tue, 2005-09-27 at 14:01 +0800, 铁石 wrote: > I am trying to write a stript that extract jpg files > from a html I had downloaded.I encounter a problem with > a Big5 charset html file.Big5 used in Hongkong ans Taiwan. > In this html file there's a jpg names "xvg_h%202.jpg" > in vi ,the