> On Sep 6, 2017, at 9:14 PM, Stefan Ram wrote:
>
> I can run this (your code) without an error here (Python 3.6.0),
> from a file named "Scraper1.py":
I'll check tomorrow. I recently switched from 3.5.x to 3.6.1 in the PyCharm
IDE. It's probably FUBAR in some obscure way.
Thanks,
Chris R.
> On Sep 8, 2017, at 6:57 AM, Ned Batchelder wrote:
>
> What is it that CompSci folks want that developers don't
> want, that ruined Python 3?
Long-winded debates about obscure language features that left the layman
programmers in the bit bucket about 50+ comments ago.
While some of this can b
> On Sep 8, 2017, at 1:21 PM, accessnew...@gmail.com wrote:
> Ideas as to how to accomplish this?
Export your spreadsheets as Comma Separated Values (CSV) files and use the CSV
module to read/write those files.
https://docs.python.org/3/library/csv.html
Chris R.
--
https://mail.python.org/m
> On Sep 11, 2017, at 3:58 AM, Paul Moore wrote:
>
> I'm doing some training for a colleague on Python, and I want to look
> at a bit of object orientation. For that, I'm thinking of a small
> project to write a series of classes simulating objects moving round
> on a chess-style board of squares
> On Sep 13, 2017, at 5: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%/)
>
> . So far I've only ever read it, n
> On Sep 13, 2017, at 10:12 PM, Paul Rubin wrote:
>
> Ben Finney writes:
>>> I've never seen one.
>> who has told you... they are working on a Python 3 code base.
>
> Just because they've told me about it doesn't mean I saw it personally.
> The ones I've seen, including new ones, are Python 2.
> On Sep 17, 2017, at 2:19 PM, Ned Batchelder wrote:
>
>> On 9/16/17 1:38 AM, Steve D'Aprano wrote:
>> /rant on
>>
>> So apparently everyone who disagrees that Python should be more like
>> Javascript
>> is an old greybeard fuddy-duddy yelling "Get off my lawn!" to the cool kids
>> --
>> and i
> On Sep 19, 2017, at 9:09 AM, justin walters
> wrote:
>
> On Tue, Sep 19, 2017 at 8:59 AM, Grant Edwards
> wrote:
>
>>> On 2017-09-19, Rhodri James wrote:
On 19/09/17 16:00, Stefan Ram wrote:
D'Arcy Cain writes:
> of course, I use calculators and computers but I still understa
t; Someone has posted programs with \xA0 (NBSP IIRC)
> at the start of lines of the soure here before, in:
>
> From: Christopher Reimer
> Newsgroups: comp.lang.python
> Subject: Setting property for current class from property in an different
> class...
> Date: Wed, 6 Sep 2017
On Sep 27, 2017, at 12:50 AM, Bill wrote:
>
> Ever since I download the MyCharm IDE a few days ago, I've been noticing all
> sort of "spacing conventions (from PEP) that are suggested. How do folks
> regard these in general?
>
> For instance, the conventions suggest that
>
> if x>y :
>
On Oct 4, 2017, at 6:07 AM, Skip Montanaro wrote:
>
> Suppose you want to test a package (in the general sense of the word,
> not necessarily a Python package). You probably have specific unit
> tests, maybe some doctests scattered around in doc strings. Further,
> suppose that package requires y
Greetings,
I've always installed the latest and greatest version of Python 3 to develop my
own programs. I'm planning to release a program to the public. I could toss in
a note that the program runs on the latest version of Python 3.6 but I haven't
tested on earlier versions (i.e., 3.4 and 3.5)
On Oct 4, 2017, at 3:49 AM, Leam Hall wrote:
>
> Folks on IRC have suggested using virtualenv to test code under different
> python versions. Sadly, I've not found a virtualenv tutorial I understand.
> Anyone have a link to a good one?
>
> The next step will be to figure out how to package a p
On Oct 5, 2017, at 1:11 PM, Irmen de Jong wrote:
>
>> On 10/05/2017 04:23 AM, Christopher Reimer wrote:
>>
>> I'm leaning towards installing the latest minor version of each available
>> major version, running tox to run the unit tests against each o
On Oct 5, 2017, at 3:34 PM, Christopher Reimer
wrote:
>
>> On Oct 5, 2017, at 1:11 PM, Irmen de Jong wrote:
>>
>>> On 10/05/2017 04:23 AM, Christopher Reimer wrote:
>>>
>>> I'm leaning towards installing the latest minor version of each avail
On Oct 6, 2017, at 12:58 PM, Stephan Houben
wrote:
>
> Op 2017-10-06, Christopher Reimer schreef :
>
>> So I got tox and tox-docker installed. When I went to install Docker
>> for Windows, it wouldn't work because Hyper-V wasn't available on
>> Windows 10
On Oct 11, 2017, at 9:07 AM, Bill wrote:
>
> Grant Edwards wrote:
>> On 2017-10-11, Bill wrote:
>>
>>
>>> [...] I'm not here to "cast stones", I like Python. I just think
>>> that you shouldn't cast stones at C/C++.
>> Not while PHP exists. There aren't enough stones in the world...
>>
>
>
On Oct 14, 2017, at 10:44 AM, Thomas Jollans wrote:
>
>> On 14/10/17 19:34, Stefan Ram wrote:
>> r...@zedat.fu-berlin.de (Stefan Ram) writes:
>>> a post. Use whatever is appropriate in the special case
>>> given, or - to write a general library -, learn the design
>>> of a good existing library,
Greetings,
I'm setting up different test environments for tox. I can't find Windows
installer for the latest version of Python 3.4 on the download page.
Versions 3.4.5 to 3.4.7 only have the source files available.
Version 3.4.4 is the last version with Windows installers.
Testing on Python 3.
On Oct 21, 2017, at 6:08 AM, David Stanek wrote:
> This is actually a common pattern I see when teaching the language. For
> example, when a student wants to test out a package like requests many
> seem to initially want to create a requests.py module. Then they become
> very confused when they g
On Oct 27, 2017, at 1:49 AM, Peter J. Holzer wrote:
>
> BTW, I find it hard to believe that PyCharm for the Mac "comes with"
> Python 2.6. Python 2.6 is quite old. The Linux version isn't bundled
> with a python interpreter and just uses whatever is already installed on
> the machine. I guess it'
Greetings,
When I set up my static website using Pelican several years ago, many URLs
ended with index.html. Now that I'm looking at Django, I got a small set of
URLs working with and without index.html to point to the correct pages.
I read somewhere that the Django philosophy was to keep the U
On Nov 9, 2017, at 3:45 AM, John Ladasky wrote:
>
>> On Wednesday, November 8, 2017 at 11:40:18 PM UTC-8, Lawrence D’Oliveiro
>> wrote:
>>> On Thursday, November 9, 2017 at 7:51:35 PM UTC+13, r16...@rguktrkv.ac.in
>>> wrote:
>>>
>>> How can I covert numbers into word like ex:-123 One hundred t
On Nov 21, 2017, at 5:36 AM, Rustom Mody wrote:
>
>> On Tuesday, November 21, 2017 at 5:27:42 PM UTC+5:30, Ned Batchelder wrote:
>>> On 11/20/17 9:50 AM, Stefan Ram wrote:
>>> Ned Batchelder writes:
Also, why set headers that prevent the Python-List mailing list from
archiving your mes
On Nov 25, 2017, at 9:16 AM, Ian Kelly wrote:
>
>> On Sat, Nov 25, 2017 at 10:02 AM, Chris Angelico wrote:
>>> On Sun, Nov 26, 2017 at 3:36 AM, Ian Kelly wrote:
On Sat, Nov 25, 2017 at 6:00 AM, bartc wrote:
Where are your unittests for these unittests?
>>>
>>> No, the point of havin
> On Aug 30, 2016, at 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 re
> On Sep 13, 2016, at 8:58 PM, Lawrence D’Oliveiro
> wrote:
>
>> On Wednesday, September 14, 2016 at 4:34:34 AM UTC+12, Daiyue Weng wrote:
>> PyCharm warns about "Shadows name 'func' from outer scope"
>
> Typical piece of software trying to be too helpful and just getting in the
> way.
>
> Ca
Greetings,
I'm currently building a chess engine to learn the finer details of
Python. When I learned all flavors of Java in community college a decade
ago, we had to sanity check the hell out of the input values for every
function and wrote a lot of redundant code in addition to the
getters/
On 4/17/2016 3:18 PM, Michael Selik wrote:
I'd rather turn the question around: how much sanity checking is
necessary or useful? You'll find the answer is "surprisingly little"
compared to your experience in Java.
I'm looking for a pythonic approach to sanity checking. From what I read
elsewh
On 4/19/2016 1:02 AM, Michael Selik wrote:
Why relocate rather than remove? What message would you provide that's
better than ``KeyError: 42`` with a traceback that shows exactly which
dictionary is being used and how?
I think you misread my code. No dictionary exception occurs in the
sanity
Greetings,
Thanks to everyone for providing feedback. Here's my revised code to
generate a set of chess pieces.
class PieceFactory(object):
def factory(color, piece, position):
if piece == 'Bishop':
return Bishop(color, position)
if piece == 'K
On 4/21/2016 6:54 PM, Tim Chase wrote:
I'd simplify this code to something like
class PieceFactory(object):
@staticmethod
def factory(color, piece, position):
try:
return {
'Bishop': Bishop,
'King': King,
'Knight': Knight,
On 4/21/2016 7:10 PM, Ethan Furman wrote:
I do plan to incorporate a sanity test in each Piece class to validate
the initial position value. Pawns have 16 specific positions. Bishop,
Knight and Rook each have four specific positions. King and Queen each
have two specific positions. An invalid val
On 4/21/2016 7:20 PM, Stephen Hansen wrote:
Whyyy are you using getattr? Something wrong with
PieceFactory.factory(color, piece, position)? (Or, better yet, yield
piece_factory(color, piece, position) where piece_factory is just a
function)
Because the example I found used it, I implemented i
On 4/21/2016 9:46 PM, Ethan Furman wrote:
Oh! and Enum!!! ;)
OMG! I totally forgot about Enum. Oh, look. Python supports Enum. Now I
don't have to roll my own!
Hmm... What do we use Enum for? :)
Thank you,
Chris R.
--
https://mail.python.org/mailman/listinfo/python-list
On 4/21/2016 10:25 PM, Stephen Hansen wrote:
Why not, 'color in ("black", "white")'?
Checkers seems popular around here. What if I want to change "white" to
"red," as red and black is a common color scheme for checkers. Do I
change a single constant variable or replace all the occurrences in
On 4/22/2016 1:40 PM, Michael Selik wrote:
Frankly, for someone coming from Java, the best advice is to not write any
classes until you must. Of course classes in Python are very useful. It's
just that your Java habits are unnecessary and often counter-productive.
I disagree. I wrote procedural
On 4/23/2016 2:33 PM, Matt Wheeler wrote:
This is still backwards to me. It prevents your classes from being
suitable for restoring a stored game state, not just custom starting
positions (which I think is what Ethan means by custom setups).
I haven't thought that far about saving the game stat
On 4/23/2016 6:29 PM, Ian Kelly wrote:
Python enums are great. Sadly, they're still not quite as awesome as
Java enums.
I remember enums more from C than Java. Although I haven't used them
much in either language. I'm planning to immerse myself back into C via
Cython. Depending on far I get i
On 4/23/2016 6:38 PM, Michael Selik wrote:
Why so many files? Python can easily support thousands of lines in a
file. If it's just one file any text editor can do a quick find-replace.
That goes back to the Java convention of having one class per file. It
took a while to convince myself that
On 4/23/2016 7:34 PM, Michael Torrie wrote
Procedural programming does not necessarily mean BASIC-style goto hell.
Not sure why you would think that. In fact that's not really what
procedural programming is about.
I mentioned several messages back that I spent two years writing
procedural scr
On 4/23/2016 8:19 PM, Michael Torrie wrote:
The reason you weren't taught beyond class inheritance is because Java
implements organization only through a class hierarchy. Whole
generations of Java programmers think that program organization is
through classes (a static main method means your code
Greetings,
If I'm using a dictionary to store variables for an object, and
accessing the variable values from dictionary via property decorators,
would it be better to derive the class from object or dict?
class Test1(object):
def __init__(self):
self.state = {'key': '
On 4/26/2016 8:56 PM, Random832 wrote:
what exactly do you mean by property decorators? If you're just
accessing them in a dictionary what's the benefit over having the
values be simple attributes rather than properties?
After considering the feedback I got for sanity checking my code, I've
d
On 4/27/2016 7:24 AM, Ian Kelly wrote:
Some other great questions to ask yourself are "do I really want
len(my_object) to return the number of items in this dict" and "do I
really want list(my_object) to return all the keys in this dict"? If
the answer to all those is yes, then it's probably fa
On 4/27/2016 7:33 AM, Ian Kelly wrote:
This class definition looks muddled. Because Test2 inherits from dict,
the object referred to by "self" will be a dict, and self.__dict__ is
actually a *different* dict, containing the attributes of self. The
line:
self.__dict__ = {'key', 'value'}
is
On 4/27/2016 7:00 PM, Michael Torrie wrote:
I am guessing that the reason you are storing state as it's own
dictionary is so that you can pass the state itself to the constructor?
Someone said it was bad to store the object itself to file (my original
plan) and that I should use a dictionary
On 4/27/2016 7:07 PM, Ben Finney wrote:
I would say the latter is more Pythonic, because it:
* Better conveys the intention (“set the value of the ‘self.key’
attribute”).
* Uses the built-in mechanisms of Python (don't invoke magic attributes,
instead use the system that makes use of them
On 4/27/2016 8:05 PM, Ethan Furman wrote:
I ripped out the fetch_state because that will take more work -- you
can't pass a Pawn's saved state in to Piece and get the results you
want. pickle is worth looking at for saving/restoring.
The original idea was to pass a Pawn dictionary to the cons
On 4/27/2016 8:23 PM, Ben Finney wrote:
If you want items in a mapping, explicitly use a Python ‘dict’ instance.
If you want attributes that describe an object, explicitly use
attributes of that object. Deliberately choose which one makes more
sense.
Okay, that makes sense.
Thank you,
Chris R
On 4/27/2016 8:52 PM, Ethan Furman wrote:
The point Ben was trying to make is this: you should never* call
__dunder__ methods in normal code; there is no need to do so:
- use len(), not __len__()
- use next(), not __next__()
- use some_instance.an_attribute, not
some_instance.__dict__['an_a
On 4/27/2016 8:52 PM, Michael Torrie wrote:
In fact if it were me I would save game state to some kind of ini file,
which would mean manually going through each object and writing out the
relevant data to the ini file using the right syntax. And then reverse
the process when restoring from a fi
Greetings,
I was playing around with a piece of code to remove lowercase letters
and leave behind uppercase letters from a string when I got unexpected
results.
string = 'Whiskey Tango Foxtrot'
list(filter((lambda x: not x.islower()), string))
['W', ' ', 'T', ' ', 'F']
Note the
On 4/29/2016 6:29 PM, Stephen Hansen wrote:
If isupper/islower were perfect opposites of each-other, there'd be no
need for both. But since characters can be upper, lower, or *neither*,
you run into this situation.
Based upon the official documentation, I was expecting perfect opposites.
str.
On 4/29/2016 11:43 PM, Stephen Hansen wrote:
The official documentation is accurate.
That may be true on a technical level. But the identically worded text
in the documentation implies otherwise. Maybe I'm nitpicking this. Even
if I submitted a bug to request a clearer explanation in the
doc
On 4/30/2016 10:11 AM, Stephen Hansen wrote:
You're thinking of the whole "string", but you're operating on
single-character substrings, and when " ".islower() is run, its false.
Because the two-pronged test, a) if all cased characters are lowercase
and b) there is at least one cased character.
On 5/3/2016 4:20 AM, Cai Gengyang wrote:
So I have completed up to CodeAcademy's Python Unit 2 , now moving on to Unit3
: Conditionals and Control Flow.
But I feel my motivation wavering , at times I get stuck and frustrated when
trying to learn a new programming language ?
This might not be
On 5/3/2016 8:00 PM, DFS wrote:
How far along are you in your engine development?
I can display a text-based chess board on the console (looks better with
a mono font).
8 BR BN BB BQ BK BB BN BR
7 BP BP BP BP BP BP BP BP
6 __ __ __ __ __ __ __ __
5 __ __ __ __ __ __ __ __
4
Greetings,
Below is the code that I mentioned in an earlier thread.
string = "Whiskey Tango Foxtrot"
''.join(list(filter(str.isupper, string)))
'WTF'
That works fine and dandy. Except Pylint doesn't like it. According to
this link, list comprehensions have replaced filters and the
On 5/7/2016 9:51 AM, DFS wrote:
Has anyone ever in history gotten 10/10 from pylint for a non-trivial
program?
I routinely get 10/10 for my code. While pylint isn't perfect and
idiosyncratic at times, it's a useful tool to help break bad programming
habits. Since I came from a Java background
On 5/5/2016 7:57 PM, Stephen Hansen wrote:
On Thu, May 5, 2016, at 07:46 PM, Dan Sommers wrote:
On Thu, 05 May 2016 18:37:11 -0700, Stephen Hansen wrote:
''.join(x for x in string if x.isupper())
The difference is, both filter and your list comprehension *build a
list* which is not needed
On 5/7/2016 12:23 PM, Stephen Hansen wrote:
On Sat, May 7, 2016, at 11:52 AM, Christopher Reimer wrote:
You can do better. You should strive for 10/10 whenever possible,
figure out why you fall short and ask for help on the parts that don't
make sense.
I think this is giving far too
On 5/5/2016 6:37 PM, Stephen Hansen wrote:
On Thu, May 5, 2016, at 06:26 PM, Christopher Reimer wrote:
Which is one is correct (Pythonic)? Or does it matter?
First, pylint is somewhat opinionated, and its default options shouldn't
be taken as gospel. There's no correct: filter is fin
On 5/7/2016 12:52 PM, Ray Cote wrote:
I’m impressed with 10/10.
My approach is to ensure flake8 (a combination of pyflakes and pep8
checking) does not report any warnings and then run pyLint as a final
check.
I just installed pyflakes and ran it against my 10/10 files. It's not
complaining ab
On 5/3/2016 10:13 PM, DFS wrote:
Wanted to start a new thread, rather than use the 'motivated' thread.
Can you play your game at the console?
Nope. Only displays the board on the console. An early version had the
forward movement for pawns implemented.
The way I think about a chess engine i
On 5/7/2016 2:22 PM, Chris Angelico wrote:
On Sun, May 8, 2016 at 5:17 AM, Christopher Reimer
wrote:
Since the code I'm working on is resume fodder (i.e., "Yes, I code in
Python! Check out my chess engine code on GitHub!"), I want it to be
as Pythonic and PEP8-compliant as
On 5/7/2016 1:31 PM, Marko Rauhamaa wrote:
Christopher Reimer :
Never know when an asshat hiring manager would reject my resume out of
hand because my code fell short with pylint.
Remember that it's not only the company checking you out but also you
checking the company out.
Would you wa
On 5/7/2016 6:40 PM, Terry Reedy wrote:
On 5/7/2016 3:17 PM, Christopher Reimer wrote:
For my purposes, I'm using the list comprehension over filter to keep
pylint happy.
How sad. The pylint developers arrogantly take it on themselves to
revise Python, against the wishes of Guido an
On 5/8/2016 5:02 AM, Steven D'Aprano wrote:
On Sun, 8 May 2016 08:01 am, Christopher Reimer wrote:
On 5/7/2016 2:22 PM, Chris Angelico wrote:
Also, be sure you read this part of PEP 8:
https://www.python.org/dev/peps/pep-0008/#a-foolish-consistency-is-the-hobgoblin-of-little-
On 5/7/2016 11:58 PM, Marko Rauhamaa wrote:
Chris Angelico :
So the question is: Do we care about country equality or individual
equality? You can't have both.
That's why there's been a long-standing initiative to split California
into multiple states:
https://en.wikipedia.org/wiki/Six_Cal
On 5/8/2016 8:09 AM, Rustom Mody wrote:
See:
https://www.washingtonpost.com/news/rampage/wp/2016/05/07/ivy-league-economist-interrogated-for-doing-math-on-american-airlines-flight/
Closing line: "In America today, the only thing more terrifying than foreigners
is...math."
Wonder how close to
On 5/8/2016 9:27 AM, Steven D'Aprano wrote:
On Sun, 8 May 2016 08:22 pm, beliav...@aol.com wrote:
There are
far more female than male teachers. I don't attribute it to anti-male
suppression but to greater female interest in working with children.
Of course there is suppression of male teachers
On 5/8/2016 10:53 AM, alister wrote:
On Mon, 09 May 2016 03:12:14 +1000, Steven D'Aprano wrote:
On Sun, 8 May 2016 08:21 pm, Cai Gengyang wrote:
If one looks at the Forbes List, you will see that there are 4
programmers amongst the top ten richest people in the world (Bill
Gates, Mark Zuckerb
Greetings,
My chess engine has a Piece class with the following methods that use
the @property decorator to read and write the position value.
@property
def position(self):
return self._position
@position.setter
def position(self, position):
if self._first_move
On 5/20/2016 11:50 AM, Christopher Reimer wrote:
This code does work, blows up the unit test, and keeps PyCharm happy.
@property
def position(self):
return super().position
@position.setter
def position(self, position):
pass
Re-declaring @property and calling
On 5/20/2016 8:59 AM, Zachary Ware wrote:
On Fri, May 20, 2016 at 3:09 AM, Erik wrote:
On 20/05/16 00:51, Gregory Ewing wrote:
It's not so bad with "else" because you need to look back
to find out what condition the "else" refers to anyway.
With my tongue only slightly in my cheek, if it wa
On 5/20/2016 3:43 PM, Steven D'Aprano wrote:
But the idea that you should avoid a Python feature while programming in
Python because Javascript doesn't have it, or Ruby, or C, is surely the
height of muddleheaded thinking. You're not programming Javascript, Ruby or
C, you're programming in Pytho
On 5/20/2016 7:31 PM, Chris Angelico wrote:
On Sat, May 21, 2016 at 11:23 AM, Christopher Reimer
wrote:
On 5/20/2016 3:43 PM, Steven D'Aprano wrote:
But the idea that you should avoid a Python feature while programming in
Python because Javascript doesn't have it, or Ruby, or C,
On 5/21/2016 1:52 AM, Dirk Bächle wrote:
Hi Christopher,
On 20.05.2016 20:50, Christopher Reimer wrote:
Greetings,
My chess engine has a Piece class with the following methods that use
the @property decorator to read and write the position value.
slightly off topic: is your chess engine
On 5/21/2016 3:05 AM, Steven D'Aprano wrote:
On Sat, 21 May 2016 03:18 pm, Rustom Mody wrote:
Given that for the most part, most of us are horribly uneducated [
http://www.creativitypost.com/education/9_elephants_in_the_classroom_that_should_unsettle_us
]
how do we go about correcting our wr
> On May 23, 2016, at 1:22 PM, Grant Edwards wrote:
>
>> On 2016-05-23, Ian Kelly wrote:
>>> On Mon, May 23, 2016 at 9:53 AM, Ian Kelly wrote:
>>> I'm not sure where ℝ comes into this in the first place. Existing
>>> Python numeric types only represent various subsets of ℚ (in the case
>>> of f
On May 24, 2016, at 7:23 AM, Grant Edwards wrote:
>
>> On 2016-05-24, Steven D'Aprano wrote:
>>> On Tue, 24 May 2016 08:36 am, Christopher Reimer wrote:
>>>
>>> Those symbols are blowing my 8-bit ASCII brain. :)
>>
>> That's cer
> On May 24, 2016, at 11:38 PM, Gregory Ewing
> wrote:
>
> Christopher Reimer wrote:
>> Nope. I meant 8-bit ASCII (0-255).
>> http://www.ascii-code.com
>
> That page is talking about latin-1, which is just one of many
> possible 8-bit extensions of ascii.
Ba
> On May 25, 2016, at 3:47 AM, Marko Rauhamaa wrote:
>
> Christopher Reimer :
>
>> Back in the early 1980's, I grew up on 8-bit processors and latin-1 was
>> all we had for ASCII.
>
> You really were very advanced. According to https://en.wikipedia.org/wiki/
On 6/3/2016 7:31 PM, Steven D'Aprano wrote:
On Sat, 4 Jun 2016 09:06 am, Sayth Renshaw wrote:
I cant create a list with an append method pf.append(thing) in one go .
Correct. You cannot append to a list until the list exists.
Nor can you uppercase a string until the string exists:
s = "hell
Sent from my iPhone
> On Jun 10, 2016, at 3:52 PM, mad scientist jr
> wrote:
> .
> Now that it's done, I am wondering what kind of things I could do better.
This is Python, not BASIC. Lay off on the CAP LOCK key and delete all the
comments and separation blocks. No one is going to find your
> On Jun 22, 2016, at 7:59 AM, Grant Edwards wrote:
>
>> On 2016-06-22, Random832 wrote:
>>> On Wed, Jun 22, 2016, at 10:19, Grant Edwards wrote:
>>>
>>> Is that guaranteed by Python, or just a side-effect of the
>>> implementation? Back in the days when Python used native C
>>> integers I thi
On 6/26/2016 6:21 AM, Steven D'Aprano wrote:
On Sun, 26 Jun 2016 08:48 pm, BartC wrote:
On 26/06/2016 08:36, Lawrence D’Oliveiro wrote:
One of Python’s few mistakes was that it copied the C convention of using
“=” for assignment and “==” for equality comparison.
One of C's many mistakes. Unf
On 6/26/2016 8:41 AM, MRAB wrote:
On 2016-06-26 11:48, BartC wrote:
On 26/06/2016 08:36, Lawrence D’Oliveiro wrote:
One of Python’s few mistakes was that it copied the C convention of
using “=” for assignment and “==” for equality comparison.
One of C's many mistakes. Unfortunately C has bee
On 6/26/2016 8:13 PM, Elizabeth Weiss wrote:
Hi There,
What is the point of this code?:
word=[]
print(word)
The result is []
When would I need to use something like this?
Thank you!
Sometimes you need to assign an empty list to a variable prior to using
it in a looping structure.
Here'
> On Jun 30, 2016, at 11:42 PM, Jussi Piitulainen
> wrote:
>
> DFS writes:
>
>> Here's a related program that doesn't require you to tell it what type
>> of operation to perform. Just enter 'num1 operator num2' and hit
>> Enter, and it will parse the entry and do the math.
>>
>> -
> On Jul 1, 2016, at 5:46 AM, Jussi Piitulainen
> wrote:
>
> Christopher Reimer writes:
>
>> For my BASIC interpreter, each line of BASIC is broken this way into
>> tokens.
>>
>> line_number, keyword, *expression = line.split(' ', 2)
>>
> On Jul 1, 2016, at 6:52 AM, Steven D'Aprano wrote:
>
>> On Fri, 1 Jul 2016 10:25 pm, Christopher Reimer wrote:
>>
>> For my BASIC interpreter, each line of BASIC is broken this way into
>> tokens.
> [...]
>> By using * to unpack the split line
> On Jan 15, 2016, at 10:09 AM, Bernardo Sulzbach
> wrote:
>
>> On Fri, Jan 15, 2016 at 3:02 PM, William Ray Wing wrote:
>>
>> What Micro$oft was actually sued for was worse. They would approach a small
>> company: “We like your product/technology, we think we are interested in
>> buying y
On 1/15/2016 10:09 AM, Bernardo Sulzbach wrote:
On Fri, Jan 15, 2016 at 3:02 PM, William Ray Wing wrote:
What Micro$oft was actually sued for was worse. They would approach a small
company: “We like your product/technology, we think we are interested in buying
you out, but we want to see you
On 2/13/2016 5:35 AM, MWS wrote:
Just to add to the above discussion, i find that when my workplace
updated from win 7 to win 8.1 with fresh install, i downloaded the
official python 3.5 and installed it. Everything went well during
installation, but, i couldn't find the default install python d
On 10/7/2015 10:49 PM, Chris Angelico wrote:
Awesome! Contributors are always welcome.
On a YouTube video from PyCon 2015, I think someone mentioned the need
for more people to look at Python on Windows. Does this mean that Python
on Linux and/or Mac get more love than Python on Windows?
I
Greetings,
I'm developing a web scraper script. It takes 25 minutes to process 590
pages and ~9,000 comments. I've been told that the script is taking too
long.
The way the script currently works is that the page requester is a
generator function that requests a page, checks if the page cont
Greetings,
I have two functions that I generalized to be nearly identical except
for one line. One function has a yield statement, the other function
appends to a queue.
If I rewrite the one line to be a function passed in as an argument --
i.e., func(data) -- queue.append works fine. If I c
On 6/5/2017 4:55 PM, Gregory Ewing wrote:
Mahmood Naderan wrote:
from a button on a web page, I chose "export as excel" to download
the data.
Do you get an option to export in any other format?
CSV would be best, since you can trivially read that
with Python's csv module.
If Excel is the onl
1 - 100 of 117 matches
Mail list logo