Ryan Strunk wrote:
Hello everyone,
I am still learning to program by writing this boxing game. I'm running into
a problem with how to organize data. My current setup looks something like
this:
"""This feels incredibly disgusting to me."""
You might find it a little less disgusting with the app
Hello everyone,
I am still learning to program by writing this boxing game. I'm running into
a problem with how to organize data. My current setup looks something like
this:
"""This feels incredibly disgusting to me."""
self.behaviors = {
'offensive_combos': {
'combo1': {
How do you display text in a Entry field and have it disappear when a
person clicks in it?
This is what I have so far:
from Tkinter import *
root = Tk()
root.title("Password Changer")
root.geometry("300x300+600+250")
label1 = Label(root, text="Enter you password: ")
label1.grid(sticky=W, row
On Thu, Sep 8, 2011 at 10:03 AM, Alan Gauld wrote:
> On 08/09/11 11:58, Richard D. Moores wrote:
>
>> I've succeeded in writing a dictionary ({}) that I can use as a small
>> personal phone book. The dictionary (very shortened and simplified)
>> looks like this in the script;
>>
>> p = {}
>>
>> p[
Steven D'Aprano wrote:
> lina wrote:
>
>> one example:
>>
>> def info(object, spacing=10, collapse=1):
>> """Print methods and docs strings.
>>
>> Take modules, class, list, dictionary, or strong."""
>> methodList = [e for e in dir(object) if callable(getattr(object, e))]
>> pro
On Thu, Sep 8, 2011 at 11:17 PM, Marc Tompkins wrote:
> On Thu, Sep 8, 2011 at 8:08 AM, lina wrote:
>>
>> On Thu, Sep 8, 2011 at 11:03 PM, Steven D'Aprano
>> wrote:
>> > lina wrote:
>> >
>> >> collapse the text means? destory the text? make it collapse?
>> >
>> > Collapse runs of spaces into a s
On Thu, Sep 8, 2011 at 8:08 AM, lina wrote:
> On Thu, Sep 8, 2011 at 11:03 PM, Steven D'Aprano
> wrote:
> > lina wrote:
> >
> >> collapse the text means? destory the text? make it collapse?
> >
> > Collapse runs of spaces into a single space.
>
> That's what I want, thanks. ^_^
>
Be aware that
On Thu, Sep 8, 2011 at 11:03 PM, Steven D'Aprano wrote:
> lina wrote:
>
>> collapse the text means? destory the text? make it collapse?
>
> Collapse runs of spaces into a single space.
That's what I want, thanks. ^_^
>
>
>
> --
> Steven
> ___
> Tutor m
lina wrote:
collapse the text means? destory the text? make it collapse?
Collapse runs of spaces into a single space.
--
Steven
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/l
<... ... >
>> collapse is a function that Mark must have described earlier in the
>> chapter you are working on. Are you using the online version? which chapter
>>
http://diveintopython.org/power_of_introspection/optional_arguments.html
>> I spoke too soon. collapse is a boolean variable that y
lina wrote:
one example:
def info(object, spacing=10, collapse=1):
"""Print methods and docs strings.
Take modules, class, list, dictionary, or strong."""
methodList = [e for e in dir(object) if callable(getattr(object, e))]
processFunc = collapse and (lambda s: " ".join(s.spli
On Thu, Sep 8, 2011 at 10:48 AM, Joel Goldstick wrote:
>
> On Thu, Sep 8, 2011 at 10:36 AM, Andre Engels wrote:
>
>> On Thu, Sep 8, 2011 at 4:16 PM, lina wrote:
>>
>>> On Thu, Sep 8, 2011 at 9:59 PM, Alan Gauld
>>> wrote:
>>> > On 08/09/11 14:02, lina wrote:
>>> >>
>>> >> Hi,
>>> >>
>>> >> I fai
On Thu, Sep 8, 2011 at 10:36 AM, Andre Engels wrote:
> On Thu, Sep 8, 2011 at 4:16 PM, lina wrote:
>
>> On Thu, Sep 8, 2011 at 9:59 PM, Alan Gauld
>> wrote:
>> > On 08/09/11 14:02, lina wrote:
>> >>
>> >> Hi,
>> >>
>> >> I failed to understand the "collpase" meaning in a string.
>> >>
>> >> can
On Thu, Sep 8, 2011 at 4:16 PM, lina wrote:
> On Thu, Sep 8, 2011 at 9:59 PM, Alan Gauld
> wrote:
> > On 08/09/11 14:02, lina wrote:
> >>
> >> Hi,
> >>
> >> I failed to understand the "collpase" meaning in a string.
> >>
> >> can someone give me a simple example?
> >
> > Can you give us some con
James Hartley wrote:
This is more a design question.
One lesson C++ programmers might learn is that throwing exceptions from
within library code is fraught with problems because the internals of
exception handling were spelled out in the C++ standard. This manifests
Do you mean "weren't spell
On Thu, Sep 8, 2011 at 9:59 PM, Alan Gauld wrote:
> On 08/09/11 14:02, lina wrote:
>>
>> Hi,
>>
>> I failed to understand the "collpase" meaning in a string.
>>
>> can someone give me a simple example?
>
> Can you give us some context?
> Its not a method of a string object so far as I can tell?
>
Thanks, this is very informative.
open some windows for me.
On Thu, Sep 8, 2011 at 9:58 PM, Alan Gauld wrote:
> On 08/09/11 13:59, lina wrote:
>>
>>
>>
>> what does the 0x7f8221a22cb0 mean here? the computer physical address.
>
> It's a unique identifier for the object which is implementation
This is more a design question.
One lesson C++ programmers might learn is that throwing exceptions from
within library code is fraught with problems because the internals of
exception handling were spelled out in the C++ standard. This manifests
itself as problems when the library was compiled wi
On 08/09/11 11:58, Richard D. Moores wrote:
I've succeeded in writing a dictionary ({}) that I can use as a small
personal phone book. The dictionary (very shortened and simplified)
looks like this in the script;
p = {}
p['bp1'] = 'xxx'
p['bp2'] = 'ooo'
p['ch'] = 'zzz'
p['me'] = 'aaa'
p['mg'] =
On 08/09/11 13:59, lina wrote:
what does the 0x7f8221a22cb0 mean here? the computer physical address.
It's a unique identifier for the object which is implementation
dependant. In practice you can consider it the memory address.
But I wouldn't try using it as an address by passing it into
On 08/09/11 14:02, lina wrote:
Hi,
I failed to understand the "collpase" meaning in a string.
can someone give me a simple example?
Can you give us some context?
Its not a method of a string object so far as I can tell?
Where did you read about it?
--
Alan G
Author of the Learn to Program we
lina wrote:
Hi,
I failed to understand the "collpase" meaning in a string.
can someone give me a simple example?
Sorry,
I don't understand what you mean. Can you give context?
--
Steven
___
Tutor maillist - Tutor@python.org
To unsubscribe
lina wrote:
Hi,
what does the 0x7f8221a22cb0 mean here? the computer physical address.
That's the ID of the list object, converted to hexadecimal.
Every object in Python gets a unique (for the life of the object) ID. In
CPython, the version you are using, that ID happens to be the memory
On Thu, Sep 8, 2011 at 04:43, Peter Otten <__pete...@web.de> wrote:
> Richard D. Moores wrote:
>
>> I've succeeded in writing a dictionary ({}) that I can use as a small
>> personal phone book. The dictionary (very shortened and simplified)
>> looks like this in the script;
>>
>> p = {}
>>
>> p['bp
On 08/09/11 11:10, John wrote:
Following up on this...
Why does pylint seem to think it is a bad idea?
Description ResourcePathLocationType
ID:W0142 plot_ts_array_split_x: Used * or **
magic tsplot.py /research.plot line 299PyLint Problem
I assume beca
On Thu, Sep 8, 2011 at 04:43, Peter Otten <__pete...@web.de> wrote:
> Richard D. Moores wrote:
>
>> I've succeeded in writing a dictionary ({}) that I can use as a small
>> personal phone book. The dictionary (very shortened and simplified)
>> looks like this in the script;
>>
>> p = {}
>>
>> p['bp
Richard D. Moores wrote:
But I'd like to put the lines of the dictionary in a text file so that
I can add key/value items to it by writing to it with another script.
If you expect human beings (yourself, or possibly even the user) to edit
the text file, then you should look at a human-writabl
Hi,
I failed to understand the "collpase" meaning in a string.
can someone give me a simple example?
Sorry,
--
Best Regards,
lina
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/l
Hi,
what does the 0x7f8221a22cb0 mean here? the computer physical address.
Thanks,
--
Best Regards,
lina
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
c smith wrote:
Also, am I correct in thinking that 3.0 will always be called 3.0 but will
change over time and will always include experimental features, while 2.x
will gradually increase the 'x' and the highest 'x' will indicate the most
current, stable release?
No, I'm afraid you are wrong.
Richard D. Moores wrote:
> I've succeeded in writing a dictionary ({}) that I can use as a small
> personal phone book. The dictionary (very shortened and simplified)
> looks like this in the script;
>
> p = {}
>
> p['bp1'] = 'xxx'
> p['bp2'] = 'ooo'
> p['ch'] = 'zzz'
> p['me'] = 'aaa'
> p['mg']
On Thu, Sep 8, 2011 at 04:36, Christian Witts wrote:
> On 2011/09/08 12:58 PM, Richard D. Moores wrote:
>
> I've succeeded in writing a dictionary ({}) that I can use as a small
> personal phone book. The dictionary (very shortened and simplified)
> looks like this in the script;
>
> p = {}
>
> p[
On 2011/09/08 12:58 PM, Richard D. Moores wrote:
I've succeeded in writing a dictionary ({}) that I can use as a small
personal phone book. The dictionary (very shortened and simplified)
looks like this in the script;
p = {}
p['bp1'] = 'xxx'
p['bp2'] = 'ooo'
p['ch'] = 'zzz'
p['me'] = 'aaa'
p['m
John wrote:
> Following up on this...
>
> Why does pylint seem to think it is a bad idea?
>
> Description ResourcePathLocationType
> ID:W0142 plot_ts_array_split_x: Used * or **
> magic tsplot.py /research.plot line 299PyLint Problem
I would guess it's a rea
I've succeeded in writing a dictionary ({}) that I can use as a small
personal phone book. The dictionary (very shortened and simplified)
looks like this in the script;
p = {}
p['bp1'] = 'xxx'
p['bp2'] = 'ooo'
p['ch'] = 'zzz'
p['me'] = 'aaa'
p['mg'] = 'vvv'
p['pu1'] = 'bbb'
p['pu2'] = 'ccc'
p['pw
Following up on this...
Why does pylint seem to think it is a bad idea?
Description ResourcePathLocationType
ID:W0142 plot_ts_array_split_x: Used * or **
magic tsplot.py /research.plot line 299PyLint Problem
Thanks,
john
On Thu, Aug 25, 2011 at 10:44 AM
On 08/09/11 04:26, c smith wrote:
I found a book at the local library that covers python but it's 2.2.
I already have been using 2.7 for basic stuff and would like to know if
it's worth my time to read this book.
That depends on your experience level and what you are looking to get
out of it.
c smith wrote:
> oh, and a question on 'pickle':
> can pickle deserialize things that were not serialized by python?
> can it convert data into a python data type regardless of it was
> originally a 'c array' or something else that python doesn't support?
As long as the file written by C is a val
38 matches
Mail list logo