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
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
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
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
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
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
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
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
"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,
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
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
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
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
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
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
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
16 matches
Mail list logo