解密 Skill 脚本

https://www.cnblogs.com/yeungchie/

  • code
procedure(Decrypt(inputFile @optional outputFile "tt")
	prog((inp out line)
		if(inputFile then
			unless(outputFile
				outputFile = sprintf(nil"%s.dec" inputFile)
			)
			when(isFile(outputFile)
				print("You must specify a file thatdoesn't exist!!!\n")
				hiGetAttention()
				return()
			)
			unless(inp = infile(inputFile)
				printf("Unable to open input file:%s\n" inputFile)
				return()
			)
			unless(out = outfile(outputFile"w")
				printf("Unable to open output file:%s\n" outputFile)
				return()
			)
			while(line = lineread(inp)
				when(line != t
					pprint(line out)
				)
			)
			close(inp)
			close(out)
		else
			printf("You must at least specify aninput file!\n")
			return()
		)
		return(t)
	)
);Decrypt
  • describe

  • example

上一篇:day08_for循环


下一篇:python基础-循环