Category : pycharm

I have a jar file, which runs as expected when passing certain command line arguments. eg: java -jar MyJar.jar -help provides me the information I need. Now we plan to migrate to a python environment. I take the jar and execute the following in PyCharm import subprocess subprocess.call([‘java’, ‘-jar’, ‘MyJar.jar’,’ -help’]) I get the following ..

Read more

I am using python 3.6. I installed Jupyterlab using pip command in my virtual environment but when I type "Jupyter Notebook" to open it, I get the error: **def _failing_new(*args: t.Any, kwargs: t.Any) -> t.NoReturn: AttributeError: module ‘typing’ has no attribute ‘NoReturn’ —- Currently installed libraries in my virtual environment are : —- argon2-cffi==20.1.0 async-generator==1.10 ..

Read more

This is my python code (using PyCharm): def read_file(inputfile): """input: file with a text Output: the text in the file without the special characters ‘n’ or ‘r’ in the text""" with open(inputfile, "r") as f: file_txt = f.read() file_txt = file_txt.replace("n", "") file_txt = file_txt.replace("r", "") return file_txt print(read_file(r"C:(path)file.txt")) This code works fine on any ..

Read more

This seems like a problem a lot of folks have. I completely changed my index.html page. Then saved changes, stopped and re-ran server.py which has the following code: from flask import Flask, render_template app = Flask(__name__) @app.route(‘/’) def home(): return render_template(‘index.html’) if __name__ == "__main__": app.run(debug=True) I have saved changes, stopped and re-run flask from ..

Read more

I was wondering if it was possible to have smart typed return which pycharm can understand for autocompletion and quick documentation like this: def get_all(self, type_item): u""" :param type type_item: :return: return items of type type_item :rtype: list[type_item] """ return self._container[type_item].values() which doesn’t work since it consider that the return type is just of type ..

Read more

Traceback (most recent call last): File "C:/Users/Rahul waskel/AppData/Local/Temp/Rar$DRa10284.17127/checkbox_detection/checkbox_detect.py", line 167, in <module> json.dump(all_box,f) File "C:UsersAppDataLocalProgramsPythonPython38libjson__init__.py", line 179, in dump for chunk in iterable: File "C:UsersAppDataLocalProgramsPythonPython38libjsonencoder.py", line 431, in _iterencode yield from _iterencode_dict(o, _current_indent_level) File "C:UsersAppDataLocalProgramsPythonPython38libjsonencoder.py", line 405, in _iterencode_dict yield from chunks File "C:UsersAppDataLocalProgramsPythonPython38libjsonencoder.py", line 325, in _iterencode_list yield from chunks File "C:UsersAppDataLocalProgramsPythonPython38libjsonencoder.py", line 325, ..

Read more