Re: [Tutor] regexp

2011-11-07 Thread Peter Otten
Asokan Pichai wrote:

> IMO the regex is not too bad; I will not use it for this job -- typing
> a 50+ character string
> is more painful (and more error prone) than writing 5--10 lines of code.

Well, you can build the string programmatically:

>>> "*".join(string.ascii_lowercase) + "*"
'a*b*c*d*e*f*g*h*i*j*k*l*m*n*o*p*q*r*s*t*u*v*w*x*y*z*'


___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] regexp

2011-11-07 Thread Albert-Jan Roskam
Nice solution indeed! Will it also work with accented characters? And how 
should one incorporate the collating sequence into the solution? By explicitly 
setting the locale? It might be nice if the outcome is always the same, 
whereever you are in the world.

 
Cheers!!
Albert-Jan


~~
All right, but apart from the sanitation, the medicine, education, wine, public 
order, irrigation, roads, a fresh water system, and public health, what have 
the Romans ever done for us?
~~


>
>From: Terry Carroll 
>To: tutor@python.org
>Sent: Sunday, November 6, 2011 8:21 PM
>Subject: Re: [Tutor] regexp
>
>On Sat, 5 Nov 2011, Dinara Vakhitova wrote:
>
>> I need to find the words in a corpus, which letters are in the alphabetical
>> order ("almost", "my" etc.)
>> I started with matching two consecutive letters in a word, which are in
>> the alphabetical order, and tried to use this expression: ([a-z])[\1-z], but
>> it won't work, it's matching any sequence of two letters. I can't figure out
>> why... Evidently I can't refer to a group like this, can I? But how in this
>> case can I achieve what I need?
>
>First, I agree with the others that this is a lousy task for regular 
>expressions.  It's not the tool I would use.  But, I do think it's doable, 
>provided the requirement is not to check with a single regular expression. For 
>simplicity's sake, I'll construe the problem as determining whether a given 
>string consists entirely of lower-case alphabetic characters, arranged in 
>alphabetical order.
>
>What I would do is set a variable to the lowest permissible character, i.e., 
>"a", and another to the highest permissible character, i.e., "z" (actually, 
>you could just use a constant, for the highest, but I like the symmetry.
>
>Then construct a regex to see if a character is within the lowest-permissible 
>to highest-permissible range.
>
>Now, iterate through the string, processing one character at a time.  On each 
>iteration:
>
>- test if your character meets the regexp; if not, your answer is
>   "false"; on pass one, this means it's not lower-case alphabetic; on
>   subsequent passes, it means either that, or that it's not in sorted
>   order.
>- If it passes, update your lowest permissible character with the
>   character you just processed.
>- regenerate your regexp using the updated lowest permissible character.
>- iterate.
>
>I assumed lower case alphabetic for simplicity, but you could modify this 
>basic approach with mixed case (e.g., first transforming to all-lower-case 
>copy) or other complications.
>
>I don't think there's a problem with asking for help with homework on this 
>list; but you should identify it as homework, so the responders know not to 
>just give you a solution to your homework, but instead provide you with hints 
>to help you solve it.
>___
>Tutor maillist  -  Tutor@python.org
>To unsubscribe or change subscription options:
>http://mail.python.org/mailman/listinfo/tutor
>
>
>___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] regexp

2011-11-07 Thread Peter Otten
Albert-Jan Roskam wrote:

> Nice solution indeed! Will it also work with accented characters? And how
> should one incorporate the collating sequence into the solution? By
> explicitly setting the locale? It might be nice if the outcome is always
> the same, whereever you are in the world.

This is probably easier to achieve with sorted() than with regular 
expressions:

