Message from Python discussions

December 2018

— `print(list(filter(None, my_list)))`

— 

Language:

py3


Source:
ok = []
my_list = [
['list'],
[],
['list too']
]
for i in my_list:
ok.append(list(filter(None, i)))
print(ok)

# how if in append ?


Result:
[['list'], [], ['list too']]

— .... why?

— Language:

python3


Source:
my_list = [
['list'],
[],
['list too']
]
print(list(filter(None,my_list)))


Result:
[['list'], ['list too']]

Message permanent page

— Language:

py3


Source:
ok = []
my_list = [
['list'],
[],
['list too']
]
for i in list(filter(None, my_list)):
ok.append({'o': i})
print(ok)


Result:
[{'o': ['list']}, {'o': ['list too']}]

Message permanent page

— Or this?

— How to print binary of 1024

— 

print(bin(1024))

— Hey all i have an exe file located in a remote server,
im connecting to that server using paramiko sshclient,
this exe is taking me to a new enviroment how can i do that with paramiko sshclient,
the session suposse to be open and i need to intractive send commands and get their output.

or maybe i shoud use for that sftpclient or maybe with subprocess?

Message permanent page

— Do what

— In other words i want to run exe with sshclient and go to where the exe 'taking me'

— Hi. Please, see the PythonRules before posting photos of screen next time.