MCPcopy Index your code
hub / github.com/ronreiter/interactive-tutorials / create_submission

Method create_submission

ideone/__init__.py:140–178  ·  view source on GitHub ↗

Create a submission and upload it to Ideone. Keyword Arguments ----------------- * source_code: a string of the programs source code * language_name: the human readable language string (e.g. 'python') * language_id: the ID of the programming languag

(self, source_code, language_name=None, language_id=None,
                          std_input="", run=True, private=False)

Source from the content-addressed store, hash-verified

138
139
140 def create_submission(self, source_code, language_name=None, language_id=None,
141 std_input="", run=True, private=False):
142 """
143 Create a submission and upload it to Ideone.
144
145 Keyword Arguments
146 -----------------
147
148 * source_code: a string of the programs source code
149 * language_name: the human readable language string (e.g. 'python')
150 * language_id: the ID of the programming language
151 * std_input: the string to pass to the program on stdin
152 * run: a boolean flag to signifying if Ideone should compile and
153 run the program
154 * private: a boolean flag signifying the code is private
155
156 Returns
157 -------
158
159 A dictionary with the keys error and link. The link is the
160 unique id of the program. The URL of the submission is
161 http://ideone.com/LINK.
162
163 Examples
164 --------
165
166 >>> ideone_object = Ideone('username', 'password')
167 >>> ideone_object.create_submission('print(42)', language_name='python')
168 {'error': 'OK',
169 'link' : 'LsSbo'}
170
171 """
172 language_id = language_id or self._translate_language_name(language_name)
173 result = self.client.service.createSubmission(self.user, self.password,
174 source_code, language_id,
175 std_input, run, private)
176 result_dict = Ideone._transform_to_dict(result)
177 Ideone._handle_error(result_dict)
178 return result_dict
179
180 def submission_status(self, link):
181 """

Callers 1

run_codeFunction · 0.95

Calls 3

_transform_to_dictMethod · 0.80
_handle_errorMethod · 0.80

Tested by

no test coverage detected