>>> locale.setlocale(locale.LC_ALL, "")
'de_DE.UTF-8'
>>> words = [line.strip() for line in open("/usr/share/dict/ngerman") if 
len(line)>4]
>>> [w for w in words if "".join(sorted(w, key=locale.strxfrm)) == w]
['Abel', 'Abels', 'Abgott', 'Abort', 'Achim', 'Achims', 'Adel', 'Adelns', 
'Adels', 'Ader', 'Agio', 'Agios', 'Akku', 'Alls', 'Amor', 'Amors', 'BGHSt', 
'BIOS', 'Beet', 'Beginns', 'Behr', 'Behrs', 'Beil', 'Beils', 'Bein', 
'Beins', 'Bens', 'Benz', 'Beos', 'Bert', 'Bett', 'Betty', 'Bill', 'Bills', 
'Billy', 'Boot', 'Boss', 'Cello', 'Cellos', 'Cent', 'Chintz', 'Chip', 
'Chips', 'Chlor', 'Chlors', 'Chor', 'Chors', 'City', 'Clou', 'Cmos', 'Cruz', 
'Dekor', 'Dekors', 'Dell', 'Dells', 'Delors', 'Demo', 'Demos', 'Depp', 
'Depps', 'Dill', 'Dills', 'Egos', 'Film', 'Films', 'Filz', 'First', 'Flop', 
'Floß', 'Flöz', 'Forst', 'Gips', 'Gott', 'Hinz', 'Horst', 'Hort', 'Inst', 
'Klops', 'Klos', 'Klotz', 'Kloß', 'Knox', 'Kost', 'Löss', 'Moor', 'Moors', 
'Moos', 'Mopp', 'Mopps', 'Mops', 'Most', 'aalst', 'aalt', 'abbeißt', 'aber', 
'abesst', 'abfloss', 'abflosst', 'abhörst', 'abhört', 'ablöst', 'acht', 
'adeln', 'adelst', 'adelt', 'agil', 'ahmst', 'ahmt', 'ahnst', 'ahnt', 
'anno', 'beehrst', 'beehrt', 'beeilst', 'beeilt', 'beginn', 'beginnst', 
'beginnt', 'begoss', 'begosst', 'beim', 'beirrst', 'beirrt', 'beißt', 
'bellst', 'bellt', 'biss', 'bisst', 'bist', 'bloß', 'dehnst', 'dehnt', 
'dein', 'denn', 'dimm', 'dimmst', 'dimmt', 'dorrst', 'dorrt', 'dort', 
'dörrst', 'dörrt', 'döst', 'ehrst', 'ehrt', 'eilst', 'eilt', 'eins', 
'einst', 'eint', 'erst', 'esst', 'filmst', 'filmt', 'floss', 'flosst', 
'flott', 'flößt', 'foppst', 'foppt', 'fort', 'gilt', 'goss', 'gosst', 
'hisst', 'hopst', 'hörst', 'hört', 'irrst', 'irrt', 'isst', 'lost', 'löst', 
'Äffin', 'äffst', 'äfft']


___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


[Tutor] Handling exceptions

2011-11-07 Thread Gerhardus Geldenhuis
Hi
I am trying to handle exceptions for a xmlrpc class interfacing with
cobbler.

The exception:

 xmlrpclib.Fault: 


and the experimental code.

  try:
server = xmlrpclib.Server("http://192.168.2.11/cobbler_api";)
#...
  except xmlrpclib.Fault as detail:

print 'xmlrpc error'
print detail
#print detail.arguments
print repr(detail)

I don't understand what I am getting from the exception. Do I only get a
string and is the above snippet a good/clean/nice way of handling it. If I
only get a string then it is likely that I will have to have  few if's to
handle the various error strings returned.

Regards

-- 
Gerhardus Geldenhuis
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Handling exceptions

2011-11-07 Thread Hugo Arts
On Mon, Nov 7, 2011 at 12:52 PM, Gerhardus Geldenhuis
 wrote:
> Hi
> I am trying to handle exceptions for a xmlrpc class interfacing with
> cobbler.
> The exception:
>  xmlrpclib.Fault:  test_profile'">
>
> and the experimental code.
>   try:
>     server = xmlrpclib.Server("http://192.168.2.11/cobbler_api";)
>     #...
>   except xmlrpclib.Fault as detail:
>     print 'xmlrpc error'
>     print detail
> #    print detail.arguments
>     print repr(detail)
> I don't understand what I am getting from the exception. Do I only get a
> string and is the above snippet a good/clean/nice way of handling it. If I
> only get a string then it is likely that I will have to have  few if's to
> handle the various error strings returned.
> Regards
> --
> Gerhardus Geldenhuis
>

It depends on the specific library used. Generally, the type of the
exception, sometimes in conjunction with the error message, will tell
you what went wrong. In this case, the xmlrpclib.Fault exception
represents all XML-RPC Faults, and there are faultCode and faultString
attributes to figure out where it went wrong. See also the xmlrpclib
documentation (docs are your friend!)

http://docs.python.org/library/xmlrpclib.html#fault-objects

HTH,
Hugo
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Handling exceptions

2011-11-07 Thread Steven D'Aprano

Gerhardus Geldenhuis wrote:


  try:
server = xmlrpclib.Server("http://192.168.2.11/cobbler_api";)
#...
  except xmlrpclib.Fault as detail:

print 'xmlrpc error'
print detail
#print detail.arguments
print repr(detail)

I don't understand what I am getting from the exception. Do I only get a
string and is the above snippet a good/clean/nice way of handling it. If I
only get a string then it is likely that I will have to have  few if's to
handle the various error strings returned.


No, that is the wrong way of handling exceptions.

You should not catch exceptions only to print them. (Actually, there are 
a few times where it *is* appropriate to catch and print exceptions by 
hand, as you have done, but they are rare.)


In general, the only reason to catch an exception is to recover from it, 
then to proceed. E.g. "if it fails, try something different".


In the above, you don't recover from the failure to connect to the 
server. You print some diagnostic information, but then your code tries 
to continue without a defined server.


