⑴ 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,