在程序研發過程中,我們往往需要大量的虛擬實驗數據。Python中有多個包可以用于生成虛擬數據,其中功能較為完善的是ForgeryPy。
采用pip進行安裝:
pip install ForgeryPy打開源碼:
# -*- coding: utf-8 -*-# Copyright (C) 2012 by Tomasz Wójcik <[email protected]>## Permission is hereby granted, free of charge, to any person obtaining a copy# of this software and associated documentation files (the "Software"), to deal# in the Software without restriction, including without limitation the rights# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell# copies of the Software, and to permit persons to whom the Software is# furnished to do so, subject to the following conditions:## The above copyright notice and this permission notice shall be included in# all copies or substantial portions of the Software.## THE SOFTWARE IS ForgeryPy包括了地理位置、日期、網絡、名稱等大量虛擬生成算法,非常方便我們用來生成虛擬數據。其中一次的運行結果:
Paso [email protected] KingZoomloungeMaecenas leo odio, condimentum id, luctus nec, molestie sed, justo.
|
新聞熱點
疑難解答