Shit said in #python


 
Ciar Main Page >> TTK's Home Page
 
More quotes: Alaric   Fuz   Sonic   Pie   Izzy   Danny   TTK   Shit Said in Python   Shit Said in Go   mst
 
 
Display quotes in order:     
 [1074] #programming_is_hard
2020-08-25 16:14:12 <JohnnyL> WHy isn't my goto working? Has it been deprecated in 3.7?
2020-08-25 16:14:26 <_habnabit> JohnnyL, python has never had goto
     #python
 
 
 [1073] #programming_is_hard
2018-05-01 19:47:24 <Geren> mandeep: ok so line 33 says you go through the for loop N times, where N is the number of elements
2018-05-01 19:47:39 <Geren> and line 35 says for each element, you go through another loop of N-1 times ?
2018-05-01 19:47:44 <Geren> isnt that N^2 ?
2018-05-01 20:03:00 <mandeep> Geren: 2^n
2018-05-01 20:07:19 <Geren> mandeep:  thank you.
2018-05-01 20:07:24 <mandeep> np
     #python
 
 
 [1072] #perl
2018-05-01 18:39:17 #perl: <Biessie> ANyone know of a perl irc bot that tracks alt coins (crypto currency) prices and reports back as you ask for it?
2018-05-01 18:46:48 #perl: <thrig> sounds fairly easy to write with a bot module and the coin api thing something
2018-05-01 18:48:32 #perl: <Grinnz> perlbot: irc
2018-05-01 18:48:33 #perl: <perlbot> Grinnz: Don't parse IRC with regex! See Bot::BasicBot, POE::Component::IRC, Net::Async::IRC, Mojo::IRC, or
          Parse::IRC. Avoid Net::IRC. | http://xkcd.com/1782/ | If you must use TCP directly, take a look at POE::Filter::IRC or Parse::IRC for parsing.
2018-05-01 19:02:49 #perl: <Biessie> thrig : no coder here :(
2018-05-01 19:22:33 #perl: <dimestop> Biessie: I know a python one
2018-05-01 19:22:42 #perl: <Biessie> yea?
2018-05-01 19:22:51 #perl: <dimestop> https://git.supernets.org/acidvegas/cmc
2018-05-01 19:23:14 #perl: <dimestop> just look at the screenshot, is that what you mean?
2018-05-01 19:23:58 #perl: <Biessie> i was actually playing with that one keep getting this error on my linux box
2018-05-01 19:24:04 #perl: <Biessie> printf'{get_time()} | [~] - {msg}')
2018-05-01 19:24:07 #perl: <Biessie> invalid syntax
2018-05-01 19:24:20 #perl: <dimestop> are you using python 2 or 3
2018-05-01 19:24:40 #perl: <Biessie> shoot i have both i think?
2018-05-01 19:24:49 #perl: <Biessie> how do i know what is default
2018-05-01 19:24:52 #perl: <dimestop> try python3 if you're not already
2018-05-01 19:24:56 #perl: <dimestop> python --version
2018-05-01 19:24:56 #perl: <Biessie> kk
2018-05-01 19:25:10 #perl: <Biessie> its showing 2.7.12
2018-05-01 19:25:20 #perl: <dimestop> python3 --version
2018-05-01 19:25:20 #perl: <dimestop> ?
2018-05-01 19:25:29 #perl: <Biessie> 3.5.2
2018-05-01 19:25:54 #perl: <dimestop> then do: python3 whateverthescriptis.py
2018-05-01 19:26:25 #perl: <dimestop> also lol @ python talk in #perl
2018-05-01 19:26:34 #perl: <dimestop> I don't even use python
2018-05-01 19:26:52 #perl: <Biessie> ugh.. same error
2018-05-01 19:27:34 #perl: <dimestop> I'll ask the owner
2018-05-01 19:28:55 #perl: <Biessie> you know him? lol
2018-05-01 19:30:59 #perl: <dimestop> yeah
2018-05-01 19:32:36 #perl: <dimestop> so he said you need python 3.6.5 for fstring support
2018-05-01 19:32:38 #perl: <dimestop> https://cito.github.io/blog/f-strings/
2018-05-01 19:32:50 #perl: <dimestop> anyway brb work
2018-05-01 19:34:17 #perl: <Biessie> thanks
2018-05-01 19:42:20 #perl: <Biessie> works. thanks dimestop
2018-05-01 19:42:21 #perl: <Biessie> :)
2018-05-01 19:43:29 #perl: <dimestop> np
 
[Note: In #python they would have insisted that Biessie use python whether a solution already existed in perl or not]
     #perl
 
 
 [1071] #continuous-integration
2017-12-12 15:57:33 <Remram> there are packages out there whose setup.py is insane, and errors out on PY3, or does something different, or
          doesn't handle egg_info
2017-12-12 15:57:55 <Remram> as long as we have those, package management on Python is going to be broken
2017-12-12 16:04:00 <ttkpy> CPAN solves this by shoving all newly contributed modules through CI in various environments (windows, linux,
          freebsd, various versions of the language, etc) .. when a module fails to build, that is noted on its MetaCPAN page
2017-12-12 16:04:32 <ttkpy> and users avoid using it until module authors fix their code (which might be in the code itself or in the
          installation blargh)
2017-12-12 16:04:58 <ttkpy> might python apply a similar solution to root out these naughty setup.py?
2017-12-12 16:06:38 <ttkpy> example of a naughty module's CPANtesters CI results grid:  http://matrix.cpantesters.org/?dist=Curses+1.36
2017-12-12 16:06:58 <dw> ttkpy: i posted this very thing to python-ideas many moons ago and it was shot down by the packaging guys as "too much work"
2017-12-12 16:07:18 <nedbat> dw, ttkpy: build it
2017-12-12 16:07:26 <runciter> who pays for the CI?
2017-12-12 16:07:54 <ttkpy> runciter - the CPANtesters are volunteers who provide their own hardware
2017-12-12 16:08:06 <dw> nedbat: i feel strongly disincentivized by every packaging-related interaction i've ever had
2017-12-12 16:08:19 <runciter> as a contributor to open source projects that use existing CI service's free tier, it can be a bummer because the
          CI services response times vary from good to terrible
2017-12-12 16:08:20 <nedbat> dw: it doesn't have to be part of pypi, does it?
2017-12-12 16:08:32 <runciter> ttkpy: how do you trust the CPANtesters?
2017-12-12 16:08:33 <dw> nedbat: a good solution does, yes
2017-12-12 16:08:49 <nedbat> dw: not at first?  And why does it need to be part of pypi?
2017-12-12 16:08:52 <ttkpy> runciter - through time and familiarity, so you won't get trust immediately upon launch
2017-12-12 16:09:22 <runciter> ttkpy: a lot of open source communities in python seem to be moving away from self-hosted solutions
2017-12-12 16:10:50 * ttkpy contemplates how he'd prioritize a CPANtesters-for-pypi project
2017-12-12 16:11:11 * ttkpy glances at the 70+ other projects he's neglecting
2017-12-12 16:14:58 <dw> nedbat: because the alternatiev is scraping pypi for already-released packages to discover failures.
2017-12-12 16:15:05 <dw> nedbat: it needs to happen as part of release
2017-12-12 16:15:28 <nedbat> dw: at first, you'd need to do it asynchronously. too much stuff would become unavailable if you gate releases on it.
2017-12-12 16:19:51 <dw> ttkpy, nedbat: https://mail.python.org/pipermail/python-ideas/2014-April/027705.html was the thread in question, it
          never got nearly as far as discussing pypi integration before devolving into arguing about how much work it'd be
2017-12-12 16:21:53 <ttkpy> thanks, dw
2017-12-12 16:22:29 <ttkpy> the success of CPANtesters implies it's not insurmountably difficult
2017-12-12 16:22:53 <ttkpy> the python community is far more vibrant and energized, so it should be easier to pull off
2017-12-12 16:24:24 <dw> code and technology are rarely the difficult parts of any project
     #python
 
 
 [1070] #windows
2017-11-03 13:00:27 <ChrisWarrick> windows doesn't do argument lists
2017-11-03 13:00:41 <ttkpy> wat
2017-11-03 13:01:11 <nanonyme> ChrisWarrick, oh, yeah, true, it goes through that stringification and might or might not get through in one piece
2017-11-03 13:01:50 <ChrisWarrick> ttkpy: windows deals with strings. Pythona's subprocess module takes those lists and stringifies them
          according to some rules. Then the subprocess unstringifies it according to some other rules.
2017-11-03 13:06:22 <nanonyme> ttkpy, if you want to dive into the horribleness that is Windows, https://github.com/python/cpython/blob/master/Lib/subprocess.py#L426
2017-11-03 13:07:13 <nanonyme> ttkpy, good luck trying to get your quotes intact through that. There's no quote escaping in Windows
2017-11-03 13:09:38 <nanonyme> ttkpy, what you usually do in Windows is you write a file and execute that.
2017-11-03 13:10:13 <nanonyme> Trying to do anything complex through command arguments is pure lunacy
2017-11-03 13:12:19 <ttkpy> nanonyme - I see.  Thank you.
     #python
 
 
 [1069] #unnecessary_complexity
2017-11-03 12:53:08 <linux_dream> usually i do : voltage_something = some data, then when I trim some values in voltage_something, I put voltage_something_trimmed = ...  etc
2017-11-03 12:53:24 <linux_dream> so the name of the variable tells me what I performed over the variable,  although it can become 2km long
2017-11-03 12:54:30 <SnoopJeDi> Maybe you want to encapsulate that history in a class
     #python
 
 
 [1068] #windows
2014-04-29 16:38:44 <The_NetZ> very interesting. I come from a modest ruby bacground, but the fact that it sucks so bad on windows is discouraging, at least the latest versions.  How well does current python (3.x) run on windows?
2014-04-29 16:39:25 <ssbr_worklappy> The_NetZ: it performs adequately.
2014-04-29 16:40:20 <The_NetZ> ssbr_worklappy: and this is as a raw windows executable, not via cygwin or the like?
2014-04-29 16:41:10 <ssbr_worklappy> The_NetZ: of course!
2014-04-29 16:41:17 <ssbr_worklappy> The_NetZ: just be sure to install the 32bit one. :)
2014-04-29 16:42:32 <The_NetZ> ssbr_worklappy: is that so...  I realize that 32bit executables can run on 64bit systems, but in most cases 64bit executables are the default, but you mean in this case 32bit python is preferable to 64bit?
2014-04-29 16:43:07 <ssbr_worklappy> The_NetZ: most people use 32 bit python for windows, which means most third party libraries are built for 32 bit python.  It is a pain to get 64 bit libraries.
     #python
 
 
 [1067] #perl_hate
2014-04-17 11:48:17 <dash> markdown is pretty terrible
2014-04-17 11:48:30 <therealfakemoot> dash: why do you say that?
2014-04-17 11:48:37 <dash> therealfakemoot: it's a pile of perl regexps
2014-04-17 11:48:42 <dash> not an actual document format
2014-04-17 11:49:20 <therealfakemoot> dash: Oh. that's terrible.
2014-04-17 11:49:42 <therealfakemoot> dash: and what do you propse as an alternative? rst?
2014-04-17 11:49:48 <dash> therealfakemoot: i guess
     #python
 
 
 [1066] #programming_is_hard
2014-04-14 16:43:59 <drag0nius_> how can i get minimum value of numpy.int16 (or any other int datatype)
2014-04-14 16:44:58 <ttkp> drag0nius_ - do the math?
2014-04-14 16:45:57 <drag0nius_> nooooo
     #python
 
 
 [1065] #its_funny_so_laugh
2014-04-01 12:40:09 <\u03b5> drjeats: I don't understand why you would use mongodb to store data that has a schema
2014-04-01 12:41:27 <therealfakemoot> Yeah. Just use postgres 9.4 with the jsonb datatype
2014-04-01 12:41:46 <drjeats> I don't really want to get into that debate. just trust that I didn't blindly go down this path
2014-04-01 12:41:58 <drjeats> and the data's already in mongo
2014-04-01 12:42:12 <drjeats> and if you're using mongo and don't have any schema whatsoever you're doing it wrong
2014-04-01 12:42:30 <dash> too many words
2014-04-01 12:42:49 <dash> how about "if you're using mongo you're doing it wrong"
     #python
 
 
 [1064] #thinking_different
2014-03-04 11:44:24 <cdunklau> mikemol: strive to avoid coments
2014-03-04 11:44:34 <cdunklau> mikemol: you can test code. you can't test comments
2014-03-04 11:44:54 <ttkp> cdunklau O_o I hope that was a joke
2014-03-04 11:45:04 <cdunklau> ttkp: nope
     #python
 
 
 [1063] #its_funny_so_laugh
2014-02-25 12:28:58 <Cydrobolt> join ##php
2014-02-25 12:29:00 <Cydrobolt> oops
2014-02-25 12:29:09 <kevlarman> Cydrobolt: why would you go and do something like that?
2014-02-25 12:29:18 <Cydrobolt> the slash didn't go in
2014-02-25 12:29:22 <|Nyx|> Cydrobolt: No thank you
2014-02-25 12:29:29 <jita> PHP
2014-02-25 12:29:31 <Cydrobolt> I didn't mean to say it....
     #python
 
 
 [1062] #programming_is_hard
2014-02-25 10:53:17 <fission6> how can i get the ISP given an IP
2014-02-25 10:53:29 <nanonyme> fission6, check whois database
2014-02-25 10:53:44 <cwillu_at_work> also, not a python question
2014-02-25 10:53:56 <fission6> how can i do this .. in python
     #python
 
 
 [1061] #thread_hate
