« first day (2077 days earlier)      last day (2868 days later) » 

3:02 AM
I'm using Linux again, hurrah! Hurrah!
 
3:35 AM
Hello everyone! this is my first time on the chat, I recently gained 20+ reps!
 
 
2 hours later…
5:57 AM
@JGreenwell Last time I had to use Windows, I lasted only 1 week.
cbg btw
 
6:33 AM
Morning cabbage
 
6:52 AM
cbg
 
7:18 AM
Stupid reason to downvote #81: to make your new answer to an older question 'stand out'. I had this happen twice to the same answer in two days.
 
cbg
./script.py works well and I just curious to know why ./script compile file not working ? is there any other way to make it work without typing python script
 
Yes. Google for "Python shebang"
Though really your question is not very clear.
So I've had to guess what you actually mean.
You should write clear and concise questions.
 
Hm...! I want to know " Can I able to run compile script without mentioning python in the start ?"
normally i can run the compile script "python script.pyc"
 
Then yes, google for "Python shebang"
 
yeah shebang works with executable script not the compile script .. ./shebang
 
7:36 AM
@RajaSimon: .pyc files are just cached bytecode files, and they are binary data. You can't use those with the shebang feature because they are not text. On UNIX systems, there is no way for you to run a .pyc byte cache file without explicitly naming the python command to run them with.
Python doesn't actually byte-compile the start-up script, only files you import.
 
oh... Okay @MartijnPieters thanks for the explanation ..
 
0
Q: Python - writing to python files?

AndriusIs there some more convenient way to write into python files than using read/write for any file (like txt files etc). I mean python knows what actually is the structure of python file, so if I need to write into it, maybe there is some more convenient way to do it? I have lots of these files in...

 
If you want to only distribute .pyc files, include a small stub script file that imports your project.
 
too broad?
 
Is there any advantage gained from running bytecode files directly? Doesn't the python command look at the dates and then can tell "This is py and pyc match so I'll run the pyc" or something?
I swear I remember hearing that somewhere.
 
7:39 AM
@MartijnPieters the main purpose is distribute... I don't want them to look my code...
 
The original code can be retrieved from bytecode.
 
oops...
 
51
A: Is it possible to decompile a compiled .pyc file into a .py file?

RichVelUncompyle2 worked well for me with Python 2.7 to decompile the .pyc bytecode into .py, whereas unpyclib crashed with an exception. See this answer on uncompyle2 for some other comments.

 
@RajaSimon note that .pyc files are trivially decompiled again.
or rather, disassembled; just run dis.dis() on them.
Conversion to readable Python code is slightly harder but there are scripts that do this.
Rather get yourself a proper source code license and have a lawyer go over this for you. Code obfuscation rarely works.
 
Oh... I already emailed to that person hope they will not decompile... @MartijnPieters next time I'll get the lawyer :)
 
7:46 AM
Cabbage!
 
8:21 AM
from @IljaEverilä though
 
8:33 AM
BREXIT NOW! (hope my reverse psychology works)
 
8:43 AM
Cbg
@AnttiHaapala :)
 
9:01 AM
@AnttiHaapala If the outcome is to leave, I'm blaming it on you.
;-)
 
good late morning
@MartijnPieters I think that's called "strategic downvoting"
but really it should be called "asshole downvoting"
 
@AndrasDeak it absolutely is. The first of the two answers was rather dismal, and then became victim of the same tactic when the second one was posted. Oh the irony!
 
:)
maybe the second one didn't read your answer, but used mathematical induction with the other crappy answer as n=1, forgetting to prove the induction step
Oh @QPaysTaxes good to see you here:) Let the weird whitespace-sensitive syntax flow through you.
 
9:24 AM
Hey up.
 
Mornin'
 
If we leave the EU, will they rename it to Britgamer?
 
Sooo...is the brexit vote tomorrow?
 
Today!
 
Today
 
9:36 AM
oooooooh
nice:D
 
If we leave the EU it won't matter because it will break the final sigil, thus releasing the Great Lord Cthulhu from his restless slumber.
 
welp, good luck (and potentially thanks for all the fish)
 
Also - dick move by ScotRail today. They're striking.
 
