using System.Text.Json;
var text = Console.ReadLine();
var jsonDocument = JsonDocument.Parse(text);
var elements = from obj in jsonDocument.RootElement.EnumerateArray()
let mark = obj.GetProperty("markName").GetString()
let serie = obj.GetProperty("serieName").GetString()
let name = $"{mark} {serie}"
select name;
var result = string.Join(", ", elements);
Console.WriteLine(result);
Get-Process | Where-Object {$_.ProcessName -eq '1cv8'}
(Get-Process -PID $PID).SessionId
Get-Process | Where-Object {$_.ProcessName -eq '1cv8'} | select si,sessionid
$si = (Get-Process -PID $PID).SessionId; Get-Process | Where-Object {($_.SI -eq $si) -and ($_.ProcessName -eq '1cv8')}
const fragment = document.createDocumentFragment();
const app = createApp(MyComponent).mount(fragment);
console.log(app.count);
console.log(app.$data.count);
class StoppableThread(threading.Thread):
"""Thread class with a stop() method. The thread itself has to check
regularly for the stopped() condition."""
def __init__(self, *args, **kwargs):
super(StoppableThread, self).__init__(*args, **kwargs)
self._stop_event = threading.Event()
def stop(self):
self._stop_event.set()
def stopped(self):
return self._stop_event.is_set()
Не понимаю как использовать синтаксис в нем.
from flask import render_template
from flask import Flask
app = Flask(__name__)
@app.route('/')
def index():
name = 'Бендер Сгибальщик Родригес'
return render_template('index.html',name=name)
app.run(host='0.0.0.0', port=5000,debug=True)
<html>
<head>
<title>Футурама</title>
</head>
<body>
<h2>Привет, {{name}}!</h2>
</body>
</html>
from subprocess import Popen, PIPE
def get_ping():
args = ["ping", "-n", "4", "www.ya.ru"] # -n требуются права Администратора
process = Popen(args, stdout=PIPE)
"""
# Построчное чтение данных
for line in process.stdout:
print("stdout:", line.decode('cp866'))
"""
data, error = process.communicate() # Распаковка кортежа
print(error)
return data.decode(encoding='cp866') # cp866 для Windows
def main():
print(get_ping())
input()
if __name__ == '__main__':
main()