« first day (2333 days earlier)      last day (2624 days later) » 

3:02 PM
@Kevin I remember this video ... oh god how it was so frustrating to watch :\
 
Captain Canuck in the house.
Whaddup cabbagites
 
DSM
Tundra-y cabbage for you.
 
@idjaw waddup Joe \o how was your weekend?
 
@DSM haha....That is the first I heard someone call that.
weekend was very busy. Wife was working, so it was me and the littles
 
anyone else hanging around DFW this morning?
 
3:04 PM
I ran out of ideas by the end of the weekend, so I took my son out to the back, gave him a shovel and told him to help daddy break the ice on the deck
 
@corvid "In the long run, low standards don't benefit anyone. We're upping our standards, so up yours."
3
 
@WayneWerner the airport?
 
@Kevin so much truth in a 2 minute video
 
Indeed. On my way to NJ for business
 
But realtalk, there is value in just lending a sympathetic ear and not going into problem solving robot mode
 
3:06 PM
@corvid xkcd.com/927 Which one?
 
@WayneWerner Are you going to Suffern? I find it funny that there is a place so closely named to suffering, in NJ...based on what I keep hearing about NJ
 
Nah, Jersey City, which I hear is mostly suffering :D
or maybe that's annoying? The only thing I really know about Jersey is that people make fun of it for smelling bad, and reality shows that I don't watch
 
^^
Glad to see that even in Canada we hear the same thing
Consistency is enough proof for me
 
@MarcusS I guess I'll be across from NYC
 
Many of NJ's stereotypes are true, but not homogeneously. For instance, it's only an industrial hellscape for the 200 feet on either side of the entire turnpike. Drive a little farther and you might find some nice pine forests.
 
3:10 PM
Hm. I wonder what the cheapest way is to get to Central Park
 
@WayneWerner From NJ?
 
Yeah. I was thinking about walking - it's 1.5 hrs from where I'll be staying, which isn't bad... but there's also a ferry involved
seems like it might be worth hopping a bus at that point
 
Which part of Central Park?
 
I'm going to take a stab and say, train to Penn Station (It's Penn station right?)....then continue on the subway until you get to whichever stop closest to an entrance
 
Not that I'm committed to going, of course. But it would be interesting to visit.
 
3:13 PM
How I hate systems that use email as the primary identifier for users, but allow only searching by name in the administrative interface
 
Oh that's dumb. I mean the first part is fine, but the last part sure isn't -_-
 
@IljaEverilä that's really really silly
 
If it were me I'd use the PATH to go from JC -> NYC and then take a subway up to Central Park
 
^^ we did that in reverse when we were flying out of NYC
 
^^ yeah...I was basing my trip from Long Island....I assumed it would be similar from NJ
but you guys would probably know better
 
3:15 PM
@WayneWerner A lot of stuff is just the same thing put in a different order or arrangement though, I don't get why people waste dev cycles on that
 
Whether that's the cheapest way I don't know -- but if you plan on moving around a bit, it may be the cheapest overall since you can re-use cards, etc.
 
^^
Totally
 
Wayne, that reminds me, productivity still hasn't resume for me. I'm only on the pool of radioactive rods :) That means if there's about 100+ of these pages, this week would be my "reading" week :D
 