(If your code above is only for experimentation, that's fine.)

If you aren't able to recover from an exception, normally the right 
thing to do is... just don't catch it at all. In this case, just write this:


server = xmlrpclib.Server("http://192.168.2.11/cobbler_api";)

without a try...except block, and if an exception is raised, you will 
get a traceback automatically printed showing you:


* the type of error
* an error message
* the line number of the code that failed
* the full stack trace of each operation leading up to the error


Learning to read stack traces is not hard, but it is absolutely vital to 
being a good Python coder.



In particular, you should never programmatically make decisions about an 
error based on the error message:



# Don't do this!
try:
x = mylist.index(None)
except ValueError as e:
if e.message == "x not in list":
process_failure()


The problem is that the error message is not part of the promised 
interface of the language. It could change suddenly, without warning, at 
any time. Just because the message is "x not in list" today, doesn't 
mean it will be tomorrow, or next week, or in two minutes. The only 
promise being made is that the error message will be useful to a human 
reader (or at least, it *should* be useful). The exact wording is 
certainly not promised, and so cannot be relied upon.




--
Steven
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Having trouble visiting the subscribers list.

2011-11-07 Thread Alexander
On Sat, Nov 5, 2011 at 9:24 PM, Steven D'Aprano  wrote:

> Nathaniel Trujillo wrote:
>
>> I recently subscribed to tutor and I am trying to visit the subscribers
>> list so I can ask a question but I wasn't given an admin address. Not only
>> that but I don't know what an admin address is. Your help is greatly
>> appreciated.
>>
>
>From the website: http://mail.python.org/mailman/listinfo/tutor
(*The subscribers list is only available to the list administrator.*)
And for good reason. We ( you and I and other members of the list ) and not
admins.
Alexander


> Why do you want to see the list of subscribers? That's private information.
>
> If you want to ask a question, ask it by sending an email to <
> tutor@python.org>.
> --
> Steven
> ___
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/**mailman/listinfo/tutor
>
--
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Printing with no newline :(

2011-11-07 Thread Sarma Tangirala
On 6 November 2011 21:09, Alan Gauld  wrote:

> On 06/11/11 10:23, Sarma Tangirala wrote:
>
>  I'm sorry. Didn't notice the python 3 part, I just joined the list and
>> did not look at the OPs post. Sorry about that.
>>
>
> welcome to the list :-)
>
>
>  Please bear with me on this, but does the following not print "end" for
>> every iteration of "items"?
>>
>> for item in items:
>>  print(item, end="")
>>
>
> No, end is a new optional parameter for the print function in Python 3.
> Recall that in Python2 print was a command whereas in Python 3 it is a
> function which has a couple of new options:
>
>
Thank you!


> ---
> Help on built-in function print in module builtins:
>
> print(...)
>print(value, ..., sep=' ', end='\n', file=sys.stdout)
>
>Prints the values to a stream, or to sys.stdout by default.
>Optional keyword arguments:
>file: a file-like object (stream); defaults to the current sys.stdout.
>sep:  string inserted between values, default a space.
>end:  string appended after the last value, default a newline.
>
>
>
> --
> Alan G
> Author of the Learn to Program web site
> http://www.alan-g.me.uk/
>
>
> __**_
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/**mailman/listinfo/tutor
>




-- 
Sarma Tangirala,
Class of 2012,
Department of Information Science and Technology,
College of Engineering Guindy - Anna University
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Printing with no newline :(

2011-11-07 Thread Prasad, Ramit
>> for line in file:
>> m = re.search(regexp, line)
>> if m:
>> letterGroup = m.group(0)
>> print(letterGroup[4])

>You can specify what to print after the argument(s) with the end keyword 
>parameter:

 items = 1, 2, 3
 for item in items:
>... print(item, end=" ")
>...


Alternatively you could do the following.
letterGroups = []
for line in file:
m = re.search(regexp, line)
if m:
letterGroups.append( m.group(0)[4] )

print( ' '.join( letterGroups ) )



Ramit


Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology
712 Main Street | Houston, TX 77002
work phone: 713 - 216 - 5423

--



This email is confidential and subject to important disclaimers and
conditions including on offers for the purchase or sale of
securities, accuracy and completeness of information, viruses,
confidentiality, legal privilege, and legal entity disclaimers,
available at http://www.jpmorgan.com/pages/disclosures/email.  
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


[Tutor] Single line webserver

2011-11-07 Thread Rich Lovely
Hi all, I was part of this list a couple of years ago, and a recent discussion 
at a python dojo brought to mind something I'd seen then:  a one-liner 
(potentially single statement) webserver.  I'm pretty sure it was posted to 
this list, but I can't find it in the archives, and a google search is 
similarly lacking in relevant results.

I was wondering if anyone (maybe the original author?) had a copy they could 
send me.

Rich "RoadieRich" Lovely

There are 10 types of people in the world:
Those who know binary,
Those who do not,
And those who are off by one.

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


[Tutor] Writing the Map function as a oneliner

2011-11-07 Thread Rafael Turner
Hello,

I am trying to write the map function as a oneliner. I currently have
implement map as a list comprehension:
map = lambda F,li: [F(x) for x in li]

But I would like to make recursive version. Here is what I was thinking:

I can write map as

def pyMap(F,li):
if li == []:
return []
else:
return [F(li[0])] + map2(F, li[1:])

I can logical encode an if-then-else structure as follows:

Let Q be the result of the following IF,THEN, ELSE conditional structure:

If(S):
  Then: A
Else: B

We can implement this only using logical constructors.

Q = (A AND S) OR (B AND NOT S)

where:

   S is the input for the If condition,
   A is the input to Then subexpression
   B is the input for the Else subexpression
   Q is the output of the entire If-Then-Else expression.

So, I tried:
def pyMap2(F, li):
def ifFun(P,eq): return li == []
return ([] and ifFun(li,[])) or ([F(li[0])] + pyMap2(F, li[1:]) and not [])

But it's no use. pyMap works fine but pyMap2 does not.

I saved the above code as map.py and ran it in the interpreter.

>>> import map
>>> map.pyMap2(lambda x: x + 2, [1,2,3])
Traceback (most recent call last):
  File "", line 1, in 
  File "map.py", line 15, in pyMap2
return ([] and fIF(li,[])) or ([F(li[0])] + pyMap2(F, li[1:]) and not [])
  File "map.py", line 15, in pyMap2
return ([] and fIF(li,[])) or ([F(li[0])] + pyMap2(F, li[1:]) and not [])
  File "map.py", line 15, in pyMap2
return ([] and fIF(li,[])) or ([F(li[0])] + pyMap2(F, li[1:]) and not [])
  File "map.py", line 15, in pyMap2
return ([] and fIF(li,[])) or ([F(li[0])] + pyMap2(F, li[1:]) and not [])
IndexError: list index out of range


Thank you for your help,
Rafael
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Single line webserver

2011-11-07 Thread Steven D'Aprano

Rich Lovely wrote:

Hi all, I was part of this list a couple of years ago, and a recent discussion 
at a python dojo brought to mind something I'd seen then:  a one-liner 
(potentially single statement) webserver.  I'm pretty sure it was posted to 
this list, but I can't find it in the archives, and a google search is 
similarly lacking in relevant results.

I was wondering if anyone (maybe the original author?) had a copy they could 
send me.


https://duckduckgo.com/html/?q=python%20one%2Dliner%20web%20server

Hits #2 #3 and #4 are:

http://tobyho.com/2010/04/26/one-liner-webserver-with/
http://www.garyrobinson.net/2004/03/one_line_python.html
http://aroberge.blogspot.com/2010/08/my-favourite-python-one-liner.html



--
Steven
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Single line webserver

2011-11-07 Thread Alan Gauld

On 07/11/11 23:23, Rich Lovely wrote:


a one-liner (potentially single statement) webserver.


There is a python module in the standard library that implements a basic 
webserver, presumably it was based on that.


Try the docs for the library modules...

--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Writing the Map function as a oneliner

2011-11-07 Thread Alan Gauld

On 07/11/11 23:32, Rafael Turner wrote:

Hello,

I am trying to write the map function as a oneliner
But I would like to make recursive version. Here is what I was thinking:

I can write map as

def pyMap(F,li):
 if li == []:
 return []
 else:
 return [F(li[0])] + map2(F, li[1:])



Using the conditional expression it is nearly trivial to
convert your function to a one-liner:


def pyMap(F,li):
return [] if li == [] else [F(li[0])] + pyMap(F,li[1:])

which becomes

pyMap = lambda F, li: [] if li == [] else [F(li[0])] + pyMap(F,li[1:])


HTH,

--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


[Tutor] tkfiledialogs and hidden files

2011-11-07 Thread Jose Amoreira
Hello!
Is there any way to configure tkFileDialogs so that they don't display hidden 
files?
Thanks.
Ze Amoreira
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


[Tutor] Question about GUI applications.

2011-11-07 Thread Nathaniel Trujillo
I just wrote the following GUI application. How do I get rid of the 7k in
the upper left hand corner and how to I put other stuff there like say a
picture of someone. Thanks for the help.

Here is the GUI application. It is called mad_lib.py.py

# Mad Lib
# Create a story based on user input
from tkinter import *
class Application(Frame):
""" GUI application that creates a story based on user input. """
def __init__(self, master):
""" Initialize Frame. """
super(Application, self).__init__(master)
self.grid()
self.create_widgets()
def create_widgets(self):
""" Create widgets to get story infomation and to display story. """
# create instruction label
Label(self, text = "Enter information for a new story").grid(row =
0, column = 0, columnspan = 2, sticky = W)
# create a label and text entry for the name of a person
Label(self, text = "Person: ").grid(row = 1, column = 0, sticky = W)
self.person_ent = Entry(self)
self.person_ent.grid(row = 1, column = 1, sticky = W)
# create a label and text entry for a plural noun
Label(self, text = "Plural Noun:").grid(row = 2, column = 0, sticky
= W)
self.noun_ent = Entry(self)
self.noun_ent.grid(row = 2, column = 1, sticky = W)
# create a label and text entry for a verb
Label(self, text = "Verb:").grid(row = 3, column = 0, sticky = W)
self.verb_ent = Entry(self)
self.verb_ent.grid(row = 3, column = 1, sticky = W)
# create a label for adjectives check buttons
Label(self, text = "Adjective(s):").grid(row = 4, column = 0,
sticky = W)
# create itchy check button
self.is_itchy = BooleanVar()
Checkbutton(self, text = "itchy", variable =
self.is_itchy).grid(row = 4, column = 1, sticky = W)
# create joyous check button
self.is_joyous = BooleanVar()
Checkbutton(self, text = "joyous", variable =
self.is_joyous).grid(row = 4, column = 2, sticky = W)
# create electric check button
self.is_electric = BooleanVar()
Checkbutton(self, text = "electric", variable =
self.is_electric).grid(row = 4, column = 3, sticky = W)
# create a label for body parts radio buttons
Label(self, text = "Body Part:").grid(row = 5, column = 0, sticky =
W)
# create variable for single body part
self.body_part = StringVar()
self.body_part.set(None)
# create body part radio buttons
body_parts = ["bellybutton", "big toe", "medulla oblongata"]
column = 1
for part in body_parts:
Radiobutton(self, text = part, variable = self.body_part, value
= part).grid(row = 5, column = column, sticky = W)
column += 1
# create a submit button
Button(self, text = "Click for story", command =
self.tell_story).grid(row = 6, column = 0, sticky = W)
self.story_txt = Text(self, width = 75, height = 10, wrap = WORD)
self.story_txt.grid(row = 7, column = 0, columnspan = 4)
def tell_story(self):
""" Fill text box with new story based on user input. """
# gets values fom the GUI
person = self.person_ent.get()
noun = self.noun_ent.get()
verb = self.verb_ent.get()
adjectives = ""
if self.is_itchy.get():
adjectives += "itchy, "
if self.is_joyous.get():
adjectives += "joyous, "
if self.is_electric.get():
adjectives += "electric, "
body_part = self.body_part.get()
# create the story
story = "The famous explorer "
story += person
story += " had nearly given up a life-long quest to find The Lost
City of "
story += noun.title()
story += " when one day, the "
story += noun
story += " found "
story += person + "."
story += "A strong, "
story += adjectives
story += "peculiar feeling overwhelmed the explorer. "
story += "After all this time, the quest was finally over. A tear
came to "
story += person + "'s "
story += body_part + ". "
story += "And then, the "
story += noun
story += " promptly devoured "
story += person + "."
story += "The moral of the story? Be careful what you "
story += verb
story += " for."
# display the story
self.story_txt.delete(0.0, END)
self.story_txt.insert(0.0, story)
# main
root = Tk()
root.title("Mad Lib")
app = Application(root)
root.mainloop()
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Single line webserver

2011-11-07 Thread Lie Ryan

On 11/08/2011 10:23 AM, Rich Lovely wrote:

Hi all, I was part of this list a couple of years ago, and a recent discussion 
at a python dojo brought to mind something I'd seen then:  a one-liner 
(potentially single statement) webserver.  I'm pretty sure it was posted to 
this list, but I can't find it in the archives, and a google search is 
similarly lacking in relevant results.

I was wondering if anyone (maybe the original author?) had a copy they could 
send me.



Windows Command Prompt gotta be the most powerful language on earth, it 
has a full-blown server in a single word:


C:\Program Files\Apache Software Foundation\Apache2.2\bin> httpd.exe

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor