python

Pycharm in AMD or INTEL !

Pycharm in AMD or INTEL !

شاید دارم اشتباه میکنم و یا شاید هم توهم زده باشم

ولی وقتی pycharm رو روی
پلتفرم های intelی اجرا میکنم  بدون مشکل اجرا میشن ، ولی وقتی نوبت به surface میرسه که دارای AMD CPU هست کمی
قاطی پاتی میشه و ارور زیر رو میده

"C:\Program Files\JetBrains\PyCharm 2019.2\bin\runnerw64.exe" C:\Users\1234\handycamy\Scripts\python.exe "C:\Program Files\JetBrains\PyCharm 2019.2\plugins\python\helpers\pydev\pydevd.py" --multiproc --qt-support=auto --client 127.0.0.1 --port 55061 --file D:/projects/handycamy/manage.py runserver 8000
Using Cython speedups
Unable to load jupyter_debug plugin
Executing file D:/projects/handycamy/manage.py
arguments: ['D:/projects/handycamy/manage.py', 'runserver', '8000']
PYDEVD_FILTER_LIBRARIES False

Started in multiproc mode

('Connecting to ', '127.0.0.1', ':', '55061')
('Connected.',)
debugger: received >>99	-1	55062
<<
Received command: ??? 99	-1	55062

Received port 55062

pydev debugger: process 10916 is connecting

('Connecting to ', '127.0.0.1', ':', '55062')
('Connected.',)
debugger: received >>501	1	0.1	WIN
<<
Received command: CMD_VERSION 501	1	0.1	WIN

sending cmd -->          CMD_VERSION @@BUILD_NUMBER@@
Connected to pydev debugger (build 193.6911.25)
debugger: received >>111	3	python-line	d:/projects/handycamy/cdn_app/views/getpostapiview.py	179	get	THREAD	None	None
<<
Received command: CMD_SET_BREAK 111	3	python-line	d:/projects/handycamy/cdn_app/views/getpostapiview.py	179	get	THREAD	None	None

Added breakpoint:d:\projects\handycamy\cdn_app\views\getpostapiview.py - line:179 - func_name:b'get'

debugger: received >>146	9	SHOW_RETURN_VALUES	0
122	7	python-BaseException	None	None	0	1	0
101	5	
<<
Received command: CMD_SHOW_RETURN_VALUES 146	9	SHOW_RETURN_VALUES	0

Show return values: False

Received command: CMD_ADD_EXCEPTION_BREAK 122	7	python-BaseException	None	None	0	1	0

Exceptions to hook on terminate: {'BaseException': <_pydevd_bundle.pydevd_breakpoints.ExceptionBreakpoint object at 0x000001C13728D908>}

Received command: CMD_RUN 101	5	

sending cmd -->    CMD_THREAD_CREATE <xml><thread name="MainThread" id="pid_10916_id_1929327341752" /></xml>
sending cmd -->  CMD_PROCESS_CREATED <process/>
Patching args: ['C:\\Users\\1234\\handycamy\\Scripts\\python.exe', 'D:/projects/handycamy/manage.py', 'runserver', '8000']
New args: C:\Users\1234\handycamy\Scripts\python.exe "C:\Program Files\JetBrains\PyCharm 2019.2\plugins\python\helpers\pydev\pydevd.py" --port 55061 --client 127.0.0.1 --DEBUG_RECORD_SOCKET_READS --multiproc --file D:/projects/handycamy/manage.py runserver 8000
Using Cython speedups
Unable to load jupyter_debug plugin
Executing file D:/projects/handycamy/manage.py
arguments: ['D:/projects/handycamy/manage.py', 'runserver', '8000']
PYDEVD_FILTER_LIBRARIES False

Started in multiproc mode

('Connecting to ', '127.0.0.1', ':', '55061')
('Connected.',)
debugger: received >>99	-1	55077
<<
Received command: ??? 99	-1	55077

Received port 55077

pydev debugger: process 6324 is connecting

('Connecting to ', '127.0.0.1', ':', '55077')
('Connected.',)
debugger: received >>501	1	0.1	WIN
<<
Received command: CMD_VERSION 501	1	0.1	WIN

sending cmd -->          CMD_VERSION @@BUILD_NUMBER@@
debugger: received >>111	3	python-line	d:/projects/handycamy/cdn_app/views/getpostapiview.py	179	get	THREAD	None	None
<<
Received command: CMD_SET_BREAK 111	3	python-line	d:/projects/handycamy/cdn_app/views/getpostapiview.py	179	get	THREAD	None	None

debugger: received >>111	11	python-line	d:/projects/handycamy/cdn_app/views/getpostapiview.py	179	get	THREAD	None	None
<<
Received command: CMD_SET_BREAK 111	11	python-line	d:/projects/handycamy/cdn_app/views/getpostapiview.py	179	get	THREAD	None	None

Added breakpoint:d:\projects\handycamy\cdn_app\views\getpostapiview.py - line:179 - func_name:b'get'
Added breakpoint:d:\projects\handycamy\cdn_app\views\getpostapiview.py - line:179 - func_name:b'get'


debugger: received >>101	7	
122	5	python-BaseException	None	None	0	1	0
146	9	SHOW_RETURN_VALUES	0
<<
Received command: CMD_RUN 101	7	

Received command: CMD_ADD_EXCEPTION_BREAK 122	5	python-BaseException	None	None	0	1	0

Exceptions to hook on terminate: {'BaseException': <_pydevd_bundle.pydevd_breakpoints.ExceptionBreakpoint object at 0x0000014478D9D2E8>}

Received command: CMD_SHOW_RETURN_VALUES 146	9	SHOW_RETURN_VALUES	0

Show return values: False

debugger: received >>146	15	SHOW_RETURN_VALUES	0
122	13	python-BaseException	None	None	0	1	0
<<
Received command: CMD_SHOW_RETURN_VALUES 146	15	SHOW_RETURN_VALUES	0

Show return values: False

Received command: CMD_ADD_EXCEPTION_BREAK 122	13	python-BaseException	None	None	0	1	0

Exceptions to hook on terminate: {'BaseException': <_pydevd_bundle.pydevd_breakpoints.ExceptionBreakpoint object at 0x000001C13728DEF0>}

sending cmd -->    CMD_THREAD_CREATE <xml><thread name="MainThread" id="pid_6324_id_1393558802728" /></xml>
Watching for file changes with StatReloader
sending cmd -->    CMD_THREAD_CREATE <xml><thread name="django-main-thread" id="pid_6324_id_1393633849584" /></xml>
sending cmd -->    CMD_THREAD_CREATE <xml><thread name="Dummy-6" id="pid_6324_id_1393633849976" /></xml>

Process finished with exit code -1

بعد از سرچ های مفصل رسیدم به تنظیمات زیر

و توضیح اینکه خودتون سرچ کنید ببینید اینها یعنی چی

حوصله ی توضیح دادنشون رو ندارم

Posted by محمد رضا بهمنی in کد زنی, 0 comments
تبدیل صفحه angularjs به pdf

تبدیل صفحه angularjs به pdf

چند روز وقت گذاشتم برای تبدیل صفحه angularjs به pdf و نتایج زیر رو گرفتم

  • weasyprint به خوبی تبدیل به pdf میکنه در پایتون ولی بطور کل جاوا اسکریپت رو نادیده میگیره
  • weasyprint نسبت به authentication در وب امکاناتی نداره
  • html2pdf برای پایتون ۳.۶ طراحی نشده
  • xhtml2pdf به خوبی در نمیاره صفحه رو
  • و ….
  • آخر مجبور شدم صفحه ای میخواستم تبدیل به pdf یا png کنم رو در قالب iframe با مدیریت دسترسی در اختیار کاربر قرار بدم تا سر وقت مناسبت بیشتر روی این حوزه کار کنم
  • ولی آخرش phantomJS خیلی خوب و خفن بود که امکان attach کوکی هم داشت و کمی جواب میداد ولی مشکلی که داشت این بود صبر نمیکرد تا تمامی کلاس های انگولار اینجکت بشه

این هم به همین خاطر جواب نداد

Posted by محمد رضا بهمنی in کد زنی, 0 comments