4337 links
  • Arnaud's links
  • Home
  • Login
  • RSS Feed
  • ATOM Feed
  • Tag cloud
  • Picture wall
  • Daily
    Type 1 or more characters for results.
    Links per page: 20 50 100
    ◄Older
    page 1 / 5
    97 results tagged python x
    • thumbnail
      safety · PyPI
      March 9, 2023 at 4:30:56 PM GMT+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 .

      May 24, 2022 at 11:43:53 AM GMT+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
      May 20, 2022 at 1:59:01 PM GMT+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

      May 18, 2022 at 9:36:46 AM GMT+2 - permalink - archive.org - https://docs.python.org/3/howto/regex.html
      group named python re
    • IPAM — pynetbox 6.6.2.dev7+g0f1e588 documentation
      May 4, 2022 at 1:56:18 PM GMT+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/
      May 4, 2022 at 9:58:14 AM GMT+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/
      February 11, 2022 at 8:30:18 PM GMT+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

      February 7, 2022 at 11:19:29 AM GMT+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)."

      December 29, 2021 at 11:19:35 AM GMT+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 }} 
      September 24, 2021 at 11:47:44 AM GMT+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

      August 4, 2021 at 4:12:06 PM GMT+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)
      July 7, 2021 at 4:42:22 PM GMT+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
      May 21, 2021 at 10:21:09 AM GMT+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
      May 12, 2021 at 2:34:08 PM GMT+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

      May 12, 2021 at 2:27:40 PM GMT+2 - permalink - archive.org - https://github.com/jazzband/pip-tools
      pip python
    • Welcome to Invoke! — Invoke documentation
      March 17, 2021 at 3:55:20 PM GMT+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

      February 12, 2021 at 10:37:06 AM GMT+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. ⛺
      January 30, 2021 at 10:47:08 AM GMT+1 - permalink - archive.org - https://github.com/zestyping/q
      debug lazy python
    • thumbnail
      colorama · PyPI
      January 8, 2021 at 10:03:06 AM GMT+1 - permalink - archive.org - https://pypi.org/project/colorama/
      color python
    • Advanced usage of Python requests - timeouts, retries, hooks
      December 13, 2020 at 8:04:04 PM GMT+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