https://ftp.postgresql.org/pub/odbc/versions/msi/psqlodbc_13_01_0000-x64.zip
Загрузка драйвера ODBC PostgreSQL для Windows
Добавить комментарий
https://ftp.postgresql.org/pub/odbc/versions/msi/psqlodbc_13_01_0000-x64.zip
import pyodbc
conn_str = (
"DRIVER={PostgreSQL Unicode};"
"DATABASE=postgres;"
"UID=postgres;"
"PWD=whatever;"
"SERVER=localhost;"
"PORT=5432;"
)
conn = pyodbc.connect(conn_str)
crsr = conn.execute("SELECT 123 AS n")
row = crsr.fetchone()
print(row)
crsr.close()
conn.close()
>>> help(ord)
Help on built-in function ord in module builtins:
ord(c, /)
Return the Unicode code point for a one-character string.
>>> ord('2')
50
>>> ord('п')
1087
>>> chr(50)
'2'
>>> chr(1087)
'п'
>>>
import pygame
from pygame.locals import *
pygame.init()
screen = pygame.display.set_mode((640, 480))
clock = pygame.time.Clock()
def main():
while True:
for event in pygame.event.get():
if event.type == QUIT:
pygame.quit()
return
elif event.type == MOUSEWHEEL:
print(event)
print(event.x, event.y)
print(event.flipped)
print(event.which)
clock.tick(60)
main()
Python .NET
PS C:\Users\user> C:\Users\user\AppData\Local\Programs\Python\Python38\python.exe -m pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org pythonnet
Collecting pythonnet
Downloading pythonnet-2.5.2-cp38-cp38-win_amd64.whl (81 kB)
|████████████████████████████████| 81 kB 39 kB/s
Requirement already satisfied: pycparser in c:\users\user\appdata\local\programs\python\python38\lib\site-packages (from pythonnet) (2.20)
Installing collected packages: pythonnet
Successfully installed pythonnet-2.5.2
PS C:\Users\user> C:\Users\user\AppData\Local\Programs\Python\Python38\python.exe
Python 3.8.7 (tags/v3.8.7:6503f05, Dec 21 2020, 17:59:51) [MSC v.1928 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import clr
>>> from System import String
>>> from System import Math
>>> Math.Round(1.2346, 3)
1.235
>>>
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Module docstring
"""
import ...
Ещё варианты обсуждают здесь https://stackoverflow.com/questions/1523427/what-is-the-common-header-format-of-python-files
dir > a.txt 2>&1
Синтаксис 2>&1 перенаправит 2 (stderr) в 1 (stdout).
Код файла с программой:
using System;
class test {
static void Main(){
Console.Write("Enter Path:");
var path = Console.ReadLine();
var file = new System.IO.StreamWriter(path, true);
var OutText = "test some text";
file.WriteLine(OutText);
file.Close();
}
}
Компиляция:
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\csc.exe .\1.cs
В результате в текущей папке сформируется экзешник
sudo mount -t drvfs '\\server\dir' /mnt/serverdir
/mnt/c/Windows/notepad.exe c:\test.xml
/mnt/c/Windows/explorer.exe .