2014-02-21 09:58:38 <triad> what do you think about algorithms ?
2014-02-21 09:58:50 <dash> triad: I'm against them.
2014-02-21 10:00:13 <cwillu_at_work> triad, the thing to keep in mind about dash is that he's seen things that would drive a lesser mind to despair at everything.  In his case, it's merely driven him to scoff at everything.
2014-02-21 10:00:57 <ttkp> dash's anger towards threads goes beyond scoffing.  he seems to want to eradicate them from the face of the planet.
2014-02-21 10:01:05 <ssbr_> ttkp: is that so wrong
2014-02-21 10:01:24 <dash> ttkp: we'd be better off without 'em, it is true
2014-02-21 10:01:48 <dash> ttkp: i am not particularly angry about technical mistakes of the past though
2014-02-21 10:02:01 <dash> ttkp: if i was going to take that route, i'd stay permanently angry all the time
     #python
 
 
 [1060] #programming_is_hard
2014-02-20 15:46:50 <Moonlightning> is `if foo_integer & 1:` really that Unpythonic compared to `if foo_integer % 2 == 0:`?
2014-02-20 15:48:59 <|Nyx|> Moonlightning: bitwise operations have an annotation like "If you are flipping bits, then python is prolly not the language you want to be using" in the docs.
 
[Note: as far as I can tell, half of "unpythonic" is actually "math is hard, and we hate it" in disguise.]
     #python
 
 
 [1059] #do_my_homework
2014-02-20 15:32:09 <issphp> i've got this challenge, im supposed to create a user and delete it without knowing the password
2014-02-20 15:32:19 <ttkp> issphp - is this a homework assignment?
2014-02-20 15:32:27 <issphp> ttkp: yea
2014-02-20 15:32:35 <ttkp> you're asking us to do your homework?
2014-02-20 15:32:42 <issphp> ttkp: lol
2014-02-20 15:32:45 <\u03b5> ttkp: nooo! It's a    challenge
2014-02-20 15:33:21 <issphp> ttkp: its half-homework, half challenge
     #python
 
 
 [1058] #thread_hate
2014-02-18 20:27:45 <dash> GIL is completely irrelevant to concurrency
2014-02-18 20:28:32 <ttkp> cool!  so it's possible to concurrently run python bytecode in the same process, now?
2014-02-18 20:28:48 <dash> ttkp: sure, has been since 1.x
2014-02-18 20:28:55 <dash> ttkp: in the obvious way
2014-02-18 20:29:11 <ttkp> "the obvious way" == threads, yes?
2014-02-18 20:29:17 <dash> ttkp: or an event loop
2014-02-18 20:29:40 <ttkp> the event loops with which I'm familiar don't provide concurrent execution
2014-02-18 20:30:18 <dash> ttkp: sure they do
2014-02-18 20:30:43 <ttkp> in the same process, using threads?
2014-02-18 20:30:54 <dash> ttkp: in the same process, not using threads
2014-02-18 20:31:17 <dash> ttkp: if you don't block then it's easy to process concurrent events
2014-02-18 20:31:47 <ttkp> oh, so you're *not* talking about concurrently running python bytecode
2014-02-18 20:31:55 <dash> ttkp: sure I am
2014-02-18 20:32:03 <dash> ttkp: i'm not talking about _parallel execution_, though.
2014-02-18 20:32:08 <ttkp> no, you're talking about concurrent events
2014-02-18 20:32:16 <ttkp> not bytecode processing concurrently
2014-02-18 20:32:19 <dash> ttkp: yes that is what concurrency is about.
2014-02-18 20:32:37 <ttkp> you had me all excited for a moment there 
2014-02-18 20:35:10 <ireallylikedogs> can anyone recommend a simple guide (perhaps with examples) to multithreading / thread pools? currently, i'm using imaplib/regex to do some searches on the contents of a bunch of emails, and it's taking a really long time.
2014-02-18 20:36:37 <dash> ireallylikedogs: enjoy this simple pictorial guide: http://goo.gl/movdCX
     #python
 
 
 [1057] #programming_is_hard
2014-02-11 18:20:30 <scizzat> ok so i'm new to python and i'm taking an intro to programming class, i dont know why but i'm just stumped at this assignment.....
2014-02-11 18:21:26 <scizzat> it's basically u have to write a program that takes a person and their pay, their pay starts at 1 penny, doubles every day, but u dictate how many days it calculates for
2014-02-11 18:22:01 <scizzat> and u have to have it show in two columns, days worked and the pay for each day, eventually adding the total over the days at the end
2014-02-11 18:22:30 <ttkp> scizzat - what part has you stumped?
2014-02-11 18:22:55 <kosh> that sounds kind of trivial
2014-02-11 18:23:12 <scizzat> i guess the having the table double each line
2014-02-11 18:23:38 <kosh> scizzat: think about the math first, not the program
[..kosh tries to help scizzat for a while..]
2014-02-11 18:37:35 <kosh> just on pencil and paper try to rewrite 1 2 4 8 16 32 64 128 as powers of 2 and look at the pattern
2014-02-11 18:37:51 <ttkp> scizzat - their pay doubles every day, right?  how do you double a value?
2014-02-11 18:38:08 <scizzat> multiply it by 2 obviously
2014-02-11 18:38:11 <ttkp> right
2014-02-11 18:38:19 <scizzat> and that's what i have in the code
2014-02-11 18:38:28 <scizzat> but it lists each day with the same number
2014-02-11 18:38:37 <scizzat> it's not taking the previous number and multiplying by 2
2014-02-11 18:39:08 <ttkp> scizzat - paste your code to paste.pound-python.org and tell us the URL it gives you.
2014-02-11 18:39:15 <ttkp> scizzat - so we can look at it.
2014-02-11 18:40:09 <scizzat> http://bpaste.net/show/vjwyIMRBYznMjszDilu7/
2014-02-11 18:42:11 <ttkp> scizzat - their pay is doubling every day, right?  So where in this loop are you doubling their pay?
2014-02-11 18:42:50 <scizzat> that's where i'm stuck at ttkp
2014-02-11 18:43:28 <ttkp> scizzat - let's say pay is stored in a variable named "pay".  How would you cause the value in "pay" to double?
2014-02-11 18:43:39 <scizzat> pay * 2
2014-02-11 18:43:45 <ttkp> close
2014-02-11 18:44:06 <scizzat> pay ** 2
2014-02-11 18:44:25 <scizzat> i know that in python the 2nd power is **
2014-02-11 18:44:27 <deltab> scizzat: how do you change the value of a variable?
2014-02-11 18:44:29 <ttkp> scizzat - you were closer the first time.  "pay * 2" is twice the pay, but how do you save that result in "pay"?
2014-02-11 18:44:41 <scizzat> reassign it?
2014-02-11 18:44:45 <ttkp> yes
2014-02-11 18:45:50 <ttkp> scizzat - do you know how to assign "pay * 2" to "pay"?
2014-02-11 18:46:06 <scizzat> well as of right now i have
2014-02-11 18:46:08 <scizzat> Amount = days_worked * 2
2014-02-11 18:46:29 <deltab> scizzat: that doesn't mention 'pay'
2014-02-11 18:46:49 <scizzat> so then i should create another line or this case variable called pay
2014-02-11 18:46:53 <ttkp> scizzat - yes
2014-02-11 18:47:34 <scizzat> ok so i changed it to day_amount
2014-02-11 18:48:00 <ttkp> scizzat - is that the amount that the person gets paid on that day?
2014-02-11 18:48:25 <scizzat> number_of_days better?
2014-02-11 18:48:51 <ttkp> scizzat - the amount that the person gets paid on a day is what is doubling, right?
2014-02-11 18:49:00 <scizzat> yes
2014-02-11 18:49:03 <scizzat> and i have to have it start at a penny
2014-02-11 18:49:06 <ttkp> right
2014-02-11 18:49:10 <scizzat> so day 1 - 0.01 etc
2014-02-11 18:50:45 <ttkp> scizzat - does "pay = pay * 2" make sense?
2014-02-11 18:51:33 <kosh> ttkp: don't give answers, we are trying to get him to think
2014-02-11 18:51:46 <kosh> ttkp: it is a very important skill to learn how to think about things like this
2014-02-11 18:52:07 <scizzat> ultimately should i not have it start with the first day minus 1
2014-02-11 18:52:09 <scizzat> and then times 2?
[...]
2014-02-11 18:59:27 <scizzat> i'm in college for IT network security, this is one of the pre-reqs
     #python
 
 
 [1056] #thread_hate
