Re: Teaching Python

2014-09-29 Thread Simon Ward
o Think Like a Computer Scientist - Learning with Python 3": http://openbookproject.net/thinkcs/python/english3e/ If you're after a printed book, the original (I believe) author's current version is here: http://www.greenteapress.com/thinkpython/thinkpython.html Simon -- https://mail.python.org/mailman/listinfo/python-list

How donwnload youtube videos?

2014-10-04 Thread Dymond Simon
Hi guys .. Uhm, ı have to download youtube videos ı was tried urlretrive but doesn't work ı have no idea that's why.So there is my question, "we cant donwload youtube videos directly ? ". -- https://mail.python.org/mailman/listinfo/python-list

Re: [OT] spelling colour / color was Re: Toggle

2014-10-11 Thread Simon Ward
tionaries online is not just British English, it derives common usage from a corpus of English used around the world: http://www.oxforddictionaries.com/words/what-are-the-main-differences-between-the-oed-and-odo http://www.oxforddictionaries.com/words/the-oxford-english-corpus Simon -- https://mail.python.org/mailman/listinfo/python-list

Re: Creating a counter

2014-10-16 Thread Simon Kennedy
On Wednesday, 15 October 2014 19:39:43 UTC+1, Shiva wrote: > I am trying to search a string through files in a directory - however while > Python script works on it and writes a log - I want to present the user with > count of number of strings found. So it should increment for each string > foun

Re: Is there an easy way to control indents in Python

2014-10-16 Thread Simon Kennedy
On Wednesday, 15 October 2014 20:31:15 UTC+1, Ian wrote: > I agree. I very rarely use blank lines inside functions. As I see it, > if you feel you need a blank line for separation within a function, > that's an indication your function is overly complex and should be > broken up. Whereas I feel t

Re: Creating a counter

2014-10-16 Thread Simon Kennedy
On Thursday, 16 October 2014 15:05:47 UTC+1, Ian wrote: > I would have suggested a Counter if I thought it fit the OP's use > case. If you're listing directory contents, you're not going to have > any repeated strings, so all the counts will be 1, and your Counter > might as well be a list, which

Re: Is there an easy way to control indents in Python

2014-10-20 Thread Simon Kennedy
On Saturday, 18 October 2014 11:53:16 UTC+1, Steven D'Aprano wrote: > I'm curious what aspect of idiomatic Perl code you are referring to. When > people talk about Perl code dismissively, I normally think of three things: > > - excessively long one-liners; > - excessive use of symbols and sigils

Re: Is there an easy way to control indents in Python

2014-10-21 Thread Simon Kennedy
On Monday, 20 October 2014 18:56:05 UTC+1, Ian wrote: > Rather, I'm saying that where the blank line is should be the start of > a new function. There would still be a blank line, just no longer > inside the function. > > Now, maybe you think there should be more blank lines in the above, in > wh

Create an index from a webpage

2011-09-08 Thread Simon Cropper
essentially a contents page or sitemap for the site. Interestingly, despite trying quite a few keyword combinations, I was unable to find such a script. Anyone have any ideas? -- Cheers Simon Simon Cropper - Open Content Creator / Website Administrator Free and Open Source Software

Re: Create an index from a webpage [RANT, DNFTT]

2011-09-08 Thread Simon Cropper
he pages in that website (recursive list of internal links to HTML documents; ignore images, etc.). In subsequent notes to Thomas 'PointedEars'... I pointed to an example of the desired output here http://lxml.de/sitemap.html -- Cheers Simon Simon Cropper - Open Content Creator / We

Re: Create an index from a webpage [RANT, DNFTT]

2011-09-08 Thread Simon Cropper
On 09/09/11 10:32, Rhodri James wrote: On Fri, 09 Sep 2011 00:40:42 +0100, Simon Cropper Ahem. You should expect a certain amount of ribbing after admitting that your Google-fu is weak. So is mine, but hey. I did not admit anything. I consider my ability to find this quite good actually

Re: Create an index from a webpage [RANT, DNFTT]

2011-09-08 Thread Simon Cropper
d when the python script is run. I am now considering how I might address this requirement. If I create a python script I will post it on PyPI. As with all my work it will be released under the GPLv3 licence. Thanks for your help. -- Cheers Simon Simon Cropper - Open Content Creator /

Re: Create an index from a webpage [RANT, DNFTT]

2011-09-08 Thread Simon Cropper
On 09/09/11 12:59, Chris Angelico wrote: On Fri, Sep 9, 2011 at 12:43 PM, Simon Cropper wrote: At present I am definitely getting the impression that my assumption that something like this' must out there', is wrong. I have found a XML-Sitemaps Generator at http://www.xml-sitemaps

Re: Data acquisition

2011-10-25 Thread Paul Simon
After receiving the data, check the received data for correct format, correct first and last characters, and if possible, check sum. I've worked through this problem with rs-485 data collection systems where there is no hand shaking and would not be surprised to expect the same even with rs-232. Paul Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: Fairly OT: Why "flufl"?

2013-02-04 Thread Simon Hayward
On Feb 4, 2013 4:27 PM, "nn" wrote: > > On Feb 4, 10:10 am, Chris Angelico wrote: > > This isn't particularly related to the post I'm quoting, it's more a > > point of curiosity. > > > > On Mon, Feb 4, 2013 at 10:53 AM, João Bernardo wrote: > > > > Re: [Python-ideas] constant/enum type in stdlib

"Laws of Form" are a notation for the SK calculus, demo in Python.

2013-03-31 Thread forman . simon
"nothing".) (())A -> i(i)(A) -> I(A) -> A I just discovered this (that the Laws of Form have a direct mapping to the combinator calculus[5] by means of λc.cSK) and I haven't found anyone else mentioning yet (although [6] might, I haven't worked my way all

Re: Making ETL from Access 97 to Access 2003

2013-04-15 Thread Paul Simon
browne.com/ser-48.html ? If there are indices and especially linked primary and foreign keys its much more complicated than that. One has to delve into Access container structures etc. As far as I know it has to be done from Access. Paul Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: Making ETL from Access 97 to Access 2003

2013-04-15 Thread Paul Simon
"rusi" wrote in message news:92551c63-1347-4f1a-9dca-d1bbd5e4d...@ys5g2000pbc.googlegroups.com... Its hard to distinguish what you are saying from what I said because you've lost the quotes. On Apr 15, 9:01 pm, "Paul Simon" wrote: > "rusi" wrote in me

Re: Self-awareness of imported modules? Do they know where they live?

2005-12-15 Thread Simon Brunning
The only self aware Python scripts that I'm aware are the timbot and the effbot. Their sources are available from the PSU website at -- http://mail.python.org/mailman/listinfo/python-list

Re: Why and how "there is only one way to do something"?

2005-12-15 Thread Simon Brunning
On 12/15/05, Steve Holden <[EMAIL PROTECTED]> wrote: > Aahz wrote: > > python -c 'import this' > > Faster: > >python -m this So, there's two ways to do it. ;-) -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -

Re: Overlapping Regular Expression Matches With findall()

2005-12-15 Thread Simon Brunning
t > duplicate matches of any of them. I know I can filter the > list containing found matches myself, but that is somewhat > expensive for a list containing thousands of matches. Probably the cheapest way of de-duping the list would be to dump it straight into a set, provided that you ar

Re: getopt and options with multiple arguments

2005-12-19 Thread Simon Brunning
an only get one argument > with each option. In the above case, there isn't even an option string > before the *, but even if there was, I don't know how to get getopt to > give me all the expanded filenames in an option. > > Help! :) You could use the glob module to expand t

Re: How to create linked list automatically

2005-12-19 Thread Simon Brunning
this argument when you build your Node objects... > am trying to connect them, but when i try to print the connection i > got this: > === > >>> > connection done > None So it's hardly surprising that printing

python coding contest

2005-12-25 Thread Simon Hengel
, suggestions and ideas. Have fun, -- Simon Hengel -- http://mail.python.org/mailman/listinfo/python-list

Re: python coding contest

2005-12-25 Thread Simon Hengel
promize between shortness and readibility > plus elegance of design"""? I would love to choose those criteria for future events. But I'm not aware of any algorithm that is capable of creating a ranking upon them. Maybe we can come up with a solution. Any ideas? Cheers, Simon. -

Re: python coding contest

2005-12-25 Thread Simon Hengel
> I would suggest that all whitespace (except within string literals) > should be ignored, as well. Good point, but i assume that is not possible with regular expressions. Cheers, Simon -- python coding contest - http://www.pycontest.net/ -- http://mail.python.org/mailman/listinfo/python-list

Re: python coding contest

2005-12-25 Thread Simon Hengel
esidents of > the Americas would have to go to bed VERY late, get up VERY early, or > spend extra effort setting up cron jobs), and that would bias everything > in a most unfair manner. Not sure what to do about it, is there something more fair than first come first serve? Cheers, Simon

Re: python coding contest

2005-12-25 Thread Simon Hengel
> What is your algorithm for determining "shortest" program? Are you > counting tokens, lines or characters? Does whitespace count? like: $wc -c seven_seg.py At the moment we have to live with characters, and yes whitespace characters do count. Sorry for that. Have fu

Re: python coding contest

2005-12-25 Thread Simon Hengel
ersonally I prefer > that if be illegal, but if it's legal I'll have to do it). You may change input to something more short, like x. Everything that passes the test, has a good chance to be accepted. Cheers, Simon Hengel -- python coding contest - http://www.pycontest.net/ -- h

Re: python coding contest

2005-12-28 Thread Simon Hengel
> the dream of winning the contest seems to be over. Sorry for that, I'm considering doing a ranking on the nicest cheats too. Have fun, Simon Hengel -- python coding contest - http://www.pycontest.net/ -- http://mail.python.org/mailman/listinfo/python-list

Re: python coding contest

2005-12-28 Thread Simon Hengel
Hello, > After all, I'd really love to set up another contest with > different measures and criteria. for future events i will take a close look at other possibilities for doing a ranking. At the moment the 22c3 and the contest is eating up all my time. Pleas appreciate that i may not keep up wit

Re: python coding contest

2005-12-29 Thread Simon Hengel
i broke things while tweaking some stuff. Sorry for the inconveniences, Simon Hengel -- python coding contest - http://www.pycontest.net/ -- http://mail.python.org/mailman/listinfo/python-list

Re: python coding contest

2005-12-29 Thread Simon Hengel
> It seems, that the site had some trouble to stay online and especially > to provide the ranking today. There was a problem with our server, sorry for that. Have fun, Simon Hengel -- http://mail.python.org/mailman/listinfo/python-list

Re: Is 'everything' a refrence or isn't it?

2006-01-04 Thread Simon Brunning
i = 4 Rebind the name "i" to the integer object 4. Note that this has no effect on the object that used to be bound to "i" at this point, nor any effect on the list object. > print lst Print your old list. Clear now? -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Inheritance problem?

2006-01-06 Thread Simon Percivall
Don't use self.__class__, use the name of the class. -- http://mail.python.org/mailman/listinfo/python-list

Re: making objects unassignable "read-only" (especially when extending)

2006-01-18 Thread Simon Brunning
On 18 Jan 2006 11:59:23 GMT, Johannes Zellner <[EMAIL PROTECTED]> wrote: > Hi, > > can I make an object read-only, so that > > x = new_value > > fails (and x keeps it's orginal value)? This works for me: http://groups.google.com/group/comp.lang.python/msg/2b17

PyCon Vs. Europython

2006-01-18 Thread Simon Burton
the more esoteric python projects, such as the AST integration, and PyPy. Participating in a sprint would be brilliant. The line-up of talks at this year's PyCon looks more interesting to me, compared to Europython 2005. thanks, Simon Burton. -- http://mail.python.org/mailman/listinfo/p

Re: Relying on the behaviour of empty container in conditional statements

2006-07-11 Thread Simon Forman
hould do it for herself. The "pythonic" form is safe, not weird, and just as explicit. There's no more point to using the len() form than there is to saying "seq[len(seq)-1]" rather than just "seq[-1]" to get the last item of a sequence. My $0.02 Peace, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: Abuse of the object-nature of functions?

2006-07-11 Thread Simon Forman
except Exception, err: if err not in (DontCatchMe1, DontCatchMe2): # Handle err HTH, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: Abuse of the object-nature of functions?

2006-07-11 Thread Simon Forman
Simon Forman wrote: > Carl J. Van Arsdall wrote: > > Hrmms, well, here's an interesting situation. So say we wanna catch > > most exceptions but we don't necessarily know what they are going to > > be. For example, I have a framework that executes modules (pytho

Data access from multiple code modules

2006-07-12 Thread simon . hibbs
n GUI form, and panels defined as seperate objects in seperate files. Various panels will contain controlls for manipulating data in the DataObject, or wherever data storage end up. Best regards, Simon Hibbs (who strugles to get his head round this OOP stuff sometimes). -- http://mail.pyt

Re: Data access from multiple code modules

2006-07-12 Thread simon . hibbs
7;s hard to get out of that mentality. Many thanks, Simon Hibbs P.S. Regular reader of your blog on Oreillynet. -- http://mail.python.org/mailman/listinfo/python-list

Re: testing array of logicals

2006-07-13 Thread Simon Brunning
On 12 Jul 2006 11:14:43 -0700, John Henry <[EMAIL PROTECTED]> wrote: > Is there a more elagant way of doing this? > > # logflags is an array of logicals > test=True > for x in logflags: >test = test and x > print test min(logflags) I feel dirty now. ;-) -- Cheers

Re: Data access from multiple code modules

2006-07-13 Thread simon . hibbs
nd it. This seems to me to be the superior approach. Are there any other architectural options that anyone could suggest? Simon Hibbs -- http://mail.python.org/mailman/listinfo/python-list

Re: Data access from multiple code modules

2006-07-13 Thread simon . hibbs
for all the transformations I want to perform on the data. Simon Hibbs -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie

2006-07-13 Thread simon . hibbs
ing engine using Python, SQLite and wxPython. It's easily my most ambitious project so far. Simon Hibbs -- http://mail.python.org/mailman/listinfo/python-list

Re: Accessors in Python (getters and setters)

2006-07-13 Thread Simon Brunning
lass() my_object.bad_name = "This should issue a warning" print my_object.bad_name # This too print my_object.good_name # But this should be fine if __name__ == '__main__': test() -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Accessors in Python (getters and setters)

2006-07-13 Thread Simon Brunning
On 7/13/06, Simon Brunning <[EMAIL PROTECTED]> wrote: > Something like this any use to you? Or this, about a squillion times cleaner: class MyClass(object): def _get_bad_name(self): warn('"bad_name" deprecated. Please refer to "good_name&qu

Re: testing array of logicals

2006-07-13 Thread Simon Brunning
On 13 Jul 2006 05:45:21 -0700, John Henry <[EMAIL PROTECTED]> wrote: > > Simon Brunning wrote: > > > > min(logflags) > > > > !!! Be aware that not only is this an outrageous misuse of min(), it's also almost certainly much less efficient than /F's s

Re: running python from a memory stick?

2006-07-13 Thread Simon Brunning
able > file to install it. But is it possible to do it some other way, such as > how you might build it yourself on Linux (although I don't know how to > do that yet) and then just write and run scripts normally straight from > your memory stick? Google for Movable Python

Re: bay area based - python guru..

2006-07-13 Thread Simon Brunning
On 7/13/06, Stefan Behnel <[EMAIL PROTECTED]> wrote: > Maybe the right thing to ask back is: how much do you pay? And possibly; *which* bay? ;-) -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: String handling and the percent operator

2006-07-13 Thread Simon Forman
Pythonic way to do this? (Maybe I could somehow use generators?) > > thx. > -tom! strings have a count() method. Since you know that you won't have things like '%%s' in your boilerplate, it's perfectly reasonable to use: return boilerplate % ((module,) * boilerplate.count('%s')) in your code. Peace, ~Simon return boilerplate % ((module,) * 3) -- http://mail.python.org/mailman/listinfo/python-list

Re: String handling and the percent operator

2006-07-13 Thread Simon Forman
Tom Plunket wrote: > Simon Forman wrote: > > > strings have a count() method. > > thanks! > > For enrichment purposes, is there a way to do this sort of thing with > a generator? E.g. something like: > > def SentenceGenerator(): >words = ['I', &

Re: testing array of logicals

2006-07-13 Thread Simon Forman
John Henry wrote: > Hi list, > > Is there a more elagant way of doing this? > > # logflags is an array of logicals > test=True > for x in logflags: >test = test and x > print test > > -- > Thanks, So many ways *drool* How about: False not in logflags (Anybody gonna run all these throu

Re: testing array of logicals

2006-07-13 Thread Simon Forman
> > False not in logflags > Or, if your values aren't already bools False not in (bool(n) for n in logflags) Peace, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: searching for strings (in a tuple) in a string

2006-07-14 Thread Simon Forman
Simon Forman wrote: ... > I usually use this with assert statements when I need to check a > sequence. Rather than: > > for something in something_else: assert expression > > I say > > assert False not in (expression for something in something_else) > > This way the

Re: instances

2006-07-14 Thread Simon Forman
an instance of a class. :) One can ONLY create instances of classes. > 4. An instance can only perform functions that are provided from the > method it was instanced from. Yes, *IF* you replace "method" in that sentence with "class", and "functions" with "methods". > 5. Is there any other key information I am missing. I hope this helps, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: reading specific lines of a file

2006-07-15 Thread Simon Forman
a multi gigabyte log file. I found that a very fast way to do this was to build an index file containing the int offset in bytes of each line in the log file. I could post the code if you're interested. Peace, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: instantiate all subclasses of a class

2006-07-16 Thread Simon Forman
, class_ in getmembers(m, isclass): if class_ is m.A: continue if m.A in getmro(class_): exec t % (name, name) Peace, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: instantiate all subclasses of a class

2006-07-16 Thread Simon Forman
> > > classes themselves. But I only would like to do this with classes that > > > are subclasses of A. > > > > > > Any ideas? > > > > It's pretty easy > > > > > > import m > > from inspect import getmembers, isclass, get

Re: Coding style

2006-07-17 Thread Simon Brunning
On 17 Jul 2006 08:56:34 -0700, PTY <[EMAIL PROTECTED]> wrote: > Which is better? > > lst = [1,2,3,4,5] > > while lst: > lst.pop() > > OR > > while len(lst) > 0: > lst.pop() How about: lst = [1,2,3,4,5] while lst: lst.pop() Or even just:

Re: execute a shell script from a python script

2006-07-17 Thread Simon Forman
spec wrote: > Thanks, actually there are no args, is there something even simpler? > > Thanks > Frank you could try os.system() >From the docs: system(command) Execute the command (a string) in a subshell. This is implemented by calling the Standard C function system(), and has the same limi

Re: mkdir

2006-07-18 Thread Simon Brunning
rybook/os.htm> - but it really couldn't be simpler. There's not much to demonstrate. If it's deprecated, it's the first I've heard of it. -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Python linker

2006-07-18 Thread Simon Brunning
ET framework (if they don't already have it!). So, they'll download and install the .NET framework at 23 MB, but they won't download and install Python at 9 and half? -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: range() is not the best way to check range?

2006-07-18 Thread Simon Forman
Dan Bishop wrote: > [EMAIL PROTECTED] wrote: > > it seems that range() can be really slow: > ... > > if i in range (0, 1): > > This creates a 10,000-element list and sequentially searches it. Of > course that's gonna be slow. And you're doing it 3 times. -- http://mail.python.org/m

Re: range() is not the best way to check range?

2006-07-18 Thread Simon Forman
in range(lo, hi, step) without doing "the necessary algebra". i.e. n in set(xrange(0, 10000, 23)) ... Peace, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: range() is not the best way to check range?

2006-07-18 Thread Simon Forman
Diez B. Roggisch wrote: > Simon Forman wrote: > > > Nick Craig-Wood wrote: > >> > >> Sets are pretty fast too, and have the advantage of flexibility in > >> that you can put any numbers in you like > >> > > > > I know this is self-evid

Re: Piping external commands

2006-07-18 Thread Simon Forman
arbitrary commands? For piping subcommands check out the subprocess module, especially http://docs.python.org/lib/node242.html , for bzip2 check out the bz2 module http://docs.python.org/lib/module-bz2.html , but note, there's also a tarfile module http://docs.python.org/lib/module-tarfile.

Re: range() is not the best way to check range?

2006-07-18 Thread Simon Forman
K.S.Sreeram wrote: > Simon Forman wrote: > > Nick Craig-Wood wrote: > >> Sets are pretty fast too, and have the advantage of flexibility in > >> that you can put any numbers in you like > >> > > > > I know this is self-evident to most of the people r

Re: range() is not the best way to check range?

2006-07-18 Thread Simon Forman
tac-tics wrote: > Simon Forman wrote: > > To me, and perhaps others, "T = > > set(xrange(0, 1, 23))" and "n in T" are somewhat easier to read > > and write than "not n % 23 and 0 <= n < 1", YMMV. > > Eh? How is the first eas

Re: New SourceForge project: Diet Python!!!

2006-07-19 Thread Simon Hibbs
, would be a Very Good Thing. They're planning on manufacturing 100 million of these things! Simon Hibbs -- http://mail.python.org/mailman/listinfo/python-list

TextCtrl focus events in wxWidgets

2006-07-19 Thread Simon Hibbs
ould implement this, or a similarly user friendly behaviour? Best regards, Simon Hibbs -- http://mail.python.org/mailman/listinfo/python-list

Re: New SourceForge project: Diet Python!!!

2006-07-19 Thread Simon Brunning
On 19 Jul 2006 02:34:09 -0700, Simon Hibbs <[EMAIL PROTECTED]> wrote: > I was reading an article about the One Laptop Per Child initiative the > other day, and being a Python fan I wondered if there are any plans to > put Python on it, or at least make it available. A cut-down vers

Re: TextCtrl focus events in wxWidgets

2006-07-19 Thread Simon Hibbs
ge in the console. I'm trapping other events successfuly elsewhere using similar code. Simon Hibbs . -- http://mail.python.org/mailman/listinfo/python-list

Re: TextCtrl focus events in wxWidgets

2006-07-19 Thread Simon Hibbs
rony steelandt wrote: > Since the event handler of a textctrl inherits from wxCommandEvent, > I would guess that the binding should be to EVT_COMMAND_KILL_FOCUS Still not working :( Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: TextCtrl focus events in wxWidgets

2006-07-19 Thread Simon Hibbs
Simon Hibbs wrote: > rony steelandt wrote: > > Since the event handler of a textctrl inherits from wxCommandEvent, > > I would guess that the binding should be to EVT_COMMAND_KILL_FOCUS > > Still not working :( I can trap EVT_TEXT_ENTER events successfuly, without using EV

Re: TextCtrl focus events in wxWidgets

2006-07-19 Thread Simon Hibbs
Frank Millman wrote: > Try self.PlantCtrl.Bind(wx.EVT_KILL_FOCUS, self.OnUpdatePlantCtrl) And Voila! It works. Many, many thanks. Any idea what is going on? Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: Project organisation

2006-07-19 Thread Simon Hibbs
. Simon Hibbs -- http://mail.python.org/mailman/listinfo/python-list

Re: Text Summarization

2006-07-19 Thread Simon Forman
[EMAIL PROTECTED] wrote: > Jim Jones wrote: > > Is there a Python library that would allow me to take a paragraph of text, > > and generate a one or two sentence summary of that paragraph? > > There is a OTS wrapper. http://libots.sourceforge.net/ as for the wrapper, this was all I could find (i

Re: Authentication

2006-07-19 Thread Simon Forman
rse.. server = smtplib.SMTP('smtp.gmail.com', 587) try: server.ehlo() server.starttls() server.ehlo() server.login(me, p) # Do some more stuff here... finally: server.close() HTH, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple file writing techiques ...

2006-07-19 Thread Simon Forman
> Colin You should check out the fileinput module. HTH, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: Depricated String Functions in Python

2006-07-20 Thread Simon Forman
e map() (or really don't like list comprehensions ;P ) you could use this: lower_list = map(lambda s : s.lower(), str_list) Hope this helps, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: regular expression - matches

2006-07-21 Thread Simon Forman
ur re pattern with the "$" character (depending on what the rest of your pattern matches.) HTH, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: regular expression - matches

2006-07-21 Thread Simon Forman
John Salerno wrote: > Simon Forman wrote: > > > Python's re.match() matches from the start of the string, so if you > > want to ensure that the whole string matches completely you'll probably > > want to end your re pattern with the "$" character (de

Re: An optparse question

2006-07-21 Thread Simon Forman
T wrote: > fuzzylollipop wrote: > > > > you can make the usage line anything you want. > > > > ... > > usage = 'This is a line before the usage line\nusage %prog [options] > > input_file' > > parser = OptionsParser(usage=usage) > > parser.print_help() > > ... > > > > No, that affects the string pri

Re: An optparse question

2006-07-21 Thread Simon Forman
subclass the Formatter passed in to the Parser. IMHO, optparse does a tricky task well, but it's implemented in a hard to follow, inflexible manner. My "favorite" pet peeve is that the options "dictionary" it returns isn't a dict. I wound up doing this to it to get

Re: regular expression - matches

2006-07-21 Thread Simon Forman
John Salerno wrote: > Thanks guys! A pleasure. : ) -- http://mail.python.org/mailman/listinfo/python-list

Re: Nested function scope problem

2006-07-21 Thread Simon Forman
Gerhard Fiedler wrote: > On 2006-07-21 21:05:22, Josiah Manson wrote: > > > I found that I was repeating the same couple of lines over and over in > > a function and decided to split those lines into a nested function > > after copying one too many minor changes all over. The only problem is > > th

Re: Which Pyton Book For Newbies?

2006-07-23 Thread Simon Forman
t;, at http://infohost.nmt.edu/tcc/help/lang/python/tkinter.html HTH, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: Track keyboard and mouse usage

2006-07-23 Thread Simon Forman
ually someone did. http://python-xlib.sourceforge.net/ It's old but it works fine. Speaks X protocol in pure python. HTH, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: Search within running python scripts

2006-07-24 Thread Simon Forman
gmax2006 wrote: > Hi, > > Is it possible that a python script finds out whether another instance > of it is currently running or not? > > Thank you, > Max Yes, there are several ways. What OS are you using? ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: Search within running python scripts

2006-07-24 Thread Simon Forman
gmax2006 wrote: > Simon Forman wrote: > > gmax2006 wrote: > > > Hi, > > > > > > Is it possible that a python script finds out whether another instance > > > of it is currently running or not? > > > > > > Thank you, > &

Re: Search within running python scripts

2006-07-24 Thread Simon Forman
e this, as I have noticed that IDLE seems to do exactly this, and on windows and linux, but I was afraid to look the fool if it was indeed foolish. (and also, I didn't know details of it.) Thanks Cameron. Peace, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: dicts vs classes

2006-07-25 Thread Simon Hibbs
ral way to express yourself. Any objctions to this, or pitfalls? Simon Hibbs -- http://mail.python.org/mailman/listinfo/python-list

Re: About Embedding PyWin or wxPython

2006-07-25 Thread Simon Hibbs
h you would need to distribute the .NET and IronPython runtimes. Multiple-language and library integration is after all what .NET is all about. Simon Hibbs -- http://mail.python.org/mailman/listinfo/python-list

Re: How do I pass a list to a __init__ value/definition?

2006-07-25 Thread Simon Brunning
ession('dbh', [1,2,3,4], 5) >>> spam.regressors [1, 2, 3, 4] What makes you think you only have the first member of the list? Can you show us the code that's not working? -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Paste text across multiple text boxes

2006-07-25 Thread Simon Hibbs
This link seems to have some relevent code. http://lists.wxwidgets.org/archive/wxPython-users/msg07340.html Simon Hibbs -- http://mail.python.org/mailman/listinfo/python-list

Re: dicts vs classes

2006-07-25 Thread Simon Forman
Simon Hibbs wrote: > I'm wondering about whether to use objects in this way or dictionaries > for a program I'm writing at the moment. It seems to me that unless you > need some of the functionality supplied with dictionaries (len(a), > has_key, etc) then simple objects are

Re: Help in string.digits functions

2006-07-25 Thread Simon Forman
digits:" will evaluate True because > '121206' is not in '0123456789'. > > Whereas test.isdigit() returns true if all the characters in test are > digits. > > So yes, there is a big difference between the two. > > Regards, > > John > > > Your first test could be rewritten to do what I think you're thinking it should do like so: import string test='121206' for ch in test: if ch not in string.digits: print "I am not all Digits" break else: print "I am all Digits" But isdigit() would be the better way. Peace, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: print function question

2006-07-25 Thread Simon Forman
ine (it will cause a space to appear instead if you print something else, but NOT if you write directly to stdout.) print "Hello", print "world!" # prints Hello world! on one line with a space between them, but import sys print "Hello", sys.stdout.write("world!") # prints Helloworld! Peace, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

<    1   2   3   4   5   6   7   8   9   10   >