Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ipython #4

Open
QGB opened this issue May 17, 2019 · 4 comments
Open

ipython #4

QGB opened this issue May 17, 2019 · 4 comments

Comments

@QGB
Copy link
Owner

QGB commented May 17, 2019

docker run -it -p 8888:8888 --privileged -v /root/docker/jupyter/minimal-notebook/x86_64-python-3.11.6/opt:/opt -v /root/docker/jupyter/minimal-notebook/x86_64-python-3.11.6/home/jovyan:/home/jovyan -v /mnt:/mnt docker.io/jupyter/minimal-notebook:x86_64-python-3.11.6

import sys;'qgb.U' in sys.modules or sys.path.append('/mnt/c/QGB/babun/cygwin/bin/');from qgb import *



python3 -m IPython --InteractiveShellApp.exec_lines=['"from qgb import *"']   



python3 -m IPython --InteractiveShellApp.exec_lines="['from qgb import *','N.rpcServer(locals=globals())']"


U.cdqp();U.git('pull origin master ')

{里的操作会在系统命令之前执行?,所以 U.r 无效 ?}

In [526]: !cd qgb;gplf;echo {U.r(U,T,N,F,py)} {U.r(es)} {U.pid};echo {U.r(U,T,N,F,py)} {U.r(es)} {U.pid}
#Error unindent does not match any outer indentation level (U.py, line 1940)
#Error unindent does not match any outer indentation level (U.py, line 1940)
++ git clean -f
++ git reset --hard
HEAD is now at fbb44e1 d
++ git pull origin master
remote: Enumerating objects: 5, done.
remote: Counting objects: 100% (5/5), done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 3 (delta 2), reused 0 (delta 0)
Unpacking objects: 100% (3/3), done.
From https://coding.net/u/QGB/p/QPSU/git

  • branch master -> FETCH_HEAD
    fbb44e1..e372892 master -> origin/master
    Updating fbb44e1..e372892
    Fast-forward
    U.py | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)
    ++ chmod 777 Clipboard.py Clipboard.pyc '!.cmd' es.py file F.py F.pyc __importCode.py init.py init.pyc ipy.py main.py mysql.py N pycache py.py py.pyc '!qpsu.bat' '!t.bat' tests T.py T.pyc up.bat U.py U.pyc Win
    None None 11487
    None None 11487

In [527]:

@QGB
Copy link
Owner Author

QGB commented Sep 19, 2019

flask 请求 调用 U.flat 导致无限循环后占满内存后 会自动出错退出线程

@QGB
Copy link
Owner Author

QGB commented Nov 16, 2019

from IPython.utils.process import system, getoutput,py3compat # python 3.5
from IPython.utils import py3compat # python 3.7
py3compat.DEFAULT_ENCODING='gb18030' # default utf-8

# fix ipy.getoutput(cmd) 乱码

@QGB
Copy link
Owner Author

QGB commented Dec 9, 2019

In [25]: U.r(U,T,N,F);vsc=U.vsc;v=U.ValueOfAttr();

In [26]: v.a
-------> v.a()
-------> v.a()
  File "C:\QGB\Anaconda3\Scripts\ipython-script.py", line 10, in <module>
    sys.exit(start_ipython())
  File "C:\QGB\Anaconda3\lib\site-packages\IPython\__init__.py", line 125, in start_ipython
    return launch_new_instance(argv=argv, **kwargs)
  File "C:\QGB\Anaconda3\lib\site-packages\traitlets\config\application.py", line 664, in launch_instance
    app.start()
  File "C:\QGB\Anaconda3\lib\site-packages\IPython\terminal\ipapp.py", line 356, in start
    self.shell.mainloop()
  File "C:\QGB\Anaconda3\lib\site-packages\IPython\terminal\interactiveshell.py", line 502, in mainloop
    self.interact()
  File "C:\QGB\Anaconda3\lib\site-packages\IPython\terminal\interactiveshell.py", line 493, in interact
    self.run_cell(code, store_history=True)
  File "C:\QGB\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py", line 2855, in run_cell
    raw_cell, store_history, silent, shell_futures)
  File "C:\QGB\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py", line 2881, in _run_cell
    return runner(coro)
  File "C:\QGB\Anaconda3\lib\site-packages\IPython\core\async_helpers.py", line 68, in _pseudo_sync_runner
    coro.send(None)
  File "C:\QGB\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py", line 3058, in run_cell_async
    interactivity=interactivity, compiler=compiler, result=result)
  File "C:\QGB\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py", line 3249, in run_ast_nodes
    if (await self.run_code(code, result,  async_=asy)):
  File "C:\QGB\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py", line 3326, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-26-9ff3589cf25c>", line 1, in <module>
    v.a()
  File "C:/QGB/babun/cygwin/bin\qgb\U.py", line 3445, in __call__
    return print_stack()

 def __call__(self, *args, **kwargs):
 	return print_stack()

@QGB
Copy link
Owner Author

QGB commented Feb 18, 2022

image
在此处 按Tab 补全 任意模块 (如U.uniq) 会导致ipython卡死,按ctrl+c 过几秒可恢复
或者一直等待,卡死自动恢复,但是补全始终不会出现(包括下方选择框)


In [240]: ipy.gstitle
Out[240]: '13412 ipy:7.9 py:3.74 at[2022-02-10__08.13.58__.682] C:/test/ipy/'

In [241]: import qgb.N.Backend.taobao;cds=U.sort(qgb.N.Backend.taobao.coudan(py.ist fps,0.39),c=1);                   
                                                                                               

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant