라벨이 Code development인 게시물 표시

'help' command in MATLAB and Python

All of programming languages or programs have their own help command. For example, in MATLAB >>> help object How about Python ? >>> help( object ) Thanks, Have Fun!

Python IDLE execution in shell, text-based tool such as linux terminal or windows powershell.

When you are using text-based system such as linux terminal or windows dos (or powerhsell), you may want open file of  python ( blahblah.py ) through IDLE. In this case, you can use below commands If python path is here C:\Python27\ In order to open IDLE, you have to open using pythonw.exe So you can do like this. C:\Python27\pythonw.exe C:\Python27\Lib\idlelib\idle.py .\blahblah.py Thanks! Have fun!

Problem about not launching of Google Android Studio; Environment variables setting

Mostly, this is because of environment variables JAVA_HOME and JDK_HOME Set like this! Variable name: JAVA_HOME Variable value: C:\Program Files\JAVA\jdk1.8.X_XX Variable name: JDK_HOME Variable value: C:\Program Files\JAVA\jdk1.8.X_XX and add the Path! and then you can figure out that this is get right echo %JAVE_HOME% echo %JDK_HOME% Thanks! Details: http://techglimpse.com/google-android-studio-launching-fix-windows/

Using method 'join' for list with integers

Maybe there is a experience that you want to use join method to list consists of just integers. In that case, you can easily resolve this problem as follows. resultlist = [fn(arg) for arg in range(originallist)] resultstring = str.join(resultlist) or just conveniently resultstring = str.join( fn(arg) for arg in range(originallist) )

When you can not find out "Edit with IDLE" from the right click context menu

When you face this kinds of problem in Windows, you could check below two things in registry. 1. HKEY_CLASSES_ROOT\Python.File 2. HKEY_CLASSES_ROOT\*\shell First, HKEY_CLASSES_ROOT\Python.File 1> Open regedit 2> Go to 'HKEY_CLASSES_ROOT\Python.File\shell\Edit with IDLE\command', if it does not exist create it by click right mouse button. 3> Adjust the value of key;  "[PYTHONPATH]\pythonw.exe" "[PYTHONPATH]\Lib\idlelib\idle.pyw" -e "%1" 4> And then go to 'HKEY_CLASSES_ROOT\Python.NoConFile\shell\Edit with IDLE\command'. 5> Adjust the value of key;  "[PYTHONPATH]\pythonw.exe" "[PYTHONPATH]\Lib\idlelib\idle.pyw" -e "%1" Second, HKEY_CLASSES_ROOT\*\shell 1> Open regedit 2> Go to 'HKEY_CLASSES_ROOT\*\shell' and create a key below with name of 'command'. 3> Adjust the value of key;  "[PYTHONPATH]\pythonw.exe"

Submit File for Iterative Calculation in Density Functional Theory (VASP) using Bash Shell

이미지
Many times we run into the situation which we should calculate iterative. In this case, this bash shell script can be used very helpfully. Here is example script. This script is that we can calculate iteratively changing the value of ISIF in INCAR file. sed "s/ISIF=${prei}/ISIF=${i}/" INCAR > temp means that find the lines with ISIF=value of prei (initial value is defined 1) and change it to ISIF=value of i ( i is changed from 1 to 7 ). So, this bash shell makes it possible to simulate with various kinds of relax conditions. $mpi_cmd -np $num_proc -hostfile $PBS_NODEFILE $lmp_cmd > vasp.log 2>&1 This command is excution command. (This is different according to your cluster environment) if [ "${prei}" -eq 7 ]; then mkdir calculatenum_${i} cp * calculatenum_${i} else prei=${i} cp CONTCAR POSCAR fi Here are the if loop that determines wheter calculated files save or not. Last calculation will be saved. The others is not sa