2023. 11. 18.

Install Virtualenv on osX (MAC)

 1) Install brew 

     home page:  https://brew.sh/

2 ) Install python3 

  $>  brew install python3

3) Install virtualenv

  $> pip3 install virtualenv

4) check installed python version

   ls -l /usr/local/bin/python*

5) make Local Env 

  $> python3 -m virtualenv  venv310 --python=/usr/local/bin/python3.10

     // venv310 :  directory which contains python3.10 data 

     // --python={installed path}  :  source path which is selected python version

2023. 7. 15.

Passing custom event function from parent component to child in react

 


Passing  function  from parent to child component 
for click-event customizing 

1) define function in app level

    function. custom_event (key, event) {

      // this is custom function 

      console.log ("call custom function ") ;

    }

2) passing custom function to child by property

     when click item ,  item calls internalClick

       custom_event function is called by name "customFunction" in internalClick function 

        


// in app.js     

  function. custom_event (key, event) {

      // this is custom function 

      console.log ("call custom function ") ;

    }

 <BoardList  customFunction= { this.props.custom_event }  />    


//  in BoardList.js

      // some loop ... 

     <BoardRow keyField={ this.props.keyField}   customFunction = { this.props.customFunction} /> 


//  in BoardRow.js 

     <BoardItem keyField={ this.props.keyField} customFunction = { this.props.customFunction} /> 

// in BoardItem.js 

     internalClick = (e) => {

       console.log ( "click item ") ;

       this.props.customFunction(this.props.keyField , e) ;

     }

    render() {

          return (<button  onClick = { this.internalClick } > click </button>)

    }

    

      

    



Python new string format (update) f-string

 Update .. 

Late news 


My previous post:  2016 

https://blog.boxstory.com/2016/08/python-new-string-format.html


New Addition  :  f-string   ( support  from 3.6 )

variable = 'hello'
print(f' my variable is {variable}') # using f' xxxx {variable_name}'


 # output 
my variable is hello 

# Yes , It's very simple and powerful. 

2023. 5. 21.

brew command list in mac OS


homepage: 

  • site : https://brew.sh/ 
  • full command list : https://docs.brew.sh/Manpage

Minimum command list

  • Install
    • brew install {programname}
  • Start service 
    • brew services start {program name}
  • Stop service
    • brew services stop {program name }
  • List services
    • brew services list
  • Update brew itself
    • brew update
  • Upgrade program
    • brew upgrade {program name }