On 05/15/2013 05:53 PM, Andrew Bradley wrote:
I apologize if these questions are too rudimentary--I am trying to wrap my head
around how this
language works in a more general sense so I can start applying it to things.
-Andrew
Check out the book "Making Games with Python & Pygame" at
http:/
On 05/24/2013 03:53 PM, Thomas Murphy wrote:
Here's where I got to:
raw_address = "cookielover93 TheGermanHatesSaurkraut WhatsThatBoy932834"
address_library = [raw_address.split()]
print address_library
for address in address_library:
final_address = "@" + str(address)
print final_addr
On 06/03/2013 08:39 PM, eschneide...@comcast.net wrote:
Is there a more efficient way of doing this? Any help is gratly appreciated.
import random
def partdeux():
print('''A man lunges at you with a knife!
Do you DUCK or PARRY?''')
option1=('duck')
option2=('parry')
optionsi
On 06/04/2013 08:21 AM, mstagliamonte wrote:
Hi everyone,
I am a beginner in python and trying to find my way through... :)
I am writing a script to get numbers from the headers of a text file.
If the header is something like:
h01 = ('>scaffold_1')
I just use:
h01.lstrip('>scaffold_')
and this
On 06/07/2013 09:28 AM, Eam onn wrote:
On Friday, June 7, 2013 5:21:36 PM UTC+1, Ian wrote:
On Fri, Jun 7, 2013 at 9:53 AM, wrote:
Do you know of any tutorial for PyGame? Preferably a video tutorial but any
tutorial at all is fine! I can't seem to find any, even on pygame.org!!!
Check
On 06/09/2013 03:37 AM, Νικόλαος Κούρας wrote:
I mean utf-8 could use 1 byte for storing the 1st 256 characters. I meant up to
256, not above 256.
NO!!
0 - 127, yes.
128 - 255 -> one byte of a multibyte code.
That's why the decode fails, it sees it as incomplete data so it can't do
anythi
On 06/10/2013 01:11 AM, Νικόλαος Κούρας wrote:
Τη Δευτέρα, 10 Ιουνίου 2013 10:51:34 π.μ. UTC+3, ο χρήστης Larry Hudson έγραψε:
I mean utf-8 could use 1 byte for storing the 1st 256 characters. I meant up to
256, not above 256.
0 - 127, yes.
128 - 255 -> one byte of a multibyte code.
On 06/10/2013 06:56 AM, Νικόλαος Κούρας wrote:
ps. i tried to post a reply to the thread i opend via thunderbird mail
client, but not as a reply to somne other reply but as new mail send to
python list.
because of that a new thread will be opened. How can i tell thunderbird
to reply to the orig
On 06/10/2013 01:29 AM, Νικόλαος Κούρας wrote:
Trying this:
months = { 'Ιανουάριος':1, 'Φεβρουάριος':2, 'Μάρτιος':3, 'Απρίλιος':4,
'Μάϊος':5, 'Ιούνιος':6, \
'Ιούλιος':7, 'Αύγουστος':8, 'Σεπτέμβριος':9, 'Οκτώβριος':10,
'Νοέμβριος':11, 'Δεκέμβριος':12 }
for key in sorted( months.valu
On 06/11/2013 08:47 AM, Eam onn wrote:
Is there a PyGame tutorial out there? I've seen TheNewBoston's tuts, but he
didn't finish his. MetalX100 did a VERY good tutorial. I've been having trouble
with some player movement because he isn't moving smoothly, he jumps. If I add
5 pixels to his X po
On 06/11/2013 01:09 PM, Νικόλαος Κούρας wrote:
Τη Τρίτη, 11 Ιουνίου 2013 10:52:02 π.μ. UTC+3, ο χρήστης Larry Hudson έγραψε:
On 06/10/2013 06:56 AM, Νικόλαος Κούρας wrote:
i think your suggestions works only if you have a mail handy in TB and you hit
follow-up what if you dont have the mail
On 06/12/2013 01:20 AM, Larry Hudson wrote:
On 06/11/2013 01:09 PM, Νικόλαος Κούρας wrote:
Τη Τρίτη, 11 Ιουνίου 2013 10:52:02 π.μ. UTC+3, ο χρήστης Larry Hudson έγραψε:
On 06/10/2013 06:56 AM, Νικόλαος Κούρας wrote:
I forgot to specify I'm talking about using Thunderbird Newsgroups, no
On 06/14/2013 09:56 AM, Nick the Gr33k wrote:
On 14/6/2013 7:31 μμ, Steven D'Aprano wrote:
On Fri, 14 Jun 2013 16:07:56 +0300, Nick the Gr33k wrote:
Returning True is the same thing as returning a variable's truthy value?
NO! 'True' and 'False' are the two values of the boolean type. The
On 06/15/2013 03:10 PM, alex23 wrote:
On Jun 16, 7:29 am, lucabrasi...@gmail.com wrote:
Here's a report of a similar issue with Blender (which also provides a
local install of Python under Windows):
http://translate.google.com.au/translate?hl=en&sl=fr&u=http://blenderclan.tuxfamily.org/html/m
On 06/17/2013 08:50 AM, Simpleton wrote:
On 17/6/2013 2:58 μμ, Michael Torrie wrote:
a = 5
b = a
a <---> memory address
b <---> memory address
I like to think a and b as references to the same memory address
Not quite: a and b _are_ memory addresses, At the same time, a and b are references
On 06/25/2013 05:05 PM, willlewis...@gmail.com wrote:
thanks man you answered my questions very clear, btw do you know of a place
where I can learn python I know some tutorials but are 2. something and I'm
using 3.3 and I've been told they are different.
One fairly obvious place is on the pyt
On 07/17/2012 04:24 AM, Lipska the Kat wrote:
...
Thanks for your time and I'll try to do a bit better with the reading thing
before asking more
questions... not sure about this obsession with code indentation though :-|
I think it's inaccurate to call this indentation an obsession, it's part
On 07/23/2012 06:22 AM, Dave Angel wrote:
On 07/23/2012 09:06 AM, Chris Angelico wrote:
On Mon, Jul 23, 2012 at 10:55 PM, Roy Smith wrote:
Some day, we're going to have programming languages that take advantage
of the full unicode character set. Right now, we're working in ASCII
and creating
On 08/06/2012 11:11 AM, Emile van Sebille wrote:
for i in range(N,N+100):
for j in range(M,M+100):
do_something(i % 100 ,j % 100)
Emile
How about...
for i in range(100):
for j in range(100):
do_something((i + N) % 100, (j + M) % 100)
-=- La
On 08/10/2012 01:28 PM, Chuck wrote:
Thanks for the help guys! I finally got it working. Shouldn't I technically
call quiz() through the constructor, though? Otherwise, the constructor is
pointless. I just put in pass for now.
For this particular example, frankly, a class doesn't make sen
On 03/16/2012 05:45 AM, Ray Song wrote:
I confess i've indulged in Haskell and found
f a
more readable than
f(a)
And why aren't functions curried (partially applied function is another
function which takes the rest arguments) by default?
Thanks in advance for any suggestions.
--
Ra
On 06/07/2011 03:01 PM, harrismh777 wrote:
Ethan Furman wrote:
--> print("Testing %0*i" % (width, 1))
The '*' acts as a place holder for the width argument.
very nice...
It works for precision as well as width.
wid = 10
prec = 3
num = 123.456789
print "%0*.*f" % (wid, prec, num)
gives
On 06/08/2011 01:09 PM, Cathy James wrote:
I am almost there, but I need a little help:
I would like to
a) print my dogs in the format index. name: breed as follows:
0. Mimi:Poodle
1.Sunny: Beagle
2. Bunny: German Shepard
I am getting
(0, ('Mimi', 'Poodle')) . Mimi : Poodle instead-what have
On 06/08/2011 11:59 PM, Larry Hudson wrote:
On 06/08/2011 01:09 PM, Cathy James wrote:
I am almost there, but I need a little help:
I would like to
...
Here's one possible replacement. There are many other approaches as well.
(This leaves the individual dogs as a (name, breed) tupl
On 11/15/2013 07:02 AM, Grant Edwards wrote:
On 2013-11-15, Paul Rudin wrote:
Steven D'Aprano writes:
A few minor errors is one thing, but when you see people whose posts are
full of error after error and an apparent inability to get English syntax
right, you have to wonder how on earth they
On 11/20/2013 11:34 AM, Kay Y. Jheallee wrote:
On 13.Nov.20.Wed 14:02, Steven D'Aprano wrote:> Hi Kay,
>
> You emailed me off-list, but your email address is bouncing or invalid,
> so I have no way to email you back.
So THAT's where it went! Sorry about that...yes, it WAS meant for the group
On 11/24/2013 07:20 PM, Dave Angel wrote:
Are you really trying to protect against yourself accidentally invoking it or
someone
maliciously doing it?
I would probably give scrpt2 an obnoxious name like htrerttcdrrthyyh.py or put
it in an obscure
directory. But if you explain the rationale we m
On 12/24/2013 08:07 AM, vanommen.rob...@gmail.com wrote:
[snip...]
x = 1
while x <> 10
var x = x
x = x + 1
[snip...]
Besides the other valid answers you have received, I want to add one other minor nit. The
symbol <> for unequal is deprecated -- it's better to use != instead.
On 01/02/2014 08:31 AM, raj kumar wrote:
Hello, I am beginner to python and i am writing following code
from pytesser import *
and i am getting an error as follow
Traceback (most recent call last):
File "", line 1, in
File "C:\Python33\lib\site-packages\pytesser.py", line 61
print
On 01/03/2014 08:03 PM, Sean Murphy wrote:
Hello all.
This is a newly question. But I wish to understand why the below code is
providing different results.
import os, sys
if len(sys.argv) > 2:
filenames = sys.argv[1:]
else
print ("no parameters provided\n")
sys.edit()
for filename
On 01/03/2014 10:32 PM, Sean Murphy wrote:
Hi everyone.
[snip]
The 2nd part of my original question still stands. I will expand upon this a bit more to
give more context. I want to print from the beginning of the paragraph to the end. Each
paragraph ends with "\n\n\n".
If I use "\n\n\n" in l
On 01/14/2014 02:03 AM, Igor Korot wrote:
[snip]
C:\Documents and Settings\Igor.FORDANWORK\Desktop\winpdb>python
Python 2.7.5 (default, May 15 2013, 22:43:36) [MSC v.1500 32 bit
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
test = "I,like,my,chocolate"
On 02/02/2014 05:12 PM, David Hutto wrote:
A little OT, but these might peak your interest for this:
Also a little OT, but the word you're looking for is spelled pique. ;-)
(Although, it IS pronounced 'peak'.)
-=- Larry -=-
--
https://mail.python.org/mailman/listinfo/python-list
On 02/07/2014 11:06 PM, Igor Korot wrote:
Hi, ALL,
I'm trying to do a very easy task: sort python dictionary by value
where value is a datetime object.
When trying to do that in Python shell everthing works as expected.
C:\Documents and Settings\Igor.FORDANWORK>python
Python 2.7.5 (default, May
On 02/08/2014 05:21 PM, Scott W Dunning wrote:
I figured it out! Thanks Chris! Taking it one step at a time with the five
digit number really helped me to see how to break it all up! Are you a
teacher? I appreciate the help and the patients! I like that you don’t just
give me the answer t
On 10/22/2014 05:02 PM, Seymore4Head wrote:
On Thu, 23 Oct 2014 00:44:01 +0100, Mark Lawrence
wrote:
(This is in reference to the line: if y in str(range(10)):)
I suggest you try str(range(10)) from the interactive prompt and see
exactly what you get, as it's nothing like what you expect
On 10/22/2014 03:30 PM, Seymore4Head wrote:
On Wed, 22 Oct 2014 16:30:37 -0400, Seymore4Head
wrote:
One more question.
if y in str(range(10)
Why doesn't that work.
I commented it out and just did it "long hand"
def nametonumber(name):
lst=[]
nx=[]
for x in (name):
lst.a
On 10/23/2014 01:44 PM, Seymore4Head wrote:
I tried to make range(10) work in Python 3 by:
if int(y) in range(10):
name.append(str(y))
It doesn't.
That's true, it doesn't. However, did you actually READ the error message it gives? It has
NOTHING to do with range().
On 10/24/2014 07:38 AM, Seymore4Head wrote:
I do get the difference. I don't actually use Python 2. I use
CodeSkulptor. I do have Python 3 installed. Actually I have Python 2
installed but IDLE defaults to Python 3. So it is a pain to actually
load Python 2.
Exactly HOW are you trying to
On 10/24/2014 09:37 AM, Seymore4Head wrote:
import string
Not needed, delete it.
def nametonumber(name):
lst=[]
nx=[]
digit=[]
Not needed. You create digit as an empty list, them immediately follow by assigning a string to
it (NOT a _list_ of characters, but an actual string
On 10/24/2014 12:07 PM, Seymore4Head wrote:
On Fri, 24 Oct 2014 19:40:39 +0100, Mark Lawrence
How many more times, state what you expect to happen and what actually
happens. "doesn't work" is useless. Please read this http://sscce.org/
Good suggestion.
OK how is this?
It doesn't print wha
On 10/30/2014 01:16 PM, Seymore4Head wrote:
class pet:
def set_age(self,age):
self.age=age
def get_age(self):
return self.age
pax=pet
pax.set_age(4)
Traceback (most recent call last):
File "C:\Functions\test.py", line 18, in
pax.set_age(4)
TypeError: set_age(
On 11/02/2014 01:50 AM, Denis McMahon wrote:
[snip]
from math import sqrt
class SquareGeometryError(Exception):
"""The parameters create an illegal geometry for a square"""
pass
class Rectangle:
def __init__(self,length,width):
self.length=length
self.width=wid
On 11/05/2014 03:00 AM, Ivan Evstegneev wrote:
Hello everyone,
I’m a Python beginner and just getting familiar with it. (I need it for my EE
B.Sc. project)
For the learning purposes I use IDLE and (Learning Python by written by Mark
Lutz).
Let’s say that I have some earlier experience with C l
First, I'll repeat everybody else: DON'T TOP POST!!!
On 11/16/2014 04:41 PM, Abdul Abdul wrote:
Dave,
Thanks for your nice explanation. For your answer on one of my questions:
*Modules don't have methods. open is an ordinary function in the module.*
Isn't "method" and "function" used interch
On 11/18/2014 12:59 PM, sohcahto...@gmail.com wrote:
On Tuesday, November 18, 2014 12:14:15 AM UTC-8, Larry Hudson wrote:
First, I'll repeat everybody else: DON'T TOP POST!!!
On 11/16/2014 04:41 PM, Abdul Abdul wrote:
Dave,
Thanks for your nice explanation. For your answer on
On 01/29/2015 06:55 PM, Rustom Mody wrote:
[snip...]
Like smelly cheese and classical music, math is an acquired taste.
Actually enjoyable once you get past the initiation
This comment is OT, irrelevant and only about myself...
I found the appreciation of classical music instinctive and immed
On 02/20/2015 08:47 PM, Brad s wrote:
[...]
print("command = %r" % (cmdargv,))
sfmove = subprocess.call(cmdargv)
also, is the % to Python what precision is to C++?
No. It is like the % in C's printf().
-=- Larry -=-
--
https://mail.python.org/mailman/listinfo/python-list
I have been reading the argparse section of the 3.3 docs, and running all the
example code.
But in section 16.4.2.6. for the formatter_class, the second example in that section
illustrating RawDescriptionHelpFormatter, the example code is:
parser = argparse.ArgumentParser(
prog='PROG',
On 02/22/2014 03:58 AM, Peter Otten wrote:
Larry Hudson wrote:
I have been reading the argparse section of the 3.3 docs, and running all
the example code.
But in section 16.4.2.6. for the formatter_class, the second example in
that section illustrating RawDescriptionHelpFormatter, the example
On 02/26/2014 10:24 PM, ast wrote:
Hello
box is a list of 3 integer items
If I write:
box.sort()
if box == [1, 2, 3]:
the program works as expected. But if I write:
if box.sort() == [1, 2, 3]:
it doesn't work, the test always fails. Why ?
Thx
sort() sorts the sequence in pla
On 03/01/2014 05:11 PM, Scott W Dunning wrote:
On Mar 1, 2014, at 11:03 AM, Susan Aldridge wrote:
Try this
def guess1(upLimit = 100):
import random
num = random.randint(1,upLimit)
count = 0
gotIt = False
while (not gotIt):
print('Guess a number between 1 and', upLi
I spotted a device on the table of the company calibration office...
As I recall, it was a 100A capable resistor... 0.10 OHM.
No idea what it was meant for; big binding posts at one end, and a slab
of sheet steel in a "W" shape (smooth curves, not sharp bends).
Exter
On 03/28/2014 09:26 PM, Mark H Harris wrote:
PS Thunderbird puts *both* the list and the news group addys in the to:
header field on
reply-to-list. ~nice, huh.
Must be the way YOU set it up. MY Thunderbird (currently version 24.4.0 on Mint Linux 16)
doesn't do any such thing. Besides,
On 03/29/2014 12:41 PM, Michael Torrie wrote:
On 03/29/2014 01:27 PM, Larry Hudson wrote:
On 03/28/2014 09:26 PM, Mark H Harris wrote:
PS Thunderbird puts *both* the list and the news group addys in the to:
header field on
reply-to-list. ~nice, huh.
Must be the way YOU set it up. MY
On 03/29/2014 10:52 PM, Mark H Harris wrote:
On 3/29/14 10:45 AM, Mark Lawrence wrote:
On 29/03/2014 08:21, Mark H Harris wrote:
Yes. Well, as the joke goes, if you're trilingual you speak three
languages, if you're bilingual you speak two languages, if you're
monolingual you're an America
On 04/08/2014 08:02 AM, Chris Angelico wrote:
On Wed, Apr 9, 2014 at 12:28 AM, Larry Martell wrote:
I've worked at places where:
Add to that list:
- Some of the programmers really aren't programmers, but the boss just
hasn't figured it out yet.
That was my last job, until said non-programme
On 04/18/2014 04:14 PM, gwhite wrote:
[snip]
Yeah, I have noticed that they don't seem to be needed, but I think I remember reading
"someplace-somewhere" that
a backslash means a line continuation, and perhaps I saw some author put them in. So I did it
out of trying to be "strict."
I'm not s
On 05/01/2014 05:56 AM, Roy Smith wrote:
In article ,
Mark H Harris wrote:
Absolutely, snort. I still have my K&E (Keuffel & Esser Co. N.Y.);
made of wood... (when ships were wood, and men were steel, and sheep ran
scared) ... to get to the S L T scales I have to pull the slide out
(tu
On 05/09/2014 06:11 PM, Steven D'Aprano wrote:
On Fri, 09 May 2014 17:34:17 -0500, Mark H Harris wrote:
On 5/7/14 8:27 PM, Steven D'Aprano wrote:
Why are new Python coders 'always' confused by this question of
variable (name value) vs. {name: object} model of Python?
"Always"? I don'
On 08/07/2013 01:17 AM, eschneide...@comcast.net wrote:
I'm trying to create an option for the program to repeat if the user types 'y'
or 'yes', using true and false values, or otherwise end the program. If anyone
could explain to me how to get this code working, I'd appreciate it.
letters='ab
On 08/06/2013 08:38 PM, krismesenbr...@gmail.com wrote:
import random
def room ():
hp = 10
while hp != 0:
random_Number = random.randint(1, 2)
#asking if you want to roll/play
des = input("Would you like to roll the die?")
One very trivial comment...
Some time ago there was a post asking for help on a rock/paper/scissors
game. I read that thread at the time it was posted, but since it
received several answers I didn't pay too much attention to it. But I
can't find that thread again right now. However, the subject stuck
(loosely) in my mind,
On 09/23/2013 06:20 AM, Ned Batchelder wrote:
If you want to run untrusted Python code and prevent malice (or stupidity) from
harming you, you
need OS-level protection.
--Ned.
That reminds me of the quote from Albert Einstein, (paraphrased):
"There are only two things that are infinite,
On 09/29/2013 09:19 AM, Νίκος wrote:
Στις 29/9/2013 7:14 μμ, ο/η Joel Goldstick έγραψε:
asked and answered. Move on
shut up. you are nothign but annoyance here.
Thanks for the laugh.
Absolutely the most hilarious thing you've ever posted!!! :-)
(Ever hear about the pot and the kettle?)
On 11/05/2013 02:07 AM, Antoon Pardon wrote:
And now you have depraved Nikos of the opportunity to really learn
something. ...
I know you meant "deprived", but "depraved Nikos" sounds like a good
description to me. ;-)
-=- Larry -=-
--
https://mail.python.org/mailman/listinfo/python-
On 11/07/2013 03:32 PM, Chris Angelico wrote:
On Fri, Nov 8, 2013 at 10:28 AM, Νίκος Αλεξόπουλος
wrote:
Also i don't have to explain my job or grant permission from Grant to start
a business. I don't care if you think otherwise.
You don't need Grant to grant permission for you to run a busine
On 03/27/2015 07:09 AM, Dave Angel wrote:
[snip]
I know, let's use "regular expressions"
This is totally OT, but...
There was a recent (2015-03-23) item on The Daily WTF web site concerning
regular expressions.
Take a look at http://thedailywtf.com/articles/regularly-expressing-hate
On 03/26/2015 06:56 PM, Chris Angelico wrote:
On Fri, Mar 27, 2015 at 12:41 PM, Rustom Mody wrote:
[snip]
After selecting the line above [inside python inside help(filter) ]for
cut-pasting here, by mistake I pressed Ctrl-C rather than Ctrl-Shift-C
An exception was thrown and the terminal remai
On 04/17/2015 07:22 PM, Ben Finney wrote:
BartC writes:
(Actually *I* would quite like to know why languages don't have
switchable syntax anyway to allow for people's personal preferences.)
Which people's personal preferences? Are these the same people who have
such passionate disagreement a
On 04/30/2015 01:06 AM, Cecil Westerhof wrote:
[snip]
I wrote a module where I have:
def get_indexed_message(message_filename, index):
"""
Get index message from a file, where 0 gets the first message
"""
return open(expanduser(message_filename),
'r').r
On 04/30/2015 01:50 PM, Cecil Westerhof wrote:
Op Thursday 30 Apr 2015 21:38 CEST schreef Larry Hudson:
On 04/30/2015 01:06 AM, Cecil Westerhof wrote:
[snip]
I wrote a module where I have:
def get_indexed_message(message_filename, index):
"""
Get index message from a file, w
On 06/06/2014 01:42 AM, Johannes Bauer wrote:
Ah, I didn't know rstrip() accepted parameters and since you wrote
line.rstrip() this would also cut away whitespaces (which sadly are
relevant in odd cases).
No problem. If a parameter is used in the strip() family, than _only_ those characters
On 06/23/2014 01:12 PM, kenak...@gmail.com wrote:
What package do I need to install to get thread support (import thread) for
Python 3 running under ubuntu 3?
Just curious... Ubuntu 3 -- Are you really running a version that old, or is that a typo?
Current version is 14.04
OT and FWIW: I
On 07/06/2014 08:03 AM, rxjw...@gmail.com wrote:
Thanks. I do not want to waste everyone's time. For a jump start, there are
small errors making me frustrating. Your help does help me, confirm the usage
etc. After a basic familiarity, I do not want to post more. I use cygwin Python,
I type hel
On 08/06/2014 08:48 PM, Seymore4Head wrote:
On Thu, 07 Aug 2014 13:43:40 +1000, Steven D'Aprano
wrote:
Seymore4Head wrote:
On Wed, 06 Aug 2014 22:58:51 -0400, Seymore4Head
wrote:
[snip]
Ah, now things make sense! Your subject line is misleading! It's not that
the wikibooks example doesn
On 08/12/2014 04:57 PM, Frank Scafidi wrote:
I just acquired a Raspberry Pi and want to program in Python. I was a PL/1
programmer back in
the 60's & 70's and Python is similar. I am struggling with some very
fundamental things that I
am not finding in the documentation. Can someone help me wit
On 08/23/2014 02:13 PM, Seymore4Head wrote:
On Sat, 23 Aug 2014 13:47:20 -0400, Seymore4Head
I found this function that I will be saving for later.
def make_it_money(number):
import math
return '$' + str(format(math.floor(number * 100) / 100, ',.2f'))
(I still need more practice to fi
On 08/24/2014 08:12 AM, Seymore4Head wrote:
[snip]
I almost moved, but I was looking at the print out again for this one:
print('%3d $%-13.2f $%-14.2f' % (count, payment, balance))
I can't understand why the $%-13.2f is pushed against the first
column, but the $%-14.2f is not. It seems like the
On 08/25/2014 08:14 PM, Seymore4Head wrote:
[snip]
There is lots of help built in. Trying to read all the options makes
me realize the stuff I am working on is just the tip of the iceberg.
When checking the help function, it is clear I will never get to about
90% of the features.
Thanks
That
On 08/31/2014 07:54 PM, Seymore4Head wrote:
[snip]
Since I don't ever expect to be able to type them without thinking
about them, a standard keyboard could come with half sized keys on the
sides.
While this is definitely OT, I strongly suggest you take the time to learn to touch-type.
(Actually
On 10/03/2014 04:35 AM, Shiva wrote:
Hi All,
I might be doing something really silly here, but I can't seem to spot it:
def front_x(words):
b=[]
c=[]
for a in words:
if a[0] == 'x':
b.append(a)
else:
c.append(a)
b = sorted(b)
c = sorted(c)
d= b
On 10/04/2014 10:36 AM, Shiva wrote:
What I don't understand is:
for w in eachword:
textstorage[w]=textstorage.get(w, 0) + 1
How does textstorage.get(w,0)+1 give the count of the word??
Very long-winded explanation: (But to shorten it a bit, I'm going to use ts in place of
t
On 10/14/2014 01:04 AM, Revenant wrote:
Hi all!
I'm new to Python and programming in general, and am trying to learn as much as
I can about it.
Anyway, for a basic first program I made a simple game of Paper, Rock,
Scissors. For this program, I incorporated a main menu that presented three
d
On 10/20/2014 12:49 PM, Seymore4Head wrote:
On Mon, 20 Oct 2014 20:40:18 +0100, MRAB
wrote:
Do you have to know the number of items the list will have before
making it?
No, it is not necessary, lists are NOT the same as arrays in other languages. But it IS
possible to create an initial
On 10/20/2014 12:49 PM, Seymore4Head wrote:
On Mon, 20 Oct 2014 20:40:18 +0100, MRAB
wrote:
Do you have to know the number of items the list will have before
making it?
No. Lists are NOT the same as arrays in other languages. But it IS possible to create an
initial list of a spec
On 12/24/2011 11:09 PM, GZ wrote:
Hi,
I run into a weird problem. I have a piece of code that looks like the
following:
f(, a=None, c=None):
assert (a==None)==(c==None)
<...>
At first glance this looked like it should be a simple boolean "and", but then I realized that
when a and
On 02/23/2013 03:46 PM, piterrr.dolin...@gmail.com wrote:
Hi all,
... I have discovered today there is no do...while type loop. [Sigh]
No biggie. This is easily simulated with:
while True:
...
if :
break
Less easily simulated is the lack of a switch/case structure. This
On 02/24/2013 02:43 PM, piterrr.dolin...@gmail.com wrote:
... But for the moment I am trying to imitate familiar ground.
This is EXACTLY why you're having trouble grasping Python. Python is a different language and
requires a different mind-set and different approach. In this, it is NO dif
On 03/20/2013 09:28 PM, Steven D'Aprano wrote:
On Wed, 20 Mar 2013 20:12:13 -0700, rusi wrote:
"I did an horrible mistake" [...] is 'h' a vowel in french?
This-language-lesson-was-brought-to-you-by-the-letters-thorn-wynn-and-ash-
ly y'rs,
As a point of totally irrelevant trivia...
(And
On 04/05/2013 10:36 PM, Timothy Madden wrote:
[snip...]
8-character tab stops should be the default. Debating that is I believe another
topic, and
compatibility with python2 should be enough to make that debate unnecessary.
As everyone keeps telling you -- there is NO default tab size. Defau
On 04/09/2013 09:49 AM, thomasancill...@gmail.com wrote:
So what would be the proper way to perform a loop of this program. I still
can't quite figure out the best way to do it.
My suggestion... (pseudocode)
# Print a heading/introduction here
while True:
# Print menu, with an added
On 04/09/2013 11:44 PM, Larry Hudson wrote:
On 04/09/2013 09:49 AM, thomasancill...@gmail.com wrote:
So what would be the proper way to perform a loop of this program. I still
can't quite figure
out the best way to do it.
My suggestion... (pseudocode)
# Print a heading/introduction
On 04/16/2013 08:37 AM, aaB wrote:
hello,
I represent the CA's rule with a list of integers, of value 1 or 0.
Here is the function I use to generate the list:
def get_rule(rulenum):
rule = []
while rulenum > 0:
rule.append(rulenume % 2)
rulenum /= 2
while len(rule) < 8:
Quin wrote:
s = f.readline()
if 'mystring' in s: print 'foundit'
if 'mystring' not in s: print 'not found'
if 'mystring' in s:
print 'processing'
this generates output:
not found
processing
so, it doesn't find the substring, but goes into processing code anyway.
This is using IronPython
A
On 02/17/2011 12:27 AM, Werner wrote:
I have a trivially simple piece of code called timewaster.py:
while True:
i = 0
for i in range(10):
break
_
It runs fine with Eric bu
Catherine Moroney wrote:
Hello,
I want to call a system command (such as uname) that returns a string,
and then store that output in a string variable in my python program.
What is the recommended/most-concise way of doing this?
I could always create a temporary file, call the "subprocess.Pope
On 09/13/2017 09:18 AM, ROGER GRAYDON CHRISTMAN wrote:
I have not yet mastered how to respond to a particular note in a threadwith the
mailer that I use, so this is not in response to anyone in particular,but just
to some of the sentiments as a whole.
if x:> # do something
Completely out
On 09/13/2017 05:33 AM, leam hall wrote:
On Wed, Sep 13, 2017 at 8:28 AM, Stefan Ram wrote:
I presume that "tkinter" is intended to be pronounced
"logically":
T K inter (tee kay inter /ti keI In t%/)
. But it would be faster to pronounce it
T kinter (tee kinter /ti kIn t%/)
. S
On 09/27/2017 09:41 AM, leam hall wrote:
On Sat, Sep 23, 2017 at 5:26 PM, Ned Batchelder
wrote:
[snip]
The question is, what should a person "know" when hiring out as a
programmer? What is 'know" and what should be "known"? Specifically with
Python.
Hopefully NOT like this person...
(Sourc
1 - 100 of 183 matches
Mail list logo