On 06/24/2013 08:20 AM, Lutz Horn wrote:
Hi,
Am 24.06.2013 14:12 schrieb christheco...@gmail.com:
username=raw_input("Please enter your username: ")
password=raw_input("Please enter your password: ")
if username == "john doe" and password == "fopwpo":
print "Login Successful"
else:
pr
Hi,
Am 24.06.2013 14:12 schrieb christheco...@gmail.com:
username=raw_input("Please enter your username: ")
password=raw_input("Please enter your password: ")
if username == "john doe" and password == "fopwpo":
print "Login Successful"
else:
print "Please try again"
while not usernam
On 06/24/2013 03:00 PM, John Gordon wrote:
In
=?UTF-8?B?Q2hyaXMg4oCcS3dwb2xza2HigJ0gV2Fycmljaw==?= writes:
while True:
username = raw_input("Please enter your username: ")
password = raw_input("Please enter your password: ")
if username == "john doe" and password == "fopwpo":
In
=?UTF-8?B?Q2hyaXMg4oCcS3dwb2xza2HigJ0gV2Fycmljaw==?=
writes:
> > while True:
> > username = raw_input("Please enter your username: ")
> > password = raw_input("Please enter your password: ")
> >
> > if username == "john doe" and password == "fopwpo":
> > print "Login Suc
On Mon, Jun 24, 2013 at 8:42 PM, John Gordon wrote:
> In
> christheco...@gmail.com writes:
>
>> On Sunday, June 23, 2013 6:18:35 PM UTC-5, christ...@gmail.com wrote:
>> > How do I bring users back to beginning of user/password question once they
>> >
>> > fail it? thx
>
>> Can't seem to get this
In
christheco...@gmail.com writes:
> On Sunday, June 23, 2013 6:18:35 PM UTC-5, christ...@gmail.com wrote:
> > How do I bring users back to beginning of user/password question once they
> >
> > fail it? thx
> Can't seem to get this to cooperate...where does the while statement belong?
while T
On Sunday, June 23, 2013 6:18:35 PM UTC-5, christ...@gmail.com wrote:
> How do I bring users back to beginning of user/password question once they
>
> fail it? thx
Can't seem to get this to cooperate...where does the while statement belong?
--
http://mail.python.org/mailman/listinfo/python-list
On Monday, June 24, 2013 5:42:51 PM UTC+5:30, christ...@gmail.com wrote:
> Here is my code...I'm using 2.7.5
>
>
> username=raw_input("Please enter your username: ")
> password=raw_input("Please enter your password: ")
> if username == "john doe" and password == "fopwpo":
> print "Login Succ
Here is my code...I'm using 2.7.5
username=raw_input("Please enter your username: ")
password=raw_input("Please enter your password: ")
if username == "john doe" and password == "fopwpo":
print "Login Successful"
else:
print "Please try again"
--
http://mail.python.org/mailman/listinfo/
I'm using 2.7
--
http://mail.python.org/mailman/listinfo/python-list
On Sun, 23 Jun 2013 16:18:35 -0700, christhecomic wrote:
> How do I bring users back to beginning of user/password question once
> they fail it? thx
Write a loop. If they don't fail (i.e. they get the password correct),
then break out of the loop.
--
Steven
--
http://mail.python.org/mailman/
On 06/23/2013 05:18 PM, christheco...@gmail.com wrote:
> How do I bring users back to beginning of user/password question once they
> fail it? thx
This is not a very good question. There is no context
so we cannot tell if you are talking about a command line
program that prompts for a username
How do I bring users back to beginning of user/password question once they
fail it? thx
--
http://mail.python.org/mailman/listinfo/python-list
On Aug 29, 10:46 pm, "Russell E. Owen" <[EMAIL PROTECTED]> wrote:
you
> can safely compute stuff with a background thread and display it from> the
> main thread). But cross that bridge later.>
> -- Russell
thanks Russel
gordon
--
http://mail.python.org/mailman/listinfo/python-list
In article
<[EMAIL PROTECTED]>,
gordon <[EMAIL PROTECTED]> wrote:
> On Aug 29, 4:45 am, "Russell E. Owen" <[EMAIL PROTECTED]> wrote:
> >your Controller object should not create root nor should
> > it call mainloop to start the event loop.
>
> guys
> thanks for the helpful replies..I rewrote the
On Aug 29, 4:45 am, "Russell E. Owen" <[EMAIL PROTECTED]> wrote:
>your Controller object should not create root nor should
> it call mainloop to start the event loop.
guys
thanks for the helpful replies..I rewrote the code as you advised. It
creates a controller object and a gui object from main s
In article
<[EMAIL PROTECTED]>,
gordon <[EMAIL PROTECTED]> wrote:
> On Aug 27, 10:42 pm, Fredrik Lundh <[EMAIL PROTECTED]> wrote:
> > so I guess the question here is from where you expect to call that
> > method, and what you expect Tkinter to do when you call it...
>
> thanks for the reply
>
On Aug 27, 10:42 pm, Fredrik Lundh <[EMAIL PROTECTED]> wrote:
> so I guess the question here is from where you expect to call that
> method, and what you expect Tkinter to do when you call it...
thanks for the reply
i was planning to write a controller (as in MVC) that will instantiate
a gui clas
In article <[EMAIL PROTECTED]>,
Fredrik Lundh <[EMAIL PROTECTED]> wrote:
>gordon wrote:
>
>> is it possible to send a message to the gui instance while the Tk
>> event loop is running?I mean after i create a gui object like
.
.
gordon wrote:
is it possible to send a message to the gui instance while the Tk
event loop is running?I mean after i create a gui object like
root=Tk()
mygui=SomeUI(root)
and call
root.mainloop()
can i send message to mygui without quitting the ui or closing the
window?i tried some code like
is it possible to send a message to the gui instance while the Tk
event loop is running?I mean after i create a gui object like
root=Tk()
mygui=SomeUI(root)
and call
root.mainloop()
can i send message to mygui without quitting the ui or closing the
window?i tried some code like
mygui.someMethod(
The sets module is no longer needed, as we have the built-in sets
type. Its even getting a literal syntax soon.
As for the original problem, I agree on the homework smell.
On Jun 15, 2008, at 9:31 PM, takayuki wrote:
Dennis,
thanks for your reply. unfortunately i accidentally posted only h
Dennis,
thanks for your reply. unfortunately i accidentally posted only half
of my question! the "real" post should be up now.
my apologies.
takayuki
On Jun 16, 10:15 am, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote:
> On Sun, 15 Jun 2008 17:18:54 -0700 (PDT), takayuki
> <[EMAIL PROTECTED]> d
Hi everyone,
I'm studying python via the excellent "how to think like a python
programmer" book by Allen Downey. Noob question follows...
I have a txt file (animals.txt) which contains the following text each
on a separate line: aardvark, bat, cat, dog, elephant, fish, giraffe,
horse, inchworm,
Mike P wrote:
> Hi Experts,
>
> I've written a peice of code that works fine and fits, and passes
> values into a peice of SPSS code, the problem is that it is not
> dynamic, and so i though about how i can make it dynamic, (other code
> may not have upto 10 some may have more) and came up with r
Hi Experts,
I've written a peice of code that works fine and fits, and passes
values into a peice of SPSS code, the problem is that it is not
dynamic, and so i though about how i can make it dynamic, (other code
may not have upto 10 some may have more) and came up with regex for an
idea, but i can
Steven D'Aprano <[EMAIL PROTECTED]> writes:
> >> >>> pairs = (test[i:i+2] for i in xrange(len(test)-1))
> >> >>> for a,b in pairs:
> >> ... print a,b
> >
> > for a, b in zip(test, test[1:]):
> > print a, b
>
> May be unfortunately slow if test is half a gigabyte of data, what with
> ess
On Oct 11, 4:40 am, Steven D'Aprano <[EMAIL PROTECTED]
cybersource.com.au> wrote:
> On Wed, 10 Oct 2007 20:25:00 +, Paul Hankin wrote:
> >> A "works-for-me":
>
> >> >>> pairs = (test[i:i+2] for i in xrange(len(test)-1))
> >> >>> for a,b in pairs:
> >> ... print a,b
>
> > for a, b in zip(
On Wed, 10 Oct 2007 20:25:00 +, Paul Hankin wrote:
>> A "works-for-me":
>>
>> >>> pairs = (test[i:i+2] for i in xrange(len(test)-1))
>> >>> for a,b in pairs:
>> ... print a,b
>
> for a, b in zip(test, test[1:]):
> print a, b
May be unfortunately slow if test is half a gigabyte of da
On 10/10/07, Carsten Haese <[EMAIL PROTECTED]> wrote:
>
> Instead of passing the file object directly to the csv parser, pass in a
> generator that reads from the file and explicitly encodes the strings
> into UTF-8, along these lines:
>
> def encode_to_utf8(f):
> for line in f:
> yield
On Wed, 2007-10-10 at 16:03 -0500, Robert Dailey wrote:
> I've tried everything to make the original CSV module work. It just
> doesn't. I've tried UTF-16 encoding
What do you mean, "tried?" Don't you know what the file is encoded in?
> (which works fine with codecs.open()) but when I pass in th
I've tried everything to make the original CSV module work. It just doesn't.
I've tried UTF-16 encoding (which works fine with codecs.open()) but when I
pass in the file object returned from codecs.open() into csv.reader(), the
call to reader.next() fails because it says something isnt' in the rang
Tim Chase wrote:
>> test = u"Hello World"
>>
>> for cur,next in test:
>> print cur,next
>>
>> Ideally, this would output:
>>
>> 'H', 'e'
>> 'e', 'l'
>> 'l', 'l'
>> 'l', 'o'
>> etc...
>>
>> Of course, the for loop above isn't valid at all. I am just giving an
>> example of what I'm trying to acc
On Oct 10, 4:12 pm, Tim Chase <[EMAIL PROTECTED]> wrote:
> > test = u"Hello World"
>
> > for cur,next in test:
> > print cur,next
>
> > Ideally, this would output:
>
> > 'H', 'e'
> > 'e', 'l'
> > 'l', 'l'
> > 'l', 'o'
> > etc...
>
> > Of course, the for loop above isn't valid at all. I am just
Paul Hankin wrote:
> On Oct 10, 9:12 pm, Tim Chase <[EMAIL PROTECTED]> wrote:
>> >>> pairs = (test[i:i+2] for i in xrange(len(test)-1))
>> >>> for a,b in pairs:
>> ... print a,b
>
> for a, b in zip(test, test[1:]):
> print a, b
Very nice!
I second this solution as better than my original
Very nice solution :)
On 10/10/07, Paul Hankin <[EMAIL PROTECTED]> wrote:
>
> On Oct 10, 9:12 pm, Tim Chase <[EMAIL PROTECTED]> wrote:
> > > test = u"Hello World"
> >
> > > for cur,next in test:
> > > print cur,next
> >
> > > Ideally, this would output:
> >
> > > 'H', 'e'
> > > 'e', 'l'
> > >
All the ideas presented here are workable. I definitely have a lot of
solutions to choose from. Thanks everyone for your help. I wasn't sure if
there was some sort of language feature to naturally do this, so I had to
post on the mailing list to make sure.
--
http://mail.python.org/mailman/listinf
On Oct 10, 9:12 pm, Tim Chase <[EMAIL PROTECTED]> wrote:
> > test = u"Hello World"
>
> > for cur,next in test:
> > print cur,next
>
> > Ideally, this would output:
>
> > 'H', 'e'
> > 'e', 'l'
> > 'l', 'l'
> > 'l', 'o'
> > etc...
>
> > Of course, the for loop above isn't valid at all. I am just
On Wed, 2007-10-10 at 14:56 -0500, Robert Dailey wrote:
> Hi,
>
> I'm currently writing my own CSV parser since the built in one doesn't
> support Unicode.
Why do you think you need a CSV parser that supports unicode?
--
Carsten Haese
http://informixdb.sourceforge.net
--
http://mail.python.o
> test = u"Hello World"
>
> for cur,next in test:
> print cur,next
>
> Ideally, this would output:
>
> 'H', 'e'
> 'e', 'l'
> 'l', 'l'
> 'l', 'o'
> etc...
>
> Of course, the for loop above isn't valid at all. I am just giving an
> example of what I'm trying to accomplish. Anyone know how I c
Try this:
test = u"Hello World"
n = range(len(test))
for i in n:
cur = test[i]
try:
next = test[i+1]
except:
next = ""
print cur, next
just
On 10/10/07, Robert Dailey <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I'm currently writing my own CSV parser since the built in on
Hi,
I'm currently writing my own CSV parser since the built in one doesn't
support Unicode. I'm wondering if there's a way to iterate over the
characters in a unicode string and have access to both the 'current' and the
'next' characters each iteration. For example:
test = u"Hello World"
for cur
Exod wrote:
> Don't know if its possible in this light-weight GUI toolset, but
> can i somehow hook up into the mainloop in it, for example if i
> were to create an internet application, i would need to keep
> recieving data from within it?
That's something where you could try the Twisted framewo
"Exod" <[EMAIL PROTECTED]> wrote:
> Don't know if its possible in this light-weight GUI toolset, but can i
> somehow hook up into the mainloop in it, for example if i were to
> create an internet application, i would need to keep recieving data
> from within it?
Its possible - use the call back
Don't know if its possible in this light-weight GUI toolset, but can i
somehow hook up into the mainloop in it, for example if i were to
create an internet application, i would need to keep recieving data
from within it?
--
http://mail.python.org/mailman/listinfo/python-list
for a in range(2, len(foo)): print a
or maybe you need
for a in range(1, len(foo)): print a
?
York
bruce wrote:
> hi..
>
> basic foor/loop question..
>
> i can do:
>
> for a in foo
> print a
>
> if i want to do something like
> for a, 2, foo
>
> Except that in the OP's example foo was a sequence, not an
> integer. I think.
Yes, possibly. But then, what's "from 2 to foo"?
this way it might be
for a in [2] + foo:
print a
--
http://mail.python.org/mailman/listinfo/python-list
On 2006-07-06, Daniel Haus <[EMAIL PROTECTED]> wrote:
>> i can do:
>>
>> for a in foo
>> print a
>>
>> if i want to do something like
>> for a, 2, foo
>> print foo
>>
>> where go from 2, to foo..
> just do:
>
> for a in range(2, foo+1):
> print a
Except that in the OP's example foo
'ppreaciate the answers
duh...
-bruce
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf
Of Daniel Haus
Sent: Thursday, July 06, 2006 2:02 PM
To: python-list@python.org
Subject: Re: for loop question
just do:
for a in range(2, foo+1):
print a
just do:
for a in range(2, foo+1):
print a
range(a, b) gives [a, a+1, a+2, ..., b-2, b-1]
bruce schrieb:
> hi..
>
> basic foor/loop question..
>
> i can do:
>
> for a in foo
> print a
>
> if i want to do something like
> for a, 2, foo
> p
On 7/6/06, bruce <[EMAIL PROTECTED]> wrote:
hi..basic foor/loop question..i can do: for a in foo print aif i want to do something like for a, 2, fooprint foowhere go from 2, to foo..i can't figure out how to accomplish this...
can someone point me to how/where this is demonst
hi..
basic foor/loop question..
i can do:
for a in foo
print a
if i want to do something like
for a, 2, foo
print foo
where go from 2, to foo..
i can't figure out how to accomplish this...
can someone point me to how/where this is demonstrated...
found plenty of google fo
John W wrote:
> On 10/31/05, Steve Holden <[EMAIL PROTECTED]> wrote:
>
>>John W wrote:
>>
>>>Hello,
>>>
>>>I have a gui application where I am trying to use the asyncore module to
>>>gather data from other computers. I am able to connect, but I am getting
>>>constant handle_write_event method call
Steve,
Ar you saying that I should close the connection until I have data to
write? Or should I be using the readable and writable methods to
turn it off?
Thanks for your help, unfortunatly, I have struggled with the
documentation and getting a clear understanding of everything.
This is my firs
John W wrote:
> Hello,
>
> I have a gui application where I am trying to use the asyncore module to
> gather data from other computers. I am able to connect, but I am getting
> constant handle_write_event method calls into my application. It is
> obviously slowing down the gui processing significa
Hello,
I have a gui application where I am trying to use the asyncore module
to gather data from other computers. I am able to connect, but I
am getting constant handle_write_event method calls into my
application. It is obviously slowing down the gui processing
significantly.
My understanding
56 matches
Mail list logo