i am in the process of programming a game (in C# monoGame) and i want to use a scriptlanguage for Enemy and NPC AI what would the best option be to communicate with a python script?
 
IronPython, maybe?
 
3:21 PM
^^ was thinking something like that yeah. But also, no idea what your set up is going to be like. Is this just a script that will be called, is it a service that will be running?
so much room for activities
 
@KevinMGranger isn't ironPython only adding .net as imports?
 
There's also something like: pythonnet.github.io
Is IPC still a thing?
 
@idjaw the most optimal solution in my view would be something like a service
 
It's been several years since I did any .NET at all
 
Bah, posted an answer five seconds before OP deleted the question. No points for me.
 
3:23 PM
@idjaw i also thought about IPC but i wasn't sure if there isn't a better solution ^^
 
DSM
As much as I enjoy Python, I'm not sure I'd go polyglot just for a bit of program logic.
 
I guess it's better than trying to post an answer five seconds after deletion. At least users with delete-o-vision can see my post preserved forever
 
If you are looking at a service communicating over network protocol, then you need to separate things and think about how to communicate over an API of some sort. So you shouldn't be thinking in terms of put-the-python-in-the-c#......you should be thinking about something like, if Python is running as a web app, can I make it run as a web app that my C# app can hit endpoints to and get answers back. Then you don't worry about Python.
 
"forever" being defined as "until the server perma-deletes the post"
 
You might be right about IronPython. I do have to say, C# can be very expressive if you know the right tricks. You might do just fine sticking with C#.
 
3:24 PM
But....I'm going to stop assuming before I dig myself in to a hole of "I am going in the wrong direction because I have no idea what is happening anymore"
 
@SebastianL I hear that Lua is quite trendy for scripting of that kind, these days.
 
@KevinMGranger i want the game to be easily modable so i thought python would be a good idea
 
No idea if Python can talk to Lua or what, though
 
Yeah I was just writing a message about LUA
 
Well, for C# that might make it harder. Lua is the lingua franca for extensible games, although you can also do mods in C# easily.
 
3:26 PM
(That is old)
 
Or, oops, I misread the question. I thought you were writing the engine in Python and wanted some other scripting language for your scripts.
 
I know that game engines embed other runtimes such as Lua or Python for scripting, although I have no idea how.
 
^^ this proves my point of stepping away. I have no idea what's happening anymore :)
 
8
Q: Embedding IronPython in C#

Darren YoungI am just looking into using IronPython with C# and cannot seem to find any great documentation for what I need. Basically I am trying to call methods from a .py file into a C# program. I have the following which opens the module: var ipy = Python.CreateRuntime(); var test = ipy.UseFile("C:\\U...

 
A C game engine would have a very easy time just using CPython's C interface. But the CLR is a mystery to me
Ah, see, I assumed IronPython would have an equivalent to the C interface.
 
3:28 PM
i have ironPython running in my game, but to be honest the way i use it for now its quiet slow (i run a script once for every action)
 
I guess the real question is do you think you'd have access to a much bigger modding community if you allowed extension through Python+LUA vs C#+LUA
 
So then improve it? You might have better luck asking C# people about that.
 
I was just about to say, you probably need some voodoo to keep the Python environment running, because you're not going to want to start a new Python process every frame.
 
Okay Thanks anyway :)
 
3:42 PM
I'm really happy with the stack I we put together for integration tests last week
 
Welp, more flight time rhubarb
 
It was taking way too long to bring up external apps that we needed to talk to for integration tests. So I wrote really simple fake services for it that we housed in docker containers. So it would handle any API call you throw at it, but it comes up in minimal time
 
DSM
@WayneWerner: enjoy the friendly skies!
 
It cut down our test time so much
I love refactoring resulting in time saving
happiness
 
Mocks for services are cool, but why can't it be done at the local layer?
 
3:43 PM
@WayneWerner Fair skies my friend.
 
Ooh, OP undeleted his post and accepted my answer. Didn't expect that to happen.
 
@KevinMGranger We want prod-like testing, so we want to bring up the 'real' boxes with appropriate network configuration. Because, depending on the environment, the appropriate box will come up. So if you are running locally or in your own test stack, it will use the mock (unless you explicitly override)....when it needs to run in the prod environment, it just uses a different hiera, and knows to bring up the real-deal
 
We're using this cool Java library at work called Chronicle-Map. Coordinates access to memory mapped files for shared concurrent access across processes. I want a Python version of this.
 
@davidism wow...that's REALLY cool
 
My friendly skies so far: goo.gl/photos/KbXFhw7gkod6GnyJA
 
