![]() ![]() The script will take the number of records from the user after execution. #Call the function to generate fake records and store into a json file Num = int ( input ( "Enter the number of records:" ) ) ![]() #Take the number of records from the user With open ( 'customer.json', 'w' ) as fp: random_number (digits = 5 )Ĭustomer = fake. #Iterate the loop based on the input value and generate fake dataĬustomer = fake. #Define function to generate fake data and store into a JSON file All customer data will be stored in a dictionary and stored in the customer.json file by using the JSON module. The other values of the customer will be name, address, email, and phone number. Here, the customer id of 5 digits will be generated by using the random_number() method. The generate_data() function is created in the script to generate a particular number of customer records by using for loop. Create a Python file with the following script that will generate a particular number of dummy records and store the records in a JSON file. The group of dummy data can be stored in JSON by using a Python script. Once the review is complete, your code fix will be merged into master branch within the DataGenerator repository.The following output will appear after executing the above script. Once you complete your code, build and test it, please make a pull request for review. Then, you can assign yourself to the bug as the owner and start developing your code. If you want to get involved in fixing bugs, first read the steps outlined above under "Contribute". Please make sure you provide a clear description of the issue along with a testable scenario. Once you identify that your issue is new, create a new ticket. ![]() When you encounter bugs, please try to find out if the issue has already been reported by searching here. Once you have completed the commit you can make a pull request referencing the initial issue created for the work. ![]() I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the open source license(s) involved. The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it. The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same open source license (unless I am permitted to submit under a different license), as indicated in the file or The contribution was created in whole or in part by me and I have the right to submit it under the open source license indicated in the file or When you signoff, you are agreeing to the following:ĭeveloper's Certificate of Origin (adapted from the linux kernel)īy making a contribution to this project, I certify that: Git commit -s -m 'YOUR COMMIT DESCRIPTION' git commit -signoff -m 'YOUR COMMIT DESCRIPTION' Once you have written your code, please make sure to sign off your work when you commit it. If you believe that you have a worthwhile contribution, please open an issue on GitHub and explain your idea. We encourage everyone who has an idea to fork the code, experiment and share their experiences with us through our Google Group. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |