python -m venv myvenv
вы снова получаете ответ python, то это может быть связано с тем, что переменная среды PATH настроена неправильно или не была настроена вообще. py -m venv myvenv
myvenv\Scripts\activate
python manage.py runserver
console.log(`${1+1}`);
// Вывод в консоль: "2"
// Обратите внимание на обратные кавычки вокруг выражения 1+1
console.log(`${1}+${1}`);
// Вывод в консоль: "1+1"
// Здесь мы разбиваем выражение на две части и использовали шаблонную строку, чтобы конкатенировать их как текст
console.log(`${1}+${1}`.split(''));
// Вывод в консоль: ["1", "+", "1"]
// Мы использовали метод split, чтобы разбить строку на массив символов
function run(string) {
string = `${string}`;
return string.split('');
}
console.log(run(1+1)); // ["1", "+", "1"]
installWeather({ data: { name: 'Lviv' } })
import React, { useState, useEffect } from 'react';
function InstallWeather(props) {
const [weatherData, setWeatherData] = useState(null);
useEffect(() => {
fetch(`https://api.openweathermap.org/data/2.5/weather?q=${props.city}&units=metric&appid=YOUR_APP_ID`)
.then(response => response.json())
.then(data => setWeatherData(data))
.catch(error => console.log(error));
}, [props.city]);
if (!weatherData) {
return <div>Loading...</div>;
}
const { name, main, weather, wind } = weatherData;
const { temp, humidity, pressure } = main;
const { description, icon } = weather[0];
const imgUrl = `http://openweathermap.org/img/w/${icon}.png`;
const windSpeed = wind.speed;
const windDegree = wind.deg;
return (
<div className="wrapper">
<div className="container">
<h1 className="place" id="place">City: {name}</h1>
<p className="temp" id="temp">Temperature: {temp}°C</p>
<p className="pressure" id="pressure">Pressure: {pressure} hPa</p>
<p className="description" id="description">Description: {description}</p>
<p className="humidity" id="humidity">Humidity: {humidity}%</p>
<p className="speed" id="speed">Wind speed: {windSpeed} m/s</p>
<p className="degree" id="degree">Wind degree: {windDegree}°</p>
<img className="image" id="image" src={imgUrl} alt="Weather" title="Weather"/>
</div>
</div>
);
}
export default InstallWeather;
import React, { useState, useEffect } from 'react';
function InstallWeather(props) {
const [weatherData, setWeatherData] = useState(null);
useEffect(() => {
fetch(`https://api.openweathermap.org/data/2.5/weather?q=${props.city}&units=metric&appid=YOUR_APP_ID`)
.then(response => response.json())
.then(data => setWeatherData(data))
.catch(error => console.log(error));
}, [props.city]);
if (!weatherData) {
return <div>Loading...</div>;
}
const { name, main, weather, wind } = weatherData;
const { temp, humidity, pressure } = main;
const { description, icon } = weather[0];
const imgUrl = `http://openweathermap.org/img/w/${icon}.png`;
const windSpeed = wind.speed;
const windDegree = wind.degree;
return (
<div className="wrapper">
<div className="container">
<h1 className="place" id="place">City: {name}</h1>
<p className="temp" id="temp">Temperature: {temp}°C</p>
<p className="pressure" id="pressure">Pressure: {pressure} hPa</p>
<p className="description" id="description">Description: {description}</p>
<p className="humidity" id="humidity">Humidity: {humidity}%</p>
<p className="speed" id="speed">Wind speed: {windSpeed} m/s</p>
<p className="degree" id="degree">Wind degree: {windDegree}°</p>
<img className="image" id="image" src={imgUrl} alt="Weather" title="Weather"/>
</div>
</div>
);
}
export default InstallWeather;
import React, { useState, useEffect } from 'react';
function App() {
const [elements, setElements] = useState([]);
const data = { data: ['file1', 'file2', 'file3'] };
const newElements = [];
useEffect(() => {
for (let i = 0; i < data.data.length; i++) {
newElements.push(<Uploaded_file button_name={data.data[i]} key={i}></Uploaded_file>);
}
setElements(newElements);
}, []);
return (
<div>
{elements}
</div>
);
}
export default App;
let zSpacing = -1000;
let lastPos = zSpacing / 5;
let $frames = document.getElementsByClassName('frame');
let frames = Array.from($frames);
let zVals = [];
const lastFrame = $frames[$frames.length - 1];
const lastFrameHeight = lastFrame.offsetHeight;
const lastFrameTop = lastFrame.offsetTop;
// функция для установки начальных CSS-атрибутов
function setInitialStyles() {
frames.forEach(function(n, i) {
zVals.push((i * zSpacing) + zSpacing);
let transform = `translateZ(${zVals[i]}px)`;
let opacity = 0;
if (zVals[i] < Math.abs(zSpacing) / 1.8) {
opacity = 1;
}
frames[i].setAttribute('style', `transform: ${transform}; opacity: ${opacity};`);
});
}
// вызываем функцию установки начальных CSS-атрибутов
setInitialStyles();
window.onscroll = function() {
let top = document.documentElement.scrollTop;
let delta = lastPos - top;
lastPos = top;
frames.forEach(function(n, i) {
zVals[i] += delta * -5.5;
let transform = `translateZ(${zVals[i]}px)`;
let opacity = 0;
if (zVals[i] < Math.abs(zSpacing) / 1.8) {
opacity = 1;
}
frames[i].setAttribute('style', `transform: ${transform}; opacity: ${opacity};`);
});
if (top + window.innerHeight >= lastFrameTop + lastFrameHeight) {
window.scrollTo(0, lastFrameTop);
}
};
window.scrollTo(0, 1);
let soundbutton = document.querySelector('.soundbutton');
let audio = document.querySelector('.audio')
soundbutton.addEventListener('click', e => {
soundbutton.classList.toggle('paused')
audio.paused ? audio.play() : audio.pause()
});
window.onfocus = function() {
soundbutton.classList.contains('paused') ? audio.pause() : audio.play()
};
window.onblur = function() {
audio.pause()
};
https://github.com/blueimp/Gallery
https://github.com/neptunian/react-photo-gallery