ChangeDinosawer wrote: http://i.imgur.com/q5cRcNs.png
Code: Select all
collapsed[temp['text']] = True if (temp['open'] == 1 or temp['open'] == 'true') else False
Code: Select all
collapsed[temp['text']] = temp['open'] == 1 or temp['open'] == 'true'
ChangeDinosawer wrote: http://i.imgur.com/q5cRcNs.png
Code: Select all
collapsed[temp['text']] = True if (temp['open'] == 1 or temp['open'] == 'true') else False
Code: Select all
collapsed[temp['text']] = temp['open'] == 1 or temp['open'] == 'true'
I've never had any IDE do thatFlatfingers wrote: Every last stinkin' one of them insists on injecting junk into my nice clean code
And only 1 IDE who did that and that notification was very easy to turn off.Flatfingers wrote:
and tries to force me to organize my code according to its beliefs as to how programs "should be" written.
Well, the reveal that Python is the new LTSL made a few people here eager to learn itVictor Tombs wrote:The last time I had a rubbing of shoulders with Python was with Wrye Bash during my Oblivion days. Good to know the coding fraternity are still using it.
Thanks Dino, I have updated the landing page for handy resources.Dinosawer wrote:ARISE THREAD AND REVEL IN YOUR NEW-FOUND USEFULNESS
Other than that, myself and several other people who regularly hang out on the Limit Theory IRC are Python programmers and are more than willing to help you if you have a problem, so feel free to drop by.Spoiler: SHOW
You know, if you're going to moan about indentation marking scope, that would lead me to believe that you're not indenting your ifs, fors, and functions in your braced-language code.Flatfingers wrote:(Beyond the indentation-as-scope-control silliness. )
Grumble away.
I go for the "all code on a single line" approach.Grumblesaur wrote:You know, if you're going to moan about indentation marking scope, that would lead me to believe that you're not indenting your ifs, fors, and functions in your braced-language code.Flatfingers wrote:(Beyond the indentation-as-scope-control silliness. )
Grumble away.
Honestly, you're going to be indenting anyway. Forcing people to indent if they mightn't otherwise means readability is forced as well, and Python is all about readability. It's a total non-issue for anyone who indents when they reach a new scope nesting level anyhow.
KingMoo wrote: I go for the "all code on a single line" approach.
Code: Select all
for x in range(100):print('Fizz'*(x%3>1)+'Buzz'*(x%5>3)or str(x+1))+'\n'
RESULT:Grumblesaur wrote:KingMoo wrote: I go for the "all code on a single line" approach.Code: Select all
for x in range(100):print('Fizz'*(x%3>1)+'Buzz'*(x%5>3)or str(x+1))+'\n'
Code: Select all
>>> for x in range(100):print('Fizz'*(x%3>1)+'Buzz'*(x%5>3)or str(x+1))+'\n'
...
1
2
Fizz
4
Buzz
Fizz
7
8
Fizz
Buzz
11
Fizz
13
14
FizzBuzz
16
17
Fizz
19
Buzz
Fizz
22
23
Fizz
Buzz
26
Fizz
28
29
FizzBuzz
31
32
Fizz
34
Buzz
Fizz
37
38
Fizz
Buzz
41
Fizz
43
44
FizzBuzz
46
47
Fizz
49
Buzz
Fizz
52
53
Fizz
Buzz
56
Fizz
58
59
FizzBuzz
61
62
Fizz
64
Buzz
Fizz
67
68
Fizz
Buzz
71
Fizz
73
74
FizzBuzz
76
77
Fizz
79
Buzz
Fizz
82
83
Fizz
Buzz
86
Fizz
88
89
FizzBuzz
91
92
Fizz
94
Buzz
Fizz
97
98
Fizz
Buzz
Code: Select all
>>> while True:for i in ["/","-","|","\\","|"]:print "%s\r" % i,
File "<stdin>", line 1
while True:for i in ["/","-","|","\\","|"]:print "%s\r" % i,
^
SyntaxError: invalid syntax
Users browsing this forum: No registered users and 2 guests