2014-02-07 13:10:53 <offby1> dash: I dunno.  Can't one thread kill another?
2014-02-07 13:10:58 <dash> offby1: no, of course not
2014-02-07 13:11:01 <offby1> no?
2014-02-07 13:11:07 <dash> offby1: How would that work?
2014-02-07 13:11:18 <offby1> I dunno :-)
2014-02-07 13:12:06 <dash> on linux, threads are not processes.
2014-02-07 13:12:35 <dash> offby1: a good rule of thumb is that using threads adds more problems, it doesn't remove them ;)
2014-02-07 13:13:48 <ttkp> POSIX.1-2001 allows for the signalling of individual threads .. qv the pthread_kill(3) man page
2014-02-07 13:13:53 <dash> ttkp: ha ha
2014-02-07 13:14:00 <dash> ttkp: you're hilarious.
2014-02-07 13:14:37 <ttkp> oh sorry, I forgot, threads are taboo here
2014-02-07 13:14:58 <therealfakemoot> ttkp: They're not taboo. They're just not the right tool for as many tasks as people think.
2014-02-07 13:15:01 <dash> ttkp: delusional statements unconnected to reality are taboo
2014-02-07 13:15:20 <dash> (for example, POSIX standards documents)
 
[Note: dash is wrong.]
 
     #python
 
 
 [1055] #programming_is_hard
2014-02-04 15:20:35 <John_Conner> i mean i tried appending to a binary pickle but it dont seem to work, can it be used in a json?
2014-02-04 15:21:04 <ttkp> John_Conner - appending data to a json document doesn't work either.
2014-02-04 15:21:18 <John_Conner> Alright, I just thought appending to a file worked like appending to a list
2014-02-04 15:23:28 <ttkp> John_Conner - you can append to files, but whether the data structure you're using in that file supports appended data is another matter entirely.
2014-02-04 15:24:55 <ttkp> John_Conner - appending to a file containing csv or ini structured data generally works, but appending to a file containing xml, json, or pickled data will not.
2014-02-04 15:25:25 <John_Conner> ah ok thanks for that explanation ttkp
     #python
 
 
 [1054] #its_funny_so_laugh
2014-02-04 13:11:24 <Guddu> What is the preferred way of signing XML documents in Python?
2014-02-04 13:11:35 <CrtxReavr> With a sharpie.
     #python
 
 
 [1053] #programming_is_hard
2014-02-03 20:32:15 <sixninetynine> it's pretty nasty json, honestly
2014-02-03 20:32:41 <sixninetynine> a dictionary of lists :/
     #python
 
 
 [1052] #thinking_different
2014-01-30 20:44:10 <therealfakemoot> databases are easier [than files] because they abstract away a massively complex system for storing data in a managable, queryable way.
 
[Note: This utterly mystified me until I realized he and others like him were actually thinking about files in terms of operations of database-like complexity, not simple file operations which are of course easier to use than any database interface.]
     #python
 
 
 [1051] #thinking_different
2014-01-24 11:10:54 <brickhead> I want to implement a max method which gives max of more than two values
2014-01-24 11:11:00 <brickhead> max(2,4,5) = 5
2014-01-24 11:11:20 <dash> brickhead: max([2, 4, 5])
2014-01-24 11:11:21 <Wild_Cat> brickhead: max([2, 4, 5])
2014-01-24 11:11:21 <kevlarman> brickhead: max already does that
2014-01-24 11:11:41 <brickhead> aaww
2014-01-24 11:11:54 <ttkp> also:
2014-01-24 11:11:55 <ttkp> >>> max(2,3,4,7,1)
2014-01-24 11:11:55 <ttkp> 7
2014-01-24 11:12:10 <ttkp> it's like it was written by a perl coder
2014-01-24 11:12:30 <brickhead> awesome
2014-01-24 11:13:13 <tos9> ttkp: yeah uh. People had some really bad ideas when it came to API design in builtins.
2014-01-24 11:13:16 <tos9> Especially early ones.
     #python
 
 
 [1050] #programming_is_hard
2014-01-23 14:42:59 <prudhvi> Hi, using python how can i convert a json to a class object?
2014-01-23 14:43:11 <kevlarman> prudhvi: what?
     #python
 
 
 [1049] #duh
2014-01-14 14:44:00 <Zer000> how fast is [::-1] on a list?
2014-01-14 14:44:53 <dash> Zer000: eight
     #python
 
 
 [1048] #programming_is_hard
2014-01-13 18:31:40 <legrandin> maybe ill try project euler out, it looks interesting
2014-01-13 18:31:47 <dash> legrandin: don't
2014-01-13 18:31:54 <dash> legrandin: it's a trap
2014-01-13 18:32:16 <dash> legrandin: seriously. it's a set of math problems disguised as programming problems.
2014-01-13 18:32:26 <ttkp> math is good for you
2014-01-13 18:32:39 <legrandin> well, does it improve computational thinking? i guess thats the point
2014-01-13 18:32:44 <dash> ttkp: has the FDA verified your claim
2014-01-13 18:32:45 <dash> legrandin: No.
2014-01-13 18:33:10 <ttkp> legrandin - computational thinking improves computational thinking.
2014-01-13 18:33:23 <ttkp> just pick something and start biting.
2014-01-13 18:33:26 <dash> It's not clear that 'computational thinking' is a single thing
2014-01-13 18:33:39 <dash> legrandin: The kinds of thinking that apply to project euler problems have very very little application to web development
     #python
 
 
 [1047] #wtf
