On 04/07/2015 10:16 PM, boB Stepp wrote:
Despite Mark's warning, I feel I must see if I understand what is going on here.
Switching to Py 3.4 since I am now at home:
Python 3.4.3 (v3.4.3:9b73f1c3e601, Feb 24 2015, 22:44:40) [MSC v.1600
64 bit (AMD64)] on win32
Type "copyright", "credits" or "l
On 07Apr2015 21:16, boB Stepp wrote:
Despite Mark's warning, I feel I must see if I understand what is going on here.
Switching to Py 3.4 since I am now at home:
Python 3.4.3 (v3.4.3:9b73f1c3e601, Feb 24 2015, 22:44:40) [MSC v.1600
64 bit (AMD64)] on win32
Type "copyright", "credits" or "licen
On Mon, Apr 6, 2015 at 2:42 PM, Dave Angel wrote:
> On 04/06/2015 03:20 PM, Emile van Sebille wrote:
>>
>> On 4/6/2015 7:54 AM, boB Stepp wrote:
>>>
[...]
>>
>> Maybe this form helps:
>>
>> Python 2.7.6 (default, Mar 22 2014, 22:59:56)
>> [GCC 4.8.2] on linux2
>> Type "help", "copyright", "credi
On Mon, Apr 6, 2015 at 12:54 PM, Dave Angel wrote:
> On 04/06/2015 12:43 PM, boB Stepp wrote:
>
>>
>> I was breaking down longer functions into smaller ones. Along the way
>> I noticed I was passing an entire dictionary from one function to
>> another. I only needed to pass one particular value, n
On 4/6/2015 12:42 PM, Dave Angel wrote:
On 04/06/2015 03:20 PM, Emile van Sebille wrote:
Python 2.7.6 (default, Mar 22 2014, 22:59:56)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> d = {'a':'123'}
>>> def func(s=d['a']):
... print s
...
>
On 06/04/2015 20:20, Emile van Sebille wrote:
On 4/6/2015 7:54 AM, boB Stepp wrote:
Python 2.7.8 (default, Jun 30 2014, 16:03:49) [MSC v.1500 32 bit
(Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
d = {'n': 'Print me!'}
d
{'n': 'Print me!'}
d['n']
'Print me
On 04/06/2015 03:20 PM, Emile van Sebille wrote:
On 4/6/2015 7:54 AM, boB Stepp wrote:
Python 2.7.8 (default, Jun 30 2014, 16:03:49) [MSC v.1500 32 bit
(Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
d = {'n': 'Print me!'}
d
{'n': 'Print me!'}
d['n']
'Print
On 4/6/2015 7:54 AM, boB Stepp wrote:
Python 2.7.8 (default, Jun 30 2014, 16:03:49) [MSC v.1500 32 bit
(Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
d = {'n': 'Print me!'}
d
{'n': 'Print me!'}
d['n']
'Print me!'
def func(d['n']):
SyntaxError: invalid syn
On 04/06/2015 12:43 PM, boB Stepp wrote:
I was breaking down longer functions into smaller ones. Along the way
I noticed I was passing an entire dictionary from one function to
another. I only needed to pass one particular value, not the whole
dictionary, so that is how I got into the issue I a
Thanks, Joel! Thanks, Dave!
On Mon, Apr 6, 2015 at 11:31 AM, Dave Angel wrote:
[...]
> Now, it's possible that what you're trying to do is something that can be
> accomplished some other way. So please elaborate on your purpose in using
> the syntax you did. Or supply a small program that sho
On 04/06/2015 10:54 AM, boB Stepp wrote:
Python 2.7.8 (default, Jun 30 2014, 16:03:49) [MSC v.1500 32 bit
(Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
d = {'n': 'Print me!'}
d
{'n': 'Print me!'}
d['n']
'Print me!'
def func(d['n']):
SyntaxError: invalid
On Mon, Apr 6, 2015 at 11:20 AM, Joel Goldstick
wrote:
> On Mon, Apr 6, 2015 at 10:54 AM, boB Stepp wrote:
>> Python 2.7.8 (default, Jun 30 2014, 16:03:49) [MSC v.1500 32 bit
>> (Intel)] on win32
>> Type "copyright", "credits" or "license()" for more information.
> d = {'n': 'Print me!'}
On Mon, Apr 6, 2015 at 10:54 AM, boB Stepp wrote:
> Python 2.7.8 (default, Jun 30 2014, 16:03:49) [MSC v.1500 32 bit
> (Intel)] on win32
> Type "copyright", "credits" or "license()" for more information.
d = {'n': 'Print me!'}
d
> {'n': 'Print me!'}
d['n']
> 'Print me!'
def fun
Python 2.7.8 (default, Jun 30 2014, 16:03:49) [MSC v.1500 32 bit
(Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> d = {'n': 'Print me!'}
>>> d
{'n': 'Print me!'}
>>> d['n']
'Print me!'
>>> def func(d['n']):
SyntaxError: invalid syntax
>>> def func(d):
p
On Wed, Feb 4, 2015 at 6:12 PM, Antonio Zagheni
wrote:
> Hi there,
>
> I am a begginer in python and I'm trying to learn something about Tkinter.
>
> I did a game (the code is below) using Tkinter were two players have to fill
> a row, a column or a diagonal with either 'X' or 'O'.
> When it happ
On 05/02/15 00:12, Antonio Zagheni wrote:
from Tkinter import *
...
jogador = 1
rodada = 1
fim = False
Notice that fim is declared here as a global variable
def analise():
global jogador, rodada
But you do not include fim here
print flag_botaoA1, flag_botaoA2, flag_botaoA3
Hi there,
I am a begginer in python and I'm trying to learn something about Tkinter.
I did a game (the code is below) using Tkinter were two players have to fill a
row, a column or a diagonal with either 'X' or 'O'.
When it happens, the code was supposed to recognize the winner ('Jogador 1 or 2
Got it - it needs the blank line to signal that code block has ended.
Thanks
On Mar 22, 2007, at 3:05 PM, Jason Massey wrote:
In the interpreter this doesn't work:
>>> f = open(r"c:\python24\image.dat")
>>> line = f.readline()
>>> while line:
... line = f.readline()
... f.close()
Traceback
On Thu, 22 Mar 2007, Jason Massey wrote:
> In the interpreter this doesn't work:
>
> >>> f = open(r"c:\python24\image.dat")
> >>> line = f.readline()
> >>> while line:
> ... line = f.readline()
> ... f.close()
> Traceback ( File "", line 3
> f.close()
> ^
> SyntaxError: invalid synta
In the interpreter this doesn't work:
f = open(r"c:\python24\image.dat")
line = f.readline()
while line:
... line = f.readline()
... f.close()
Traceback ( File "", line 3
f.close()
^
SyntaxError: invalid syntax
But this does:
f = open(r"c:\python24\image.dat")
line = f.readline()
Jay Mutter III wrote:
> Why is it that when I run the following interactively
>
> f = open('Patents-1920.txt')
> line = f.readline()
> while line:
> print line,
> line = f.readline()
> f.close()
>
> I get an error message
>
> File "", line 4
> f.close()
> ^
> SyntaxError: inv
Why is it that when I run the following interactively
f = open('Patents-1920.txt')
line = f.readline()
while line:
print line,
line = f.readline()
f.close()
I get an error message
File "", line 4
f.close()
^
SyntaxError: invalid syntax
but if i run it in a script there is no
22 matches
Mail list logo