[Tutor] encoding text in html

2006-09-13 Thread anil maran
i was trying to display some text it is in utf-8 in postgres and when it is displayed in firefox and ie, it gets displayed as some symols with 4numbers in a box or so even for ' apostrophe please tell me how to display this properly i try title.__str__ or title.__repr__ both dont work___

Re: [Tutor] Traversing Excel Columns

2006-09-13 Thread Chris Hengge
I'll give that a shot tomorrow when I work on the script some more. Thanks for the note on 'file'... none of the IDE's I've used have colored or yelled at me, so I just assumed it was free for the taking.. (used to VS where it yells at you for more then I'd care) I've just started using SPE thou

Re: [Tutor] encoding text in html

2006-09-13 Thread anil maran
submits: We\xe2\x80\x99re pretty surthis is how it is stored in postgresplease help me outthanks- Original Message From: anil maran <[EMAIL PROTECTED]>To: tutor@python.orgSent: Wednesday, September 13, 2006 12:14:10 AMSubject: encoding text in html i was trying to display some text it is in

Re: [Tutor] encoding text in html

2006-09-13 Thread anil maran
「ひぐらしのなく頃に」30秒TVCF風ver.0.1 this is how it is getting displayed in browser- Original Message From: anil maran <[EMAIL PROTECTED]>To: anil maran <[EMAIL PROTECTED]>Sent: Wednesday, September 13, 2006 2:07:55 AMSubject: Re: [Tutor] encoding text in htmlsubmits: We\xe2\x80\x99re prett

Re: [Tutor] encoding text in html

2006-09-13 Thread Kent Johnson
anil maran wrote: > > 「ひぐらしのなく頃に」30秒TVCF風ver.0.1 > > this is how it is getting displayed in browser I'm pretty sure that is not how We\xe2\x80\x99re displays; can you show an example of the same text as it is stored and as it displays? Kent > > - O

Re: [Tutor] encoding text in html

2006-09-13 Thread Kent Johnson
anil maran wrote: > > > i was trying to display some text > it is in utf-8 in postgres and when it is displayed in firefox and ie, > it gets displayed as some symols with 4numbers in a box or so > even for ' apostrophe > please tell me how to display this properly > i try > title.__str__ > > or

[Tutor] about assert

2006-09-13 Thread linda.s
Python manual has a very brief introduction of "assert" statements. It is very difficult for me to understand it. Can anyone give me an example? Thanks, Linda ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] about assert

2006-09-13 Thread Luke Paireepinart
linda.s wrote: > Python manual has a very brief introduction of "assert" statements. It > is very difficult for me to understand it. Can anyone give me an > example? > #example of assert.py def test(a): if 25 / 4 == a: return True else: return False def assert_it(a):

Re: [Tutor] about assert

2006-09-13 Thread Marc Poulin
--- "linda.s" <[EMAIL PROTECTED]> wrote: > Python manual has a very brief introduction of > "assert" statements. It > is very difficult for me to understand it. Every program has some fundamental assumptions that must remain true in order for the program to continue giving correct results. The

[Tutor] quick ?

2006-09-13 Thread dpotter
I am new to Python (and programming). In teaching myself I wrote a small program that will pick random lottery numbers, I want to check for duplicates and rerun the random function. But I am hitting a wall. This is what I think should work, but I still get duplicates. TIA. print "\n" count =

Re: [Tutor] quick ?

2006-09-13 Thread Kent Johnson
[EMAIL PROTECTED] wrote: > I am new to Python (and programming). In teaching myself I wrote a > small program that will pick random lottery numbers, I want to check for > duplicates and rerun the random function. But I am hitting a wall. > This is what I think should work, but I still get duplic

[Tutor] CGI / HTTP

2006-09-13 Thread Rob
I created a CGI form mailer script that would keep individual email addresses private.   The emailer works fine and I have created similar scripts that work.  However, I wanted to forward the info from a form without having the script return any content.  So if there are no errors, the visit

Re: [Tutor] encoding text in html

2006-09-13 Thread Danny Yoo
On Wed, 13 Sep 2006, anil maran wrote: > > i was trying to display some text it is in utf-8 in postgres and when it > is displayed in firefox and ie, it gets displayed as some symols with > 4numbers in a box or so even for ' apostrophe please tell me how to > display this properly i try title

[Tutor] Excluding branches while walking directory tree

2006-09-13 Thread William O'Higgins Witteman
Hello all, I am looking for an approach for the following problem: I have to walk a directory tree and examine files within it. I have a set of directory names and filename patterns that I must skip while doing this walk. How do I create a set of rules to skip files or directory branches? I'm

Re: [Tutor] quick ?

