如何在Sun Solaris中解压缩import random
import time
#variable names with character stats
lvl = 1
strength = 0
health = 100
maxhealth = health * lvl
#monster dictionaries which display stats
imp = {'health':10,'attack':1,'speed':20}
killer_ant = {'health':15,'attack':2,'speed':100}
goblin = {'health':5,'attack':3,'speed':4}
monster_dict = {'imp':imp, 'killer_ant':killer_ant, 'goblin':goblin}
#choosing a random monster from monster_dict
counter=0
randNum= random.randint(1,3)
for name,monster_stat in monster_dict.items():
counter=counter+1
if counter == randNum:
print ('The monsters name is', name,monster_stat)
#weapon classes
sword = {'sword':0,'attack':5,'speed':1}
mace = {'mace':0,'attack':10,'speed':2}
staff = {'staff':0,'attack':15,'speed':3}
weapon_dict2 = {'sword':sword,'mace':mace,'staff':staff}
#class selection somewhat works
class_choice = input("choose a weapon (sword, mace, or staff)")
inventory = [ ]
for name2,character_stat in weapon_dict2.items():
if class_choice == name2:
inventory.append(class_choice)
print('here is your inventory:', inventory)
print('class choice is valid.')
else:
print('class choice is invalid.')
'''
class choice is invalid sometimes repeats twice or when it is valid, #says its invalid
'''
battle_choice = input('what do you want to do (use weapon or run away)')
first_turn = True
while first_turn:
if battle_choice == 'run away':
if character_stat['speed'] > monster_stat['speed']:
print('you are faster than monster and you have escaped')
break
else:
print('you cant escape and the monster will fight you')
break
if battle_choice == "use weapon":
while battle_choice == 'use weapon':
monster_stat['health'] = monster_stat['health'] - character_stat['attack']
print(monster_stat['health'])
maxhealth = maxhealth - monster_stat['attack']
print(maxhealth)
包。我在
gunzip解
.dstream.Z
解压缩
# gunzip pkg@1821417@27528.dstream.Z
gzip: pkg@1821417@27528.dstream.Z: not in gzip format
罐
# unzip pkg@1821417@27528.dstream.Z
Archive: pkg@1821417@27528.dstream.Z
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
unzip: cannot find zipfile directory in one of pkg@1821417@27528.dstream.Z or
pkg@27528.dstream.Z.zip, and cannot find pkg@1821417@27528.dstream.Z.ZIP, period.
的cpio
jar xf pkg@1821417@27528.dstream.Z
bash: jar: command not found
在这里,我必须按# cpio -idvu pkg@1821417@27528.dstream.Z
,因为没有打印出来。
此外,我使用 file 命令检查:
Ctrl+C
答案 0 :(得分:1)
对于带有uncompress
后缀的此类文件,您应该.Z
。如今它是一种古老的工具,但它当然仍然有效。
这样的事情:
uncompress pkg@1821417@27528.dstream.Z