likuo 发表于 2021-1-18 15:39:55

windows上可以运行的python脚本,为什么linux报错

我写的脚本在window上用jupyter nootbook可以运行成功。在linux上相同的文件,出现下面的错误。
UnicodeDecodeError: 'utf-8' codec can't decode bytes in position 1042-1043: invalid continuation byte

代码很简单,如下。是python的问题还是linux和windows系统的问题?

adict={}
with open("dbNSFP4.1_gene.complete.txt") as g:
    for line in g:
      lst=line.strip().split("\t")
      gene=lst
      other="\t".join(lst)+"\n"
      if gene not in adict:
            adict=other

昨非 发表于 2021-1-18 15:41:52

本帖最后由 昨非 于 2021-1-18 15:47 编辑

你的linux的文件编码不是utf-8的,所以open函数出了问题
一般Linux下的文件按默认都是utf-8的,你这个不是,
可以看看这篇博文,试试换个文件编码形式
http://blog.chinaunix.net/uid-23886490-id-3773994.html

YunGuo 发表于 2021-1-18 15:43:27

试试打开文件添加encoding='gbk'

likuo 发表于 2021-1-18 15:48:18

下面是有问题的那一行
COL2A1        na        3.506122093        0.793923657        0.063983595        0.018152459        5.693519803        1.289236354        0.103901648        0.029477406        PI3K-Akt signaling pathway - Homo sapiens (human);ECM-receptor interaction - Homo sapiens (human);Focal adhesion - Homo sapiens (human);Protein digestion and absorption - Homo sapiens (human);Human papillomavirus infection - Homo sapiens (human);Neural Crest Differentiation;Spinal Cord Injury;Focal Adhesion;Simplified Interaction Map Between LOXL4 and Oxidative Stress Pathway;Focal Adhesion-PI3K-Akt-mTOR-signaling pathway;PI3K-Akt Signaling Pathway;Endochondral Ossification;Collagen chain trimerization;Collagen biosynthesis and modifying enzymes;Collagen formation;Extracellular matrix organization;Integrin;Beta1 integrin cell surface interactions;Syndecan-1-mediated signaling events;Integrins in angiogenesis        Cell Communication;Focal adhesion;ECM-receptor interaction        "FUNCTION: Type II collagen is specific for cartilaginous tissues. It is essential for the normal embryonic development of the skeleton, for linear growth and for the ability of cartilage to resist compressive forces.; "        "DISEASE: Spondyloepiphyseal dysplasia congenital type (SEDC) : Disorder characterized by disproportionate short stature and pleiotropic involvement of the skeletal and ocular systems. {ECO:0000269|PubMed:10678662, ECO:0000269|PubMed:11746045, ECO:0000269|PubMed:2339128, ECO:0000269|PubMed:2543071, ECO:0000269|PubMed:7757086, ECO:0000269|PubMed:8019561, ECO:0000269|PubMed:8325895, ECO:0000269|PubMed:8423604}. Note=The disease is caused by mutations affecting the gene represented in this entry.; DISEASE: Spondyloepiphyseal dysplasia, Stanescu type (SEDSTN) : An autosomal dominant spondyloepiphyseal dysplasia characterized by glycoproteins accumulation in chondrocytes. Clinical features include progressive joint contractures, premature degenerative joint disease particularly in the knee, hip and finger joints, and osseous distention of the metaphyseal ends of the phalanges causing swolling of interphalangeal joints of the hands. Radiological features include generalized platyspondyly, hypoplastic pelvis, epiphyseal flattening with metaphyseal splaying of the long bones, and enlarged phalangeal epimetaphyses of the hands. {ECO:0000269|PubMed:26183434}. Note=The disease is caused by mutations affecting the gene represented in this entry.; DISEASE: Spondyloepimetaphyseal dysplasia, Strudwick type (SEMDSTWK) : A bone disease characterized by disproportionate short stature from birth, with a very short trunk and shortened limbs, and skeletal abnormalities including lordosis, scoliosis, flattened vertebrae, pectus carinatum, coxa vara, clubfoot, and abnormal epiphyses or metaphyses. A distinctive radiographic feature is irregular sclerotic changes, described as dappled in the metaphyses of the long bones. {ECO:0000269|PubMed:16088915, ECO:0000269|PubMed:7550321, ECO:0000269|Ref.39}. Note=The disease is caused by mutations affecting the gene represented in this entry.; DISEASE: Achondrogenesis 2 (ACG2) : An autosomal dominant disease characterized by the absence of ossification in the vertebral column, sacrum and pubic bones. {ECO:0000269|PubMed:10745044, ECO:0000269|PubMed:10797431, ECO:0000269|PubMed:15054848, ECO:0000269|PubMed:17994563, ECO:0000269|PubMed:2572591, ECO:0000269|PubMed:7757081, ECO:0000269|PubMed:7757086, ECO:0000269|PubMed:7829510}. Note=The disease is caused by mutations affecting the gene represented in this entry.; DISEASE: Legg-Calve-Perthes disease (LCPD) : Characterized by loss of circulation to the femoral head, resulting in avascular necrosis in a growing child. Clinical pictures of the disease vary, depending on the phase of disease progression through ischemia, revascularization, fracture and collapse, and repair and remodeling of the bone. {ECO:0000269|PubMed:17394019}. Note=The disease is caused by mutations affecting the gene represented in this entry.; DISEASE: Kniest dysplasia (KD) : Moderately severe chondrodysplasia phenotype that results from mutations in the COL2A1 gene. Characteristics of the disorder include a short trunk and extremities, mid-face hypoplasia, cleft palate, myopia, retinal detachment, and hearing loss. {ECO:0000269|PubMed:7874117, ECO:0000269|PubMed:8863156}. Note=The disease is caused by mutations affecting the gene represented in this entry.; DISEASE: Avascular necrosis of femoral head, primary, 1 (ANFH1) : A disease characterized by mechanical failure of the subchondral bone, and degeneration of the hip joint. It usually leads to destruction of the hip joint in the third to fifth decade of life. The clinical manifestations, such as pain on exertion, a limping gait, and a discrepancy in leg length, cause considerable disability. ANFH1 inheritance is autosomal dominant. {ECO:0000269|PubMed:15930420, ECO:0000269|PubMed:21671384}. Note=The disease is caused by mutations affecting the gene represented in this entry.; DISEASE: Osteoarthritis with mild chondrodysplasia (OSCDP) : Osteoarthritis is a common disease that produces joint pain and stiffness together with radiologic evidence of progressive degeneration of joint cartilage. {ECO:0000269|PubMed:1975693, ECO:0000269|PubMed:1985108, ECO:0000269|PubMed:7757086, ECO:0000269|PubMed:8507190}. Note=The disease is caused by mutations affecting the gene represented in this entry.; DISEASE: Platyspondylic lethal skeletal dysplasia Torrance type (PLSD-T) : Platyspondylic lethal skeletal dysplasias (PLSDs) are a heterogeneous group of chondrodysplasias characterized by severe platyspondyly and limb shortening. PLSD-T is characterized by varying platyspondyly, short ribs with anterior cupping, hypoplasia of the lower ilia with broad ischial and pubic bones, and shortening of the tubular bones with splayed and cupped metaphyses. Histology of the growth plate typically shows focal hypercellularity with slightly enlarged chondrocytes in the resting cartilage and relatively well-preserved columnar formation and ossification at the chondro-osseous junction. PLSD-T is generally a perinatally lethal disease, but a few long-term survivors have been reported. {ECO:0000269|PubMed:10745044, ECO:0000269|PubMed:14729840, ECO:0000269|PubMed:15643621}. Note=The disease is caused by mutations affecting the gene represented in this entry.; DISEASE: Multiple epiphyseal dysplasia with myopia and conductive deafness (EDMMD) : A generalized skeletal dysplasia associated with significant morbidity. Joint pain, joint deformity, waddling gait, and short stature are the main clinical signs and symptoms. EDMMD is an autosomal dominant disorder characterized by epiphyseal dysplasia associated with progressive myopia, retinal thinning, crenated cataracts, conductive deafness. {ECO:0000269|PubMed:9800905}. Note=The disease is caused by mutations affecting the gene represented in this entry.; DISEASE: Spondyloperipheral dysplasia (SPD) : SPD patients manifest short stature, midface hypoplasia, sensorineural hearing loss, spondyloepiphyseal dysplasia, platyspondyly and brachydactyly. {ECO:0000269|PubMed:15316962}. Note=The disease is caused by mutations affecting the gene represented in this entry.; DISEASE: Stickler syndrome 1 (STL1) : An autosomal dominant form of Stickler syndrome, an inherited disorder that associates ocular signs with more or less complete forms of Pierre Robin sequence, bone disorders and sensorineural deafness. Ocular disorders may include juvenile cataract, myopia, strabismus, vitreoretinal or chorioretinal degeneration, retinal detachment, and chronic uveitis. Pierre Robin sequence includes an opening in the roof of the mouth (a cleft palate), a large tongue (macroglossia), and a small lower jaw (micrognathia). Bones are affected by slight platyspondylisis and large, often defective epiphyses. Juvenile joint laxity is followed by early signs of arthrosis. The degree of hearing loss varies among affected individuals and may become more severe over time. Syndrome expressivity is variable. {ECO:0000269|PubMed:11007540, ECO:0000269|PubMed:20513134, ECO:0000269|PubMed:7977371}. Note=The disease is caused by mutations affecting the gene represented in this entry.; DISEASE: Stickler syndrome 1 non-syndromic ocular (STL1O) : An autosomal dominant form of Stickler syndrome characterized by the ocular signs typically seen in Stickler syndrome type 1 such as cataract, myopia, retinal detachment. Systemic features of premature osteoarthritis, cleft palate, hearing impairment, and craniofacial abnormalities are either absent or very mild. {ECO:0000269|PubMed:16752401, ECO:0000269|PubMed:17721977, ECO:0000269|PubMed:8317498}. Note=The disease is caused by mutations affecting the gene represented in this entry.; DISEASE: Rhegmatogenous retinal detachment autosomal dominant (DRRD) : A eye disease that most frequently results from a break or tear in the retina that allows fluid from the vitreous humor to enter the potential space beneath the retina. It is often associated with pathologic myopia and in most cases leads to visual impairment or blindness if untreated. {ECO:0000269|PubMed:11007540, ECO:0000269|PubMed:15671297}. Note=The disease is caused by mutations affecting the gene represented in this entry.; DISEASE: Czech dysplasia (CZECHD) : A skeletal dysplasia characterized by early-onset, progressive pseudorheumatoid arthritis, platyspondyly, and short third and fourth toes. {ECO:0000269|PubMed:18553548, ECO:0000269|PubMed:19764028, ECO:0000269|PubMed:7757086, ECO:0000269|PubMed:8244341}. Note=The disease is caused by mutations affecting the gene represented in this entry.; "        "Spondyloepiphyseal dysplasia congenital type;Spondyloepiphyseal dysplasia, Stanescu type ;Spondyloepimetaphyseal dysplasia, Strudwick type;Achondrogenesis 2 ;Legg-Calve-Perthes disease;Kniest dysplasia;Avascular necrosis of femoral head, primary, 1 ;Osteoarthritis with mild chondrodysplasia;Platyspondylic lethal skeletal dysplasia Torrance type;Multiple epiphyseal dysplasia with myopia and conductive deafness ;Spondyloperipheral dysplasia;Stickler syndrome 1 ;Stickler syndrome 1 non-syndromic ocular ;Rhegmatogenous retinal detachment autosomal dominant ;Czech dysplasia;"        "Multiple epiphyseal dysplasia, Beighton type;Legg-Calv￿Perthes disease;Czech dysplasia, metatarsal type;Kniest dysplasia;Weissenbacher- Zweymuller syndrome;Spondyloperipheral dysplasia-short ulna syndrome;Autosomal dominant rhegmatogenous retinal detachment;Spondyloepiphyseal dysplasia, Stanescu type;Mild spondyloepiphyseal dysplasia due to COL2A1 mutation with early-onset osteoarthritis;Spondyloepimetaphyseal dysplasia congenita, Strudwick type;Achondrogenesis type 2;Hypochondrogenesis;Spondylometaphyseal dysplasia, 'corner fracture' type;Spondylometaphyseal dysplasia, Schmidt type;Stickler syndrome type 1;Dysspondyloenchondromatosis;Familial avascular necrosis of femoral head;Platyspondylic dysplasia, Torrance type;Spondyloepiphyseal dysplasia congenita"        Disease-causing germline mutation(s) in;Disease-causing germline mutation(s) in;Disease-causing germline mutation(s) in;Disease-causing germline mutation(s) in;Candidate gene tested in;Disease-causing germline mutation(s) in;Disease-causing germline mutation(s) in;Disease-causing germline mutation(s) in;Disease-causing germline mutation(s) in;Disease-causing germline mutation(s) in;Disease-causing germline mutation(s) in;Disease-causing germline mutation(s) in;Candidate gene tested in;Disease-causing germline mutation(s) in;Disease-causing germline mutation(s) in;Disease-causing germline mutation(s) in;Disease-causing germline mutation(s) in;Disease-causing germline mutation(s) in;Disease-causing germline mutation(s) in        .        "Narrow chest;Cleft palate;Limitation of joint mobility;Hearing impairment;Osteoarthritis;Abnormality of epiphysis morphology;Short neck;Broad forehead;Short stature;Retinal detachment;Scoliosis;Platyspondyly;Glaucoma;Talipes equinovarus;Cataract;Flat face;Coxa vara;Short thorax;Myopia;Micromelia;Skeletal dysplasia;Hyperlordosis;Nystagmus;Hypertelorism;Kyphosis;Limited hip movement;Impairment of activities of daily living;Groin pain;Short stepped shuffling gait;Flattened femoral head;Hip pain;Lower limb asymmetry;Hip osteoarthritis;Restrictive ventilatory defect;Vitreoretinopathy;Muscular hypotonia;Limited elbow movement;Coxa vara;Short neck;Retinal detachment;Pectus carinatum;Kyphosis;Autosomal dominant inheritance;Malar flattening;Flat face;Waddling gait;Platyspondyly;Hip dislocation;Limited hip movement;Flattened epiphysis;Cleft palate;Talipes equinovarus;Hypoplasia of the odontoid process;Cervical myelopathy;Ovoid vertebral bodies;Delayed pubic bone ossification;Myopia;Generalized hypotonia;Respiratory distress;Lumbar hyperlordosis;Delayed calcaneal ossification;Limitation of knee mobility;Barrel-shaped chest;Spondyloepiphyseal dysplasia;Scoliosis;Neonatal short-trunk short stature;Tracheomalacia;Umbilical hernia;Autosomal dominant inheritance;Hip dislocation;Enlarged joints;Coronal cleft vertebrae;Short neck;Conductive hearing impairment;Respiratory distress;Motor delay;Cleft palate;Round face;Splayed epiphyses;Myopia;Platyspondyly;Retinal detachment;Hip contracture;Gait disturbance;Lumbar kyphoscoliosis;Midface retrusion;Coxa vara;Abnormal cartilage collagen;Depressed nasal bridge;Dumbbell-shaped long bone;Inguinal hernia;Proptosis;Cataract;Recurrent otitis media;Hypoplastic pelvis;Flared metaphysis;Malar flattening;Delayed epiphyseal ossification;Flattened, squared-off epiphyses of tubular bones;Disproportionate short-trunk short stature;Autosomal dominant inheritance;Avascular necrosis of the capital femoral epiphysis;Delayed skeletal maturation;Short stature;Multifactorial inheritance;C1-C2 subluxation;Cleft palate;Metaphyseal dappling;Narrow greater sciatic notch;Pectus carinatum;Protuberant abdomen;Hypoplasia of the odontoid process;Hypoplastic pubic bone;Club-shaped proximal femur;Coxa vara;Hyperlordosis;Inguinal hernia;Autosomal dominant inheritance;Pes planus;Genu valgum;Metaphyseal irregularity;Scoliosis;Brachydactyly;Myopia;Severe short stature;Spondyloepimetaphyseal dysplasia;Platyspondyly;Delayed pubic bone ossification;Anterior rib cupping;Coxa vara;Platyspondyly;Gait disturbance;Abnormality of epiphysis morphology;Hypertelorism;Abnormality of the metaphysis;Kyphosis;Disproportionate short stature;Spondyloepimetaphyseal dysplasia;Osteoarthritis;Short thorax;Respiratory distress;Myopia;Flat face;Hyperlordosis;Retinal detachment;Genu valgum;Abnormality of the sternum;Short femoral neck;Micromelia;Talipes equinovarus;Scoliosis;Genu varum;Cleft palate;Hypoplasia of the odontoid process;Metaphyseal irregularity;Ovoid vertebral bodies;Mild short stature;Coxa vara;Hyperlordosis;Scoliosis;Recurrent fractures;Kyphosis;Genu valgum;Tetralogy of Fallot;Abnormality of the wrist;Pes planus;Hypoplasia of the odontoid process;Spondylometaphyseal dysplasia;Micromelia;Beaking of vertebral bodies;Platyspondyly;Cataract;Glaucoma;Scoliosis;Morbus Scheuermann;Osteoarthritis;Midface retrusion;Membranous vitreous appearance;Mitral valve prolapse;Bifid uvula;Cleft palate;Arachnodactyly;Kyphosis;Arthropathy;Spondyloepiphyseal dysplasia;Autosomal dominant inheritance;Submucous cleft hard palate;Blindness;Pierre-Robin sequence;Pectus excavatum;Sensorineural hearing impairment;Anteverted nares;Disproportionate tall stature;Depressed nasal bridge;Irregular femoral epiphysis;Spondylolisthesis;Retinal detachment;Malar flattening;Myopia;Conductive hearing impairment;Short stature;Micromelia;Hypoplastic pelvis;Metaphyseal dysplasia;Genu valgum;Joint dislocation;Platyspondyly;Abnormality of the wrist;Spondylometaphyseal dysplasia;Short long bone;Myopia;Kyphoscoliosis;Joint stiffness;Short stature;Platyspondyly;Knee osteoarthritis;Hip osteoarthritis;Beaking of vertebral bodies;Heberden's node;Autosomal dominant inheritance;Irregular vertebral endplates;Schmorl's node;Narrow iliac wings;Short femoral neck;Irregular vertebral endplates;Short metatarsal;Waddling gait;Growth abnormality;Arthralgia;Flat capital femoral epiphysis;Short toe;Platyspondyly;Flexion contracture;Thoracic kyphosis;Narrow femoral neck;Short metacarpal;Intervertebral space narrowing;Coxa vara;Scoliosis;Autosomal dominant inheritance;Prominent forehead;Genu varum;Narrow chest;Short foot;Pulmonary hypoplasia;Hypoplastic pelvis;Metaphyseal cupping;Short palm;Abnormality of the carpal bones;Polyhydramnios;Depressed nasal bridge;Hypoplastic scapulae;Micromelia;Cleft palate;Disproportionate short-limb short stature;Skeletal dysplasia;Short distal phalanx of finger;Hypoplasia of the capital femoral epiphysis;Abdominal distention;Malar flattening;Hydrops fetalis;Low-set ears;Platyspondyly;Short thorax;Cystic hygroma;Postaxial hand polydactyly;Aplasia/Hypoplasia of the lungs;Abnormality of cardiovascular system morphology;Micromelia;Macrocephaly;Frontal bossing;Narrow chest;Short neck;Umbilical hernia;Flat face;Hydrops fetalis;Long philtrum;Thickened nuchal skin fold;Abdominal distention;Lethal skeletal dysplasia;Short nose;Abnormal enchondral ossification;Disproportionate short-limb short stature;Anteverted nares;Polyhydramnios;Micrognathia;Femoral hernia;Arthralgia;Stiff neck;Spondyloepiphyseal dysplasia;Autosomal dominant inheritance;Platyspondyly;Beaking of vertebral bodies;Trismus;Coxa valga;Hypoplastic ilia;Kyphoscoliosis;Autosomal dominant inheritance;Asteroid hyalosis;Brachydactyly;Flat face;Conductive hearing impairment;Myopia;Coxa valga;Retinal thinning;Short stature;Epiphyseal dysplasia;Genu valgum;Cataract;Narrow mouth;Short phalanx of finger;Round face;Cartilage destruction;Skeletal muscle atrophy;Short stature;Avascular necrosis;Delayed skeletal maturation;Joint dislocation;Arthralgia;Abnormality of the dentition;Myopia;Autosomal dominant inheritance;Rhegmatogenous retinal detachment;Abnormal vitreous humor morphology;Short ribs;Protuberant abdomen;Thin ribs;Short neck;Lethal skeletal dysplasia;Macrocephaly;Flat acetabular roof;Abnormality of the abdominal wall;Neonatal short-limb short stature;Narrow chest;Severe limb shortening;Coarse facial features;Severe platyspondyly;Disc-like vertebral bodies;Metaphyseal cupping;Hypoplastic ischia;Short long bone;Hypoplastic pubic bone;Decreased cranial base ossification;Autosomal dominant inheritance;Hypoplastic ilia;Stillbirth;Broad long bones;Abdominal distention;Disproportionate short-trunk short stature;Disproportionate short-limb short stature;Absent vertebral body mineralization;Edema;Short ribs;Short long bone;Cleft palate;Hypoplastic iliac wing;Autosomal dominant inheritance;Cystic hygroma;Horizontal ribs;Polyhydramnios;Barrel-shaped chest;Hydrops fetalis;Short tubular bones of the hand;Abnormality of the foot;Coxa vara;Genu varum;Ovoid vertebral bodies;Hypoplasia of the odontoid process;Short femoral neck;Waddling gait;Spondylometaphyseal dysplasia;Autosomal dominant inheritance;Scoliosis;Pectus carinatum;Metaphyseal irregularity;Short stature;Hyperconvex vertebral body endplates;Hypoplasia of the maxilla;Arthralgia;Osteoarthritis;Mitral valve prolapse;Retinal detachment;Platyspondyly;Short nose;Sensorineural hearing impairment;Abnormality of vertebral epiphysis morphology;Skeletal dysplasia;Cleft palate;Intellectual disability;Proptosis;Myopia;Long philtrum;Visual loss;Joint hyperflexibility;Cataract;Abnormal vitreous humor morphology;Epiphyseal dysplasia;Genu valgum;Conductive hearing impairment;Anonychia;Retinal dysplasia;Myopia;Cataract;Round face;Narrow mouth;Flat face;Short palm;Short toe;Flat capital femoral epiphysis;Spondyloepiphyseal dysplasia;Short distal phalanx of the 5th finger;Kyphosis;Hypoplasia of the ulna;Flat acetabular roof;Short metatarsal;Barrel-shaped chest;Short stature;Midface retrusion;Shortening of all middle phalanges of the fingers;Limited elbow extension;Short distal phalanx of the 2nd finger;Short thumb;Short distal phalanx of finger;Autosomal dominant inheritance;Malar flattening;Acetabular spurs;Pugilistic facies;Shortening of all proximal phalanges of the fingers;Broad palm;Short foot;Sensorineural hearing impairment;Platyspondyly;Cone-shaped epiphyses of the phalanges of the hand;Short distal phalanx of the 3rd finger;Pectus carinatum;Brachydactyly;Short metacarpal;Broad thumb;Absent styloid process of ulna;Short distal phalanx of the 4th finger;Micrognathia;Osteoarthritis;Hyperlordosis;Hip dislocation;Skeletal dysplasia;Joint stiffness;Flattened, squared-off epiphyses of tubular bones;Scoliosis;Enlarged thorax;Kyphosis;Dumbbell-shaped long bone;Respiratory distress;Vitreoretinopathy;Hypoplastic pelvis;Rhizomelia;Depressed nasal bridge;Midface retrusion;Platyspondyly;Coxa vara;Flared metaphysis;Ptosis;Short thorax;Disproportionate short-trunk short stature;Myopia;Retinopathy;Cataract;Cleft palate;Tracheomalacia;Micromelia;Glaucoma;Glossoptosis;Tracheal stenosis;Hearing impairment;Round face;Ectopia lentis;Retinal detachment;Proptosis;Avascular necrosis of the capital femoral epiphysis;Autosomal dominant inheritance;Generalized osteoporosis;Glossoptosis;Malar flattening;Sensorineural hearing impairment;Osteoarthritis;Cleft palate;Arthralgia;Pectus excavatum;Pectus carinatum;Abnormal metacarpal morphology;Long philtrum;Exostoses;Micrognathia;Abnormality of fibula morphology;Delayed skeletal maturation;Anisospondyly;Pretibial blistering;Exostoses;Multiple enchondromatosis;Spondylometaphyseal dysplasia;Intellectual disability;Lower limb asymmetry;Enlarged joints;Osteoarthritis;Vertebral segmentation defect;Short stature;Abnormality of ulnar metaphysis;Skin erosion;Platyspondyly;Genu valgum;Generalized joint laxity;Joint dislocation;Cerebral calcification;Kyphoscoliosis;Metaphyseal enchondromatosis;Short stature;Limitation of joint mobility;Short metacarpal;Abnormality of vertebral epiphysis morphology;Hypoplasia of the ulna;Type E brachydactyly;Platyspondyly;Abnormality of pelvic girdle bone morphology;Abnormality of the metaphysis;Cone-shaped epiphysis;Pectus carinatum;Micromelia"        skeletal system development;cartilage condensation;tissue homeostasis;endochondral ossification;chondrocyte differentiation;heart morphogenesis;proteoglycan metabolic process;central nervous system development;visual perception;sensory perception of sound;regulation of gene expression;extracellular matrix organization;collagen fibril organization;notochord development;inner ear morphogenesis;regulation of immune response;cartilage development;roof of mouth development;limb bud formation;embryonic skeletal joint morphogenesis;cartilage development involved in endochondral bone morphogenesis;otic vesicle development;cellular response to BMP stimulus;anterior head development;negative regulation of extrinsic apoptotic signaling pathway in absence of ligand        extracellular region;collagen trimer;collagen type II trimer;basement membrane;extracellular space;endoplasmic reticulum lumen;extracellular matrix;collagen-containing extracellular matrix        extracellular matrix structural constituent;extracellular matrix structural constituent conferring tensile strength;MHC class II protein binding;identical protein binding;proteoglycan binding;metal ion binding;platelet-derived growth factor binding        .        1.00E+00        2.72E-10        0        0        0        0        0.042731629        0.004792332        0.0235623        0        N        N        Col2a1        "homeostasis/metabolism phenotype; cellular phenotype; craniofacial phenotype; adipose tissue phenotype (the observable morphological and physiological characteristics of mammalian fat tissue that are manifested through development and lifespan); growth/size/body region phenotype; behavior/neurological phenotype (the observable actions or reactions of mammalian organisms that are manifested through development and lifespan); embryo phenotype; skeleton phenotype; renal/urinary system phenotype; immune system phenotype; vision/eye phenotype; digestive/alimentary phenotype; limbs/digits/tail phenotype; nervous system phenotype (the observable morphological and physiological characteristics of the extensive, intricate network of electochemical structures in the body that is comprised of the brain, spinal cord, nerves, ganglia and parts of the receptor organs that are manifested through development and lifespan); hearing/vestibular/ear phenotype; cardiovascular system phenotype (the observable morphological and physiological characteristics of the mammalian heart, blood vessels, or circulatory system that are manifested through development and lifespan); normal phenotype; mortality/aging (the observable characteristics related to the ability of a mammalian organism to live and age that are manifested throughout development and life span); respiratory system phenotype; "

