QGB / QPSU

QGB's Python Simplified Utils
MIT License
4 stars 3 forks source link

PythonAnywhere #14

Open QGB opened 3 years ago

QGB commented 3 years ago
for k in _13:
    try:v=getattr(os,k)()
    except Exception as e:v=e
    print('%-22s'%k,v)
   ....:     
get_blocking           get_blocking() takes exactly 1 argument (0 given)
get_exec_path          ['/home/klk/.local/bin', '/home/klk/.local/bin', '/usr/local/bin', '/usr/local/sbin', '/usr/bin', 
                              '/usr/sbin', '/bin', '/sbin', '.']
get_inheritable        get_inheritable() takes exactly one argument (0 given)
get_terminal_size      os.terminal_size(columns=128, lines=39)
getcwd                 /home/klk
getcwdb                b'/home/klk'
getegid                60000
getenv                 getenv() missing 1 required positional argument: 'key'
getenvb                getenvb() missing 1 required positional argument: 'key'
geteuid                3771130
getgid                 60000
getgrouplist           getgrouplist() takes exactly 2 arguments (0 given)
getgroups              []
getloadavg             (0.98, 0.97, 0.8)
getlogin               [Errno 2] No such file or directory
getpgid                Required argument 'pid' (pos 1) not found
getpgrp                118
getpid                 118
getppid                1
getpriority            Required argument 'which' (pos 1) not found
getresgid              (60000, 60000, 60000)
getresuid              (3771130, 3771130, 3771130)
getsid                 getsid() takes exactly one argument (0 given)
getuid                 3771130
getxattr               Required argument 'path' (pos 1) not found
QGB commented 3 years ago
In [243]: okc=[]
     ...: for c in T.asciiPrint:
     ...:     cs=c*3
     ...:     r=N.get(url+cs)
     ...:     if r!=cs:
     ...:         print(ord(c),cs,r,)
     ...:     else:
     ...:         okc.append(c)
     ...:
32
35 ###
37 %%% SyntaxError('invalid syntax', ('<string>', 1, 16, 'r=N.geta(q)%23-%%%\n'))
47 /// /

In [244]: url[-7:]
Out[244]: '(q)%23-'

In [246]: U.len(T.asciiPrint,okc)
Out[246]: [95, 91]

               T.join(okc,'')
Out[252]: '!"$&\'()*+,-.0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~'

In [253]: N.get url+_
--------> N.get(url+_)
--------> N.get(url+_)
Out[253]: '!"$&\'()*+,-.0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~'

In [256]:  _252==_253
Out[256]: True
QGB commented 2 years ago

10.0.0.202


* Uses proxy env variable no_proxy == 'localhost,127.0.0.1,localaddress,.localdomain.com,/var/run/docker.sock'
*   Trying 127.0.0.1:5000...
* TCP_NODELAY set
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0* connect to 127.0.0.1 port 5000 failed: Connection refused
* Failed to connect to 127.0.0.1 port 5000: Connection refused

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
* Closing connection 0
curl: (7) Failed to connect to 127.0.0.1 port 5000: Connection refused

* Uses proxy env variable no_proxy == 'localhost,127.0.0.1,localaddress,.localdomain.com,/var/run/docker.sock'
*   Trying 127.0.0.1:8000...
* TCP_NODELAY set
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0* Connected to 127.0.0.1 (127.0.0.1) port 8000 (#0)
> GET / HTTP/1.1
> Host: 127.0.0.1:8000
> User-Agent: curl/7.68.0
> Accept: */*
> 
* Received HTTP/0.9 when not allowed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
* Closing connection 0
curl: (1) Received HTTP/0.9 when not allowed

* Uses proxy env variable no_proxy == 'localhost,127.0.0.1,localaddress,.localdomain.com,/var/run/docker.sock'
*   Trying 127.0.0.1:11300...
* TCP_NODELAY set
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0* Connected to 127.0.0.1 (127.0.0.1) port 11300 (#0)
> GET / HTTP/1.1
> Host: 127.0.0.1:11300
> User-Agent: curl/7.68.0
> Accept: */*
> 
* Received HTTP/0.9 when not allowed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
* Closing connection 0
curl: (1) Received HTTP/0.9 when not allowed

* Uses proxy env variable no_proxy == 'localhost,127.0.0.1,localaddress,.localdomain.com,/var/run/docker.sock'
*   Trying 127.0.0.1:36837...
* TCP_NODELAY set
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0* connect to 127.0.0.1 port 36837 failed: Connection refused
* Failed to connect to 127.0.0.1 port 36837: Connection refused

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
* Closing connection 0
curl: (7) Failed to connect to 127.0.0.1 port 36837: Connection refused

* Uses proxy env variable no_proxy == 'localhost,127.0.0.1,localaddress,.localdomain.com,/var/run/docker.sock'
*   Trying 127.0.0.1:40377...
* TCP_NODELAY set
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0* connect to 127.0.0.1 port 40377 failed: Connection refused
* Failed to connect to 127.0.0.1 port 40377: Connection refused

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
* Closing connection 0
curl: (7) Failed to connect to 127.0.0.1 port 40377: Connection refused

* Uses proxy env variable no_proxy == 'localhost,127.0.0.1,localaddress,.localdomain.com,/var/run/docker.sock'
*   Trying 127.0.0.1:42043...
* TCP_NODELAY set
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0* connect to 127.0.0.1 port 42043 failed: Connection refused
* Failed to connect to 127.0.0.1 port 42043: Connection refused

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
* Closing connection 0
curl: (7) Failed to connect to 127.0.0.1 port 42043: Connection refused
QGB commented 2 years ago
07:33 ~ $ ssh 10.0.0.202
The authenticity of host '10.0.0.202 (10.0.0.202)' can't be established.
ECDSA key fingerprint is SHA256:NCUV19Bhpuh9ladq7UJe1FWKmr1PIXGoywj/V3ZZSK0.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '10.0.0.202' (ECDSA) to the list of known hosts.
QGB commented 2 years ago

In [11]: sys.path
Out[11]: 
['/usr/local/bin',
 '/usr/local/lib/python39.zip',
 '/usr/local/lib/python3.9',
 '/usr/local/lib/python3.9/lib-dynload',
 '',
 '/usr/local/lib/python3.9/site-packages',
 '/usr/local/lib/python3.9/site-packages/IPython/extensions',
 '/home/q11/.ipython']
# 此时不能 import 刚刚pip install 的库

In [14]: exit

10:52 ~ $ 
10:52 ~ $ 
10:52 ~ $ ipython
Python 3.9.5 (default, May 27 2021, 19:45:35) 
Type 'copyright', 'credits' or 'license' for more information
IPython 7.21.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: import sys

In [2]: sys.path
Out[2]: 
['/usr/local/bin',
 '/usr/local/lib/python39.zip',
 '/usr/local/lib/python3.9',
 '/usr/local/lib/python3.9/lib-dynload',
 '',
 '/home/q11/.local/lib/python3.9/site-packages',
 '/usr/local/lib/python3.9/site-packages',
 '/usr/local/lib/python3.9/site-packages/IPython/extensions',
 '/home/q11/.ipython']

In [3]: import github  #重启ipython后 可以了