2006-09-13 Thread Bob Gailer
[EMAIL PROTECTED] wrote: > I am new to Python (and programming). In teaching myself I wrote a > small program that will pick random lottery numbers, I want to check for > duplicates and rerun the random function. But I am hitting a wall. > This is what I think should work, but I still get duplic

Re: [Tutor] Excluding branches while walking directory tree

2006-09-13 Thread Kent Johnson
William O'Higgins Witteman wrote: > Hello all, > > I am looking for an approach for the following problem: > > I have to walk a directory tree and examine files within it. I have a > set of directory names and filename patterns that I must skip while > doing this walk. How do I create a set of

[Tutor] Using my own installed python version in my directory tree.

2006-09-13 Thread Ziad Rahhal
Hi, I installed pythin on Linux operating system but on my own tree directory. Now I want to get rid (not deleting) the default python installation, which means I want my own python version to be recognized when I use "python" command. PYTHONPATH has nothing to do with that since it just points t

Re: [Tutor] Excluding branches while walking directory tree

2006-09-13 Thread Dave Kuhlman
On Wed, Sep 13, 2006 at 11:15:44AM -0400, William O'Higgins Witteman wrote: > Hello all, > > I am looking for an approach for the following problem: > > I have to walk a directory tree and examine files within it. I have a > set of directory names and filename patterns that I must skip while > d

Re: [Tutor] Using my own installed python version in my directory tree.

2006-09-13 Thread Dave Kuhlman
On Wed, Sep 13, 2006 at 05:39:13PM +0200, Ziad Rahhal wrote: > Hi, > > I installed pythin on Linux operating system but on my own tree directory. > Now I want to get rid (not deleting) > the default python installation, which means I want my own python version to > be recognized when I use "python

[Tutor] python for web developing

2006-09-13 Thread federico ramirez
Hello! I have heard that python is very good for web development, but you need frameworks, like django or turbogears.I know that you dont really need them, you can just write cgi scripts with python...butIm a php programmer, and i want to make another dinamic site with sql, in python, but i need sq

Re: [Tutor] CGI / HTTP

2006-09-13 Thread Kent Johnson
Rob wrote: > > I created a CGI form mailer script that would keep individual email > addresses private. > > The emailer works fine and I have created similar scripts that work. > However, I wanted to forward the info from a form without having the > script return any content. So if there ar

[Tutor] what happens when...

2006-09-13 Thread josip
Hi all! Can You explain me what happens when in this function I remove board arg: def human_move(board, human)? What is doing that argument?   Thanks!         # global constantsX = "X"O = "O"EMPTY = " "TIE = "TIE"NUM_SQUARES = 9 def display_instruct():    """Display game instructions."""

Re: [Tutor] about assert

2006-09-13 Thread alan . gauld
>>Python manual has a very brief introduction >>of "assert" statements. It is very difficult First you probably don't need to use asserts very often, they are useful if you are building production strength code but for most users of Python the exception mechanism is good enough. Basically we

[Tutor] List manipulation

2006-09-13 Thread Srinivas Iyyer
Dear group: I have a data like this: 10 15 16 20 25 35 45 50 55 60 61 65 75 80 Since 15 precedes 16, I want to consider 10:20 as one unit. If I repeat completely for data I would get: 10 20 25 35 45 50 55 65 75 80 test = ['10\t15', '1

[Tutor] GDAL- Help

2006-09-13 Thread Nagendra Singh
Hi, I am just starting to learn Python and I want to perform some GIS tasks which requires the gdal module (http://www.gdal.org/). I have installed FWTools which also comes with a built in Python interface but I also have a stand alone version of Python which I use. I am trying to use the gdal mod

Re: [Tutor] about assert

2006-09-13 Thread Marc Poulin
--- [EMAIL PROTECTED] wrote: > >>Python manual has a very brief introduction > >>of "assert" statements. It is very difficult > > First you probably don't need to use asserts > very often, they are useful if you are building > production strength code but for most users > of Python the exce

Re: [Tutor] List manipulation

2006-09-13 Thread Bob Gailer
Srinivas Iyyer wrote: > Dear group: > > I have a data like this: > 10 15 > 16 20 > 25 35 > 45 50 > 55 60 > 61 65 > 75 80 > > Since 15 precedes 16, I want to consider 10:20 as one > unit. If I repeat completely for data > > I would get: > 10 20 > 25 35 >

[Tutor] Methods and classes

2006-09-13 Thread Chris Hengge
Can anyone explain what I've been reading? I'm trying to understand why many documents show: def myMethod(vars): or class myClass(var): and others show: def myMetheod(self, vars) or class myClass(self, vars) Either way seems to work fine, so I'm not sure what it ha

Re: [Tutor] List manipulation

2006-09-13 Thread Srinivas Iyyer
Thank you Bob for your email. Sorry for the confusion. here is what I ment: test = ['10\t15', '16\t20', '25\t35', '45\t50', '55\t60', '61\t65', '75\t80'] >>> x = [] >>> y = [] >>> for m in test: ... cols = m.split('\t') ... x.append(cols[0]) ... y.append(cols[1]) ... >>> x ['10', '

Re: [Tutor] Methods and classes

2006-09-13 Thread John Fouhy
On 14/09/06, Chris Hengge <[EMAIL PROTECTED]> wrote: > Can anyone explain what I've been reading? I'm trying to understand why > many documents show: >def myMethod(vars): > or >class myClass(var): > and others show: >def myMetheod(self, vars) > or >class myClass(self

Re: [Tutor] what happens when...

2006-09-13 Thread John Fouhy
On 14/09/06, josip <[EMAIL PROTECTED]> wrote: > > Hi all! > Can You explain me what happens when in this function I remove board arg: > def human_move(board, human)? > What is doing that argument? Have you tried removing the argument and running the code? What error message do you get? What do y

Re: [Tutor] Methods and classes

2006-09-13 Thread Chris Hengge
OK, now that you asked for an example of a class using 'self', I can't find it..so either the thing I was reading was wrong... or I dreamed it up.. or it was something specific that I was looking at that decided I wasn't interested in and now I don't remember. As for a quick example of the method

Re: [Tutor] Methods and classes

2006-09-13 Thread John Fouhy
On 14/09/06, Chris Hengge <[EMAIL PROTECTED]> wrote: > The deitel book has a note on page 229: >Failure to specify an object reference (usually called self) as the > first parameter in a method definition causes fatal logic errors when > the method is invoked at runt-ime. > > Now I've got m

Re: [Tutor] Methods and classes

2006-09-13 Thread Kent Johnson
Chris Hengge wrote: > The deitel book has a note on page 229: > Failure to specify an object reference (usually called self) as the > first parameter in a method definition causes fatal logic errors when > the method is invoked at runt-ime. > > Now I've got methods all over the place among s

Re: [Tutor] Methods and classes

2006-09-13 Thread Chris Hengge
On Wed, 2006-09-13 at 18:26 -0400, Kent Johnson wrote: > Chris Hengge wrote: > > The deitel book has a note on page 229: > > Failure to specify an object reference (usually called self) as the > > first parameter in a method definition causes fatal logic errors when > > the method is invoked at

Re: [Tutor] Methods and classes

2006-09-13 Thread Kent Johnson
Chris Hengge wrote: > On Wed, 2006-09-13 at 18:26 -0400, Kent Johnson wrote: >> You have to distinguish between a method (a function that is part of a >> class definition) and a standalone function (not part of any class). >> Python allows both. Standalone functions don't have a 'self' parameter

[Tutor] Input mask for console?

2006-09-13 Thread Chris Hengge
I need either a way to mask the input from a console, or a method to not display the typed characters to the screen. Someone point me in the right direction? Thanks. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Input mask for console?

2006-09-13 Thread Kent Johnson
Chris Hengge wrote: > I need either a way to mask the input from a console, or a method to not > display the typed characters to the screen. Someone point me in the > right direction? getpass.getpass() ? Kent ___ Tutor maillist - Tutor@python.org htt

Re: [Tutor] Input mask for console?

2006-09-13 Thread Chris Hengge
nevermind.. figured it out.. Thanks. On Wed, 2006-09-13 at 19:48 -0400, Kent Johnson wrote: > Chris Hengge wrote: > > I need either a way to mask the input from a console, or a method to not > > display the typed characters to the screen. Someone point me in the > > right direction? > > getpass.g

Re: [Tutor] Input mask for console?

2006-09-13 Thread Chris Hengge
I'm assuming I can use that like usrpass = getpass.getpass(raw_input("Password: ")) On Wed, 2006-09-13 at 19:48 -0400, Kent Johnson wrote: > Chris Hengge wrote: > > I need either a way to mask the input from a console, or a method to not > > display the typed characters to the screen. Someone po

Re: [Tutor] List manipulation

2006-09-13 Thread Bob Gailer
try this: >>> test = ['10\t15', '16\t20', '25\t35', '45\t50','55\t60', '61\t65', '75\t80'] >>> t='\t'.join(test).split('\t') >>> t ['10', '15', '16', '20', '25', '35', '45', '50', '55', '60', '61', '65', '75', '80'] >>> t2=[int(i) for i in t] >>> t2 [10, 15, 16, 20, 25, 35, 45, 50, 55, 60,

Re: [Tutor] Methods and classes

2006-09-13 Thread Luke Paireepinart
[snip some] >> So just make sure I always declare self for methods (functions in >> classes)? Is this unique to python? or do some other languages already >> include self, and just hide it from the programmer? >> > > All the OO languages I know have a similar concept. Python is more > explic