2014-01-13 18:17:05 <taqu> I need help making a program that counts how many times 'a' appears. However i cant use the count function. Any help?
2014-01-13 18:17:11 <dash> taqu: Why can't you?
2014-01-13 18:17:25 <ttkp> taqu - school assignment?
2014-01-13 18:17:41 <taqu> no, but im trying to find another way
2014-01-13 18:17:46 <dash> taqu: Why?
2014-01-13 18:18:05 <taqu> Just to see if its possible
2014-01-13 18:18:13 <dash> taqu: Anything is possible.
2014-01-13 18:18:28 <dash> taqu: Why are you counting how many times 'a' appears?
2014-01-13 18:18:43 <taqu> Lauren Ipsum?
2014-01-13 18:18:53 <tos9> Oh, you know her too
2014-01-13 18:19:01 <tos9> Send her my regards.
     #python
 
 
 [1046] #duh
2014-01-13 15:19:34 <clemens> Yhg1s: :) There is a chance that Python's socket code is to blame if it does "magic" with the retrieved error message, perhaps.
2014-01-13 15:20:27 <Yhg1s> clemens: no, it does not.
2014-01-13 15:21:01 <Yhg1s> clemens: it uses FormatMessage() with MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), so you get the user's default language (and thus encoding)
2014-01-13 15:21:03 <clemens> Yhg1s: OK. But you are cheating by actually looking at the code. Where is the fun in that, what about the joy of guessing.
2014-01-13 15:21:24 <cdunklau> guessing is for suckers and the QA team
2014-01-13 15:21:26 <cdunklau> :)
2014-01-13 15:21:33 <Yhg1s> clemens: so I think locale.getpreferredencoding(False) is the right thing to use.
2014-01-13 15:21:50 <Yhg1s> clemens: I'm sorry, I thought you wanted help, not an adventure.
     #python
 
 
 [1045] #programming_is_hard
2014-01-13 10:02:49 <ribot> i'm using fopen, fread(8) and it seems to have read only 6 characters... i wonder if it is somehow reading in utf-8, whereas it should read as ascii i think... the same code was working in another script in python 2.7, where i suppose it's not reading in utf-8
     #python
 
 
 [1044] #fyi
2014-01-10 11:46:55 <ttkp> huh .. wp says "Prior to version 6.0, BitTorrent was written in Python" .. didn't realize that
2014-01-10 11:47:07 <dash> yep
2014-01-10 11:47:10 <ttkp> did it use Twisted or call into the socket API directly?
2014-01-10 11:47:17 <dash> it used asyncore
2014-01-10 11:47:29 <dash> bittorrent was started when twisted was rather new
2014-01-10 11:47:46 <dash> but yeah bram was in here pretty often with a lot of basic python questions. kinda funny
2014-01-10 11:50:02 <ttkp> asyncore looks like the primitive-but-sane ancestor of Twisted
2014-01-10 11:50:37 <sproingie> it's not sane
2014-01-10 11:50:50 <sproingie> it is the ancestor though
     #python
 
 
 [1043] #thread_hate
2014-01-10 11:21:32 <dash> locsmif: python isn't the worst thing. It could just be better.
2014-01-10 11:24:37 <locsmif> dash: I've read about threading and the GIL.
2014-01-10 11:25:23 <dash> locsmif: python supports "actual threading" everywhere
2014-01-10 11:25:40 <dash> locsmif: but the presence of threads is one of the drawbacks of python i want to fix
2014-01-10 11:25:56 <locsmif> I read that in practice, the execution order is close to serial
2014-01-10 11:26:24 <locsmif> dash: what about the Windows kernel model where threading is supposedly more efficient than forking?
2014-01-10 11:26:29 <dash> locsmif: not really interesting in practice
2014-01-10 11:26:43 <locsmif> Okay
2014-01-10 11:27:11 <dash> locsmif: here's no real need to start processes or threads very often
2014-01-10 11:27:14 <ttkp> it's not like process shrinks are mostly fictional these days, and not contributing significantly to single-threaded performance, and future performance gains will be had primarily from effective utilization of concurrency.
2014-01-10 11:27:55 <dash> locsmif: if you want to spread cpu-bound work across multiple cores, then it's enough to start N processes at the startup of your app and distribute tasks between them
2014-01-10 11:28:10 <dash> locsmif: python doesn't make this easy or pleasant though
2014-01-10 11:28:54 <dash> the 'multiprocessing' module demonstrates how hacky python's data model really is
2014-01-10 11:31:32 <locsmif> I didn't know any of this, but I suppose that (you seem like one of the regulars here) you've tried things, seen things, and know very well what you're talking about. I had really hoped python could handle these things.
2014-01-10 11:31:53 <locsmif> But then again, you warned me about it now, let's see what I run into
2014-01-10 11:32:09 <cdunklau> locsmif: if you're doing io-bound stuff, twisted can help
2014-01-10 11:32:11 <dash> locsmif: defaults matter, and python's defaults were invented in the early 90s :)
2014-01-10 11:32:17 <cdunklau> especially if it's mostly networking
2014-01-10 11:32:25 <cdunklau> or talking to processes
2014-01-10 11:33:01 <dash> yeah. twisted is the nice thing in terms of model, but the API is more difficult than it has to be
     #python
 
 
 [1042] #programming_is_hard
2014-01-09 14:45:29 <travisgriggs> how can I get something file like (e.g. readline(), read(), write()) for a socket?
2014-01-09 14:46:09 <Yhg1s> travisgriggs: sockets have a 'makefile' method, but it's usually a mistake to use it. (sockets aren't quite equivalent to files, and the subtle differences are likely to cause all kinds of issues.)
2014-01-09 14:48:08 <travisgriggs> Yhg1s: other suggestions then? i just need to implement a very simple little tcp client protocol
2014-01-09 14:49:00 <Yhg1s> travisgriggs: I suggest using the socket methods.
2014-01-09 14:49:10 <Yhg1s> travisgriggs: I also suggest using Twisted, which will make it a lot less work to do it correctly.
2014-01-09 14:49:11 <travisgriggs> iow, i guess... python docs describe the socket module as "Low level networking interface". Where is the high level one then?
2014-01-09 14:49:19 <Yhg1s> travisgriggs: Twisted is the high-level one.
2014-01-09 14:49:23 <travisgriggs> twisted scares me
2014-01-09 14:49:44 <dash> travisgriggs: and the socket api doesn't? :)
2014-01-09 14:49:44 <Yhg1s> travisgriggs: it's funny, because BSD sockets are a lot scarier.
2014-01-09 14:49:53 <dash> travisgriggs: maybe that is because you know less about socket! :)
2014-01-09 14:50:02 <Yhg1s> (they have an enormous amount of corner cases and platform-specific behaviour.)
2014-01-09 14:50:14 <ttkp> to be fair, the socket API has a much shallower learning curve than Twisted
2014-01-09 14:50:16 <travisgriggs> no, i'm pretty comfortable with sockets
2014-01-09 14:50:26 <Yhg1s> travisgriggs: do you know what EINTR means?
2014-01-09 14:50:34 <travisgriggs> yes
2014-01-09 14:50:42 <simpson> EAGAIN?
2014-01-09 14:50:46 <travisgriggs> yep
2014-01-09 14:50:50 <simpson> EAGAIN?
2014-01-09 14:50:55 <Yhg1s> simpson :)
2014-01-09 14:56:50 <travisgriggs> for illustration purposes... i google twisted, click on a couple links till i arrive at a simpleclient.py example (echo client). now i start seeing that i need to import a reactor (or maybe that's just the server) and a protocol? and now i'm thinking, why do I want to care about all of this?
2014-01-09 14:57:10 <cdunklau> travisgriggs: believe it or not it makes everything easier
2014-01-09 14:57:20 <travisgriggs> contrast that with pyserial, doing a very similar write query/read response protocol over a serial line
2014-01-09 14:57:35 <Yhg1s> travisgriggs: it's because Twisted is event-driven, so it has a reactor, and it doesn't get in your way of writing re-usable code, so t uses abstractions like 'transport' and 'protocol'.
2014-01-09 14:57:36 <cdunklau> travisgriggs: reactor is really just the mainloop
2014-01-09 14:57:40 <dash> travisgriggs: I agree that the API is poor
2014-01-09 14:57:46 <dash> travisgriggs: but it's due to limitations of python
2014-01-09 14:57:50 <dash> travisgriggs: at least partly
2014-01-09 14:57:55 <travisgriggs> opened up the pyserial docs, found how to get a stream like object on the resource and was off and running
2014-01-09 14:58:18 <simpson> travisgriggs: Yes, programming requires writing code.
2014-01-09 14:59:13 <travisgriggs> maybe what i should have said is "i'd like something a little more than the low level, and i'm not interested in the all powerful high level abstraction of everything, is there something like the middle level?"
2014-01-09 14:59:22 <Yhg1s> travisgriggs: there is not.
2014-01-09 14:59:42 <travisgriggs> you always this helpful simpson?
2014-01-09 14:59:57 <travisgriggs> thanks Yhg1s
2014-01-09 14:59:58 <simpson> travisgriggs: Actually; I am usually *less* helpful. Today, however, I feel quite Zen.
2014-01-09 15:02:14 <travisgriggs> spent 20 years chasing "frameworks" in Smalltalk, i'm less excited about them now days. not that good ones don't exist
2014-01-09 15:02:46 <Yhg1s> travisgriggs: would it help if we just said 'library that calls your code'?
     #python
 
 
 [1041] #lost_in_translation
2014-01-09 12:38:17 <proteneer> aside from (), {}, "", [], are there other operators that denote a container?
     #python
 
 
 [1040] #windows
2014-01-08 12:01:46 <cwillu_at_work> Enich, look into sqlalchemy
2014-01-08 12:01:50 <cwillu_at_work> oh, windows
2014-01-08 12:01:51 <cwillu_at_work> blech
     #python
 
 
 [1039] #wtf
2014-01-03 16:25:22 <em> can python restrict the amount of data that can go into a specified directory?
     #python
 
 
 [1038] #its_funny_so_laugh
2014-01-02 14:09:49 <Cam> How do I turn "abcd" into two strings of "ab" and "cd" in one call?
2014-01-02 14:10:07 <Cam> i.e not S[:1] and  S[1:]
2014-01-02 14:10:27 <dash> Cam: neither of those are calls
2014-01-02 14:11:00 <Cam> dash, meh, they call some __secret__ function, that's what I meant.
2014-01-02 14:11:36 <kevlarman> Cam: no, there is no syntactic sugar for what you're asking
2014-01-02 14:11:45 <Cam> kevlarman, thanks for actually helping!
2014-01-02 14:12:01 <nedbat> Cam: why don't you want s[:1] and s[1:] ?
2014-01-02 14:12:14 <Cam> nedbat, well it was going to be in a lambda but now I guess I will just make a function
2014-01-02 14:12:16 <ttkp> Cam - [x for x in re.split('(\w\w)','abcd') if x != '']
2014-01-02 14:12:36 <nedbat> ttkp: !?!
2014-01-02 14:12:38 <Cam> ttkp, o.O
2014-01-02 14:12:40 <ttkp> Cam - but I suspect [s[:1], s[1:]] would be faster :-)
2014-01-02 14:12:51 <dash> ttkp: don't be terrible please
2014-01-02 14:13:01 <ttkp> dash - Cam was asking for something silly, so I gave it to him
2014-01-02 14:13:08 <dash> ttkp: yes that is not allowed here.
2014-01-02 14:13:15 <ttkp> dash - oh, okay.  Noted.
     #python
 
 
 [1037] #programming_is_hard
2013-12-31 13:35:49 <Moonlightning> #python : speaking of hashes, what's up with locality-sensitive hashes?
2013-12-31 13:35:56 <Moonlightning> I've searched, but all I can find is weird math stuff.
2013-12-31 13:38:12 <ttkpy> Moonlightning - http://en.wikipedia.org/wiki/Locality-sensitive_hashing has a pretty good explanation for laypeople
2013-12-31 13:42:02 <Moonlightning> ttkpy @.@
2013-12-31 13:42:37 <Moonlightning> ttkpy: the intro paragraph is a great explanation, but the rest is what I meant when I said /weird math stuff/
     #python
 
 
 [1036] #programming_is_hard
2013-12-31 11:37:07 <JC_SoCal> i need to supply input to this function with 8 bytes
2013-12-31 11:37:10 <JC_SoCal> however i want to iterate all possible combinations of 8 bytes
2013-12-31 11:37:21 <cesarkawakami> JC_SoCal: all possible combinations of 8 bytes is a huge number.
2013-12-31 11:37:42 <JC_SoCal> so i figured i could make a generator
     #python
 
 
 [1035] #thinking_different
2013-12-27 17:20:13 <rolleiflex> javascript lacks some basic programming fundamentals. these profoundly change the implementation of V8
2013-12-27 17:20:27 <dunpeal> rolleiflex: which "fundamentals"?
2013-12-27 17:20:47 <rolleiflex> classes, though you can tack it on
     #python
 
 
 [1034] #thinking_different
2013-12-27 15:24:58 <dbillz> Is it better to learn python 2 or 3 if you are new to the language?
2013-12-27 15:25:04 <cdunklau> dbillz: python 2
2013-12-27 15:25:42 <dbillz> Why is this? I've noticed most resources focus on python 2 for beginners even modern books
2013-12-27 15:26:01 <cdunklau> dbillz: that is a big reason I recommend python 2
2013-12-27 15:26:14 <dbillz> Why python 2 before 3? sounds counter intuitive
2013-12-27 15:27:29 <cdunklau> dbillz: there is far more information available about python 2. also more third-party librarys support it
2013-12-27 15:29:56 <cdunklau> dbillz: i suggest that knowing python 2 is a good thing, since most of the python code out there is python 2
2013-12-27 15:30:02 <cdunklau> dbillz: but you don't necessarily have to start with it
2013-12-27 15:33:31 <kevlarman> dbillz: most code out there currently is python2, and it's still not uncommon to have a library you need to solve a problem not available in python3 yet
     #python
 
 
 [1033] #duh