I assume they all have shares in train automation companies, because that's probably what they're hastening
 
@IntrepidBrit that does sound dicky
 
9:38 AM
It's literally because they don't believe the doors controlled by the driver are safe, as opposed to being controlled by the conductor
 
Oh yeah I heard an interview on the radio about that yesterday
 
Despite the fact that elsewhere in the UK driver controlled doors haven't caused commuter massacres for the last 30 years
Why let the facts get in the way of a good story?
 
I thought they were looking forward to becoming an EU enclave within Royal Britland
 
@AndrasDeak they aren't EU on their own either :) Ireland will do well if it happens, I think
 
What do you mean by the first sentence? I couldn't parse that, sorry
 
9:42 AM
Scotland aren't in the EU in a way that would keep them in if Brexit happened
 
Aaah, I see, thanks:)
 
They'd need to perform the Great British Break-Off, and then apply to join the EU, which would take about 5 years
 
Crucially there's a gap between Scotland breaking off and them joining EU/NATO where we could re-invade.
 
Sssh. It's all part of the master plan
 
9:44 AM
:D
 
The UN have a pretty good track record of stopping that sort of thing, so I'm sure they'd prevent it. cough
 
Whilst we're split from rUK and rEU, it gives us time to unleash the Martijn in all computer systems North of the border legally
Then begins the SOPython control of the globe.
is now on a government watchlist
 
But which government?
 
That'd ruin the fun! When the masked men arrive in the middle of the night - I don't want to be spoiled knowing which nationality is dragging me to the gulags.
 
And possibly by the gulags
 
9:52 AM
I'm told it's real fun when you fear any noise in the night, waiting to see if the doorbell is rung
 
hello... i need a little help in python-rq
 
"doorbell terror [as in fear]" was a thing during the hard communism here
 
I feel bad for making that joke now
 
no don't be:P
I'm just a party pooper:D
with my fun historical trivia
all the people who were grown-ups in that era are very old or dead
 
Party poopers were also feared
 
9:58 AM
especially by disease control services
 
@MannuNayyar Sorry buddy. Don't know much about python-rq so any "help" I could give you would be counter productive.
On the bright side, you can now send all your party poopers to the EU as MEPs. Everyone's happy!
That's why we kept electing Farage as an MEP and not an MP
 
10:15 AM
yeah we've had the foremost neonazish lady of ours in Brussels for years now, it's working great:D
 
cbg again
@MannuNayyar I have used Celery before. If it's a very general question, I might help. Also, you can ask your question without asking for permission.
 
10:41 AM
Is it just me or is it a very slow day?
 
10:53 AM
I reckon us Brits will be quiet all day. We're going to spend it yelling at each other and telling them that their opinions are wrong, damnit!
But seriously though - it does seem slow
 
I've got a small worry that after the results are counted, the house we want will either get lots of other offers, if we remain, or our offer will be accepted and the house will be worth 40p in 5 years, if we leave
 
I had the same worries Bobby, until I figured it that it doesn't matter that much, because it's not just an investment, it's a roof over your head.
 
so why are news sites full of bloody football?
 
Because there's no other kind of football than that, while England are still in
 
So even if the value tanks, some yamming landlord can't turf you out
 
10:58 AM
Just hoping all of the worst fans aren't in the country, and don't know how to vote remotely
 
:D
I think they're happy with not needing a visa to burn cars in Lille
 
(I personally think that we should whitelist fans for international competitions, not blacklist them)
 
How do you get added to the whitelist?
 
By attending X domestic games and by not being a dickhead
 
yeah that would not be very liberal
also, we'd still need a precise dickheadometer, I hear those are rare to come by
 
11:01 AM
Not beating the living crap out of foreigners is a good indicator.
 
or just hidden by the Americans (HA!)
 
11:52 AM
cbg
 
hello
 
i don't understand why does this not work - `we=we.rstrip('\n') for we in w` where w is a list
 
@ChahatUpreti you need parentheses for a list comp
we=[we.rstrip().....]
 
oh thanks!
 
11:54 AM
square brackets for list comp, round parentheses for a genexp
depending on what you need
curly braces for a set comp, which you probably don't need
 