3:47 PM
@davidism So that seems to somewhat touch something done last year with distributed redis to manage locks
Is that something close to what would interest you?
Chronicle-Map seems to be much more involved in its development, though and seems to handle so much more than what I've been using with the distributed redis lock manager
 
The nice thing about this is that it's just mmap, so all processes share the same memory, access Java objects directly, and it's persistent across restarts.
 
ugh yeah...that's really nice
 
Python has mmap, so it's a matter of writing the locking and data structures.
 
That is interesting, but coming from the golang land of "don't communicate by sharing memory, share memory by communicating", it feels scary
 
So not necessarily the same...but it just reminded me of what we wrote up a little while ago leveraging another package -> github.com/internap/redlock-fifo
@davidism ^^
 
3:52 PM
@WayneWerner Reminds me of the plane ride I took many years ago during a family trip to Europe. As we were just leaving the US, I looked out the window and saw a distant peninsula through the fog. Two hours later, I looked out the window and saw the same distant peninsula through the fog. At this point, we were in the center of the Atlantic ocean. The peninsula was the plane's wing.
 
@idjaw interesting!
 
That was not my first plane ride, but it was my first wing-adjacent seating.
 
I occasionally get startled at how close something is by its flashing light, before realising that said light is attached to the end of a wing of the plane I'm on
 
@davidism This was introduced, because we needed a way to manage locks over a distributed system that requested access to switches
 
As long as the plane has both phalanges in place, those issues tend to disappear
 
3:58 PM
Had a terrible night sleep, is there any food (lunch, snacks) that would keep someone up through the work day? other than Coffee or caffeinated drinks... Else I'm just going to resort to running up and down the stairs to wake me up..
 
@MarcusS I get that reference.
@MooingRawr Try yanking out your nose hairs. Pain raises your altertness.
Added benefit: improved nose aesthetics
 
@Kevin I think I will resort to pain as my last option.... :\ but thank you..
plus I have very short nose hair, and no experience with plucking hair...
 
DSM
Do the kids still say "TMI"?
 
I haven't heard a kid say it this decade, but absence of evidence etc etc
 
@DSM I think so, yes.
 
4:05 PM
My most youthful relative has informed me that it's now cool to call small dogs "smol"
That's an adjective, mind. Don't say "that's a cool smol over there"
 
@Kevin smol, pupper, doggo, (doge is getting dated), bork, etc etc...
 
Also the new word for good is "lit". Please update your notes accordingly.
 
'lit fam'
 
The expected expiration date for this term is the exact day that English Literature teachers catch wind of it and attempt to use it in a double meaning during their class.
 
Register and ask questions for Habits for Effective Python Learning chat this Saturday.
3
 
4:10 PM
@davidism Can we just read/listen to the QA without signing up ? is the signing up process only for people to contribute?
 
The way Crowdcast works, you have to register to see the chat live or recorded, but registration is zero strings attached.
This is by the same guy I did the Flask chat with last year.
 
You're not up on the doggo vernacular? Dost thou not dogspot?
 
@MooingRawr Regarding your earlier question -- what I do is drink a ton of water
 
DSM
I like "thirsty" as slang for "attention-seeking".
 
@MarcusS I've had 2 cups of tea and a cup of water in the last 3 hours :) hopefully being hydrated will work.
 
4:12 PM
Uh, I've only seen that used as something very different @DSM
Well, I guess it's a specific type of attention...
 
Hard to fall asleep when you're constantly needing to get up for more water / go to the restroom
 
I've seen it used as "attention-seeking" but only in a particular narrow context
 
I always thought "thirsty" was slang for "overeager / desperate"
 
DSM
It's been adopted in a more generic sense in sports, typically for the sort of person who mentions his instagram feed in his postgame interview.
 
I've only seen it in the context of "overeager for physical affection", if you know what I mean, nudge nudge
 
4:15 PM
Thirsty: 1. Too eager to get something (especially play) 2. Desperate.
Thirst: A form of lust of or want of members of the opposite sex. This term can refer to both males and females.
Source: Urban Dictionary.... for what it's worth... I guess
 