2013-12-26 10:23:06 <rikonor> what is a POSIX system, if its not too hard to explain
2013-12-26 10:23:16 <therealfakemoot> http://en.wikipedia.org/wiki/POSIX
2013-12-26 10:23:28 <rikonor> great explenation, thanks! (-:
     #python
 
 
 [1032] #wtf
2013-12-18 15:10:19 <eevee> it's sort of sad how much effort is required to get a particular editor to work with a particular language in a useful unobtrusive way though
2013-12-18 15:10:32 <eevee> or, you know, ditch the editor entirely and use a different one per language (ugh)
2013-12-18 15:10:39 <kevlarman> dash: i'm confused, how did we get from text editors to programming languages?
2013-12-18 15:10:41 <dash> eevee: well I have hope, there has been a lot of good progress in parsing in the past few years
2013-12-18 15:11:00 <dash> kevlarman: 'text editor' is an accident of history
2013-12-18 15:11:09 <dash> kevlarman: what you actually care about is "tools for creating programs"
2013-12-18 15:11:26 <dash> kevlarman: text editors are just the major component of that right now because everybody's toolchain is exclusively text-oriented
2013-12-18 15:11:54 <eevee> dash: we would definitely need a lot of infrastructure to get non-text-based toolchains viable
2013-12-18 15:12:30 <dash> http://bsumm.net/2012/08/11/steve-yegge-and-grok.html 
2013-12-18 15:12:35 <ttkp> toolchains should be text-oriented
2013-12-18 15:12:41 <dash> "bring toolchain feature parity to all languages, all clients, all build systems, and all platforms"
2013-12-18 15:12:48 <dash> ttkp: Why should they be?
2013-12-18 15:13:18 <ttkp> dash - because they are then extensible using the wealth of extant text-oriented utilities
2013-12-18 15:14:01 <dash> ttkp: i propose we should instead have better tools so we can have better program representations.
2013-12-18 15:15:22 <ttkp> dash - you have a *lot* of standardized tools to re-implement, and advocate for universal adoption.  I won't stand in your way, but .. good luck :-)
2013-12-18 15:16:07 <dash> ttkp: Sure. And there'll be a need for text-based serialization
2013-12-18 15:17:04 <dash> the first steps are making sure languages provide their own sourcecode and AST manipulation tools
2013-12-18 15:17:15 <dash> python should have an AST->source pretty-printer
2013-12-18 15:17:17 <eevee> there are two problems here already
2013-12-18 15:17:33 <eevee> 1. text doesn't have to be a valid AST, and while writing code, most of the time it's not
2013-12-18 15:17:36 <eevee> 2. perl
2013-12-18 15:18:11 <dash> solution to #1 is incremental parsing (i.e. a parser that takes an old AST and new text and produces a new AST)
2013-12-18 15:18:23 <dash> that will let you do fast reject of syntax errors
2013-12-18 15:18:49 <dash> solution to #2 is to start a mars colony composed of every perl programmer in the world
2013-12-18 15:18:57 <eevee> sure, except it's still not a valid AST, so what does the editor do with it in the meantime
2013-12-18 15:19:21 <dash> eevee: mark it as "invalid section"
     #python
 
 
 [1031] #fyi
2013-12-18 10:42:38 <sontek> Whats the best way to track down where our app is spending its CPU time?  We are seeing some slowdown with gevent, even though we are using non-blocking calls (http requests) only.  So it seems to be doing some CPU bound tasks that we aren't aware of.
2013-12-18 10:44:45 <sontek> We we using cProfiler but it seems to only do overall time spent on CPU and doesn't break it down per function
2013-12-18 10:45:03 <sontek> We know overall its spending too much time on CPU, we need to know *where* its spending its time
     #python
 
 
 [1030] #programming_is_hard
2013-12-17 17:41:16 <Pinkamena_D> is anyone aware of some library which can compare and find out if two audio samples are 'the same' within some ajustable threshold?
     #python
 
 
 [1029] #duh
2013-12-12 15:30:50 <aberrant> so, this is sort of off-topic, but do API calls generally use the standard HTTP status codes?
2013-12-12 15:31:14 <dash> aberrant: by "API calls" do you mean "HTTP requests"?
2013-12-12 15:31:27 <aberrant> dash: yes.
2013-12-12 15:31:55 <dash> then yes.
     #python
 
 
 [1028] #lost_in_translation
2013-11-27 14:35:10 <jlevesque> python threads created outside the 'threading' module is considered daemonic -- what if they are created with `_thread` module, is that considered daemonic?
     #python
 
 
 [1027] #wrong
2013-11-26 11:00:43 <ttkp> At [REDACTED] we had python libraries with parts implemented in C, and the C code was all in separate files, with filenames prefixed by underscores.
2013-11-26 11:01:16 <ttkp> Does python have anything similar to perl's Inline::C module, for C-code and python code co-existing in the same source file?
2013-11-26 11:01:27 <dash> ttkp: there's stuff
2013-11-26 11:02:02 <ttkp> dash - what do you recommend?
2013-11-26 11:02:08 <dash> ttkp: depends on what you want to do
2013-11-26 11:03:43 <ttkp> dash - I'd like to hand out a python library, which I have partially written in C, with the expectation of people just using it without worrying about compiling it themselves (if they have a C compiler on their system).
2013-11-26 11:04:29 <dash> ttkp: what do the C parts do?
2013-11-26 11:05:20 <ttkp> dash - usually something math-intensive, like calculating the area of an irregular polygon.
2013-11-26 11:05:48 <dash> ttkp: sure. for that just use python
2013-11-26 11:06:28 <ttkp> dash - Well, I'd like it to perform nicely, and C usually performs between 100x and 1000x as well for math-intensive operations.
2013-11-26 11:06:47 <dash> ttkp: eh, maybe 2x-10x
2013-11-26 11:07:10 <ttkp> dash - I guess we've had differing experiences in that regard.
 
[Note: see a few actual microbenchmarks at: http://ciar.org/ttk/public/vs/ ]
 
     #python
 
 
 [1026] #programming_is_hard
2013-11-19 09:37:43 <Razkin> Is it possible to create an script that shall name every .gif file in a folder to a*.gif, like in alphabetical-order, ab.gif, then ac.gif, then ad.gif..etc
2013-11-19 09:38:05 <Yhg1s> Razkin: yes, that's perfectly possible.
2013-11-19 09:38:15 <Razkin> Yhg1s: can you please write something for that.
2013-11-19 09:38:24 <Yhg1s> Razkin: what part is giving you trouble?
2013-11-19 09:38:33 <Razkin> Yhg1s: I don't know any language.
2013-11-19 09:38:40 <Razkin> Yhg1s: I just came here thinking that I'd get some help.
2013-11-19 09:38:48 <_unary> Razkin that's not giving a helping hand, that's doing it for you
2013-11-19 09:38:54 <Yhg1s> Razkin: I'm afraid this channel is for helping people learn Python.
2013-11-19 09:39:41 <ttkp> thank you Razkin, for making me smile for the first time today :-)
2013-11-19 09:40:05 <Razkin> ttkp, I came here to make your penis erect, not your smile.
2013-11-19 09:40:22 <ttkp> ooh, and I was just typing up a solution for you, too ;-)
2013-11-19 09:40:30 <Razkin> OH TTKP
2013-11-19 09:40:31 <Razkin> I APOLOGIZE
2013-11-19 09:41:31 *<* Razkin has been kicked off channel #python by Yhg1s (come back when you want to learn Python)
     #python
 
 
 [1025] #thinking_different
