Repository navigation
Python code examples for file IO in xml and yml format - #14666
Conversation
|
Thank you for contribution! Please add fixes to make "Docs" builder green. |
|
@alalek Docs build is green. Could you look at the patch. |
alalek
left a comment
There was a problem hiding this comment.
Thank you for contribution!
Please follow template of Python samples (wrap this code into "main()" function): https://github.com/opencv/opencv/wiki/Coding_Style_Guide#python-samples
As a documentation/samples improvement this patch should go into 3.4 branch first. We will merge changes from 3.4 into master regularly (weekly/bi-weekly).
So, please:
- change "base" branch of this PR: master => 3.4 (use "Edit" button near PR title)
- rebase your commits from master onto 3.4 branch. For example:
git rebase -i --onto upstream/3.4 upstream/master
(check list of your commits, save and quit (Esc + "wq" + Enter)
whereupstreamis configured by following this GitHub guide and fetched (git fetch upstream). - push rebased commits into source branch of your fork (with
--forceoption)
Note: no needs to re-open PR, apply changes "inplace".
| import sys | ||
|
|
||
| def help(filename): | ||
| print (filename, 'shows the usage of the OpenCV serialization functionality.', |
There was a problem hiding this comment.
Please use normal print from Python3 (+ from __future__ import print_function for Python 2.7).
Also it is better to use docstring.
|
Thanks for reviewing the pull request. I will work on all the changes by the end of this week. |
|
@ihsan314 Do you have any progress on the patch? |
3d60d06 to
f915a04
Compare
|
I didn't have that much time in the last two weeks, so here they are today. The docstrings will be added hopefully by tomorrow. |
|
@ihsan314 Please pay attention on CI status, it still reports some issues with the code. |
|
The CI status had only one failed build, and that failed build was on Mac. I fast-forwarded my branch and tried the failed build on my machine. It worked on mine, so I hope it will pass. I also changed the strings to a docstring in the |
|
@ihsan314 Please remove "WIP" from the PR description to trigger CI builds automatically. |
|
@alalek could you look at it again. |
|
|
||
| @add_toggle_python | ||
| You can [download this from here | ||
| ](https://github.com/opencv/opencv/tree/master/samples/python/tutorial_code/core/file_input_output/file_input_output.py) or find it in the |
There was a problem hiding this comment.
master
Please use "3.4" in URLs (as patch is targeted to 3.4 branch).
Python code examples for file IO in xml and yml format * Initial "Pythonization" of file_input_output.cpp * Moved file_input_output.py to correct location * Nearly done Pythonizing file_input_output.cpp * Python equivalent of file_input_output.py created * Started Pythonizing camera_calibration.cpp * Completed Python tutorial/sample code for file_input_output * Resolved whitespace issues * Removed tabs in file_input_output.cpp * Patched import order and wrapped code in main function * Changed string to docstring format in help file * Updated link to Python example code
resolves #14665
This pullrequest changes
the fact that Python tutorials do not exist for File Input Output with XML and YML.