Tagged: python Toggle Comment Threads | Keyboard Shortcuts

  • Dimitris Kalopsikakis 08:11 on 10 December 2017 Permalink | Reply
    Tags: http server, python   

    Run a one-line http server for trivial tasks (python) 


    Reference:

     
  • Dimitris Kalopsikakis 08:04 on 10 December 2017 Permalink | Reply
    Tags: , python, venv, virtual environment   

    Simple script to create a python virtual environment 

    Before running the script, do:

    The script downloads python, compiles it, installs it in $PYINSTALL  and creates  virtual environment in $PYENV :


    Reference:

     
  • Dimitris Kalopsikakis 08:24 on 28 March 2017 Permalink | Reply
    Tags: fileinput, filter, , , python   

    Inplace filtering with python 

    This redirects standard output to the file that is being read and overwrites each line, inplace:

    usage example : ./test.py *html


    Reference:

     
  • Dimitris Kalopsikakis 12:19 on 5 December 2016 Permalink | Reply
    Tags: , , , , python, reduce   

    Second Maximum (v2) of list of integers without comparison, loop or recursion 

    Function sm() returns a tuple of the maximum and second maximum of a list of integers without any comparison or loop


    References:

     
  • Dimitris Kalopsikakis 10:02 on 29 November 2016 Permalink | Reply
    Tags: , , , python   

    Second maximum of a list with functional Python 

    Returns the second maximum of a list of numbers


    References:

     
  • Dimitris Kalopsikakis 05:08 on 28 November 2016 Permalink | Reply
    Tags: boolean, , python, sgn   

    Sgn function in Python 

    One-line sign function of a real number.

    In Python a boolean variable is subclass of integer taking two values, 0 for False and 1 for True. Also, every boolean expression returns the value of last evaluated argument.


    References:

     
  • Dimitris Kalopsikakis 10:10 on 16 November 2016 Permalink | Reply
    Tags: , , python   

    Max without comparison 


    References:

     
  • Dimitris Kalopsikakis 18:05 on 22 September 2016 Permalink | Reply
    Tags: password, python, random   

    Random password (python) 

    Creates a password of 10 characters, with letters, digits and punctuation.

     

     
  • Dimitris Kalopsikakis 23:59 on 21 September 2016 Permalink | Reply
    Tags: , programming, python, swap   

    Swap without tmp 

    1st way:

    2nd way, with XOR bitwise operator ( here: Python),


    References:

     
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