2013-11-14 09:29:20 <topi`> loops make code ugly
2013-11-14 09:29:26 <topi`> I like list comprehensions and itertools
     #python
 
 
 [1024] #wrong
2013-11-13 11:57:41 <kevlarman> dash: processes have difficulty efficiently communicating
2013-11-13 11:57:52 <dash> kevlarman: unix processes yes
2013-11-13 11:57:56 <dash> kevlarman: erlang processes less so
     #python
 
 
 [1023] #windows
2013-11-12 13:21:00 <Jerub> actually, oursql sucks if you're on windows becasue i have no idea how to build it on that platform and there's a bunch of hard to fix bugs.
     #python
 
 
 [1022] #windows
2013-11-11 11:04:50 <mlt-> How can I use multiprocessing on windows in embedded python? As there is no fork() on that platform, multiprocessing pool fires up another instance of host application instead of python interpreter only. Is there an easy solution?
     #python
 
 
 [1021] #duh
2013-10-24 22:26:07 <Windy828> SIGINT is not just a linux or just a windows thing?
     #python
 
 
 [1020] #thread_hate
2013-10-24 14:39:15 <ssbr`> dw: my attitude with locks in projects has been to remove them if they're for some abstract untested "thread safety" feature
     #python
 
 
 [1019] #windows
2013-10-23 20:52:23 <ssbr> dw: my experience with windows is one where select magically doesn't work on pipes
     #python
 
 
 [1018] #wtf
2013-10-22 14:29:52 <Remram> other question, why aren't warnings objects?
2013-10-22 14:29:58 <Remram> they are a string attached to a class
2013-10-22 14:30:12 <Remram> this is kind of weird and really not practical
     #python
 
 
 [1017] #unnecessary_complexity
2013-10-21 15:41:09 <grout> how can i do a loop for an ammount of lins in a text file?
2013-10-21 15:41:36 <ttkp> grout: for line in file_handle:
2013-10-21 15:42:18 <dbsr> grout: if you know the number of lines you can use enumerate and break
     #python
 
 
 [1016] #programming_is_hard
2013-10-21 15:39:27 <davo> how can I tell how the python script is intending to be used?
2013-10-21 15:39:49 <Yhg1s> davo: you'd have to read the code.
     #python
 
 
 [1015] #wrong
2013-10-18 11:17:46 <therealfakemoot> CrtxReavr: If open() throws an error, you'll know that it doesn't exist
2013-10-18 11:17:29 <therealfakemoot> CrtxReavr: If it's there, you'll be able to open it
     #python
 
 
 [1014] #wtf
2013-10-16 14:59:27 <savid> Is there a way to use inspect to find exactly where a variable was defined?
     #python
 
 
 [1013] #duh
2013-10-15 19:22:45 <dman777> hi, if i have a function that i want to run once a minutes, does python have a function for that(like javasrcipt has setInterval())? should I use celery or would that be overkill?
2013-10-15 19:23:18 <cesarkawakami> dman777: crontab?
     #python
 
 
 [1012] #unnecessary_complexity
2013-10-15 16:53:39 <diverdude> how do i print a status output every 5 seconds in a while loop?
2013-10-15 16:54:15 <mayhew> diverdude: you create another thread, look into the threading module docs
2013-10-15 16:54:20 <cesarkawakami> diverdude: You could check in each iteration if 5 seconds have already passed
2013-10-15 16:56:01 <\u03b5> diverdude: may I suggest using Twisted?
     #python
 
 
 [1011] #lost_in_translation
2013-10-14 18:28:38 <python000> I need to print out each sys.argv I specified depending on how many syntax I give in the command line
     #python
 
 
 [1010] #null_semantic
2013-10-14 18:02:36 * ttkp was about to ask about that .. at previous employer, everyone used ''' for multi-line comments
2013-10-14 18:02:55 <_habnabit> ttkp, terrible
2013-10-14 18:03:30 <ttkp> _habnabit: Why terrible?  (I'm not defending it, just want to know the rationalle)
2013-10-14 18:03:44 <_habnabit> ttkp, it's not a comment. it's an abuse of syntax
2013-10-14 18:03:55 <ttkp> _habnabit: ah.
     #python
 
 
 [1009] #programming_is_hard
2013-10-14 12:50:06 <nosklo> nested structures suck. It's best to avoid making them in first place
     #python
 
 
 [1008] #wrong
2013-10-14 10:18:16 <Ivo> Eagle5: python's loops should iterate over collections of things most of the time, not usually a range of numbers like older languages (C, java) might.
 
[Note: Python was released in 1991; Java was released in 1995.  Aside from that, though, afaict the reasons people avoid C-style for loops are (1) an aversion to "math", and (2) they're a lot slower in python than iterating over a collection.)
 
     #python
 
 
 [1007] #windows
2013-10-11 18:20:04 <dunpeal> just wanted to say thanks, we're seeing a large performance degradation due to process spawning on Windows, and that's apparently it.
     #python
 
 
 [1006] #windows
2013-10-10 15:31:41 <kevlarman> Jerub: just do what i do: pretend no one runs windows servers and then act surprised when someone tries to do it :P
     #python
 
 
 [1005] #windows
2013-10-10 13:45:26 <ttback> Vivekananda_: a lot of stuffs are special on windows with python
2013-10-10 13:45:31 <ttback> Vivekananda_: i'm happy to not have to deal with that
     #python
 
 
 [1004] #windows
2013-10-09 12:08:39 <Remram> why aren't os.readlink() and os.symlink() available on Windows?
     #python
 
 
 [1003] #windows
2013-10-08 13:46:23 <eciv> in windows, why does os.path.join('dir','name') return dir\\name and not dir\name?
     #python
 
 
 [1002] #windows
2013-10-04 15:26:22 <noob101> Tritium, what is a daemons.
2013-10-04 15:26:40 <[Tritium]> noob101: they are called services on windows
     #python
 
 
 [1001] #windows
2013-10-04 10:50:40 <[Tritium]> gtk look horrid on windows </opinion>
     #python
 
 
 
 
    Ciar Main Page >> TTK's Home Page