darn i was hoping i could put off learning classes for a bit, but it seems that
is not the case. i have tested it a bit and it seems to be working correctly
now.
import random
class player():
hp = 10
speed = 5
attack = random.randint(0,5)
print (player.
Michael Torrie wrote:
I've always wondered if the 160 character limit or whatever it is is a
hard limit in their system, or if it's just a variable they could tweak
if they felt like it.
Isn't it for compatibility with SMS? Twitter could
probably change it, but persuading all the cell phone
net
Kris Mesenbrink wrote:
> import random
>
> def player():
> hp = 10
> speed = 5
> attack = random.randint(0,5)
>
The net resut of this function is nothing. It assigns values, then
they're lost when the function returns. A function is the wrong way to
deal with these three names.
> de
On Mon, Aug 12, 2013 at 12:35 AM, Kris Mesenbrink
wrote:
> the idea was to store variables for later use, but you are correct i don't
> understand functions or if that is even the best way to do it. i guess i'd
> want to be able to call the HP and ATTACK variables of player for when the
> battl
On 11Aug2013 13:47, Krishnan Shankar wrote:
| 1. How to acknowledge a reply? Should i put a one to one mail or send it to
| the mailing list itself?
Generally, a personal acknowledgement email is not necessary; usually
one would reply to the list; by citing the previous message author
(as I have
the idea was to store variables for later use, but you are correct i don't
understand functions or if that is even the best way to do it. i guess i'd want
to be able to call the HP and ATTACK variables of player for when the battle
gets called. i would then use the variables in battle to figure
On Friday, August 9, 2013 1:31:43 AM UTC-5, Peter Otten wrote:
> I see I have to fix it myself then...
Sorry man, I think in my excitement of seeing the first of your examples to
work, that I missed the second example, only seeing your comments about it at
the end of the post. I didn't expect s
I thought I responded to this. Oh well
On Friday, August 9, 2013 12:47:43 AM UTC-5, Benjamin Kaplan wrote:
> Are you using Python.NET or IronPython? IronPython is reasonably well
>
> supported, and it looks like there's a patch you can use to get PyLint
>
> working on it (see
>
> http://mail.
On Sun, Aug 11, 2013 at 11:33 PM, Kris Mesenbrink
wrote:
> import random
>
> def player():
> hp = 10
> speed = 5
> attack = random.randint(0,5)
# add the following line to return attack value:
return attack
>
> def monster ():
> hp = 10
> speed = 4
>
> def battle
import random
def player():
hp = 10
speed = 5
attack = random.randint(0,5)
def monster ():
hp = 10
speed = 4
def battle(player):
print ("a wild mosnter appered!")
print ("would you like to battle?")
answer = input()
if answer == ("yes"):
return player(
Hi,
I don't know much about Python code. Where is the connection made, eg
config file - where can I find it?
Our SQLITe database is currently 9GB and we have a table that contains
7GB of BLOB type. I think the table cannot handle any more insert of
BLOB hence I want to change it to SQL database -
On 08/11/2013 09:34 AM, MRAB wrote:
> If twitter counts characters, not codepoints, you could then ask
> whether it passes the codepoints through as given. If it does, then you
> experiment to see how much data you could send encoded as a sequence of
> combining codepoints. (You might want to check
On Sun, 11 Aug 2013 18:58:25 +0200, Xavi wrote:
> Respect to the "Names starting and ending with double-underscore". I
> don't know how to get the name of a classe without them.
> obj.__class__.__name__
I didn't say you should *never* use them, but most of the time, you don't.
However type(obj).
Thanks to all for your answers,
I guess it is more flexible with isinstance (the duck test :)
I'm going to change the type checks.
Respect to the "Names starting and ending with double-underscore".
I don't know how to get the name of a classe without them.
obj.__class__.__name__
Thanks.
--
Xavi
> This is a hard question to answer, because your code snippet isn't
> clearly extensible to the case where you have ten attributes. What's the
> rule for combining them? If instance A has five attributes less than
> those of instance B, and five attributes greater than those of instance
> B, which
On 11/08/13 15:02, Roy Smith wrote:
In article ,
Skip Montanaro wrote:
See the Rationale of PEP 450 for more reasons why “install NumPy� is not
a feasible solution for many use cases, and why having ‘statistics’ as a
pure-Python, standard-library package is desirable.
I read that b
On 11/08/2013 10:54, Joshua Landau wrote:
On 11 August 2013 07:24, Chris Angelico wrote:
On Sun, Aug 11, 2013 at 7:17 AM, Joshua Landau wrote:
Given tweet = b"caf\x65\xCC\x81".decode():
>>> tweet
'café'
But:
>>> len(tweet)
5
You're now looking at the difference between gl
In article ,
Skip Montanaro wrote:
> > See the Rationale of PEP 450 for more reasons why âinstall NumPyâ is not
> > a feasible solution for many use cases, and why having âstatisticsâ as a
> > pure-Python, standard-library package is desirable.
>
> I read that before posting but am not
Krishnan Shankar wrote:
> Hi Friends,
Hi, and welcome to the mailing list.
> I figured out that the best way is to talk to the experts and so i
> subscribed to this mailing list. It will be cool if anybody can help me out
> by telling the etiquette of this mailing list, like
>
> 1. How to
On Sun, 11 Aug 2013 06:50:36 -0500, Skip Montanaro wrote:
>> See the Rationale of PEP 450 for more reasons why “install NumPy” is
>> not a feasible solution for many use cases, and why having ‘statistics’
>> as a pure-Python, standard-library package is desirable.
>
> I read that before posting b
In article <52074b43$0$3$c3e8da3$54964...@news.astraweb.com>,
Steven D'Aprano wrote:
> On Sun, 11 Aug 2013 03:33:52 +0100, Chris Angelico wrote:
>
> > Next thing to do is split it into more lines. Why is all that in a
> > single line?
>
> The only good excuse for writing multiple statement
On 11 August 2013 13:51, wrote:
> Le dimanche 11 août 2013 11:09:44 UTC+2, Steven D'Aprano a écrit :
>> On Sun, 11 Aug 2013 07:17:42 +0100, Joshua Landau wrote:
>>
>> The reason some accented letters have single code point forms is to
>> support legacy charsets; ...
>
> No.
>
> jmf
>
> PS Unicode
Le dimanche 11 août 2013 11:09:44 UTC+2, Steven D'Aprano a écrit :
> On Sun, 11 Aug 2013 07:17:42 +0100, Joshua Landau wrote:
>
>
>
>
> The reason some accented letters have single code point forms is to
>
> support legacy charsets; ...
No.
jmf
PS Unicode normalization is failing expectedl
On Sun, Aug 11, 2013 at 12:50 PM, Skip Montanaro wrote:
> > See the Rationale of PEP 450 for more reasons why “install NumPy” is not
> > a feasible solution for many use cases, and why having ‘statistics’ as a
> > pure-Python, standard-library package is desirable.
>
> I read that before posting
Hi all,
I wrote a replacement for urlview to properly extract URLs from emails.
You can find the first draft here:
https://github.com/the-isz/pyurlview
When I call it with an email file passed to the '-f' argument, it does
pretty much what I want already. However, I intend to use it in mutt,
w
On 11 August 2013 12:14, Steven D'Aprano
wrote:
> On Sun, 11 Aug 2013 10:44:40 +0100, Joshua Landau wrote:
>
>> On 11 August 2013 10:09, Steven D'Aprano
>> wrote:
>>> The reason some accented letters have single code point forms is to
>>> support legacy charsets; the reason some only exist as com
> See the Rationale of PEP 450 for more reasons why “install NumPy” is not
> a feasible solution for many use cases, and why having ‘statistics’ as a
> pure-Python, standard-library package is desirable.
I read that before posting but am not sure I agree. I don't see the
screaming need for this pa
On Sun, Aug 11, 2013 at 12:14 PM, Steven D'Aprano
wrote:
> Consider a single character. It can have 0 to 5 accents, in any
> combination. Order doesn't matter, and there are no duplicates, so there
> are:
>
> 0 accent: take 0 from 5 = 1 combination;
> 1 accent: take 1 from 5 = 5 combinations;
> 2
On Sun, 11 Aug 2013 10:44:40 +0100, Joshua Landau wrote:
> On 11 August 2013 10:09, Steven D'Aprano
> wrote:
>> The reason some accented letters have single code point forms is to
>> support legacy charsets; the reason some only exist as combining
>> characters is due to the combinational explosi
On 11 August 2013 09:28, Steven D'Aprano
wrote:
> into more lines. Why is all that in a
>> single line?
>
> The only good excuse for writing multiple statements on a single line
> separated by semi-colons is if the Enter key on your keyboard is broken.
That's not a good excuse.
It *is* a good ex
On 11 August 2013 09:57, Chris Angelico wrote:
> On Thu, Aug 8, 2013 at 8:20 AM, sagar varule wrote:
>> stdin, stdout, stderr = client.exec_command(bv_cmd)
>> for line in stderr.readlines():
>> print line
>> for line in stdout.readlines():
>>
On 11 August 2013 07:24, Chris Angelico wrote:
> On Sun, Aug 11, 2013 at 7:17 AM, Joshua Landau wrote:
>> Given tweet = b"caf\x65\xCC\x81".decode():
>>
>> >>> tweet
>> 'café'
>>
>> But:
>>
>> >>> len(tweet)
>> 5
>
> You're now looking at the difference between glyphs and combining
On 11 August 2013 10:09, Steven D'Aprano
wrote:
> The reason some accented letters have single code point forms is to
> support legacy charsets; the reason some only exist as combining
> characters is due to the combinational explosion. Some languages allow
> you to add up to five or six different
On Sun, Aug 11, 2013 at 9:17 AM, Krishnan Shankar
wrote:
> I figured out that the best way is to talk to the experts and so i
> subscribed to this mailing list. It will be cool if anybody can help me out
> by telling the etiquette of this mailing list, like
Hi! Welcome!
> 1. How to acknowledge a
On Sun, 11 Aug 2013 07:17:42 +0100, Joshua Landau wrote:
> Basically, I think Twitter's broken.
Oh, in about a million ways, but apparently people like it :-(
> For my full discusion on the matter, see:
> http://www.reddit.com/r/learnpython/comments/1k2yrn/
help_with_len_and_input_function_33/c
Hi Friends,
I would like to introduce myself.
I am Krishnan from Chennai, India. I am using python for 2 years for Test
Automation. I am fascinated by the language and its capabilities. I am
willing to move into Python development and I am doing the best i can to
learn the language completely and
On Sun, Aug 11, 2013 at 7:17 AM, Joshua Landau wrote:
> Given tweet = b"caf\x65\xCC\x81".decode():
>
> >>> tweet
> 'café'
>
> But:
>
> >>> len(tweet)
> 5
You're now looking at the difference between glyphs and combining
characters. Twitter counts combining characters, so when you
On Thu, Aug 8, 2013 at 8:20 AM, sagar varule wrote:
> stdin, stdout, stderr = client.exec_command(bv_cmd)
> for line in stderr.readlines():
> print line
> for line in stdout.readlines():
> print line
> But problem here is client.exec_command
On Sat, 10 Aug 2013 16:42:22 -0400, Roy Smith wrote:
> In article ,
> Dennis Lee Bieber wrote:
>
>> Because id(n) is not giving you the address of the NAME. It is giving
>> you the address of the "10"
>
> Actually, it is giving you the id of the int(10) object. Maybe it's an
> address, maybe
On Sun, 11 Aug 2013 03:33:52 +0100, Chris Angelico wrote:
> Next thing to do is split it into more lines. Why is all that in a
> single line?
The only good excuse for writing multiple statements on a single line
separated by semi-colons is if the Enter key on your keyboard is broken.
:-)
--
On Sat, 10 Aug 2013 21:41:00 -0600, Jason Friedman wrote:
> class my_class:
> def __init__(self, attr1, attr2):
> self.attr1 = attr1 #string
> self.attr2 = attr2 #string
> def __lt__(self, other):
> if self.attr1 < other.attr1:
> return True
> el
On Sat, 10 Aug 2013 20:21:46 -0700, Gary Herron wrote:
> Our knee-jerk reaction to beginners using "is" should be:
> Don't do that! You almost certainly want "==". Consider "is" an
> advanced topic.
>
> Then you can spend as much time as you want trying to coach them into an
> understandi
On Sat, 10 Aug 2013 17:42:21 -0700, Gary Herron wrote:
> But for each of your examples, using "==" is equivalent to using "is".
> Each of
> if something == None
> if device == _not passed
> if device != None
> would all work as expected. In none of those cases is "is" actually
> ne
On 11 August 2013 08:02, sagar varule wrote:
> On Sunday, August 11, 2013 11:28:31 AM UTC+5:30, Joshua Landau wrote:
>> You also didn't say what didn't work with the first block of code.
>
> Submitting Command to Interactive Shell through code did not work.
In what way didn't it work? What's the
On Sunday, August 11, 2013 11:28:31 AM UTC+5:30, Joshua Landau wrote:
> On 11 August 2013 06:18, sagar varule wrote:
>
> > Can any one comment on this..
>
>
>
> If you don't get replies here it's probably because no-one knows
>
> Paramiko. I suggest posting elsewhere to see if there are any P
45 matches
Mail list logo