On 10/03/2017 10:29 AM, Stefan Ram wrote:
Is this the best way to write a "loop and a half" in Python?
x = 1
while x:
x = int( input( "Number (enter 0 to terminate)? " ))
if x:
print( f'Square = { x**2 }' )
In a C-like language, one could write:
while x = int( input( "
On 10/01/2017 03:52 PM, Bill wrote:
Steve D'Aprano wrote:
The definitive explanation of descriptors is here:
https://docs.python.org/3/howto/descriptor.html
Thank you! It is next on my list. Then I'll try that Circle problem you mentioned as an
exercise last night! I don't expect run into
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
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/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 08/17/2017 12:18 AM, Larry Hudson wrote:
On 08/16/2017 03:39 PM, Chris Angelico wrote:
On Thu, Aug 17, 2017 at 8:29 AM, Mok-Kong Shen
...
Oops, I replied to Chris's post, but it was meant for the OP. I should have replied to Mok-Kong
Shen's post instead. My bad. Sorry for the
On 08/16/2017 03:39 PM, Chris Angelico wrote:
On Thu, Aug 17, 2017 at 8:29 AM, Mok-Kong Shen
wrote:
I have earlier learned some other (older) programming languages. For
these the formal parameters are either "by reference" or "by value".
In the first case, any modification of the formal paramet
On 08/14/2017 08:25 PM, Larry Hudson wrote:
[snip]
Here is my attempt to clarify the situation with some ascii graphics.
(Well, not ascii, but utf-8 box-drawing characters — I hope they come through
ok.
And, of curse, it won't display properly with a proportional font.)
The left side i
On 08/14/2017 01:02 PM, Mok-Kong Shen wrote:
Am 14.08.2017 um 21:53 schrieb Ned Batchelder:
[snip]
def test(alist):
alist=[3,6,9]
return
def test1(alist):
alist[0],alist[1],alist[2]=3,6,9
return
def test2(alist):
alist[0],alist[1],alist[2]=3,6,9
alist=[30,60,90]
return
On 06/03/2017 09:39 PM, Chris Angelico wrote:
That's a tricky thing to pin down. Since it's possible for a sequence
to contain itself, or to contain something which contains it,
Like a Tardis?
[Sorry, couldn't resist...] ;-)
OTOH, On-Topic... It might be worth while to point out that a 'ch
On 05/26/2017 04:46 AM, Steve D'Aprano wrote:
[snip..]>
That's not how the C standard defines "undefined behaviour", or the
implication of such.
A little OT here, but...
This brings to mind this entry in the Jargon File:
http://catb.org/jargon/html/N/nasal-demons.html
--
-=- Larry -=-
-
On 03/26/2017 01:21 AM, Νίκος Βέργος wrote:
print('''UPDATE visitors SET (pagesID, host, ref, location, useros, browser, visits)
VALUES (%s, %s, %s, %s, %s, %s, %s) WHERE host LIKE "%s"''', (pID, domain, ref,
location, useros, browser, lastvisit, domain) )
prints out:
UPDATE visitors SET (pag
On 03/18/2017 05:01 PM, Nathan Ernst wrote:
[...]
Personally, I dislike any editor that, by default, changes my input to
something else. If I hit tab, I want a tab to be inserted, by default. If I
want something else, I'll change the configuration.
A trivial point (and irrelevant)... The thing
On 01/06/2017 05:03 AM, Steve D'Aprano wrote:
The second hardest problem in computer science is cache invalidation.
The *hardest* problem is naming things.
In a hierarchical tree view widget that displays items like this:
Fiction
├─ Fantasy
│ ├─ Terry Pratchett
│ │ ├─ Discw
On 01/03/2017 04:27 PM, Callum Robinson wrote:
> On Wednesday, January 4, 2017 at 1:17:11 PM UTC+13, Chris Angelico wrote:
>> On Wed, Jan 4, 2017 at 11:03 AM, Erik wrote:
>>> I doubt it's getting that far (I can see at least one syntax error in the
>>> code pasted).
>>
>> True true. In any case, t
On 01/03/2017 04:27 PM, Callum Robinson wrote:
On Wednesday, January 4, 2017 at 1:17:11 PM UTC+13, Chris Angelico wrote:
On Wed, Jan 4, 2017 at 11:03 AM, Erik wrote:
I doubt it's getting that far (I can see at least one syntax error in the
code pasted).
True true. In any case, the point is t
On 12/06/2016 03:21 AM, BartC wrote:
On 06/12/2016 07:37, Larry Hudson wrote:
Now you're suggesting the _shell_ is going to read and process a CVS
file???
What follows a shell command is a set of values a,b,c,d,e. What is encountered
in a CSV is a set
of values a,b,c,d,e. You really
On 12/05/2016 10:50 AM, BartC wrote:
And just what ARE A, C, and D?
It doesn't matter, and is not the concern of the shell. It should restrict
itself to the basic
parsing that may be necessary when parameters are separated by white-space and
commas, if a
parameter can contain white-space
On 12/05/2016 06:51 PM, Nathan Ernst wrote:
IIRC, command.com was a relic of Win9x running on top of DOS and was a
16-bit executable, so inherently crippled (and probably never support by
the NT kernel). Whereby cmd.exe coexisted but ran in a 32-bit context.
I know my 79-year-old memory is defi
On 11/24/2016 06:53 AM, Peter Otten wrote:
Thomas Grops via Python-list wrote:
[snip...]
Instead of repeating your code with copy-and-past make a helper function
like the randx() posted by Larry Hudson.
By the way, randint(min, max) may return max so there are 9 possible
outcomes while you
On 11/23/2016 11:17 AM, Thomas Grops wrote:
I need a way of generating a random number but there is a catch:
I don't want to include certain numbers, is this possible?
random.randint(1,100) works as it will randomly pick numbers between 1 and 100
but say i don't want 48 to come out is there a
On 11/23/2016 03:09 AM, Ned Batchelder wrote:
[snip...]
Or using the new string formatting syntax:
msg = '{},{},{}:{}'.format(*item)
The *item in the format() unpacks the tuple.
"new" == "Introduced in 2.6, available since 2008" :)
--Ned.
Of course. I probably should have said "newer" o
On 11/22/2016 08:51 AM, Michiel Overtoom wrote:
Hi Ganesh,
Any better suggestion to improve this piece of code and make it look more
pythonic?
import random
# A list of tuples. Note that the L behind a number means that the number is a
'long'.
data = [(1, 1, 373891072L, 8192), (1, 3, 390
On 11/21/2016 07:10 PM, rmjbr...@gmail.com wrote:
Hi! This is my first post! I'm having trouble understanding my code. I get
"SyntaxError:invalid syntax" on line 49. I'm trying to code a simple text-based
rpg on repl.it. Thank you for reading.
print("Welcome to Gladiator Game! Choose your ch
On 11/16/2016 12:16 AM, shadecelebi wrote:
thanx a lot you guys. I'm slightly familiar with pygame from before so I'll
make sure to utilize it. and no I don't have any of the characters yet as I've
yet to start. I just wanted to know if I should keep learning python or if it
would be trivial t
On 10/31/2016 03:09 PM, devers.meetthebadger.ja...@gmail.com wrote:
http://imgur.com/a/rfGhK#iVLQKSW
How do I code a function that returns a list of the first n elements of the
sequence defined in the link? I have no idea!
So far this is my best shot at it (the problem with it is that the
On 10/09/2016 05:01 AM, Cai Gengyang wrote:
def min3(a, b, c):
min3 = a
if b < min3:
min3 = b
if c < min3:
min3 = c
if b < c:
min3 = b
return min3
print(min3(4, 7, 5))
4
This is NOT a recommendation here, just a different way of looking a
On 09/27/2016 09:20 PM, Steven D'Aprano wrote:
On Wednesday 28 September 2016 12:48, Larry Hudson wrote:
As they came through in the newsgroup, BOTH run correctly, because both
versions had leading spaces only.
(I did a careful copy/paste to check this.)
Copying and pasting from the
On 09/26/2016 01:57 PM, Cai Gengyang wrote:
Ok it works now:
for row in range(10):
for column in range(10):
print("*",end="")
but how is it different from ---
for row in range
On 09/26/2016 08:25 AM, Cai Gengyang wrote:
I just wanted to note that sometimes the code works, sometimes it doesn't.
(even though both are exactly the same code) ... Weird , dum dum dum
It is NOT weird. Python is being consistent, YOU are not.
These examples are NOT "exactly the same code
On 09/22/2016 06:40 AM, Sayth Renshaw wrote:
[snip...]
True it failed, just actually happy to get it to fail or pass successfully on
int input.
Just felt it was a clearer and more consistent approach to verifying input,
then most of the varied and rather inconsistent approaches I have seen in
On 09/20/2016 09:03 PM, Cai Gengyang wrote:
[snip...]
So for example for "bool" , it only applies to True/False and nothing else? (2
data types), i.e. :
Not exactly... bool is the data type (or class), True and False are the only two _values_ (not
types).
type(True)
type(False)
[
On 09/08/2016 07:57 AM, John Gordon wrote:
In Joaquin Alzola
writes:
Use the split
a.split(",")
for x in a:
print(x)
This won't work. split() returns a list of split elements but the
original string remains unchanged.
You want something like this instead:
newlist = a.split(",")
On 09/04/2016 09:00 AM, Veek. M wrote:
Steve D'Aprano wrote:
On Sun, 4 Sep 2016 06:53 pm, Thomas 'PointedEars' Lahn wrote:
Regarding the name (From field), my name *is* Veek.M […]
Liar. *plonk*
You have crossed a line now Thomas.
That is absolutely uncalled for. You have absolutely no l
On 08/29/2016 09:24 PM, Paul Rubin wrote:
Larry Hudson writes:
with BDS-C under CP/M. Somebody remenbering this no-fp compiler from
the dark age before PC und Linux?
I remember it well. It's what I used to initially learn C.
Source code is online here:
http://www.bdsoft.com/reso
On 08/30/2016 11:51 AM, Joe wrote:
Am 30.08.2016 um 17:52 schrieb D'Arcy J.M. Cain:
On Tue, 30 Aug 2016 15:56:07 +0200
Joe wrote:
Am 30.08.2016 um 13:01 schrieb D'Arcy J.M. Cain:
On Mon, 29 Aug 2016 21:21:05 -0700
Larry Hudson via Python-list wrote:
I remember it well. It's
On 08/30/2016 04:01 AM, D'Arcy J.M. Cain wrote:
On Mon, 29 Aug 2016 21:21:05 -0700
Larry Hudson via Python-list wrote:
I remember it well. It's what I used to initially learn C. I'm a
completely self-taught, hobby programmer. Been around since the MITS
Altair. How many reme
On 08/29/2016 01:54 AM, Joe wrote:
[snip...]
Interesting, but... The last time I did something with c, it was with BDS-C
under CM/M. Somebody
remenbering this no-fp compiler from the dark age before PC und Linux?
I remember it well. It's what I used to initially learn C. I'm a completely sel
On 08/17/2016 04:24 AM, Jussi Piitulainen wrote:
...
http://www-formal.stanford.edu/jmc/recursive/node2.html (the paper
famously titled "Part I" without any Part II, unless I mistake much.)
Totally OT here, but...
This reminds me of a old record I have with the (deliberately tongue-in-cheek)
On 07/05/2016 03:05 PM, Seymore4Head wrote:
import os
f_in = open('win.txt', 'r')
f_out = open('win_new.txt', 'w')
for line in f_in.read().splitlines():
f_out.write(line + " *\n")
f_in.close()
f_out.close()
os.rename('win.txt', 'win_old.txt')
os.rename('win_new.txt', 'win.txt')
I just
On 06/22/2016 12:42 AM, Lawrence D’Oliveiro wrote:
[snip]
I feel that’s a needlessly complicated rule. It would have been simpler if
boolean operators (and conditional expressions like in if-statements and
while-statements) only allowed values of boolean types. But that’s one of the
few warts
On 06/19/2016 08:29 PM, Steven D'Aprano wrote:
On Mon, 20 Jun 2016 12:07 pm, Rustom Mody wrote:
[snip]
In theory most Linux apps support an X mechanism for inserting characters
that don't appear on the keyboard. Unfortunately, this gives no feedback
when you get it wrong, and discoverablity is
On 06/12/2016 08:29 PM, meInvent bbird wrote:
once a nested list have a word "node" then true else false
def search(current_item):
if isinstance(current_item, list):
if len(current_item)==4:
if [item for item in current_item if item[4] == "node"] != []:
On 06/10/2016 03:52 PM, mad scientist jr wrote:
Is this group appropriate for that kind of thing?
(If not sorry for posting this here.)
So I wanted to start learning Python, and there is s much information
online, which is a little overwhelming. I really learn best from doing,
especially i
On 05/18/2016 09:53 PM, DFS wrote:
On 5/18/2016 10:58 PM, Larry Hudson wrote:
[snip...]
Why two loops? Put both summations in a single loop. Then you're only
scanning the alist once instead of twice.
groups1 = defaultdict(int)
groups2 = defaultdict(int)
for nm, matches, words in
On 05/18/2016 06:50 PM, Jake Kobs wrote:
MRAB,
I am not quite sure how to return the print statements so I thought that
returning the displayInfo def would help.. Im so lost.
Why do you think you want to _return_ a print statement? The print statement _DOES_ the
printing, there is nothing th
On 05/18/2016 05:59 PM, DFS wrote:
Have aList = [
('x','Name1', 1, 85),
('x','Name2', 3, 219),
('x','Name2', 1, 21),
('x','Name3', 6, 169)
]
want
aList = [
('Name1', 1, 85),
('Name2', 4, 240),
('Name3', 6, 169)
]
This drops the first element in each tuple:
alist = [(b,c,d) for a,b,c,d in ali
On 05/08/2016 03:07 PM, Chris Angelico wrote:
On Mon, May 9, 2016 at 6:45 AM, Larry Hudson via Python-list
wrote:
On 05/08/2016 06:01 AM, Chris Angelico wrote:
[snip...]
... I like to recommend a
little thing called "IIDPIO debugging" - I
On 05/08/2016 06:01 AM, Chris Angelico wrote:
[snip...]
... I like to recommend a
little thing called "IIDPIO debugging" - If In Doubt, Print It Out.
That means: If you have no idea what a piece of code is doing, slap in
a print() call somewhere. It'll tel
On 05/03/2016 07:55 PM, Cai Gengyang wrote:
Cool, I have finally summoned up enough activation energy to start on Unit 3,
now going through the topic on Conditionals and Control Flows (stuff like this)
boolthree = 200 == (50 * 5)
boolthree
False
Guess it would be really cool to work on AI an
On 04/10/2016 08:19 PM, Fillmore wrote:
Thank you for trying to help, Martin. So:
On 04/10/2016 09:08 PM, Martin A. Brown wrote:
#1: I would not choose eval() except when there is no other
solution. If you don't need eval(), it may save you some
headache in the future, as well, to f
I didn't see anyone responding to this, so I'll pop in here...
On 03/22/2016 04:05 AM, BartC wrote:
[...]
(Suppose you need both the value and its index in the loop? Then the one-line
for above won't
work. For example, 'something' is [10,20,30] and you want to print:
0: 10
1: 20
2: 30 )
On 03/09/2016 11:54 PM, Rustom Mody wrote:
[...]
In between these two extremes we have many possibilities
- ibus/gchar etc
- compose key
- alternate keyboard layouts
Using all these levels judiciously seems to me a good idea...
FWIW -- in Mint Linux you can select the compose key with the foll
On 02/20/2016 10:38 AM, wrong.addres...@gmail.com wrote:
[snip]
How complicated could this get in Python? Reading the numbers is one thing, and
then placing the values in text boxes of the GUI.
If that is the only object of using these values, there is no conversions necessary. The data
is r
On 02/19/2016 06:36 PM, Steven D'Aprano wrote:
On Fri, 19 Feb 2016 02:39 pm, Rustom Mody wrote:
[snip]
But you can't do anything interesting with this language, so it is not
satisfying. On the other hand, here's "Hello World" in another language,
one which is Turing complete so it can do anyt
On 02/19/2016 10:14 AM, wrong.addres...@gmail.com wrote:
[snip]
This is precisely reading one character at a time. If not exactly reading one
character, it is effectively looking at each character to assemble the number.
Not a good sign. I guess there might be libraries which will help read nu
On 02/15/2016 07:06 AM, Joel Goldstick wrote:
[snip a lot...]
Learn Python the Hard Way is pretty good some people say. Its online.
Also Diving into Python is online written by the now offline Mark Pilgrim.
I have a couple of "Hard Way" books and personally, I don't like his style of
teachin
On 02/09/2016 08:41 AM, Fillmore wrote:
Hi, I am having a hard time making my Cygwin run Python 3.5 (or Python 2.7 for
that matter).
The command will hang and nothing happens.
Just curious...
Since Python runs natively in Windows, why are you trying to run it with Cygwin?
I'm not implying t
On 01/30/2016 10:29 PM, Veek. M wrote:
[snip]
Trivial comment (and irrelevant to your question)...
Replace your
print('-')
with the shorter
print('-' * 65)
Of course, feel free to disagree if you think the longer version is
On 01/28/2016 04:01 PM, Fillmore wrote:
I learned myself Perl as a scripting language over two decades ago. All through
this time, I
would revert to it from time to time whenever I needed some text manipulation
and data analysis
script.
My problem? maybe I am stupid, but each time I have to g
On 01/23/2016 11:43 AM, Steve Petrie, P.Eng. wrote:
[snip]
I'm not sure what your exact problem is, but I can say that it isn't
this; the Unix-style forward slash is perfectly legal under Windows
(and it's even legal to mix and match).
ChrisA
I never knew that the forward slash is legal under
On 12/25/2015 06:04 PM, princeud...@gmail.com wrote:
#i have worked over 2hours only to get this: some-one help please
manipulate_data = []
[snip other incorrect nonsense...]
#this is the instruction:
Create a function manipulate_data that does the following
[snip...]
Let's start with your f
On 12/13/2015 12:05 PM, KP wrote:
On Sunday, 13 December 2015 11:57:57 UTC-8, Laura Creighton wrote:
In a message of Sun, 13 Dec 2015 11:45:19 -0800, KP writes:
Hi all,
f = open("stairs.bin", "rb")
data = list(f.read(16))
print data
returns
['=', '\x04', '\x00', '\x05', '\
On 12/02/2015 04:08 PM, John Strick wrote:
On Wednesday, December 2, 2015 at 12:58:30 PM UTC-6, Dylan Riley wrote:
hi all,
I have been trying to figure out all day why my code is printing single
characters from my list when i print random elements using random.choice the
elements in the list a
On 11/25/2015 12:32 AM, Chris Angelico wrote:
On Wed, Nov 25, 2015 at 7:14 PM, Antoon Pardon
wrote:
[snip]
"Oh come on. It's basic arithmetic. You should be able to add 7 and
7... the result's 14!"
"But it's so confusing. Why can't it be 16? It'd be more convenient
for me if it were 16."
N
On 11/21/2015 06:44 PM, Larry Hudson wrote:
On 11/20/2015 07:30 PM, Dylan Riley wrote:
i am learning python and was tasked with making a program that flips a coin 100
times and then
tells you
the number of heads and tails.
[snip]
import random
heads = int("1")
tails = int("
On 11/20/2015 07:30 PM, Dylan Riley wrote:
i am learning python and was tasked with making a program that flips a coin 100
times and then tells you
the number of heads and tails.
I have done so coming up with this piece of work but it doesnt run can anyone
help me out?
#This is credited to dy
On 11/13/2015 01:19 AM, Denis McMahon wrote:
On Fri, 13 Nov 2015 09:04:54 +1100, Steven D'Aprano wrote:
On Fri, 13 Nov 2015 07:40 am, Thomas 'PointedEars' Lahn wrote:
[crap I expect]
And you should consider the irony, and hypocrisy, of somebody who signs
his posts "PointedEars" bitching a
On 11/12/2015 06:07 AM, fl wrote:
On Thursday, November 12, 2015 at 8:58:33 AM UTC-5, fl wrote:
Hi,
def tick(self):
""" Time will be advanced by one second """
if self.__seconds == 59:
self.__seconds = 0
if (self.__minutes == 59):
On 11/10/2015 12:14 PM, Dennis Lee Bieber wrote:
On Mon, 9 Nov 2015 22:20:25 -0800, Larry Hudson via Python-list
declaimed the following:
Of course it can. The only difference a text file and a binary file is the way
it's opened.
Text files are opened with 'r' or 'w'
Your questions are somewhat difficult to answer because you misunderstand binary. The key is
that EVERYTHING in a computer is binary. There are NO EXCEPTIONS, it's all binary ALL the time.
The difference comes about in how this binary data is displayed and manipulated. I want to
emphasize, A
On 11/06/2015 05:25 AM, William Ray Wing wrote:
On Nov 5, 2015, at 10:36 PM, Larry Hudson via Python-list
wrote:
[snip]
You’re not REALLY an old timer unless you’ve used TECO.
-Bill
Agreed. I'm not really and old-timer, just old (I'm 78).
My first exposure to computers wa
On 11/05/2015 05:18 PM, Dennis Lee Bieber wrote:
On Thu, 5 Nov 2015 20:19:39 + (UTC), Grant Edwards
declaimed the following:
Though I used a line-editor for a while on VMS, I was never very good
at it, and abanded it for a full-screen editor at he first
opportunity. But, if you ever get a
On 11/02/2015 11:31 AM, Robin Koch wrote:
Am 02.11.2015 um 15:32 schrieb input/ldompel...@casema.nl:
Thank you for the explanation for it.
I must tell you that i yust beginning with python.
I bought the book beginning programming with python.
Have you programming experience with other langua
On 10/14/2015 10:04 AM, Cai Gengyang wrote:
So I am going through this article on Python for newbies
---http://askpython.com/execute-python-scripts/
Managed to create a file with these contents :
1 #!/usr/bin/env python3
2
3 print('hello world')
and saved it as hello.py
You did write that f
You've already received a lot of answers and guidance, but here is on more
point...
On 09/25/2015 12:03 PM, Cody Cox wrote:
[snip]
this I am not sure about, I set Kilo=get_input(kilo), ...
Watch your capitalization! Kilo is _NOT_ the same as kilo. Case is significant in Python (as
wel
On 09/24/2015 11:45 AM, codyw...@gmail.com wrote:
I seem to be having a problem understanding how arguments and parameters work,
Most likely why my code will not run.
Can anyone elaborate on what I am doing wrong?
'''
Cody Cox
9/16/2015
Programming Exercise 1 - Kilometer Converter
Design a modu
On 08/10/2015 01:43 PM, E.D.G. wrote:
[snip]
It has been my experience that researchers, particularly scientists,
need to have some
versatile and powerful programming language available that is compatible with
the Windows
operating system. The language needs to make certain resources av
On 08/05/2015 06:06 PM, Terry Reedy wrote:
[snip]
0. Classes where Idle is used:
Where?
Level?
None
Idle users:
1. Are you
grade school (1=12)?
undergraduate (Freshman-Senior)?
post-graduate (from whatever)?
Some college, but didn't complete.
Never had any CS or programming courses.
2. A
On 08/02/2015 01:58 PM, Joonas Liik wrote:
I have this feeling that you would get a lot more useful anwsers if
you were to describe your actual problem in stead of what you think
the solution is. There might be other, better solutions but since we
know so little about what you are doing we will l
On 08/01/2015 01:34 PM, Lukas Barth wrote:
Hi!
I have a list of numbers that I treat as "circular", i.e. [1,2,3] and [2,3,1]
should be the same. Now I want to rotate these to a well defined status, so that I can
can compare them.
If all elements are unique, the solution is easy: find the mini
On 07/15/2015 08:11 PM, Chris Angelico wrote:
On Thu, Jul 16, 2015 at 1:01 PM, Larry Hudson via Python-list
wrote:
On 07/15/2015 05:11 AM, Chris Angelico wrote:
[snip]
In addition to using print(), in some places I like using input() instead,
as in:
input('x={}, y={} -->
On 07/15/2015 05:11 AM, Chris Angelico wrote:
On Wed, Jul 15, 2015 at 9:44 PM, Jason P. wrote:
I can't understand very well what's happening. It seems that the main thread
gets blocked listening to the web server. My intent was to spawn another
process for the server independent of the test.
On 07/12/2015 05:48 AM, Simon Evans wrote:
Dear Peter Otten,
Yes, I have been copying and pasting, as it saves typing. I do get 'indented
block' error responses as a small price
> to pay for the time and energy thus saved.
>
You CANNOT ignore indenting.
Indenting is NOT optional, it is REQUIRED
On 05/31/2015 05:42 AM, Cecil Westerhof wrote:
I help someone that has problems reading. For this I take photo's of
text, use convert from ImageMagick to make a good contrast (original
paper is grey) and use lpr to print it a little bigger.
I''m wondering why you bother to take a photo, which th
On 05/31/2015 09:46 PM, fl wrote:
Hi,
When I search solution of reverse a string/number, I came across a short
function online:
def palindrome(num):
return str(num) == str(num)[::-1]
I thought that it is a general function. And with the following variable:
a
'1234_'
parlindr
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 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/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 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 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 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
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 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
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/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
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 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 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/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
1 - 100 of 183 matches
Mail list logo