Is there really a max attendance on crowdcast?
I don't get the "save my spot" thing?
I guess it can be controlled, because you want a smaller audience to communicate to easily if you are opening the floor for questions/comments?
 
DSM
Yeah, it's a tweak on that, in the same way that we use "lust" in "lust for power", "lusting after [expensive shiny object]", etc.
 
Hey, you know what they say. Two's company, $max_attendants is a crowd.
4
 
Obvious starbait, but I'll bite
 
While at Whole Foods with %relative%, I pointed out the Gorilla Munch cereal box, indicating my excitement at seeing the unrustled gorilla in person (insofar as a box can be a person, which is to say not at all). They claimed no knowledge of the social phenomena of jimmies and the rustling thereof
 
4:17 PM
The interweb is a weird place :\ I rather stick to my wholesomemes
 
Unless $max_attendants <= 2
 
^^ nerd
 
^ I should unit test my jokes, apparently
4
I'm used to them being mocked.
 
DSM
Heh
 
:D -chuckled-
 
4:19 PM
 
I think that's my cue to rbrb and actually focus on this stuff :P
 
@KevinMGranger Too Coul..ier for you? yeah no...I tried...
nose dive....crash
 
... The Excel. It's back.
 
ew
 
rb folks
 
4:31 PM
cbg("Andy K", reverse=True)
I've run out of graduate human shields to throw at it :(
/ hide behind
 
hey Python gurus. I have a small issue with IMAPLib - I'm trying to, after fetching a message, set the message back to 'unread' status so that it is 'looked at' on the next run. However, even with conn.uid('STORE', i, '-FLAGS', '(\Seen)') at the end of a for loop that iterates over the message numbers of messages listed as "unseen" from the execution, it still doesn't mark the message as unread/unseen. Anyone know how I can properly set the single message back to "unread" status?
 
DSM
Aww, visitor comes with an interesting, well-described question and it's about a module I know nothing about. :woeful:
 
lol
 
Aww, furthermore, it's a known visitor
:even_moar_woeful:
 
@BhargavRao and even WORSE, it's a known visitor who is known for needing caffeine who hasn't had any, and even MORE WORSE is the question tha kind of answers how to do this has a solution that doesn't seem to work. ONOES, EVIL AND CHAOS IS SPREADING
loljk
but still, based on everything I know about IMAP, this answer should have worked. Guess what doesn't work.
 
4:42 PM
Yeah, we're living in sad times :(
 
@ThomasWard it's clear you should've asked a vague question that after 50 minutes it becomes clear that you were trying to write jQuery in a .py file
We're good at those
 
lol
@RobertGrant well, this is kind of like tech support, a well-described question that ends up biting you all in the butt because I am knowledgeable. Oh, woe is you. :P
because all the stupid questions that COULD be asked to determine what i'm after are immediately irrelevant :)
though apparently I need a fix for keyboard fat-fingering
 
Blimey, that IMAPLib API could do with a bit of sugar
 
4:57 PM
Feeling kind of irritated that nobody's trying to address the XY problem at stackoverflow.com/q/42631097/953482
OP is saying "json.loads didn't work for me, how do I unserialize this string?" and everyone is jumping to recommend ast.literal_eval instead of trying to get loads to work
Ah, OP's edit reveals that it's not him that's dumping the data. It's some mysterious data source.
 
DSM
Some source which is providing a non-json encoding?
 
It seems so.
Incidentally, in my post, I wrote:
> You shouldn't be using str to serialize data. There's no guarantee that the resulting string will be something that can be recovered back into the original object.
And this is broadly true in the sense that __str__ is generally used to get the "informal" string version of an object. But I wonder if it's true specifically of the built-in types?
In other words, can you construct an object using only lists/dicts/ints/strings, such that ast.literal_eval(str(x)) != x
I've thought of one, but it's rather tricky so I don't think it has much explanatory value:
>>> x = []
>>> x.append(x)
>>> ast.literal_eval(str(x))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Programming\Python 3.5\lib\ast.py", line 84, in literal_eval
    return _convert(node_or_string)
  File "C:\Programming\Python 3.5\lib\ast.py", line 57, in _convert
    return list(map(_convert, node.elts))
  File "C:\Programming\Python 3.5\lib\ast.py", line 57, in _convert
    return list(map(_convert, node.elts))
  File "C:\Programming\Python 3.5\lib\ast.py", line 83, in _convert
 
Should work with repr, not sure about str. Is str the same as repr for all the basic types?
 
5:13 PM
64
Q: HTTPS: It's time

Nick CraverThis is a heads up, and a request for help. HTTPS for our entire network is long overdue, but we've been working hard on it behind the scenes. Expect a pretty big blog post when we turn it on everywhere that details the journey. There are a few lingering questions on HTTPS we're not confident i...

(the title is a lie, it's not actually done yet, just mostly done for MSO and MSE)
 
Well, OP gave the accept to one of the literal_eval answerers, so I don't think I'm going to be able to wheedle more details out of them now that their problem is ostensibly solved
I just hope the mercurial data source doesn't decide that it would rather use < and > for their string delimiters while OP's software is on the shuttle halfway to Mars
@davidism No, for instance it isn't for the str type... Oh, that's a simple example, then. x = "hello" will crash.
repr(x) contains quote marks and str(x) doesn't in that case
 
@RobertGrant Yes, it probably could heh
 
I wonder if str(some_string) ever returns anything other than some_string.
My rubber duck wordlessly indicates "all signs point to No"
 
640
A: <kbd> elements are way intrusive

Hilarious Comedy Pesto                                                                                                                                                                                                                                                                                                            

Someone has too much free time
 
Oh dear. OP's data is "user-supplied". Let's all keep him in our thoughts in this trying time.
 
5:29 PM
@Code-Apprentice wait how do people post "blocks"?
 
@MooingRawr click 'edit' and the wonders of the universe will be revealed
 
oops nvm google is a wonderful tool
 
@MooingRawr did you look at the markdown?
 
@Code-Apprentice Not sure what you are talking about (I'm assuming this: stackoverflow.com/editing-help which I googled. ) sorry I couldn't delete my ping. Was googling it :\
 
5:45 PM
I mean that you can view the edit history of any question or you can just edit the question and see
 
recbg
 
Maybe Python 4 will be out too.
 
No, everything will run on Chrome
 
Of course, because everything's chrome in the future.
 
by the year 4017 Chrome will be like IE. And then a new browser....IE will take over. And everything will repeat itself again. we have become exceedingly efficient at it
is requests-mock the thing to use to mock requests
I can easily mock patch, but I'm looking for more functionality, and it seems like this gives it
gonna go for it. See how it goes
SCIENCE!
 
6:11 PM
@idjaw "Volunteer for Testing today. For Science, of course. We will give you free cake if you complete the training rooms!" -GLaDOS, Portal.
(basically)
sorry, you made me think of that.
Anyways, for my question I just posted a q on SO about it, hopefully someone'll have a solution, maybe I'm just doing something stupid.
 
user6845426
6:23 PM
cbg o/
 
By 4017, Google would have control over 90% of the electronic market and system. Guess we will have to see if they turn evil or not.
 
user6845426
Is Theano library not supported on Python 2.7?
 
Step 1: use python 3
 
The power of search
 
6:31 PM
cbg
 
The power of reading
The power of Kevin
cbg Mr. Deak
How's the great war?
 
In Kevin we trust. Unless it's something strongly ethical in nature.
 
The power of pointing out powers
 
The typo in "comnpatibility" isn't instilling me with a whole lot of comnfidence in Theano's comnpetence
 
@idjaw the reference is lost on me, otherwise the war is long and tiresome:P
 
6:32 PM
agreend
 
@AndrasDeak At the very least, you can trust me not to be trusted
 
@AndrasDeak The only reference was the war you're fighting. Make sure you reload when you take cover only. Campers will always camp.
confusion is high
 
user6845426
Why is installing libraries so complicated with Python
 
because it's not
 
^ that's why because you're using windows
 
user6845426
6:38 PM
I'm not using windows
 
edited
 
:D
 
DSM
Installing libraries in Python used to be quite difficult. These days it usually runs pretty smoothly. Is there a problem in particular?
 
user6845426
@DSM havn't tried installing yet, im about to try get Theano
 
6:40 PM
scratches head
@AndrasDeak can you give your poor faces noses already? Those poor things must have such a hard time breathing..... looks up at his own...oh...shoot
 
oh
 
<~:^)->--<
 
You just got pinged a million times
I apologize....not really...but I do
 
good thing my laptop is on mute by default
 
oh that's nice @AndrasDeak
 
6:42 PM
and my whipped cream coffee distracted me from the visual ping
 
hmm....it is almost coffee o'clock for me
 
Don't forget to draw the ground he's standing on. <~:^)->--<(
Actually, better draw the whole earth, and his pen pal on the other side: <~:^)->--< ( ) >--<(^:~>
 
...you should drink that coffee...
 
DSM
I was able to install theano in 3.5, google an example, and run it, in about as long as it took me to type this.
 
I am coming to the conclusion that requests_mock is not that special
and the work I have to do is almost as much as the regular patching I was doing
I'm gonna have to dig deeper to see if there is something fundamental I'm missing in how to use this properly
 
DSM
6:52 PM
"The power of pointing out powers" is a nice phrase.
 
7:17 PM
Quick question, can somebody help me fix this line?

p = subprocess.Popen(['TZ=Atlantic/Azores date +%Y%m%d'], stdout=subprocess.PIPE, stderr = subprocess.PIPE)
out, err = p.communicate()
print(out)

It's throwing the error FIleNotFound: No such file or directory 'date +%Y%m%d'
I also tried:
p = subprocess.Popen(['TZ=Atlantic/Azores', 'date +%Y%m%d'], stdout=subprocess.PIPE, stderr = subprocess.PIPE)

and

p = subprocess.Popen(['date +%Y%m%d'], stdout=subprocess.PIPE, stderr = subprocess.PIPE)

to no avail
 
the error is quite straight forward. It can't find the file/directory named: date +%Y%m%d
 
there's no file/date I'm trying to call the date command
It works for ls, I don't know why it wouldn't work for date
 
DSM
It wouldn't have worked for ls with an argument.
 
oooooh. I got it. OK...I managed to save quite a few lines with requests_mock
Ok....that science was fun. Glad I did it
 
@ILikeBeansTacos Hypothetically, if you were to enter the command normally with just your keyboard, no Python involved, what exactly would it look like?
 
7:23 PM
TZ=Atlantic/Azores date +%Y%m%d
I managed to get the date part working
I need to get the one-off ENV variable and I'm golden :)
 
What does this TZ thing do? I'm searching for it on die.net but I don't see anything that matches.
 
Why "beanstacos"
 
DSM
You can pass environment variables using the env kwarg, or fall back on passing a full string to the shell. I tend not to use Popen directly, though.
 
Yeah, shouldn't it be "BeansAndTacos"? Unless you're telling an audience of tacos that you like beans.
 
Or "beantacos"
 
7:27 PM
Maybe he only likes tacos that have more than one kind of bean in them.
 
haha
I like my tacos just with beans
refried
thanks for the type about kwearg, @Kev
@Kevin
the TZ env variable sets the timezone for the date command
 
DSM gets mad when I take credit for his work, so I must politely reject your thanks
 
so it's like "give me the year, day and month at that particular timezone"
 
Well I'm over here in Windows land where you can't use an equals sign to set environment variables, so I have no idea how/if that's something that can be done
 
7:30 PM
in bash if you do that ^ you set that variable for that single call
 
Hence why I stopped trying to help when I realized it was a linux os.
 
I think
maybe not
I mean I can't reproduce what I mean
 
yeah, it's a Linux/Unix thing. As Andras said, you can set an env variable for just one call.
Maybe it's a bash thing
well, is there an idiomatic way to do it in Python? I don't have to do it in bash :\ I'm not a python expert and I'm just reading the documentation. The whole article on timezones made my head spin
and to make matters worse, I'm working with a system one part written in python 2.7 and the other one in 3.x
 
do you have physical access to the person responsible?
 
Fortunately not, I would have punched him/her in the face several times.
 
7:33 PM
do you want to get the current date in the given time zone?
 
I don't know off the top of my head, but there's a way to set env vars with Popen. You definitely shouldn't be using a single string or passing them in the command list.
 
wouldn't what Marcus linked to (time module) be appropriate?
an example therein:
>>> os.environ['TZ'] = 'EST+05EDT,M4.1.0,M10.5.0'
>>> time.tzset()
>>> time.strftime('%X %x %Z')
'02:07:36 05/08/03 EDT'
>>> os.environ['TZ'] = 'AEST-10AEDT-11,M10.5.0,M3.5.0'
>>> time.tzset()
>>> time.strftime('%X %x %Z')
'16:08:12 05/08/03 AEST'
 
Although it would make more sense to just get the date in the format you want in Python.
 
and avoid punching people in the face
 
DSM
7:35 PM
Yeah, if this is the real case and not an example, we should stay within Python. That said:
n [41]: subprocess.run(['date','+%Y%m%d-%H%M%S'], stdout=subprocess.PIPE, env={**os.environ, "TZ": "Atlantic/Azores"})
Out[41]: CompletedProcess(args=['date', '+%Y%m%d-%H%M%S'], returncode=0, stdout=b'20170306-183506\n')
 
On many Unix systems (including *BSD, Linux, Solaris, and Darwin), it is more convenient to use the system’s zoneinfo (tzfile(5)) database to specify the timezone rules. To do this, set the TZ environment variable to the path of the required timezone datafile, relative to the root of the systems ‘zoneinfo’ timezone database, usually located at /usr/share/zoneinfo. For example, 'US/Eastern', 'Australia/Melbourne', 'Egypt' or 'Europe/Amsterdam'.

>>> os.environ['TZ'] = 'US/Eastern'
>>> time.tzset()
even better ^
 
Sweet
thanks a lot guys. This is very useful.
 
no worries
 
Use datetime.utcnow() along with pytz: datetime.utcnow().astimezone(pytz.timezone('America/Los_Angeles'))
 
well, i feel stupid, i solved the problem I had... myself...
>.>
 
7:41 PM
that's never a bad thing
 
DSM
And you've answered the question, so people making the same mistake -- or just wanting an example -- can find it in the future. Win-win!
@davidism: nice, don't need to muck about with anything outside.
 
I learn that I forgot everything about timezones every time I look at the pytz docs: pythonhosted.org/pytz
 
^^
haha yeah. same here
 
DSM
I grew up hearing "starts at 9:00, 10:30 in Newfoundland" and that sort of thing, so I always knew there were dark mysteries..
 
I'm just glad I don't have to deal with dates < 1970 or other timescales. Astropy to the resuce in case I do though: docs.astropy.org/en/stable/time
 
7:47 PM
Haven't used pytz -- is it sort of like the equivalent of Joda Time for Java?
 
That's probably python-dateutil, which uses pytz.
38083 rep right now, first palindrome I've noticed in a while. This is a good day.
 
update @AndrasDeak your recommendations along with @davidism worked like a charm. thanks a lot :)
 
cool
 
DSM
Poor little subprocess module.
 
I've never used any time thingies so my share of the credit goes to @Marcus for linking the docs :P
 
7:58 PM
And all I did was link a doc I found using Google so my share of the credit goes to Google
 
sometimes I take a moment to appreciate the simple little helper functions that make life easier
 

« first day (2333 days earlier)      last day (2624 days later) »