4337 links
  • Arnaud's links
  • Home
  • Login
  • RSS Feed
  • ATOM Feed
  • Tag cloud
  • Picture wall
  • Daily
Links per page: 20 50 100
◄Older
page 1 / 5
97 results tagged python x
  • thumbnail
    safety · PyPI
    9 mars 2023 à 16:30:56 UTC+1 - permalink - archive.org - https://pypi.org/project/safety/
    python scan security
  • Note: pas besoin de requirements.txt en local si on a un setup.py

    virtualenv venv
    . venv/bin/activate
    pip install --editable .

    24 mai 2022 à 11:43:53 UTC+2 - permalink - archive.org - https://links.infomee.fr/?ruUKGA
    dev python
  • thumbnail
    Auto activate and deactivate python venv using zsh - DEV Community
    python_venv() {
      MYVENV=./venv
      # when you cd into a folder that contains $MYVENV
      [[ -d $MYVENV ]] && source $MYVENV/bin/activate > /dev/null 2>&1
      # when you cd into a folder that doesn't
      [[ ! -d $MYVENV ]] && deactivate > /dev/null 2>&1
    }
    autoload -U add-zsh-hook
    add-zsh-hook chpwd python_venv
    20 mai 2022 à 13:59:01 UTC+2 * - permalink - archive.org - https://dev.to/moniquelive/auto-activate-and-deactivate-python-venv-using-zsh-4dlm
    python venv zsh
  • Regular Expression HOWTO — Python 3.10.4 documentation

    named group

    18 mai 2022 à 09:36:46 UTC+2 - permalink - archive.org - https://docs.python.org/3/howto/regex.html
    group named python re
  • IPAM — pynetbox 6.6.2.dev7+g0f1e588 documentation
    4 mai 2022 à 13:56:18 UTC+2 * - permalink - archive.org - https://pynetbox.readthedocs.io/en/latest/IPAM.html
    ipam lib netbox network python
  • thumbnail
    GitHub - Textualize/rich: Rich is a Python library for rich text and beautiful formatting in the terminal.
    • https://pypi.org/project/simple-term-menu/
    • https://click.palletsprojects.com/en/8.1.x/
    4 mai 2022 à 09:58:14 UTC+2 - permalink - archive.org - https://github.com/Textualize/rich
    color format python terminal
  • thumbnail
    Regardez "Reuven M. Lerner - Practical decorators - PyCon 2019" sur YouTube

    You want to really understand decorators? Watch this video!

    boilerplate:

    import functools
    
    def decorator(func):
        @functools.wraps(func)
        def wrapper_decorator(*args, **kwargs):
            # Do something before
            value = func(*args, **kwargs)
            # Do something after
            return value
        return wrapper_decorator
    • https://realpython.com/primer-on-python-decorators/
    11 février 2022 à 20:30:18 UTC+1 * - permalink - archive.org - https://youtu.be/MjHpMCIvwsY
    decorators python
  • Specifications — The Hitchhiker's Guide to Packaging 1.0 documentation

    When you want to publish a beta version, you can use a special tag that won't be proposed to client using pip install package --upgrade
    example :
    current version = 3.0.1
    next version = 3.1.0

    I can tag with 3.1.0-alpha.1

    pip install --upgrade won't upgrade to this version but pip install package==3.1.0-alpha.1 will

    7 février 2022 à 11:19:29 UTC+1 - permalink - archive.org - https://the-hitchhikers-guide-to-packaging.readthedocs.io/en/latest/specification.html
    python semver
  • thumbnail
    python - Django template can't loop defaultdict - Stack Overflow

    django template does not like defaultdict, 2 solutions:
    1) set default_factory to None
    or
    2) cast defaultdict to a simpledict

    "The template variable resolution algorithm in Django will attempt to resolve new_data.items as new_data['items'] first, which resolves to an empty list when using defaultdict(list)."

    29 décembre 2021 à 11:19:35 UTC+1 - permalink - archive.org - https://stackoverflow.com/questions/4764110/django-template-cant-loop-defaultdict
    defaultdict django python
  • thumbnail
    Show some equivalent list comprehensions in filter examples · Issue #1068 · pallets/jinja · GitHub
    # filter out all elements not with x > 5
    a = [el for el in data if el['x'] > 5]
    
    # get all the 'c' attributes as a list
    b = [el['c'] for el in data]
    
    # get all the 'c' attributes for the elements with x > 5
    c = [el['c'] for el in data if el['x'] > 5]
    
    In Jinja2:
    
    a: {{ data | selectattr('x', 'gt', 5) | list }}
    b: {{ data | map(attribute='c') | list }} 
    c: {{ data | selectattr('x', 'gt', 5) | map(attribute='c') | list }} 
    24 septembre 2021 à 11:47:44 UTC+2 * - permalink - archive.org - https://github.com/pallets/jinja/issues/1068
    ansible comprehension list python
  • thumbnail
    OSX crash complaining of operation `in progress in another thread when fork() was called` · Issue #32499 · ansible/ansible · GitHub

    Ce truc obscur qui t'arrive et où la solution se trouve au fond d'une PR

    export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES

    4 août 2021 à 16:12:06 UTC+2 - permalink - archive.org - https://github.com/ansible/ansible/issues/32499
    ansible mac python
  • thumbnail
    python - How to search and replace text in a file? - Stack Overflow
    Sometime you cant use sed :(

    # Read in the file
    with open('file.txt', 'r') as file :
      filedata = file.read()

    # Replace the target string
    filedata = filedata.replace('ram', 'abcd')

    # Write the file out again
    with open('file.txt', 'w') as file:
      file.write(filedata)
    7 juillet 2021 à 16:42:22 UTC+2 * - permalink - archive.org - https://stackoverflow.com/questions/17140886/how-to-search-and-replace-text-in-a-file
    python replace
  • thumbnail
    Creating the Perfect Python Dockerfile | by Luis Sena | May, 2021 | Medium
    21 mai 2021 à 10:21:09 UTC+2 - permalink - archive.org - https://luis-sena.medium.com/creating-the-perfect-python-dockerfile-51bdec41f1c8
    docker gunicorn python
  • thumbnail
    pantsbuild/pex: A library and tool for generating .pex (Python EXecutable) files
    12 mai 2021 à 14:34:08 UTC+2 - permalink - archive.org - https://github.com/pantsbuild/pex
    packaging python
  • thumbnail
    jazzband/pip-tools: A set of tools to keep your pinned Python dependencies fresh.

    python dependency management with lock file

    12 mai 2021 à 14:27:40 UTC+2 - permalink - archive.org - https://github.com/jazzband/pip-tools
    pip python
  • Welcome to Invoke! — Invoke documentation
    17 mars 2021 à 15:55:20 UTC+1 - permalink - archive.org - http://www.pyinvoke.org/
    cli invoke python tools
  • Note: debug python terminal

    ++++++++++++++++++++++
    Version avec interface cmd
    ++++++++++++++++++++++

    Prérequis :

    pip install pudb

    Pour docker, dans le docker compose ajouter

    stdin_open: true
    tty: true
    Faire docker attach container_name

    Comment break/debug :

    Là où on veut break, il suffit de coller cette ligne : import pudb; pu.db

    Dans le terminal où on a fait docker attach on doit voir l'interface de pudb

    ++++++++++++++++++++++
    Version + simple
    ++++++++++++++++++++++
    Prérequis : python 3.7

    Pour docker, dans le docker compose ajouter

    stdin_open: true
    tty: true
    Faire docker attach container_name

    Comment break/debug :

    breakpoint()

    Dans le terminal où on a fait docker attach on doit voir un prompt

    On peut print les variables
    "continue" pour continuer

    12 février 2021 à 10:37:06 UTC+1 * - permalink - archive.org - https://links.infomee.fr/?lTcZoA
    debug pudb python terminal
  • thumbnail
    GitHub - zestyping/q: Quick and dirty debugging output for tired programmers. ⛺
    30 janvier 2021 à 10:47:08 UTC+1 - permalink - archive.org - https://github.com/zestyping/q
    debug lazy python
  • thumbnail
    colorama · PyPI
    8 janvier 2021 à 10:03:06 UTC+1 - permalink - archive.org - https://pypi.org/project/colorama/
    color python
  • Advanced usage of Python requests - timeouts, retries, hooks
    13 décembre 2020 à 20:04:04 UTC+1 - permalink - archive.org - https://findwork.dev/blog/advanced-usage-python-requests-timeouts-retries-hooks/
    python requests retry
Links per page: 20 50 100
◄Older
page 1 / 5
Shaarli - The personal, minimalist, super-fast, database free, bookmarking service by the Shaarli community - Help/documentation