Tagged: python Toggle Comment Threads | Keyboard Shortcuts

  • penguin 18:27 on 2018-04-12 Permalink | Reply
    Tags: python, vscode   

    Python & Visual Studio code 

    The official python plugin claims that the interpreters of Pipenv are automatically found.

    They are not.

    At least not on my machine.

    Here’s how you set them.

     
  • penguin 18:13 on 2017-10-17 Permalink | Reply
    Tags: jira, python   

    JIRA and Python 

    I really came to hating JIRA with a passion. And now I have to create about 350 tickets.

    Naturally I don’t do this by hand. But using the JIRA API is kind of … hard, there is a Python library, but usage is rather sparsely documented, and this whole thing is just annoying as hell.

    Although when you did it, it’s quite simple. Here’s an example of how to create a ticket with due date and estimate set from a CSV file:

    So simple.

     
    • Mika 14:40 on 2017-12-20 Permalink | Reply

      Hi Axel, hast Du auch einen Twitter Account, in dem Du über neue Updates aus Deinem Blog informierst, oder ist der RSS Feed meine (einzige?) Anlaufstelle?

      • penguin 18:29 on 2017-12-27 Permalink | Reply

        Hey Mika, gute Idee eigentlich 🙂 . Aktuell ist es nur RSS. Ich könnte allerdings einen Twitter-Feed dafür einrichten … .
        Freut mich allerdings dass du auf dem Laufenden bleiben möchtest 😀 . Und sorry wegen der langen Antwortzeit – ich war 4 Wochen im Urlaub. Dringend notwendig.

  • penguin 14:45 on 2017-01-17 Permalink | Reply
    Tags: , fix, pycharm, python   

    PyCharm, Arch linux & Python 3.6 

    Love Python. Love PyCharm. Love Arch Linux.

    Unfortunately Arch sneakily updated Python to 3.6. Cool, new version … but hey, why don’t my debug runs in PyCharm work any more??

    Yup, pretty confusing. It seems unable to find shared python 3.5 library. Well. After some cursing, turns out the solution is pretty simple (if you know what to do):

    • get pyenv
    • use pyenv to install Python 3.5.2, but with –enable-shared option set
    • use this python version for PyCharm projects (it does not matter if it’s in a virtualenv or not)

    Like this:

    That solved it for me 🙂

    References:
     
  • penguin 11:27 on 2016-01-29 Permalink | Reply
    Tags: , python   

    Really annoying thread properties 

    This sucks monkey ass, mainly because I didn’t think of that before. And that’s just one example why multi-threaded (soon to be -processing, probably) applications are hard.

    [code]import subprocess as sp
    import time
    import os
    from threading import Thread

    class MyThread(Thread):

    def __init__(self, mydir):
    super().__init__()
    self.mydir = mydir

    def run(self):
    os.chdir(self.mydir)
    time.sleep(2)
    print("I’m (%s) in directory %s"
    % (str(self), os.getcwd()))

    if __name__ == "__main__":
    MyThread("/tmp").start()
    time.sleep(1)
    MyThread("/").start()
    [/code]

    Result is:

    [code]I’m (<MyThread(Thread-1, started 140195858716416)>) in directory /
    I’m (<MyThread(Thread-2, started 140195850323712)>) in directory /[/code]

     
  • penguin 10:35 on 2015-06-22 Permalink | Reply
    Tags: convenience, , python   

    OpenStack floating IP convenience 

    Problem: I am working in a tenant which has a couple of hosts with floating IPs assigned. I always have to look them up either manually using the command line clients (and dealing with all those UUIDs), or manually in the web GUI. Didn’t like.

    Solution: Python script, which outputs FLOATING_IP -> HOST_NAME.

    Here it is.

    Sample output:

    Groovy.


    Main sources:

     
c
compose new post
j
next post/next comment
k
previous post/previous comment
r
reply
e
edit
o
show/hide comments
t
go to top
l
go to login
h
show/hide help
shift + esc
cancel