Curly brac...
Damnit Andras!
 
:)
you can still have dict comps if you come up with a modified scheme:P
 
and, also this does not raise an error, but somehow the trailing \n's are not removed
any ideas?
 
Bonjour, Europeans ;)
 
my list is just a list of numbers endin with \n
 
11:56 AM
@JRichardSnape hyvää päivää
 
like w=['10086\n', '10166\n', '10299\n', '10326\n']
 
@ChahatUpreti then you need the string \n removed, not the end-of-line character
use r'\n', a raw string containing a backslash and an n
'\n' is a single character denoting the line feed (end of line)
 
but it is an EOL character, right?
 
@AndrasDeak Hei siellä
 
@JRichardSnape uh-oh, you're on to me
 
11:58 AM
;)
 
my table is just these numbers on different lines @AndrasDeak
 
@ChahatUpreti but did you create those with a list?
 
no i wrote myself
 
What happens if you write print(w[0])? does it print \n at the end? Or a newline?
 
it prints 10086 followed by a new line
 
11:59 AM
hmm
then you're right, you really do have '\n', the line feed at the end
I'm not sure why rstrip doesn't remove it
 
'allo 'allo JRS
 
>>> t='145\n'
>>> print(t)
145

>>> print(t.rstrip('\n'))
145
works both in python 2 and 3
 
@IntrepidBrit thanks for replying.
 
@Chahat are you looking at we as the result and not w?
 
i do this rstrip, and print individual list elements, they dont have the nw line, but when i print the overall list, it again shows the \n
 
12:01 PM
you're assigning to we and not w...
I suspect a case of brain fart:)
 
ya, how do i change the list, do i create a new list?
 
@khajvah thanks for reply...i also used celery but worker misses tasks.
okay so the problem is the worker is shutting down by itself.
 
@ChahatUpreti your code should look like we=[we.rstrip('\n') for we in w] right now. Are you serious?
 
@AndrasDeak, ya i did that and the result for print wis ['10086\n', '10166\n', '10299\n', '10326\n']
*print w is
 
OK, at this point I have to ask you to do a Python tutorial
 
12:05 PM
yeah, i guess you are right
 
well, first you should carefully read what I already told you, but you can't avoid a tutorial
there are some tips here
I assume you don't have much experience with programming at all
 
you are right
 
well, glad to have you among us, and good luck with learning the basics:)
 
thanks!
 
@ChahatUpreti - here's a list of tutorials we recommend sopython.com/wiki/What_tutorial_should_I_read%3F
Welcome to a new, wonderful and pythony world ^^
 
12:08 PM
thanks @IntrepidBrit!
 
@IntrepidBrit oh rly:P
 
Heh heh heh
 
I come from wonderful JavaScript world.
suicide rate was too high in my world
 
must be truly wonderful indeed
Like those lemmings who take a deadly plunge to meet their hasty end. Truly magnificent creatures.
 
@AndrasDeak population growth was truly high too
 
