⑴ python 打印报表 有什么好的报表软件吗
你好,你可以用python 去调用fastreport.dll。下面是一个例子。
import clr
import threading
def fastRepot_run():
report = Report()
report.Load("test.frx")
report.Show();
clr.FindAssembly("FastReport.dll")
from FastReport import *
threading.Thread(target=fastRepot_run).start()
⑵ C#制作一个打印购物小票
usingSystem;
usingSystem.Collections.Generic;
usingSystem.Linq;
usingSystem.Text;
usingSystem.Threading.Tasks;
namespacePrintBill
{
classProgram
{
intItemId;
intAmount;
intnongfushanquan=0;
intjinmailang=0;
intshuanghuihuotuichang=0;
strings=string.Empty;
privatevoidbusiness()
{
Console.Write("输入商品编号:");
ItemId=Convert.ToInt32(Console.ReadLine());
Console.Write("输入商品数量:");
Amount=Convert.ToInt32(Console.ReadLine());
if(ItemId==1)
{
nongfushanquan=nongfushanquan+Amount;
}
if(ItemId==2)
{
jinmailang=jinmailang+Amount;
}
if(ItemId==3)
{
shuanghuihuotuichang=shuanghuihuotuichang+Amount;
}
Console.WriteLine("输入e停止购物,输入其他任意键继续购物:");
s=Console.ReadLine();
}
privatevoidProceBill()
{
doublesum1=0;
doublesum2=0;
doublesum3=0;
Console.WriteLine("----------------欢迎光临光辉超市----------------");
Console.WriteLine("商品名称单价数量小计");
if(nongfushanquan!=0)
{
sum1=nongfushanquan*1.02;
Console.WriteLine("农夫山泉1.02"+""+nongfushanquan+""+"¥"+sum1);
}
if(jinmailang!=0)
{
sum2=jinmailang*3.5;
Console.WriteLine("今麦郎碗面3.50"+""+jinmailang+""+"¥"+sum2);
}
if(shuanghuihuotuichang!=0)
{
sum3=shuanghuihuotuichang*0.5;
Console.WriteLine("双汇火腿肠0.50"+""+shuanghuihuotuichang+""+"¥"+sum3);
}
doubletotalSum=sum1+sum2+sum3;
Console.WriteLine("总计:¥"+totalSum);
}
staticvoidMain(string[]args)
{
Console.WriteLine("编号商品名称");
Console.WriteLine("1农夫山泉");
Console.WriteLine("2今麦郎碗面");
Console.WriteLine("3双汇火腿肠");
Console.WriteLine("");
Programp=newProgram();
p.business();
while(p.s!="e")
{
p.business();
}
p.ProceBill();
}
}
}
运行结果:
建议你自己再写写。
⑶ 用python打印九九乘法表代码
1、编写乘法表函数
def buildMulTable():
for i in range(1, 10):
for j in range(1, i + 1):
print('{}x{}={}\t'.format(j, i, i * j), end='')
print()
buildMulTable()
2、运行结果
1x1=1
1x2=2 2x2=4
1x3=3 2x3=6 3x3=9
1x4=4 2x4=8 3x4=12 4x4=16
1x5=5 2x5=10 3x5=15 4x5=20 5x5=25
1x6=6 2x6=12 3x6=18 4x6=24 5x6=30 6x6=36
1x7=7 2x7=14 3x7=21 4x7=28 5x7=35 6x7=42 7x7=49
1x8=8 2x8=16 3x8=24 4x8=32 5x8=40 6x8=48 7x8=56 8x8=64
1x9=9 2x9=18 3x9=27 4x9=36 5x9=45 6x9=54 7x9=63 8x9=72 9x9=81
⑷ 怎么用python打印出乘法表
循环输出就好,双重循环
for i in range(1,10):
for j in range(1,i+1):
print i, "*", j, "=", i*j,