potential_passengers = ['bob','john','sue','wendy','chris','bob','jen','wendy']
accepted_passengers = set()
for name in potential_passengers:
print('checking on {}...'.format(name))
if name not in accepted_passengers:
accepted_passengers.add(name)
print('welcome aboard, {}
you'll find a very extensive Flask tutorial at
http://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-i-hello-world .
--
https://mail.python.org/mailman/listinfo/python-list
I recommend getting your hands on "Automate The Boring Stuff With Python" from
no starch press:
http://www.nostarch.com/automatestuff
I've not read it in its entirety, but it's very beginner-friendly and is
targeted at just the sort of processing you appear to be doing.
HTH,
Don
--
https://ma
Maybe you're inadvertently running Python with either the '-i' switch or with
the PYTHONINSPECT environment variable set?
When you do that, your script will launch an interactive prompt after it
completes.
C:\Python27>echo print "hello" > hello.py
C:\Python27>python hello.py
hello
C:\Python
On Apr 17, 1:05 pm, Christian Heimes wrote:
> Am 17.04.2013 19:55, schrieb darnold:
>
> > On Apr 17, 8:50 am, Ombongi Moraa Fe
> > wrote:
>
> >> how do I use xml.etree.ElementTree to print the parameters address and
> >> deliveryStatus? Or is there a bet
On Apr 17, 8:50 am, Ombongi Moraa Fe
wrote:
> how do I use xml.etree.ElementTree to print the parameters address and
> deliveryStatus? Or is there a better python method?
>
I'm sure there are prettier ways to do this, but you can use XPath
syntax to find all of your ns1:result nodes and loop th
On Apr 17, 5:25 am, aaB wrote:
>
> - the "complement" thing:
> I haven't yet tried to reproduce this, but I will, and I will post back if I
> see
> this happening again, this time with a real log of python's interactive
> console,
> or a complete script which people can use.
>
That was happenin
i know literally nothing about syslogs, but a google search for
"python syslog parser" shows that some people have had success using
the pyparsing module:
http://www.j-schmitz.net/blog/how-to-parse-a-syslog-logfile-in-python
https://gist.github.com/leandrosilva/3651640
hth,
Don
--
http://mail.py
On Feb 5, 4:05 pm, marduk wrote:
>
> Although that implementation also scans the string 10 times (s.count()),
> which may not be as efficient (although it is happening in C, so perhaps
> not).
>
> A better solution involves only scanning the string once.
agreed. i was specifically showing how to
On Feb 5, 2:19 pm, maiden129 wrote:
> How to reverse the two loops?
>
s=input("Enter a string, eg(4856w23874): ")
checkS=['0','1','2','3','4','5','6','7','8','9']
for digit in checkS:
t = s.count(digit)
if t == 0:
pass
elif t == 1:
print(digit,"occurs 1 time.")
e
i don't think in iterators (yet), so this is a bit wordy.
same basic idea, though: for each message (set of parameters), build a
list of transactions consisting of matching send/receive times.
mildly tested:
from datetime import datetime, timedelta
sendData = '''\
05:00:06 Message sent - Va
On Dec 16, 12:38 pm, tbg wrote:
> Nice, will have to try it out...
if you're interested in learning Python and/or game programming in
Python, you might want to take a look at http://inventwithpython.com/
.
HTH,
Don
--
http://mail.python.org/mailman/listinfo/python-list
On Oct 20, 6:24 pm, Nick Sabalausky
wrote:
> Hi, I'm fairly new to Python, and I'm trying to figure out how to use
> SQLAlchemy to connect to a MySQL DB and use table reflection to set up
> SQLAlchemy's tables. But the SQLAlchemy documentation is gigantic and
> frankly kinda making my head spin,
On May 10, 4:58 am, d.po...@gmail.com wrote:
> On Wednesday, May 9, 2012 7:13:54 AM UTC-7, Miki Tebeka wrote:
> > > I am going to learn python for some plot issues. which book or sources,
> > > do you recommend please?
> > The tutorial is pretty good if you already know how to program.
> > I also
On Dec 15, 11:59 am, Miki Tebeka wrote:
> > My sort issue... as in this doesn't work
> > >>> if x.sort == y.sort:
>
> You're missing the () to make it a function call.
> Also list.sort() returns none, it mutates the original list.
> You can either
> sorted(x) == sorted(y)
> or
> set(x) ==
On Aug 23, 9:21 am, Yingjie Lin wrote:
> Hi Python users,
>
> I just realize that my post yesterday shouldn't be specifically for
> mechanize. It should be a general question for file-like objects.
>
> >>> f = open('my_file.txt')
> >>> print f.readlines()
>
> ( prints a list of strings>>>
print "this" \
" is" \
" a" \
" test" \
>>> RESTART
>>>
this is a test
--
http://mail.python.org/mailman/listinfo/python-list
17 matches
Mail list logo