12:10 PM
(I know it's probably a legend, but a good one)
 
only lucky ones like me were able to migrate
 
12:23 PM
@IntrepidBrit Hey up Intrepid. I liked your comment about the house == roof rather than investment.
 
Cabbage
 
Yeah, I've got a couple of friends who've recently had twins, and have their third child on the way. They've been turfed out by their landlord and they're struggling to find somewhere decent at short notice :(
 
I've been busy working on my custom json.JSONEncoder class, CompactEncoder. I still haven't added support for check_circular=True, but it now handles all the other args properly, including default. You can use it via json.dump or json.dumps, by supplying it as the cls arg, or you can instantiate it yourself and call its .encode method. I haven't bothered implementing the .iterencode method; I suppose that would be a nice feature...
 
cabbage PM
 
@IntrepidBrit That's hard. It's a pretty rough deal being a tenant here (I assume it's the same north of the border)
 
12:30 PM
Hi, Andras. How are things in Überwald? :)
 
@IntrepidBrit crap :(
 
@IntrepidBrit That's evil.
 
It certainly sucks. Very much appreciate that the only person who can evict me is me, (and IntrepidLass).
 
@PM2Ring heeey, I live west from there!:D
Otherwise, fine thanks. What about you?:)
 
Oh, ok. I still have traces of the 'flu lingering. And the weather is finally getting a little bit wintry. They predict that the temperature will drop below 10°C tonight.
 
12:35 PM
Sounds glorious.
 
cbg guys
 
It's 18° right now, but my mum complains of the cold when it gets below 20°. :)
 
hope you'll flly recover soon, then:)
 
Hey guys
Can anybody help me with bs4?
 
Don't ask to ask, just ask mate (see room rules)
 
12:44 PM
okay...
i am getting this error "'NoneType' object has no attribute 'find_all'"
 
Then whatever instance you're calling find_all() on, is None
 
and this is the loop to get all the href values for all anchor tag
for link in [h.get('href') for h in self.soup.find_all('a')]:
 
self.soup must be None, then
 
then self.s...
DAMNIT Kevin
Am I just really slow @ typing?
 
okay...
let me check
 
12:46 PM
sentences less than six words just come straight from my brain stem so I don't get bogged down by having to actually think about what I'm saying
 
you got it right guys...
it was the soup which was none
 
My sentence from two sentences ago isn't less than six words, but you'll have to excuse my brain stem, because it's rubbish at counting
 
HTTP Error 403: Forbidden signifies that i don't have permission to access that site? Right?
 
@Mannu
Just curious, are you trying to get all links in achor tags
 
ya @malhar
 
12:50 PM
Sure, that's one reason you might get a 403.
 
ya...you got it correct
okay @Kevin
 
@IntrepidBrit got Kevin's joke?
:D
i was thinking about it too
 
Yep. Was amused
 
morning everyone
I'm so perplexed by how datetime objects work in different languages
 
12:56 PM
Define "work"
 
I like C's version
 
I'm scoring well on my latest answer, but the OP hasn't given me an accept. Maybe he's hoping for a Martijn-level answer... stackoverflow.com/a/37990980/4014959
 
'Marjtin-level answer' Ha! Nice one!
 
@AndrasDeak wikipedia articles about math/physics are usually impossible to understand
too dry
 
1:02 PM
oops:D
wrong link
sorry
 
@corvid That's partly due to the lack of datetime support in C, so there's not a simple, well-defined base implementation for later languages to adopt. So there are a bunch of variations, some of which are merely a PITA, some of which are actually broken, like Excel's, which inherited a buggy leap year calculation from Lotus 1-2-3, so it believes that 1900 was a leap year.
 
@PM2Ring well...
 
@khajvah They can be good if they aren't too advanced. The advanced ones tend to be useless to learn from, but they're an ok reference if you already know the stuff.
 
Morning cabbage.
 
@AndrasDeak He also asked me that in a comment on my answer, and I replied.
Evening, Morg e an.
 
1:09 PM
oh, didn't notice that, sorry
 
@PM2Ring yeah that's true. I always have the "wtf" feeling when I first read those articles but after learning it's quite useful.
It's like readin K&R C book
 
except physics is not arbitrary, only complicated
but yeah I know what you mean:)
gotta go now, see you later
 
@AndrasDeak You may enjoy this current xkcd thread: Relativistic Lorentz force. There's some dumb stuff there, but there's good stuff too.
 
@PM2Ring oh yeah that seems like a messy subject
thanks, I'll check it out:)
@PM2Ring Of course it's current, it's about electrodynamics!
 
@khajvah K&R C is a great book. But it's a terrible book to learn your 1st language from.
 
1:20 PM
cbg all
 
@PM2Ring I'm having a lot of trouble with saveable recuring dates :\
and spelling for that matter
 
@corvid Like you want to do something on the 1st of every month, or the 1st monday in every month, that sort of thing? Is this in Python?
If it is Python, take a look at datetime.datetime.replace
 
lunchtime cabbage
 
@PM2Ring It has to be serializable and searchable, so I was thinking of offset since beginning of day
 
user559633
cbg
 
1:32 PM
@corvid That sounds reasonable.
 
The problem is that it is being incredibly frustrating to convert the time zones appropriately
 
Cbg
 
Hi, @Richard_G!
 
cbg all
 
@corvid you want recurrence rules: tools.ietf.org/html/rfc2445#section-4.3.10. dateutil can parse them: dateutil.readthedocs.io/en/latest/rrule.html
 
1:42 PM
@davidism awesome, that helps, thank you sir
 
unfortunately generating the rules has been left as an excercise for the reader
 
the worst kind of problems are the kinds that are hard to google :\
 
@corvid On Linux there's a database of timezone info, in /usr/lib/zoneinfo or /usr/share/zoneinfo, but the data is in a binary format. Take a look at the man pages for tzselect; the man page for tzfile has details of the file format.
 
If you're using dateutil it pulls in pytz.
 
I'm just getting some pretty strange error. I am on the East Coast (Murica), and when I use a utility to get the ms offset from the start of UTC day on the server, I get 2016-06-23T13:43:59Z, but on my client, it seems to make it a different offset completely
 
1:44 PM
Greetings, @holdenweb. Maybe you can add further light on Richard_G's question... and correct any errors I made. ;) stackoverflow.com/questions/37990752/empty-class-size-in-python
 
1:57 PM
Hey PM!
 
@corvid yeah I struggled when they said the Brexit voting stations close at 9pm CET
 
Has the poll finished?
 
When answers to questions solve your problem but you have another problem: stackoverflow.com/questions/37993600/…
(and you don't bother Googling for the answer)
 
What's a brexit voting station? Am I not European enough?
 
2:12 PM
Can crows be European?
 
guys, what did I do to make git exclude directories?
 
edit your .gitignore file
 
those are not in gitignore. I created those in pycharm and probably clicked a wrong button
weird
 
Are there multiple .gitignore files in your structure?
 
nop
 
2:17 PM
@khajvah git doesn't track directories, it tracks files
the only way to create a directory with git is to put a file in it
if you don't have a file in it that git can see, honey badger git just don't care
 
I have files in them
 
Is git tracking those files?
or file types?
 
well it should but it doesn't
 
and, you do have actual saved changes to the file, right? ;)
 
oh nvm. Some idiot(me) accidentally put .py in gitignore
god damn
 
2:20 PM
trololol
meant to be .pyc, eh? :P
 
probably. Wasted precious minutes after work
 
Github could troll people by making the default .gitignore for python ignore *.py
 
I have a strong tendency to copy my .gitignore from other projects, because it's pretty much always the same
@corvid irony is that the Github default .gitignore for python projects still requires like 3-5 more ignores for me
 
yeah same with the Node based one
 
I'm pretty sure that all the .gitignore files on github should come with *.sw[a-p] in them (which ignores all vim swap files, including if you have leftover swapfiles because vim crashed)
 
2:24 PM
I hate those files :\
 
I used to just put *.swp, but there were occasions where I'd end out with .swo
and then git would be like, "Oh look! New files!"
it wasn't until I has *.sw[p-z] in my gitignore and that happened again that I realized they were incrementing backwards
which produced the coolest mnemonic, and I'm like 90% sure that's why they increment down instead of up.
because how hard is it to remember that vim swap files are ignored with *.sw[a-p]?
at least, you know, the first 17(?) anyway
and if you've had that many hard quits of vim and you haven't bothered cleaning up your swap files you're doing something wrong
 
@WayneWerner Oh wow, that is really smart.
At least vim does one thing right. ;) ducks.
 
