Re: [Tutor] Simple PassGen

2009-02-11 Thread python
6:11 +1100 Subject: Re: [Tutor] Simple PassGen On Wed, Feb 11, 2009 at 2:26 AM, <[1]pyt...@bdurham.com> wrote: > Are you sure it isn't python 3.x you're playing with? The reason why simple print function "works" in python 2.x is because of a syntactical coinciden

Re: [Tutor] Simple PassGen

2009-02-11 Thread Lie Ryan
On Wed, Feb 11, 2009 at 2:26 AM, wrote: > > > Are you sure it isn't python 3.x you're playing with? The reason why > simple print function "works" in python 2.x is because of a syntactical > coincidence, it is still a 100% statement. > > Yes, I'm sure :) I restarted IDLE and pasted my session out

Re: [Tutor] Simple PassGen

2009-02-10 Thread python
ments. Malcolm - Original message - From: "spir" To: tutor@python.org Date: Tue, 10 Feb 2009 16:35:26 +0100 Subject: Re: [Tutor] Simple PassGen Le Tue, 10 Feb 2009 10:26:54 -0500, pyt...@bdurham.com a écrit : > IDLE 2.6.1 > >>> from __future__ import print_f

Re: [Tutor] Simple PassGen

2009-02-10 Thread spir
Le Tue, 10 Feb 2009 10:26:54 -0500, pyt...@bdurham.com a écrit : > IDLE 2.6.1 > >>> from __future__ import print_function > >>> print( 3, 4 ) > 3 4 lol! -- la vida e estranya ___ Tutor maillist - Tutor@python.org http://mail.python.org/ma

Re: [Tutor] Simple PassGen

2009-02-10 Thread python
from the Internet. IDLE 2.6.1 >>> from __future__ import print_function >>> print( 3, 4 ) 3 4 >>> Malcolm ----- Original message - From: "Lie Ryan" To: tutor@python.o

Re: [Tutor] Simple PassGen

2009-02-10 Thread Lie Ryan
On Tue, 10 Feb 2009 09:43:18 -0500, python wrote: > Kent, > >> Except they are not equivalent when you want to print more than one >> thing. ... >> Python 2.6: >> In [1]: print(3, 4) >> (3, 4) > > I'm running Python 2.6.1 (32-bit) on Windows XP. > > I don't get the tuple-like output that you ge

Re: [Tutor] Simple PassGen

2009-02-10 Thread python
Kent, > Except they are not equivalent when you want to print more than one thing. > ... > Python 2.6: > In [1]: print(3, 4) > (3, 4) I'm running Python 2.6.1 (32-bit) on Windows XP. I don't get the tuple-like output that you get. Here's what I get: >>> print( 3, 4 ) 3 4 Malcolm

Re: [Tutor] Simple PassGen

2009-02-09 Thread Kent Johnson
On Mon, Feb 9, 2009 at 5:32 PM, Marc Tompkins wrote: > Don't forget - the "print" statement is going away in 3.0, and you really > should get into the habit of using the print() function instead for new > code. IIRC, print() does NOT support suppressing the newline, but IMNRC (I > might not remem

Re: [Tutor] Simple PassGen

2009-02-09 Thread Alan Gauld
"Marc Tompkins" wrote Don't forget - the "print" statement is going away in 3.0, and you really should get into the habit of using the print() function instead for new code. IIRC, print() does NOT support suppressing the newline, From the v3 Whats New document: Old: print x,

Re: [Tutor] Simple PassGen

2009-02-09 Thread Sander Sweers
On Mon, Feb 9, 2009 at 23:32, Marc Tompkins wrote: > Don't forget - the "print" statement is going away in 3.0, and you really > should get into the habit of using the print() function instead for new > code. Why? Python's print statement is not going away in the 2.x series which will be supporte

Re: [Tutor] Simple PassGen

2009-02-09 Thread Marc Tompkins
Don't forget - the "print" statement is going away in 3.0, and you really should get into the habit of using the print() function instead for new code. IIRC, print() does NOT support suppressing the newline, but IMNRC (I might not remember correctly.) --- www.fsrtechnologies.com On Feb 9, 2009

Re: [Tutor] Simple PassGen

2009-02-09 Thread spir
Le Mon, 9 Feb 2009 13:45:04 -0800, Marc Tompkins a écrit : > The print() function adds a newline. Try this instead - above your loop, > create an empty string; in place of yor print(), append to the string; at > the end, print the whole string. > > I'd demonstrate but I'm typing this from my ph

Re: [Tutor] Simple PassGen

2009-02-09 Thread Kayvan Sarikhani
On Mon, Feb 9, 2009 at 4:53 PM, W W wrote: > It's actually not the range but the print function. Print automatically > prints a newline. If you were to create a string of what print does: > > print 'foo' > > 'foo\n' > > However, adding a trailing comma will eliminate that. It will still add a > t

Re: [Tutor] Simple PassGen

2009-02-09 Thread Kayvan Sarikhani
Ah, I see what you mean...this does seem to work: #!/usr/bin/python import random, string pool = string.digits + string.letters + string.punctuation outstr = '' for i in range(8): outstr += random.choice(pool) print outstr Thanks very much! K On Mon, Feb 9, 2009 at 4:45 PM, Marc Tompkin

Re: [Tutor] Simple PassGen

2009-02-09 Thread W W
On Mon, Feb 9, 2009 at 3:35 PM, Kayvan Sarikhani wrote: > Hello Tutors, > I thought that maybe adding "print random.choice(pool).strip()" > might work but not having any luck with that. Is the output this way, simply > because of the nature of the range, or can anyone point my in the right > dir

Re: [Tutor] Simple PassGen

2009-02-09 Thread Marc Tompkins
The print() function adds a newline. Try this instead - above your loop, create an empty string; in place of yor print(), append to the string; at the end, print the whole string. I'd demonstrate but I'm typing this from my phone. --- www.fsrtechnologies.com On Feb 9, 2009 1:35 PM, "Kayvan Sar