Re: [Tutor] what %s=%s means?

2006-07-05 Thread w chun
On 7/5/06, Ismael Garrido <[EMAIL PROTECTED]> wrote: 韩宪平 wrote: > > Returns string.""" > return ";".join(["%s=%s" % (k, v) for k, v in params.items()]) > > Whant ";"means > %s=%s? > join? > help(items) no matched. > Where can i find stuff helpful? "%s" % (param) is called strin

[Tutor] ANN: (Intensive) Intro to Python course, Aug 16-18, San Francisco

2006-07-05 Thread w chun
Greetings! Below is the announcement we've just made this morning to CLP about our upcoming Python course. Please forward this msg to anyone whom you think would be interested or would benefit from Python training courses. This includes Plone, Zope, Django, TurboGears, and Mailman groups as well

Re: [Tutor] Not Really Questions

2006-06-04 Thread w chun
hi john, everyone else has posted great replies to your inquiries, so i'll keep mine brief. > While the list is kind of slow I thought I'd post a few thoughts on a couple > of things in Python that bug me. my 1st comment is that you are not talking about Python alone. everything you state pertai

Re: [Tutor] Enumeration and constant

2006-05-29 Thread w chun
> > how about custom constant type? > > Does python provide? > No. Python tries to be as "light" as possible. There is a convention > amongst Python programmers to use upper case names to represent > constants, e.g. RED = 3. another aspect of Python numbers that make them "constant" is that all nu

Re: [Tutor] Download file from the web and store it locally.

2006-05-26 Thread w chun
> You need to step back a bit and get a better understanding of > variables > and functions and how to use them. You are trying to run before you > can walk. >: > You need to sit down and work through which variables you need > and which functions of urllib you need. > > I suspect you only need

Re: [Tutor] about calling external program in Python

2006-05-17 Thread w chun
> I'm trying to call an executable program in Python. I did the following, but > it doesn't work. Any help is appreciated. > > os.system('C:\Program Files\EPANET2\epanet2d.exe > C:\simulation test\Network3_1.inp C:\simulationtest\Network3_1.out') try putting an "r" in front of the string, i.e. o

Re: [Tutor] Nested list comprehensions

2006-05-14 Thread w chun
i agree with everyone above, kent, alan, roel... in fact, i have do a doubletake everytime i write code like this and have to look things up and/or play with some sample code as you all have done, just to make sure i got it working. (kinda reminds of going back to look at a perl script i wrote...

Re: [Tutor] How do I create the equivalent of a Java class in Python?

2006-05-13 Thread w chun
> How do I create the equivalent of a Java class in Python? I've been looking > at the reference, and it's been confusing to me at least. can you clarify what you are looking for? do you want to create a class using Python, create the equivalent of a Java class using Python via Jython, accessing

Re: [Tutor] Runing a Python program

2006-05-13 Thread w chun
> On my computer (Win2K) Python puts the current working directory in > sys.path. (I'm not sure this happens on Linux.) yes it does, on any unix-flavored system (Linux, FreeBSD, MacOS X, Solaris, etc.). since we're on the topic, there is another attribute in the sys module, sys.modules that shows

Re: [Tutor] For loop question

2006-05-10 Thread w chun
> Thanks all, appears it is the newline character which was causing me > grief. For some reason I still have to do a readlines on the open file > at this stage, but I can muck about with that to figure it out. that is surprising... i would be interested in hearing what problems you are encounter

Re: [Tutor] For loop question

2006-05-10 Thread w chun
> >> For short Python scripts I usually allow the runtime to close the file. > >> For longer programs and anything written in Jython (which has different > >> garbage collection behaviour) I usually use an explicit close(). > > > > i'm still not comfortable without doing my own explicit close(), es

Re: [Tutor] For loop question

2006-05-10 Thread w chun
>> HostFile = open("hosts.txt", 'r') >> for item in [x.strip() for x in HostFile]: >> : >> >>Why is this better when the file is large? It still creates a list with all lines in it. yup, that's why i mention this fact below while giving the genex solution. > > Why not simply: > > > > for

Re: [Tutor] For loop question

2006-05-10 Thread w chun
> Been trying to understand why the following doesn't work: > > HostFile = open("hosts.txt", 'r') > host = HostFile.readlines() > > for item in host: > print "Connecting to device",item > tn = telnetlib.Telnet(item) >: > File "c:\gideon\python24\lib\telnetlib.py", line 225, in ope

Re: [Tutor] Books

2006-05-03 Thread w chun
> > "Beginning Python: From Novice to Professional", by > > Magnus Lie Hetland > > There's also, on-line, Dive Into Python by Mark Pilgrim, often > recommended as a good intro book both of these are very good books, but the target audience is slightly different, as is for "Core Python" -- 2nd ed

[Tutor] ANN: 2006 Python training May/Aug/Nov, San Francisco

2006-05-03 Thread w chun
*** 50% DISCOUNT to STUDENTS/TEACHERS *** Dear fellow list members, Below is the announcement we've just made this morning about our upcoming advanced Python course, May 17-19, 2006. This advanced course will be offered again in Nov 2006. In Aug 2006, we will have another intensive introduction

Re: [Tutor] A Python idiom that I don't get

2006-04-25 Thread w chun
> > prefix = os.path.commonprefix(filter( bool, lines )) that is an interesting and yes, not very optimal way of saving the set of non-blank lines. the commonprefix() function takes a list of pathnames and returns the longest prefix that all strings have in common, presumably for disk filena

Re: [Tutor] [Linux] open a file in any home "~" ?

2006-04-19 Thread w chun
we are all happy to help. it is really good that you were able to get it working so fast! also, if you want to do any kind of pattern matching with * or ?, then check out the "glob" module. merci! "le livre" does not look that good from here... it is a mess and i have to clean it up before givi

Re: [Tutor] [Linux] open a file in any home "~" ?

2006-04-19 Thread w chun
> f=open("~/.myapp.conf","r") # but it returns a IOError: [Errno 2] No such > file or directory: > > How can I do to access this file whatever the user is ? use os.path.expanduser(path) http://www.python.org/doc/2.4.3/lib/module-os.path.html hope this helps! -- wesley - - - - - - - - - - - -

Re: [Tutor] Python video?

2006-04-13 Thread w chun
> > > I read this week on this forum about a kind of Python video in its > > > website. Which view is that, and where could I find it? > > > > It's a video with gushing praise over Python, made in the style of a Monty > > Python skit. > > On a similar line, I've recently discovered "podcasts". >

Re: [Tutor] Problems when displaying numbers

2006-04-12 Thread w chun
hi patricia, it would be really helpful to see an example of 'result' before and after the call to calc_numbers() as well as the code for calc_numbers if possible. this will likely reveal the problem that you are having. thanks, -wesley On 4/12/06, Patricia <[EMAIL PROTECTED]> wrote: > Hi, > >

Re: [Tutor] Protected methods/variables

2006-04-05 Thread w chun
On 4/4/06, Kent Johnson <[EMAIL PROTECTED]> wrote: > Mike Hansen wrote: > >>> - you can use __slots__ to restrict arbirtrary creation of > >> (dynamic) > >>> instrance attributes > >> You can do this, but it is generally considered a misuse of > >> __slots__ and potentially problematic. what speci

Re: [Tutor] Protected methods/variables

2006-04-04 Thread w chun
> I have missed protected method/variables in Python. How do you declare > methods/variables used only by a class and their derived classes? hi Ktalà, welcome to Python! you missed "protection" in OOP with Python bceause there are no such declarations in Python! 1) there is a privacy *hint*, wh

Re: [Tutor] Python + PostGreSQL

2006-03-31 Thread w chun
hi srini, i don't know what your system configuration was like for the installation, but from what i saw in your post (below), it just seems like /usr/local/pgsql/bin was not in your path since it looks like "sh" could not find the pg_config command, not Python (which choked afterwards). anyway,

Re: [Tutor] Python + PostGreSQL

2006-03-31 Thread w chun
> >I tried to install pygresql: version: 3.8, it failed > >throwing exception : Exception: pg_config tool is not > >available. > > > >I gave another try on google and Postgres site and > >found Pypgsql, PoPy and psycopg1. > > I think that psycopg is generally considered the preferred > package. a

Re: [Tutor] removing file from zip archive.

2006-03-31 Thread w chun
> How can we remove one file inside of a zip archive? > > import zipfile > ziparchive = zipfile.ZipFile('test.odt', 'r') > xmldata = ziparchive.read('content.xml') > ziparchive.close <--- ADD "( )" HERE TOO Sophon, You can remove any number of files from a ZIP fil

Re: [Tutor] Apple Remote "Mouse"

2006-03-31 Thread w chun
> ... this seems to me to be the kind of query where > you could legitimately post to the main Python > newsgroup / mailing list and/or to some Mac-specific > one, if there is such a thing. ... and there is: http://mail.python.org/mailman/listinfo/pythonmac-sig cheers, -- wesley - - - - - - - -

Re: [Tutor] Python app and UNIX commands

2006-03-31 Thread w chun
> I would like to write an app for Linux/Unix > that fetches a gzipped or bzipped file from a remote server by http or ftp. > The file will be downloaded to a temporary directory, unzipped and its > contents copied to specific directory. If the process has gone well, the > files in the temporary di

[Tutor] ANN: 2006 Python training courses, San Francisco

2006-03-18 Thread w chun
*** 50% DISCOUNT for STUDENTS / TEACHERS *** For those of you who already know Python or other languages but are learning Python, WE are giving 4 more Python training courses (held near the San Francisco airport) for the remainder of this year. Please forward this message to anyone else you know

Re: [Tutor] execute an OS command, get the output

2006-03-12 Thread w chun
be the cause - ypou aren't acting like the shell does. > > But aws I say thats just a guess based on a quick scim of your port. > > Alan G. > > - Original Message - > From: "w chun" <[EMAIL PROTECTED]> > To: > Sent: Sunday, March 12, 2006 3:37 A

Re: [Tutor] execute an OS command, get the output

2006-03-11 Thread w chun
ok, while we're on the subject, i thought i should ask a question for once(!). it's been awhile since i played with pipes, and i ran into this problem on the same day as this post! if i'm in the shell and playing with a 2-way game with the 'tr' command like so: $ tr '[a-z]' '[A-Z]' us US ca CA d

Re: [Tutor] Tutorial for creating web server

2006-03-04 Thread w chun
> i wanted to create my own web server, can any body suggest any tutorial, > by the way i have gone through book Core Python Programing, in this book > one example is given but it is to abstract, that i am unable to understand rakesh, 1) based on this thread and responses from various folks,

Re: [Tutor] Python & XEmacs

2006-02-21 Thread w chun
> Could anyone, please, suggest a "tutorial" about > Python Mode for XEmacs? I would like to use XEmacs, > but unfortunately, I didn't find any good > documentation about using it for programming in Python i don't know if there really is a 'tutorial'. i assume you've already found these websites

Re: [Tutor] Generating small random integer

2006-02-21 Thread w chun
> You need to tell python that randint is in the random module. > ie, instead of calling randint(), call random.randint(). now this reminds me of something... and i think i need the help of the tutors here! :-) a long time ago, i recall that randint() was deprecated in favor of randrange(). th

Re: [Tutor] 'in-place' methods

2006-02-18 Thread w chun
> Perhaps you've seen this already, but since you are wrapping the print > in a function, I suspect you want the original list to be unmodified. > Thus, compare: > > >>> def sort_print1(a_list): > a_list.sort() > print a_list > > > >>> def sort_print2(a_list): > t = list(a

Re: [Tutor] MySQLdb: at a complete loss

2006-02-18 Thread w chun
On 2/18/06, Servando Garcia <[EMAIL PROTECTED]> wrote: > Hello List > I am at a complete loss. Here is a recap, just to be clear, I have > been unable insert into a database using MySQLdb. I can only view the > database. servando, sorry to hear about these problems. it seems highly unlikely

Re: [Tutor] 'in-place' methods

2006-02-17 Thread w chun
hi mike, welcome to python. :-) your query is quite common amongst beginners, and i have actually spend some time on this topic in my courses. On 2/17/06, Michael Broe <[EMAIL PROTECTED]> wrote: > I think I understand this sorting-a-list 'in place' stuff, and things > of that kind (reversing fo

Re: [Tutor] Why doesn't this work?

2006-01-24 Thread w chun
on a barely related note, sets (mutable [set] and immutable [frozenset]) were added to Python beginning in version 2.3... so don't work too hard on your class! you may want to try something more interesting like: write a class which let's you keep track of time and does base 60 (sexagesimal / he

Re: [Tutor] Internet programming with python

2006-01-18 Thread w chun
On 1/18/06, Johan Geldenhuys <[EMAIL PROTECTED]> wrote: > > Has the book 'Internet programming with Python' (ISBN: 1558514848, > publisher: M&T Books, 1996) ever been revised or is there a secod editin > available? > I don't have it, but I would like this or something simular very much. > > Any ide

Re: [Tutor] tutorials

2006-01-17 Thread w chun
On 1/16/06, Alan Gauld <[EMAIL PROTECTED]> wrote: > > Has anyone got an easy way of printing the Python documentation in PDF > > format. Its all in HTML and is time consuming to print. > > You can buy it in paper book form. > It's a lot cheaper than trying to print the online stuff page by page! >

Re: [Tutor] pointers

2006-01-11 Thread w chun
On 1/11/06, Kent Johnson <[EMAIL PROTECTED]> wrote: > Burge Kurt wrote: > > > > void get_args(int argc, char* argv[], Argument* args) > > > > My first question about the pointers here; how can I convert them to > > Python? > > Python doesn't have pointers in the sense of direct references to > memo

[Tutor] identifier token parsing [was Re: (no subject)]

2005-12-29 Thread w chun
> hello everyone. i was looking at python docs and i came across this > > letter ::= > lowercase | uppercase > > what does ::= mean? you must be referring to identifiers and keywords page at http://docs.python.org/ref/identifiers.html take it as meaning, "may expand to." in other w

Re: [Tutor] Learning books

2005-12-23 Thread w chun
On 12/20/05, Richard <[EMAIL PROTECTED]> wrote: > Afternoon all, My son asked me what books I would like for Christmas > this year. So what would you recommend? > > I am a beginner here. hi richard, welcome to the list. are you a beginner to Python (but have programming experience), a beginner

Re: [Tutor] whats the best command to end a program

2005-12-07 Thread w chun
> what would be the best command to end a program with. > i have an app that i want to start every day at 6am from cron > but i want it to shutdown at 4pm > > i was going to check by time on every loop > > if int(time.strftime(%H)) > 4: > some

Re: [Tutor] My First Program

2005-12-07 Thread w chun
looks good for your 1st program. some improvements that i can think of: 1. notice how you repeat blocks of code? specifically, i mean: (ask a question, get the answer, validate the answer). since this is all similar code, it's a great place for you to learn what a loop is. that way, you only h

Re: [Tutor] Escaping double quotes

2005-12-07 Thread w chun
> > >>> label = 'this is "quoted"' > > >>> label.replace('"','\"') > > 'this is "quoted"' > > ## This works > > >>> label.replace('"','\'') > > "this is 'quoted'" > > > What I should have been using is label.replace('"','\\"') > :-) Nevermind. hold on a second pardner! :-) what were you t

Re: [Tutor] smtplib mail header problem

2005-12-07 Thread w chun
> It has been great for 11ish months, now all my mail is classed as > spam & junked :( dave, i'm a little surprised by this. if your code has been working for almost a year and suddently breaks, that can only be explained by 1 or 2 things: 1. your code was modified 2. the server was modified (

Re: [Tutor] Python Script Problem. Simple sql problem & py problems.

2005-12-06 Thread w chun
> I wrote my first script (ever) in Python. > : > The second one is more python specific I guess. The programs prints > the "Exiting" string on exit one time for every action I do. Which > means that if I add 4 users, I'll see 4 time exiting printed. If I add > 2 users and delete 1 us

Re: [Tutor] How to Pass lists by value

2005-12-06 Thread w chun
On 12/6/05, Alan Gauld <[EMAIL PROTECTED]> wrote: > Lots of good stuff from Wes snipped... > > (a side note here: that only mutable objects have methods.) > > But this is not quite true. Strings are immutable and have lots > of methods and even tuples and plain integers have methods oh POO. i *

Re: [Tutor] How to Pass lists by value

2005-12-06 Thread w chun
On 12/5/05, Kent Johnson <[EMAIL PROTECTED]> wrote: > > You have to change how you think about variables. In Python, a variable > is not a storage location into which values are put, it is a reference > to an object - a name given to an object. Assignment binds a name to a > value. > > When you cal

Re: [Tutor] displaying properties/methods

2005-11-18 Thread w chun
> dir(sys) > help(sys) to further elaborate, dir() will tell you what it has, and help() will dump pretty-printed doc strings for you. good luck! -- wesley - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - "Core Python Programming", Prentice Hall, (c)2006,2001 http://corepython.com

Re: [Tutor] Global var problem

2005-10-28 Thread w chun
> if __name__ == '__main__': > global x > x = 1 > t = T() > t.p() as alan mentioned, it's all about namespaces. the "global x" you have in the above piece of code doesn't do anything (because you're already or still in the global [name]space). you're getting the

Re: [Tutor] Question about an re

2005-10-28 Thread w chun
> - ->: \d+/?\d* > - -> > - ->ie 1 or more digits followed by 0 or 1 slashes followed by 0 or more > digits. this looks like it'll also accept invalid data, such as "1/" ... i think there's some more tweaking involved to get it so that if there's a '/', there is at least one digit afterwards. -

Re: [Tutor] question about try & except

2005-10-27 Thread w chun
On 10/26/05, nephish <[EMAIL PROTECTED]> wrote: > Yeah, cool. i am just starting this part. > i am glad i started with python. > thanks for the help if your app is willing to tolerate errors/crashes, then i would take alan's advice and just letting the errors happen, as opposed to being so carefu

Re: [Tutor] General programming questions

2005-10-27 Thread w chun
On 10/27/05, Matt Williams <[EMAIL PROTECTED]> wrote: > At the moment, I have something like: > > def __init__ (self, a, b, c): > if type(a) == type("a") > then. > elif type(a) == type(["a"]) > then > > I'm sure there must be a better way to do this

Re: [Tutor] Module Thread

2005-10-27 Thread w chun
On 10/26/05, Joseph Quigley <[EMAIL PROTECTED]> wrote: > I'm back to my IRC client. I accidentally found the thread module... > What will i do to receive and send at the same time via console? > > or: > Should I forget the idea of a console and start learning GUI which > will > do

Re: [Tutor] question about try & except

2005-10-26 Thread w chun
> i am writing some (for me) pretty complicated stuff for work that > really needs to work. > i have looked at exception handling... > and i am using some try / except statements. > the problem is, that even though my script does not crash, i dont know > the exact error. >

Re: [Tutor] class and methods/functions

2005-10-22 Thread w chun
On 10/22/05, Jacob S. <[EMAIL PROTECTED]> wrote: > >> def nameCheck(self, value): > >> > import re > >> > tempREG = re.match('.*:.*',value) > >> > return str(tempREG) != 'None' > > This could be written better. > > def nameCheck(self, value): > tempREG = re.match('.*:.

Re: [Tutor] Fwd: Saving command line keyed input?

2005-10-21 Thread w chun
On 10/21/05, Kent Johnson <[EMAIL PROTECTED]> wrote: > Ed Singleton wrote: > > A quick tip for the Windows command line. > > > > Ctrl-C, Ctrl-A etc don't work, neither does right-clicking > > (menu-click). However, right-clicking does work on the blue title > > bar. > > If you turn on Quick Edit (

Re: [Tutor] How do I recursively remove the contents of a directory??

2005-10-21 Thread w chun
On 10/20/05, Suri Chitti <[EMAIL PROTECTED]> wrote: > > If I have a directory /u01/qa/logs and the logs has a number of children > directories and I want to remove everything in logs and logs itself, is > there a single method or command to do that? I want to avoid recursively > removing the files

Re: [Tutor] file opening and errors.

2005-10-20 Thread w chun
On 10/20/05, Dan Klose <[EMAIL PROTECTED]> wrote: > > I usually use perl but fancy a bit of a change so have started playing > with python. congrats! :-) > using perl to open a file or directory I usually use: > open(FILE, $file) or die "Error: $!\n"; > > The $! is a perl variable that holds an

Re: [Tutor] Saving command line keyed input?

2005-10-19 Thread w chun
On 10/19/05, bob <[EMAIL PROTECTED]> wrote: > At 02:12 PM 10/19/2005, CPIM Ronin wrote: > >I know that one should use IDLE or a choosen editor for any substantial > >Python coding! However, if one happens to have written some interesting > >doodlings on the regular command line interface (under Wi

Re: [Tutor] Python books: buying advice needed

2005-10-19 Thread w chun
On 10/18/05, Kent Johnson <[EMAIL PROTECTED]> wrote: > David Stotijn wrote: > > Hi, > > > > I'm planning on buying a book to help me learn Python. Some of the books > > I'm considering are a few years old and based on an older version of > > Python (e.g. 2.3). > > Is it wise to buy a book based on

Re: [Tutor] IDLE will not appear under Win95 (Python 2.4.2) (fwd)

2005-10-17 Thread w chun
dave, you should be able to start PythonWin in one of 2 ways: 1) Start menu -> Programs -> Python 2.4 -> PythonWin or 2) C:\Python24\Lib\site-packages\pythonwin\Pythonwin.exe hope this helps! -- wesley - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - "Core Python Programming", Pre

Re: [Tutor] IDLE will not appear under Win95 (Python 2.4.2)

2005-10-17 Thread w chun
On 10/16/05, Danny Yoo <[EMAIL PROTECTED]> wrote: On Sat, 15 Oct 2005, Dave Shea wrote:> Python installed without a complaint. However, when I fire up IDLE,> there is an hour glass shown for a couple of seconds, then nothing else> happens. When I fire up Python (command line) no problem, the DOS bo

Re: [Tutor] Python 2.4.1 on Mndrk Linux 10.1 - path

2005-10-15 Thread w chun
On 10/15/05, Andy Dani <[EMAIL PROTECTED]> wrote: >When I python from /usr/loca/Python-2.4.1/bin, it does launch the interpreter but with an traceback error saying there is some conflict with "import readline" line on pythonrc.py file located somewhere in /etc/ directory. Is there any harm If I com

Re: [Tutor] output question

2005-10-14 Thread w chun
On 10/14/05, Shi Mu <[EMAIL PROTECTED]> wrote: I found the code for class "now". I got confused by two things:First, how did the former code I posted know to import tis module of "Now";Second. what does "\" mean following "self.year ,"Thanks a lot!class now:  def __str__(self):return ti

Re: [Tutor] dictionaries in classes

2005-10-14 Thread w chun
On Fri, 14 Oct 2005, Luke Jordan wrote:>  I'm trying to have functions to create, edit and store dictionaries >  within a class. i 2nd danny's motion:  make your dictionary an instance attribute (unique to that instance) rather than a class attribute (shared amongst all instances), and 2ndly, don't

Re: [Tutor] how to alter list content

2005-10-13 Thread w chun
combining the best of both worlds of nick using a faster list comp and brett using os.path.splitext():>>> files = ['DSC1.JPG', 'DSC2.JPG', 'DSC3.JPG']>>> newFiles = [os.path.splitext (f)[0] for f in files]>>> print newFiles['DSC1', 'DSC2', 'DSC3']cheers,-- wesley- - - - - -

Re: [Tutor] how to create GUI for Python progs

2005-10-13 Thread w chun
On 10/13/05, Nick Lunt <[EMAIL PROTECTED]> wrote: > I'm really confused on the issue how to create windows, forms, etc. in> Python & can't find any manual for that.> Could you possibly advise me smth useful?this has come up quite a bit recently on the list. I would recommend that you go herehttp://

Re: [Tutor] how to speed up this code?

2005-10-13 Thread w chun
On 10/12/05, Pujo Aji <[EMAIL PROTECTED]> wrote: > I have code like this: > > def f(x,y): > return math.sin(x*y) + 8 * x > > def main(): > n = 2000 > a = zeros((n,n), Float) > xcoor = arange(0,1,1/float(n)) > ycoor = arange(0,1,1/float(n)) > > for i in range(n): > fo

Re: [Tutor] Can anyone teach me...?

2005-10-12 Thread w chun
On 10/12/05, Terry Carroll <[EMAIL PROTECTED]> wrote: On Wed, 12 Oct 2005, Alan Gauld wrote:> However I have to be honest and say that building GUIs in VB ... is a> lot easier than in Python IMHO.But, man, VB as a language and library set is horrible; and pointlessly horrible, in many cases.The bes

Re: [Tutor] how to extract number of files from directory

2005-10-12 Thread w chun
On 10/12/05, Ertl, John <[EMAIL PROTECTED]> wrote: You can do most system type stuff in Python and it makes it much easier.import globjpgList = glob.glob("*.jpg") # the glob allows you to use wild cards in thesearchjpgCount = len(jpgList)This gives you a list of all files that end in .jpg.  You can

Re: [Tutor] another error in tagging program

2005-10-12 Thread w chun
On 10/12/05, enas khalil <[EMAIL PROTECTED]> wrote: > > and got the following error : > Traceback (most recent call last): > File "F:\MSC first Chapters\error correct.py", line 19, in -toplevel- > tagger.train(tagged_txt_token) > File > "C:\Python24\Lib\site-packages\nltk\tagger\__init__.py