hrp 发表于 2021-1-18 15:51:02

在win上,你应该在py文件第一行加上 # coding: utf-8,然后重新以utf-8编码保存py文件

likuo 发表于 2021-1-18 15:53:09

YunGuo 发表于 2021-1-18 15:43
试试打开文件添加encoding='gbk'

可以啦,非常感谢。我用notepad设置的是utf-8。所以一直用默认的utf-8打开。

likuo 发表于 2021-1-18 15:58:20

hrp 发表于 2021-1-18 15:51
在win上,你应该在py文件第一行加上 # coding: utf-8,然后重新以utf-8编码保存py文件

# coding: utf-8 不只是一个注释信息吗,没有什么用。utf-8编码什么意思?我的文件用notepad++打开,转换成utf-8的。在win代码也可以运行,只是在linux上没法运行

hrp 发表于 2021-1-18 16:08:16

likuo 发表于 2021-1-18 15:58
# coding: utf-8 不只是一个注释信息吗,没有什么用。utf-8编码什么意思?我的文件用notepad++打开,转换 ...

没注意看,以为是linux下python解释器不认你的py,原来是打开文件编码报错,尴尬{:10_247:}

至于第一行 # coding: utf-8 这句注释,它是有用的,建议看一看python 的 PEP263。

likuo 发表于 2021-1-18 17:10:55

likuo 发表于 2021-1-18 15:53
可以啦,非常感谢。我用notepad设置的是utf-8。所以一直用默认的utf-8打开。

好像还是不行,我用python2是可以的。但是python3还是原来的问题

昨非 发表于 2021-1-18 20:18:20

likuo 发表于 2021-1-18 17:10
好像还是不行,我用python2是可以的。但是python3还是原来的问题

看看二楼的帖子
直接在Linux下查看编码试试

likuo 发表于 2021-1-25 08:52:54

昨非 发表于 2021-1-18 20:18
看看二楼的帖子
直接在Linux下查看编码试试

谢谢 我试试

likuo 发表于 2021-1-25 21:12:16

昨非 发表于 2021-1-18 15:41
你的linux的文件编码不是utf-8的,所以open函数出了问题
一般Linux下的文件按默认都是utf-8的,你这个不是 ...

我用:set fileencoding 是utf-8编码的
页: [1]
查看完整版本: windows上可以运行的python脚本,为什么linux报错