程序在pycharm中运行良好,在termin中运行时给出错误答案

2024-09-30 01:23:46 发布

您现在位置:Python中文网/ 问答频道 /正文

背景。四年级理工科学生。第一年。你知道吗

Problem: I am running a program in two places, Pycharm (IDE) and an external server using the terminal. The output for the same python file is different when running on these two things. I need it to be the same and preferably correct. (and yes, python and the fasta file is the same on the terminal and the Pycharm).

pycharm和终端上的文件。

Pycharm文件:

  1. 染色体9.fa
  2. 你知道吗窗口.py你知道吗
  3. 要运行的命令:python窗口.py染色体9.fa

终端文件

  1. 铬9.fa
  2. 你知道吗窗口.py你知道吗
  3. 要运行的命令:python窗口.py铬9.fa

Pycharm文件的输出

There are 1255728 CpG pairs in this sequence.


[(63385200, 63385679), (64711680, 64712169), (65825370, 65825849), (131739850, 131740259), (134326260, 134326859)]

[(1092400, 1092839), (1366440, 1366849), (1549650, 1550099), (4068100, 4068849), (4326450, 4327169), (9216770, 9217449), (12647450, 12648029), (14136430, 14136909), (15126110, 15126569)
, (29073770, 29074689), (39586690, 39587139), (73198340, 73198929), (74377730, 74378379), (75009180, 75009779), (75341380, 75341889), (99970290, 99970769), (103436370, 103436809)]

getting average CpGIsland length for + strand
Average length: 491.0

getting average CpGIsland length for - strand
Average length: 564.2941176470588

终端程序的输出

('There are', 1255728, 'CpG pairs in this sequence.')

[]

[]


getting average CpGIsland length for + strand
Average length : 0

getting average CpGIsland length for - strand
Average length : 0

打印报表

print("There are",len(CG_indices),"CpG pairs in this sequence.")

两者的打印也不一样,但我现在不在乎。你知道吗

有人知道发生了什么吗?


Tags: and文件theinpyforlengthpycharm
1条回答
网友
1楼 · 发布于 2024-09-30 01:23:46

天哪,你们真是太好了。是的,我跑了Python3窗口.pychrom9.fa,运行python时它不起作用窗口.py铬9.fa。你们太棒了!谢谢你,伊恩奎,格兰弗,怪胎。(aaaaaaaaaaaaaaaa)(内部尖叫)

我仍然不知道为什么会这样,但我现在知道这显然是一个非常严重的问题。你知道吗

相关问题 更多 >

    热门问题