pythonabi24is
⑴ redhat yum安裝報錯python(abi) = 2.4 is needed by...
試一下安裝RPM Forge epel release 6。
⑵ linux下安裝yum時報錯需要python(abi)=2.4請問怎麼處理
yum應該已經有了。或者是yum2。
從提示上看。你沒有安裝python,也沒有安裝python-elementtree這個庫。
安裝一下再繼續試試看。
⑶ Python3.3裡面,s.isdigit和s.isnumeric有什麼區別求舉例
num = "1" #unicode
num.isdigit() # True
num.isdecimal() # True
num.isnumeric() # True
num = "1" # 全形
num.isdigit() # True
num.isdecimal() # True
num.isnumeric() # True
num = b"1" # byte
num.isdigit() # True
num.isdecimal() # AttributeError 'bytes' object has no attribute 'isdecimal'
num.isnumeric() # AttributeError 'bytes' object has no attribute 'isnumeric'
num = "IV" # 羅馬數字
num.isdigit() # True
num.isdecimal() # False
num.isnumeric() # True
num = "四" # 漢字
num.isdigit() # False
num.isdecimal() # False
num.isnumeric() # True
===================
isdigit()
True: Unicode數字,byte數字(單位元組),全形數字(雙位元組),羅馬數字
False: 漢字數字
Error: 無
isdecimal()
True: Unicode數字,,全形數字(雙位元組)
False: 羅馬數字,漢字數字
Error: byte數字(單位元組)
isnumeric()
True: Unicode數字,全形數字(雙位元組),羅馬數字,漢字數字
False: 無
Error: byte數字(單位元組)
================
import unicodedata
unicodedata.digit("2") # 2
unicodedata.decimal("2") # 2
unicodedata.numeric("2") # 2.0
unicodedata.digit("2") # 2
unicodedata.decimal("2") # 2
unicodedata.numeric("2") # 2.0
unicodedata.digit(b"3") # TypeError: must be str, not bytes
unicodedata.decimal(b"3") # TypeError: must be str, not bytes
unicodedata.numeric(b"3") # TypeError: must be str, not bytes
unicodedata.digit("Ⅷ") # ValueError: not a digit
unicodedata.decimal("Ⅷ") # ValueError: not a decimal
unicodedata.numeric("Ⅷ") # 8.0
unicodedata.digit("四") # ValueError: not a digit
unicodedata.decimal("四") # ValueError: not a decimal
unicodedata.numeric("四") # 4.0
#"〇","零","一","壱","二","弐","三","參","四","五","六","七","八","九","十","廿","卅","卌","百","千","萬","萬","億"
⑷ linux上安裝python3.4.4,執行./configure的時候報錯,怎麼解決
config.log的內容:
This file contains any messages proced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by python configure 3.4, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ ./configure
## --------- ##
## Platform. ##
## --------- ##
hostname = hbttdb1
uname -m = x86_64
uname -r = 2.6.32-279.el6.x86_64
uname -s = Linux
uname -v = #1 SMP Wed Jun 13 18:24:36 EDT 2012
/usr/bin/uname -p = unknown
/bin/uname -X = unknown
/bin/arch = x86_64
/usr/bin/arch -k = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo = unknown
/bin/machine = unknown
/usr/bin/oslevel = unknown
/bin/universe = unknown
PATH: /usr/lib64/qt-3.3/bin
PATH: /usr/local/sbin
PATH: /usr/local/bin
PATH: /sbin
PATH: /bin
PATH: /usr/sbin
PATH: /usr/bin
PATH: /root/bin
PATH: /data/oracle/app/oracle/proct/11.2.0/bin
PATH: .
## ----------- ##
## Core tests. ##
## ----------- ##
configure:2894: checking build system type
configure:2908: result: x86_64-unknown-linux-gnu
configure:2928: checking host system type
configure:2941: result: x86_64-unknown-linux-gnu
configure:3053: checking for --enable-universalsdk
configure:3100: result: no
configure:3123: checking for --with-universal-archs
configure:3138: result: no
configure:3288: checking MACHDEP
configure:3494: result: linux
configure:3518: checking for --without-gcc
configure:3541: result: no
configure:3665: checking for gcc
configure:3681: found /usr/bin/gcc
configure:3692: result: gcc
configure:3921: checking for C compiler version
configure:3930: gcc --version >&5
gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-4)
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for ing conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
configure:3941: $? = 0
configure:3930: gcc -v >&5
Using built-in specs.
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=Red Hat Bugzilla Main Page --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.4.7 20120313 (Red Hat 4.4.7-4) (GCC)
configure:3941: $? = 0
configure:3930: gcc -V >&5
gcc: '-V' option must have argument
configure:3941: $? = 1
configure:3930: gcc -qversion >&5
gcc: unrecognized option '-qversion'
gcc: no input files
configure:3941: $? = 1
configure:3961: checking whether the C compiler works
configure:3983: gcc conftest.c >&5
configure:3987: $? = 0
configure:4035: result: yes
configure:4038: checking for C compiler default output file name
configure:4040: result: a.out
configure:4046: checking for suffix of executables
configure:4053: gcc -o conftest conftest.c >&5
configure:4057: $? = 0
configure:4079: result:
configure:4101: checking whether we are cross compiling
configure:4109: gcc -o conftest conftest.c >&5
In file included from /usr/include/stdio.h:75,
from conftest.c:11:
/usr/include/libio.h:332: error: expected specifier-qualifier-list before 'size_t'
/usr/include/libio.h:364: error: expected declaration specifiers or '...' before 'size_t'
/usr/include/libio.h:373: error: expected declaration specifiers or '...' before 'size_t'
/usr/include/libio.h:495: error: expected '=', ',', ';', 'asm' or '__attribute__' before '_IO_sgetn'
In file included from conftest.c:11:
/usr/include/stdio.h:318: error: expected declaration specifiers or '...' before 'size_t'
/usr/include/stdio.h:324: error: expected declaration specifiers or '...' before 'size_t'
/usr/include/stdio.h:336: error: expected declaration specifiers or '...' before 'size_t'
/usr/include/stdio.h:343: error: expected declaration specifiers or '...' before 'size_t'
/usr/include/stdio.h:385: error: expected declaration specifiers or '...' before 'size_t'
/usr/include/stdio.h:387: error: format string argument not a string type
/usr/include/stdio.h:389: error: expected declaration specifiers or '...' before 'size_t'
/usr/include/stdio.h:391: error: format string argument not a string type
/usr/include/stdio.h:661: error: expected declaration specifiers or '...' before 'size_t'
/usr/include/stdio.h:664: error: expected declaration specifiers or '...' before 'size_t'
/usr/include/stdio.h:674: error: expected declaration specifiers or '...' before 'size_t'
/usr/include/stdio.h:704: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'fread'
/usr/include/stdio.h:710: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'fwrite'
/usr/include/stdio.h:732: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'fread_unlocked'
/usr/include/stdio.h:734: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'fwrite_unlocked'
configure:4113: $? = 1
configure:4120: ./conftest
./configure: line 4122: ./conftest: No such file or directory
configure:4124: $? = 127
configure:4131: error: in `/root/msk/py_workspace/py_setup/Python-3.4.4':
configure:4133: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details
## ---------------- ##
## Cache variables. ##
## ---------------- ##
ac_cv_build=x86_64-unknown-linux-gnu
ac_cv_env_CC_set=
ac_cv_env_CC_value=
ac_cv_env_CFLAGS_set=
ac_cv_env_CFLAGS_value=
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=
ac_cv_env_LDFLAGS_set=
ac_cv_env_LDFLAGS_value=
ac_cv_env_LIBS_set=
ac_cv_env_LIBS_value=
ac_cv_env_MACHDEP_set=
ac_cv_env_MACHDEP_value=
ac_cv_env_PKG_CONFIG_LIBDIR_set=
ac_cv_env_PKG_CONFIG_LIBDIR_value=
ac_cv_env_PKG_CONFIG_PATH_set=
ac_cv_env_PKG_CONFIG_PATH_value=
ac_cv_env_PKG_CONFIG_set=
ac_cv_env_PKG_CONFIG_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_host_alias_set=
ac_cv_env_host_alias_value=
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_host=x86_64-unknown-linux-gnu
ac_cv_prog_ac_ct_CC=gcc
## ----------------- ##
## Output variables. ##
## ----------------- ##
ABIFLAGS=''
AR=''
ARCH_RUN_32BIT=''
ARFLAGS=''
ASDLGEN=''
BASECFLAGS=''
BASECPPFLAGS=''
BLDLIBRARY=''
BLDSHARED=''
BUILDEXEEXT=''
CC='gcc'
CCSHARED=''
CFLAGS=''
CFLAGSFORSHARED=''
CFLAGS_NODIST=''
CONFIGURE_MACOSX_DEPLOYMENT_TARGET=''
CONFIG_ARGS=''
CPP=''
CPPFLAGS=''
CXX=''
DEFS=''
DLINCLDIR=''
DLLLIBRARY=''
DYNLOADFILE=''
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EGREP=''
ENSUREPIP=''
EXEEXT=''
EXPORT_MACOSX_DEPLOYMENT_TARGET='#'
EXT_SUFFIX=''
FRAMEWORKALTINSTALLFIRST=''
FRAMEWORKALTINSTALLLAST=''
FRAMEWORKINSTALLAPPSPREFIX=''
FRAMEWORKINSTALLFIRST=''
FRAMEWORKINSTALLLAST=''
FRAMEWORKPYTHONW=''
FRAMEWORKUNIXTOOLSPREFIX='/usr/local'
GNULD=''
GREP=''
HAS_HG='no-repository'
HAVE_GETHOSTBYNAME=''
HAVE_GETHOSTBYNAME_R=''
HAVE_GETHOSTBYNAME_R_3_ARG=''
HAVE_GETHOSTBYNAME_R_5_ARG=''
HAVE_GETHOSTBYNAME_R_6_ARG=''
HGBRANCH=''
HGTAG=''
HGVERSION=''
INSTALL_DATA=''
INSTALL_PROGRAM=''
INSTALL_SCRIPT=''
INSTSONAME=''
LDCXXSHARED=''
LDFLAGS=''
LDLAST=''
LDLIBRARY=''
LDLIBRARYDIR=''
LDSHARED=''
LDVERSION=''
LIBC=''
LIBFFI_INCLUDEDIR=''
LIBM=''
LIBOBJS=''
LIBPL=''
LIBRARY=''
LIBS=''
LIBTOOL_CRUFT=''
LINKCC=''
LINKFORSHARED=''
LIPO_32BIT_FLAGS=''
LN=''
LTLIBOBJS=''
MACHDEP='linux'
MACHDEP_OBJS=''
MAINCC=''
MKDIR_P=''
MULTIARCH=''
NO_AS_NEEDED=''
OBJEXT=''
OPT=''
OTHER_LIBTOOL_OPT=''
PACKAGE_BUGREPORT='List of issues - Python tracker'
PACKAGE_NAME='python'
PACKAGE_STRING='python 3.4'
PACKAGE_TARNAME='python'
PACKAGE_URL=''
PACKAGE_VERSION='3.4'
PATH_SEPARATOR=':'
PKG_CONFIG=''
PKG_CONFIG_LIBDIR=''
PKG_CONFIG_PATH=''
PLATDIR='plat-linux'
PY3LIBRARY=''
PYTHON=''
PYTHONFRAMEWORK=''
PYTHONFRAMEWORKDIR='no-framework'
PYTHONFRAMEWORKIDENTIFIER='org.python.python'
PYTHONFRAMEWORKINSTALLDIR=''
PYTHONFRAMEWORKPREFIX=''
PYTHON_FOR_BUILD='./$(BUILDPYTHON) -E'
PY_ENABLE_SHARED=''
RANLIB=''
READELF=''
RUNSHARED=''
SGI_ABI=''
SHELL='/bin/sh'
SHLIBS=''
SHLIB_SUFFIX=''
SIGNAL_OBJS=''
SOABI=''
SOVERSION='1.0'
SRCDIRS=''
TCLTK_INCLUDES=''
TCLTK_LIBS=''
THREADHEADERS=''
THREADOBJ=''
TRUE=''
UNIVERSALSDK=''
UNIVERSAL_ARCH_FLAGS=''
USE_INLINE=''
USE_SIGNAL_MODULE=''
USE_THREAD_MODULE=''
VERSION='3.4'
_PYTHON_HOST_PLATFORM=''
ac_ct_AR=''
ac_ct_CC='gcc'
ac_ct_CXX=''
ac_ct_READELF=''
bindir='${exec_prefix}/bin'
build='x86_64-unknown-linux-gnu'
build_alias=''
build_cpu='x86_64'
build_os='linux-gnu'
build_vendor='unknown'
datadir='${datarootdir}'
datarootdir='${prefix}/share'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
dvidir='${docdir}'
exec_prefix='NONE'
host='x86_64-unknown-linux-gnu'
host_alias=''
host_cpu='x86_64'
host_os='linux-gnu'
host_vendor='unknown'
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
mandir='${datarootdir}/man'
oldincludedir='/usr/include'
pdfdir='${docdir}'
prefix='NONE'
program_transform_name='s,x,x,'
psdir='${docdir}'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
sysconfdir='${prefix}/etc'
target_alias=''
## ----------- ##
## confdefs.h. ##
## ----------- ##
/* confdefs.h */
#define _GNU_SOURCE 1
#define _NETBSD_SOURCE 1
#define __BSD_VISIBLE 1
#define _BSD_TYPES 1
#define _DARWIN_C_SOURCE 1
#define _XOPEN_SOURCE 700
#define _XOPEN_SOURCE_EXTENDED 1
#define _POSIX_C_SOURCE 200809L
configure: exit 1
⑸ 怎樣用python算24點
這個參考一下:是csdn的
輸入4個數字, 輸出所有用加減乘除結果為24的表達式. 代碼如下:
def isEqual(num1, num2):
return
abs(num1 - num2) < 1e-5;
# End of isEqual().
http://blog.csdn.net/jq0123/article/details/6092435