On Tue, Oct 21, 2014 at 2:45 AM, Simon Kennedy wrote:
> On Monday, 20 October 2014 18:56:05 UTC+1, Ian wrote:
>> Rather, I'm saying that where the blank line is should be the start of
>> a new function. There would still be a blank line, just no longer
>> inside the function.
>>
>> Now, maybe you
On Wednesday, October 15, 2014 12:13:51 PM UTC+10, ryguy7272 wrote:
> I'm just learning Python.
One of the best ways to learn any language is to type in the example code by
hand.
As you type in the code you will make mistakes, you will learn from your
mistakes and that will help you learn the l
On Monday, 20 October 2014 18:56:05 UTC+1, Ian wrote:
> Rather, I'm saying that where the blank line is should be the start of
> a new function. There would still be a blank line, just no longer
> inside the function.
>
> Now, maybe you think there should be more blank lines in the above, in
> wh
Sorry guys, my post about SQL was not meant to be here!!!
On Mon, Oct 20, 2014 at 5:43 PM, MRAB wrote:
> On 2014-10-20 20:04, Juan Christian wrote:
>
>> Ok, new code using ?:
>>
>> import sqlite3
>>
>> db = sqlite3.connect('db.sqlite')
>>
>>
>> def create_db():
>> db.execute('''
>> CREATE T
On 2014-10-20 20:04, Juan Christian wrote:
Ok, new code using ?:
import sqlite3
db = sqlite3.connect('db.sqlite')
def create_db():
db.execute('''
CREATE TABLE TOPICS(
ID INT PRIMARY KEY NOT NULL,
URL VARCHAR NOT NULL,
AUTHOR VARCHAR NOT NULL,
MESSAGE VARCHAR NOT NULL
);
''')
def insert
On Mon, Oct 20, 2014 at 1:04 PM, Juan Christian
wrote:
> Ok, new code using ?:
I suspect you meant to post this to some other thread.
> def get_db(_id):
> cursor = db.execute("SELECT ID, URL, AUTHOR, MESSAGE FROM TOPICS WHERE ID =
> ?", (_id))
> return cursor.fetchone()
(_id) is not a tuple; it
Ok, new code using ?:
import sqlite3
db = sqlite3.connect('db.sqlite')
def create_db():
db.execute('''
CREATE TABLE TOPICS(
ID INT PRIMARY KEY NOT NULL,
URL VARCHAR NOT NULL,
AUTHOR VARCHAR NOT NULL,
MESSAGE VARCHAR NOT NULL
);
''')
def insert_db(_id, url, auth
On Mon, Oct 20, 2014 at 11:54 AM, Ian Kelly wrote:
> On Mon, Oct 20, 2014 at 9:54 AM, Simon Kennedy wrote:
>> Not having ever attempted to go beyond even the basics of Perl, the aspect
>> that causes me to refer to Perl 'dismissively' as well comment in this
>> thread, is that I don't find Perl
On Mon, Oct 20, 2014 at 9:54 AM, Simon Kennedy wrote:
> Not having ever attempted to go beyond even the basics of Perl, the aspect
> that causes me to refer to Perl 'dismissively' as well comment in this
> thread, is that I don't find Perl to be an aesthetically pleasing language
> and I consid
On Saturday, 18 October 2014 11:53:16 UTC+1, Steven D'Aprano wrote:
> I'm curious what aspect of idiomatic Perl code you are referring to. When
> people talk about Perl code dismissively, I normally think of three things:
>
> - excessively long one-liners;
> - excessive use of symbols and sigils
Simon Kennedy wrote:
> On Wednesday, 15 October 2014 20:31:15 UTC+1, Ian wrote:
>> I agree. I very rarely use blank lines inside functions. As I see it,
>> if you feel you need a blank line for separation within a function,
>> that's an indication your function is overly complex and should be
>>
On 16/10/2014 12:32 AM, Chris “Kwpolska” Warrick wrote:
Why? Because things like `print 'done'` usually have an empty line
before it:
Not in my code, they don't. I never put blank lines
inside functions.
--
Greg
--
https://mail.python.org/mailman/listinfo/python-list
On Fri, Oct 17, 2014 at 1:08 AM, Simon Kennedy wrote:
> On Wednesday, 15 October 2014 20:31:15 UTC+1, Ian wrote:
>> I agree. I very rarely use blank lines inside functions. As I see it,
>> if you feel you need a blank line for separation within a function,
>> that's an indication your function is
On Wednesday, 15 October 2014 20:31:15 UTC+1, Ian wrote:
> I agree. I very rarely use blank lines inside functions. As I see it,
> if you feel you need a blank line for separation within a function,
> that's an indication your function is overly complex and should be
> broken up.
Whereas I feel t
On 16/10/2014 12:32 AM, Chris “Kwpolska” Warrick wrote:
It should parse this as
else:
print 'false'
print 'done'
Why? Because things like `print 'done'` usually have an empty line before it:
if True:
print 'true'
else:
print 'false'
print 'done'
That should be parsed the way you w
On Wed, Oct 15, 2014 at 11:12 AM, Terry Reedy wrote:
> On 10/15/2014 10:32 AM, Chris “Kwpolska” Warrick wrote:
>> It should parse this as
>>
>> else:
>> print 'false'
>> print 'done'
>>
>> Why? Because things like `print 'done'` usually have an empty line before
>> it:
>
>
> There is no
On 10/15/2014 10:32 AM, Chris “Kwpolska” Warrick wrote:
On Wed, Oct 15, 2014 at 9:27 AM, alex23 wrote:
On 15/10/2014 12:23 PM, Juan Christian wrote:
Using PyCharm is easy:
File > Settings > (IDE Settings) Editor > Smart Keys > Reformat on paste
> choose "Reformat Block"
This isn't as s
On Wed, Oct 15, 2014 at 9:27 AM, alex23 wrote:
> On 15/10/2014 12:23 PM, Juan Christian wrote:
>>
>> Using PyCharm is easy:
>>
>> File > Settings > (IDE Settings) Editor > Smart Keys > Reformat on paste
>> > choose "Reformat Block"
>
>
>
> This isn't as straight forward as you imply. Say I have m
On 15/10/2014 12:23 PM, Juan Christian wrote:
Using PyCharm is easy:
File > Settings > (IDE Settings) Editor > Smart Keys > Reformat on paste
> choose "Reformat Block"
This isn't as straight forward as you imply. Say I have misindented code
like this:
if True:
print 'true'
els
On Wed, Oct 15, 2014 at 1:35 PM, Zachary Ware
wrote:
>> But ultimately, the
>> fault is almost certainly with the PDF.
>
> Agreed, although I'd say the PDF viewer could also be at fault.
Good point, there are some really terrible PDF viewers around. Either
way, the workaround of grabbing one line
On Tue, Oct 14, 2014 at 9:18 PM, Chris Angelico wrote:
> On Wed, Oct 15, 2014 at 1:13 PM, ryguy7272 wrote:
>> I'm just learning Python. It seems like indents are EXTREMELY important. I
>> guess, since there are no brackets, everything is controlled by indents.
>> Well, I'm reading a couple b
On Tue, Oct 14, 2014 at 7:13 PM, ryguy7272 wrote:
> I'm just learning Python. It seems like indents are EXTREMELY important. I
> guess, since there are no brackets, everything is controlled by indents.
> Well, I'm reading a couple books on Python now, and in almost all of the
> examples they
On Wed, Oct 15, 2014 at 1:13 PM, ryguy7272 wrote:
> I'm just learning Python. It seems like indents are EXTREMELY important. I
> guess, since there are no brackets, everything is controlled by indents.
> Well, I'm reading a couple books on Python now, and in almost all of the
> examples they
Using PyCharm is easy:
File > Settings > (IDE Settings) Editor > Smart Keys > Reformat on paste >
choose "Reformat Block"
On Tue, Oct 14, 2014 at 11:13 PM, ryguy7272 wrote:
> I'm just learning Python. It seems like indents are EXTREMELY important.
> I guess, since there are no brackets, everyt
I'm just learning Python. It seems like indents are EXTREMELY important. I
guess, since there are no brackets, everything is controlled by indents. Well,
I'm reading a couple books on Python now, and in almost all of the examples
they don't have proper indents, so when I copy/paste the code (
25 matches
Mail list logo