:D
I used to be a lot more um... sensitive about my editors
 
I actually don't mind vim. If I'm not going to use an IDE and I'm doing something more complex than just taking notes or something, I'll use vim.
That just rarely happens.
I do have vimmium installed for chrome, which I love.
 
but embracing ed as the standard editor really made me a lot more accepting that not everyone has achieved true enlightenment
 
2:29 PM
I use vim myself, it's easy
 
:D
@MorganThrapp What, you don't have helptags setup to use vim as a personal wiki?
 
That is insane.
 
The biggest gripe that I have with IDEs is that their attempts at vim plugins all suck. Look, if you have tabs, and :tabnew and :tabp and :tabn don't all work then your so-called vim mode is stupid.
Or if you can split windows and :split <filename> doesn't work
 
I thought pycharm's vim emulation was good.
 
See, I was about to say how much I didn't like PyCharm's vim emulation. :P
 
2:33 PM
but admittedly, I haven't really used it much
but, whats wrong with it
 
Though that's more because it shadows a bunch of PyCharm's built in hotkeys that I use all the time.
 
does it feel like its only a small subset of the functionality?
hmm, that makes sense
 
Nah, more that I only want a small subset of vim and it did too much.
I just want the movement/selection type stuff.
 
Then I've also had vim-modes in editors that have the concept of vim's buffers (think, multiple clipboards), but the vim mode can't use the buffers! \o/
@MorganThrapp Then 90% of the vim modes will be perfect for you ;)
 
Yeah, PyCharm has the opposite problem where I cannot get it to play nice with the system clipboard in vim mode.
 
2:35 PM
ahh, that makes sense
 
That was my other big problem.
 
but i think you can have multiple buffers in pycharm though
 
Yup, Ctrl+Shift+V.
 
@MorganThrapp Yeah, if "+y doesn't yank your currently highlighted text into the system clipboard, your vim mode is also broken
 
It keeps the last 5 by default, but I assume you can change that.
 
2:36 PM
and "+p to paste from system clipboard
 
Oh, huh. I never tried that. :P I'm not super familiar with vim, so I didn't know those were options.
 
like... most of these things aren't even that arcane. Just pick your hotkeys that you normally have in your system and google for that thing+vim. If you find a result and you don't have those in the vim mode... I will hate your IDE, lol.
I mean... surely one can create a quick text list of all the hotkey descriptions
 
I was missing things like Ctrl+Q for inline docs or Ctrl+Shift+I for inline implementation window.
They're not overwritten by vim, they just don't work.
 
and quickly create a text file with google.com/search?q=vim+paste+from+clipboard
Yeah... they probably wouldn't, heh
but vim has the idea of a leader key
 
@PM2Ring Looks like perfectly sounds reasoning to me
 
2:40 PM
Thanks.
 
I had to teach my new minion to use vim earlier. I warned her that our tech lead would try to corrupt her by suggesting emacs. CONSTANT VIGILANCE!
 
@MorganThrapp no reason at all why the vim mode shouldn't give you something like <leader><ctrl>q and <leader>ctrl+shift+i.
 
That might work.
I admit to having spent about an hour in total on this. :P
 
Except for they're lazy and they don't care about people who really like vim. I guess they figure we're embedded too deeply in our cult ;)
@Ffisegydd I tried emacs. It hurt my pinky. Then I started using caps for ctrl, but I still disliked it. Even tried viper mode... and you would think that emacs viper mode would be a great clone of vim, but it's garbage because again, you can't yank into other buffers, :split doesn't work... I could go on.
The best thing that emacs did for me was got me turning caps to ctrl on all my computers ;)
/rant
My biggest non-vim-mode reason to dislike IDEs is that they really only work if the source is on the machine that I'm physically sitting at.
 
IDEs are just annoying because I don't want to learn a new set of hotkeys
 
2:45 PM
tmux+vim+ipython works on my machine I'm on, on my computer at home, on my DigitalOcean droplet, on my terminal.com VMs, inside my docker containers...
@corvid I actually have made it a habit of learning as many hotkeys in other editors as I can stand.
When I had to use Visual Studio I also created a shortcut that I called "Vimify" that would launch the current file in my vim session - and I even got it to put my cursor on the correct row and column :D
super helpful when I had to make bulk edits to my code, and it was fast enough that it wasn't a huge pain.
I've realized that vim being a modal editor is a really significant factor for me. I like having clear demarcations. Something about it suits my brain. Editing text vs. creating text is rather helpful for me.
I'd be super curious to see some CT scans for people using different editors - both n00bs as well as old pros.
 
We're seeing a lot of activity here in the "annoyance at being inside a CT scan tube" lobe...
 
The part of my brain where all the pictures of cats are contained is the only active part, at all times.
 
@corvid Do you use forecats.io for your weather, then?
I'm so excited to be going to weather like this instead of weather like this
 
@WayneWerner that thing uses like a gazillion CPU cycles per second
 

« first day (2077 days earlier)      last day (2868 days later) »