Вы не можете. Если бы он был центрирован в пределах родительского поля, то в некоторой точке плавающий элемент перекрывал бы содержимое, что побеждало бы точку поплавка. Здесь вы можете использовать два подхода. Если вы знаете ширину поплавка, вы можете применить равное отрицательное правое поле. В противном случае вы можете абсолютно позиционировать элемент следующим образом .
The stdin and stdout fds are being inherited by the C shared library.
from fortran_code import fortran_function
import os
print "will run fortran function!"
# open 2 fds
null_fds = [os.open(os.devnull, os.O_RDWR) for x in xrange(2)]
# save the current file descriptors to a tuple
save = os.dup(1), os.dup(2)
# put /dev/null fds on 1 and 2
os.dup2(null_fds[0], 1)
os.dup2(null_fds[1], 2)
# *** run the function ***
fortran_function()
# restore file descriptors so I can print the results
os.dup2(save[0], 1)
os.dup2(save[1], 2)
# close the temporary fds
os.close(null_fds[0])
os.close(null_fds[1])
print "done!"