#tools-and-devops

1 messages · Page 62 of 1

small echo
#

Good idea. I'll see if I can get some time to make a minimal project.toml to demonstrate the issue

tawny temple
#

Might have even been reported already 🤷

small echo
#

Where would poetry otherwise install deps if I tell it to not use a venv?

tawny temple
#

To the global site, I guess.

wooden ibex
#

Unless requirements file won’t work, I’d just pip install requirements file and call it a day.

pallid wing
#

can conda install more than pip or is it possible to represent everything conda installs in pip requirements file

tawny temple
#

Yes it can install more than pip. It's a totally separate repository. Not everything on a conda channel will be in PyPI too. While pip can install from custom package indexes, I believe conda repos and packages are a completely incompatible format anyway.

#

Also conda has package support for other languages (like R) bedside Python

visual ridge
#

Hi,I dont know why but github made 2 identical commits. How can I delete one of them?

night quest
visual ridge
night quest
visual ridge
#

Ohh got it. Thanks

night quest
#

Like git branch before-rebase

mortal panther
#

hey guys! Does anyone use GitHub Actions for automation?

night quest
mortal panther
# night quest I used some GitHub Actions to run tests

I am working on a CLI tool that helps you to clone, update and share your GitHub Actions workflows across all of your projects, or just with the community. Do you have a project with your GH Actions, or probably you know a project with good GH Actions?

I already have a pack of workflows for Python libraries and apps, but there is a lot to improve

night quest
mortal panther
#

I also have a pack for TypeScript/JavaScript Node.js apps

#

well, other languages would be awesome as well!

night quest
mortal panther
#

@night quest thank you! I support poetry and pipenv, but not tox, so definitely going to add it

mortal panther
#

@night quest what languages do test with GHActions ?

night quest
#

However I think that my actions are not very well 😂

mortal panther
#

@night quest never tried it TBH. how do you think, would it be easy to create a universal on_push action for Rust projects? I am not familiar if there are common ways to run unit/int tests and code coverage

night quest
#

I don't know how to deal with coverage however tests can be executed by cargo test command

mortal panther
#

this looks great! thank you a lot. I will research how people use it and try to organize it in a workflow

mortal panther
#

@night quest thank you again for Rust workflows. I added a link to this repo in order to clone workflows. As I see they use multiple jobs, just added support for it

heavy knot
#

Can someone help in python begginer Journey i am lost

night quest
rancid schoonerBOT
#
Resources

The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.

night quest
#

How about it?

untold turret
#

I'm trying to install extra packages in snekbox https://github.com/python-discord/snekbox which I'm running as a dependency through docker. Where should I run
docker exec snekbox /bin/sh -c 'PYTHONUSERBASE=/snekbox/user_base pip install numpy' as it says in the README?

heavy knot
#

@night quest i'll try this

#

Is here Any hacker?

tepid flax
#

better alternatives to kafka?

tepid flax
untold turret
#

Thanks

dire dirge
#

I wrote a python program that works well enough, but I haven't figured out how to deploy updates automatically when I commit changes to the github repo. Most of the CI/CD tutorials I have found focus on websites on servers reachable over the Internet. My script runs in a VM in a private network and I'd like to know what the industry standard (or best practice) is for this type of environment before I start trying to reinvent the wheel.

mossy dock
#

the said VM, can it access github?

#

you could set a cron so that it pulls the repo every one minute

#

another question is do you need to restart the service to apply the changes? then I would add another line to restart the service after pulling the repo

dire dirge
#

Thanks @mossy dock, that's surprisingly simple and should work.

dire dirge
untold turret
#

I need to change the configuration file inside a docker image. The docs say "a Docker volume or bind mounts can be used to override the configuration files at their default locations." How do we do that?

mossy dock
#

it means you can use a file from your host system to override the same file inside docker

untold turret
#

How do I do that without rebuilding the image? I'm using docker-compose to pull the image from GitHub Container Registry.

night quest
#

Like

services:
  service:
    volumes:
      - ./host/file:/inside/container/file
untold turret
#

Thanks it worked ^_^

thin crescent
#

shot in the dark, has any one had any experience with terraformed azure functions not creating function keys

pallid wing
#

For shell scripts I use #!/usr/bin/python but is there any way to change that to use current python in path

tawny temple
#

Yes, #!/usr/bin/env python

night quest
tawny temple
#

This works for any binary, not just python

tawny temple
#

But python3 is probably more cross compatible

night quest
tawny temple
#

I don't think most distros have symlinked python3 to python

pallid wing
heavy knot
#

My app will have a dynamically changed config that will affect the way its containerized services work. What would be the best way to keep the config up to date for all services?
I thought about keeping it in Redis or using some message broker, but I haven't really used them before

tawdry needle
#

Does your container runtime support something like that?

#

im sure e.g. kubernetes has some way to update env vars across the cluster, i wouldn't know how though

heavy knot
#

I'm planning to use minikube, yes. But those configs are gonna be too big to fit in env vars

night quest
heavy knot
#

And assign it to local container env vars through k8s?

#

I'm only learning it

night quest
#

I know nothing about k8s

#

I am using my custom loader to load config file and properly change application's state

heavy knot
#

Let me be more clear, it will be a discord bot with heavy customization written with microservice approach for the sake of learning and comparing different frameworks. So I have a basic interface bot service already, now I need to handle the bot settings with another service. For long-term storage I'll use mongo, but I'll have to make the settings service somehow distribute those settings among other services which I'll add next

night quest
wooden ibex
#

Whatever you want

#

obviously the database connection can't be stored in there but everything else can be

thorn mountain
#

Hello everyone. Curious to hear how folks starting to move their scripts into a CI/CD pipeline and what tools they used

night quest
thorn mountain
#

I have quite a few automation scripts for monitoring, alerting, etc managed through repos but getting them deployed is becoming a hassle as they all run through cron

#

well deployed and updated

night quest
#

Oh, okay

thorn mountain
#

I've had a few folks mention Jenkins but it seems like it may be a bit overkill

night quest
#

Makes checks on every commit

#

Automatically build packages on stable releases

#

However I don't know anything about deployment methods

thorn mountain
#

so you're using say pylint to validate syntax, best practice, etc. before deployment

night quest
#

Pylint, pytest and so on

thorn mountain
#

I think that's likely the route I may take, just curious as a lot of the Jenkins examples show more for appstack deployments

#

and not just self contained scripts

night quest
#

For personal usage I prefer GitHub Actions

#

It's simpler method builtin inside GitHub

thorn mountain
#

I have Gitlab at home for local but looking for more for enterprise

#

Thank you for the suggestions though!!

rich copper
#

Does anyone know how come I cannot delete my docker images as root?

#
Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.40/containers/json?all=1: dial unix /var/run/docker.sock: connect: permission denied```
#

Happens when I try to reactive etc. as well

tawdry needle
#

You also apparently need sudo for docker ps

mossy dock
#

you can add docker to your user group so you don't have to sudo every time

tawdry needle
#

sudo isn't a magic prefix in your shell, it's just a command that runs another command. Your shell tries to expand the stuff inside $() first, before it executes the sudo

#

That said, a shell that natively supports something like sudo but for the entire command line would be super useful

#

I don't know of any shell that does, including the "weird" ones like fish

crude lynx
#

i worked in jupyterlab and wanted some extensions, so i wrote !pip install jupyter_contrib_nbextensions !jupyter contrib nbextension install --user !jupyter nbextension enable collapsible_headings/main But executing markdown cells with headings were still not collapsibel?

slender rain
#

I think this channel make the most since.
I'm trying to use antlr4 to generate python code that I will use in my package.
How do I make a setup.cfg/setup.py for this?
setup.cfg

[metadata]
name = CarbonLang
version = 0.0.1
author = Johnathan Dunker, Reuben French
author_email = jadunker@protonmail.com
description = C++-like programming language compilier
long_description = file: README.md
long_description_content_type = text/markdown

[options]
packages_dir =
  = src
packages = find:
cmdclass =
  install = InstallCommand

[options.packages.find]
where = src

setup.py

from setuptools.command import build_py, install

class InstallCommand(install.install):
    def run(self):
        print("antlr4 lexer call")
        subprocess.check_call(["antlr4", "-visitor", "-Xexact-output-dir", "-package", "carbon", "-Dlanguage=Python3", "-o", "src/carbon/core", "antlr/carbonLexer.g4"])
        print("antlr4 parser call")
        subprocess.check_call(["antlr4", "-visitor", "-Xexact-output-dir", "-package", "carbon", "-Dlanguage=Python3", "-lib", "src/carbon/core", "-o", "src/carbon/core", "antlr/carbonParser.g4"])
        super().run()

pyproject.toml

[build-system]
requires = [
  "setuptools",
  "antlr4-python3-runtime"
]
build-backend = "setuptools.build_meta"
#

I'm getting an InstallationError from pip

astral stag
#

hello, was anybody trying to mount subpackage in docker ? it's for dev environemnt and I'm trying to solve it whole day. Running docker-compose for dev env and I need to include subpackage data to my project

  build: .
  command: python manage.py runserver 0.0.0.0:8000
  volumes:
      - ../some-package/mypackage:/srv/django_project/mypackage
      - .:/srv/django_project
  ports:
      - "8000:8000```
night quest
astral stag
#

I did it in vagrant with symlink 🙂 but in docker it's really hard.. and if it's working, then pycharm is not following it

night quest
nocturne raft
#

Does Jenkins support use of make files to run scripts? Or does it need any plugin?

#

Also, is there a way to know if a service has finished execution so that I can call compose down?

tawdry needle
#

if the docker entrypoint or cmd exits, the container shuts down by itself

#

docker-compose should be smart enough to recognize it as having exited cleanly

nocturne raft
#

@tawdry needle thanks. the service is a worker node so how can I shut down the manager automatically once all worker nodes have finished their process?

crude lynx
#

i want to try if a dockerfile is about to work properly, is it possible testing not locally with mybinder or sth else?

tight haven
#

is there an API available which can give me access to audio files of all songs ?,trying to build a web music player

tawny temple
#

Doubtful; music isn't free.

night quest
crude lynx
#

i wonder if it is possible to do it without having locally docker installed

#

so just upload a dockerfile and mybinder would build it

night quest
#

You can always install Docker on remote machine and call it via SSH

crude lynx
#

ok so eg i could launch mybinder jupyterlab and go to the terminal where i install docker, or which remote machine do you have in mind

night quest
#

Never used it

crude lynx
#

me too:D but thanks for the explanation, actually i have meanwhile installed now docker:D

frozen niche
#

does pycharm has discord rich presence?

iron basalt
#

there's a plugin for it

#

search for 'discord' in the plugin store

ocean current
#

Hi everyone. When you develop in your Django projects, how and when do you setup your database during development?

true grove
#

wdyt about https://github.com/pycontribs/mk ? Do you find it useful?

GitHub

mk ease contributing to any open source repository by exposing most common actions you can run. Inspired by make, tox and other cool tools! - pycontribs/mk

tawny temple
#

Maybe? I'm going to have to read project documentation anyway because there's more to contributing than just learning how to run tools, so I'm going to learn how to do this stuff in a project-specific way most of the time.

#

Sometimes it's not documented but with enough experience it's not hard to infer how to do it.

#

Might be handy if contributing to a large volume of different projects, but that's not me so I can't comment on that.

nocturne raft
#

Hi, I'm trying to run a container with a volume with relative path but it keeps telling me to use absolute path. is there a way to use relative paths as volume?

crude lynx
#

dont't know if that helps but you can define WORKDIR, if not already done

night quest
crude lynx
#

i also have a quest to docker: i did a dockerfile, build and run it, i gave 80 as port, but opening the browser it didn't show up, instead the tutorial of docker appears, any tip?

#

i did not have an error and it is claimed to run, but i have no access

mossy dock
#

a) existing docker tutorial container might be running, which is why it's occupying the port 80
b) your new docker container, when you run it did you map it to host port?

#

I would recommend you to use Dockerfile in addition to docker-compose

night quest
crude lynx
#

hi thx, a) i have deleted this so i really wonder b) i run docker run -dp 80:80 imagename

mossy dock
#

dockefile snippet please

night quest
mossy dock
#

prob the service exposes to another port

crude lynx
crude lynx
night quest
crude lynx
#

it is public

#

it runs and builds fine but is not accessable for me

mossy dock
#

this is the entire Dockerfile?

#

it doesn't listen to connection after the last command. so it promptly exits

crude lynx
#

yes, i have a requirements.txt next to it and thats all

mossy dock
#

if it's a jupyter notebook, you'll have to add CMD jupyter notebook something at the end of it

crude lynx
#

it is for juypter hub

#

and juypterlab

mossy dock
#

and jupyter notebook exposes to port 8888 by default, so you'll have to use 80:8888 port mapping

#

ok same 8888 port. but you'll have to add either CMD or ENTRYPOINT for the server to be running and listening for connections

crude lynx
#

ok so CMD jupyterlab

mossy dock
#

hmmm I recall there's a few extra steps

#

you'll have to use this jupyter lab --ip=0.0.0.0 --allow-root

#

the whole thing you're doing is under devops and deployment thing, a different skillset than python programming in general

#

so if you want to learn Docker, try to familiarize yourself with Unix and bash shell first

crude lynx
#

ok, so i have added CMD jupyter lab --ip=0.0.0.0 --allow-root in dockerfile and executued the run with port 80:8888 and without -d, but i get the same error [FATAL tini (7)] exec . failed: Permission denied.

mossy dock
#

it's likely from pip install step

#

maybe you need to run it as sudo

crude lynx
sly sleet
#

pip insta shouldn't require sudo though

#

wait doesn t cmd take an array

mossy dock
#

some base images require sudo tho

#

oops probably.

crude lynx
#

so i need to replace pip install with sudo pip install

sly sleet
#

oh wait I think both work

crude lynx
#

ok so i dont replace anything

nocturne raft
#

@night quest docker run --network test -v ./tmp:./junit.xml --env-file file image-name pytest

crude lynx
#

just wanna thank you all before it will get lost, i may ask that in dev tho, but i got further now, so thanks:)

night quest
#

I am talking about -v ./tmp:./junit.xml part

nocturne raft
#

@night quest making the destination path absolute helped with the run but weirdly the file wasn't saved in the source

night quest
#

Save file from container inside host directory?

nocturne raft
#

@night quest Yes

#

right now we're using docker cp. but i thought using volumes would be an elegant solution.

agile lark
#

How can I get PyCharm Professional to both use the TODO ligature and highlight it? I'm using PragmataPro

#

Right now my TODO looks like this

#

and I want this instead, with the yellow highlighting and everything

#

Font will be provided at request, only the PragmataPro Mono Liga Regular because it's a paid font and uploading the whole set would be piracy

night quest
nocturne raft
#

@night quest that worked thanks

night quest
pallid schooner
#

Does anyone know how to get the commit from a released version of a pypi module? If I have a package thats on version x.y.z, can I get the last commit associated with that release from pypi?

night quest
pallid schooner
#

Well, I would check if tags exist on the package, but the package is mine and I don’t have any tags on it, it’s why I was trying to find the associated commit so I could add tags 😂. I just did the same thing with my open source rust library, but I was able to get the commit hash from crates.io in that case.. too bad it’s not possible here

sly sleet
#

pypi doesn't know anything about whatever your vcs setup is

#

does rust require using git or something?

tepid nymph
#

hello, I was directed here for my question about git

#

I created a new folder and did a git init, but not sure how to connect to my github account.. not able to do a git push

#

when I tried to git push my terminal said

$ git push
fatal: No configured push destination.
Either specify the URL from the command-line or configure a remote repository using

    git remote add <name> <url>

and then push using the remote name

    git push <name>

so I did that, and the command executed successfully, but git push still does not work.. still getting the same error.. thoughts?

mossy dock
#

you need to add your git remote

#

sth like git remote add $REMOTE

tepid nymph
#

yep, I did that. I can confirm that too because when I run the same command again, it says: fatal: remote $REMOTE already exists.

#

actually.. I did git remote add $REMOTE $URL

#

not sure why I've never ran into this issue before, not really sure what to think

mossy dock
#

Remote is not name of your repo

#

It'll be sth like git@username:repo name or sth

#

If you just github, there should be an instructions on how to add remote on a fresh repo

tepid nymph
#

oh, well that makes sense..

#

thank you

#

yeah I tried finding that github page but was unsuccessful. Will try again. thank you.

mossy dock
#

@tepid nymph so here's with a git remote looks like:

$ git remote -vv
origin git@github.com:${USERNAME}/${REPO_NAME}.git (fetch)
origin git@github.com:${USERNAME}/${REPO_NAME}.git (push)
#

${} being a placeholder

tepid nymph
#

interesting.. not what I was expecting.. need to go back and finally read the git basics I've been putting off.. thank you!

heavy knot
tepid nymph
#

oh, that page comes up when you create a new repo on github, thanks. I was wondering where I saw it..

#

I usually either do it from github itself or vscode, wanted to try to do it via cli this time..

#

thanks @heavy knot

#

my mistake was forgetting to append the repo name after $URL

heavy knot
#

np i dont remember it either and i think u have to make a new repo on the website github bc else it says the repo doesnt exist in the cli
but just try it out i guess mby it works for you and i just did it wrong in the past

tepid nymph
#

kk, gonna try now. let's see.

#

lol - this is so weird. Idk if it's just late and I should call it a night or what..

Me@Computer ~/OneDrive/Documents/code/DevelopedByEd (master)
$ git remote add origin https://github.com/amusabji/DevelopedByEd.git

Me@Computer ~/OneDrive/Documents/code/DevelopedByEd (master)
$ git status
On branch master
nothing to commit, working tree clean

Me@Computer ~/OneDrive/Documents/code/DevelopedByEd (master)
$ git push
fatal: The current branch master has no upstream branch.
To push the current branch and set the remote as upstream, use

    git push --set-upstream origin master


Me@Computer ~/OneDrive/Documents/code/DevelopedByEd (master)
$ git push --set-upstream origin master
remote: Repository not found.
fatal: repository 'https://github.com/amusabji/DevelopedByEd.git/' not found

Me@Computer ~/OneDrive/Documents/code/DevelopedByEd (master)
$ git remote -v
origin  https://github.com/amusabji/DevelopedByEd.git (fetch)
origin  https://github.com/amusabji/DevelopedByEd.git (push)

#

maybe I am using the arguments here incorrectly?
$ git push --set-upstream origin master

#

maybe I need to replace origin or master by DevelopedByEd ? idk..

mossy dock
#

oh this is normal. you need to tell your local branch where to push it

#

bc for a single repo you can have multiple remotes

#

in this case, just type git push --set-upstream origin master

#

do it the first time only

#

if you type git branch -vv it should now tell where the remote is pointed to

#

currently git branch -vv wouldn't point to any remote as of yet

#

you don't notice this in GUI tools bc they do this in the background

heavy knot
#

Yeah just type

git push -U origin master 

or what @mossy dock said
It does the same but -U is simpler and faster to write and is just the flag

tepid nymph
#

and I did that, I included it in my code snippet, but I am getting the error

#

thanks for the tip @heavy knot - did not know about this shortcut, pretty neat

heavy knot
#

Np and what error are you getting?

tepid nymph
#

saying the repository is not found.

#
$ git push -u origin master
remote: Repository not found.
fatal: repository 'https://github.com/amusabji/DevelopedByEd.git/' not found
#

I think what you mentioned early holds true

heavy knot
#

Yeah bc u didnt create it on the website likr github wants you too

tepid nymph
#

as much as I hate to believe it

#

yeah 😦

#

I couldve sworn I did it in the past..

#

idk

heavy knot
#

I created a .sh file were i did tricked github. Let me open that quckly and i tell you how

tepid nymph
#

hmm, interesting

heavy knot
#

I did an .sh file and made a function which i just call with the repo name and thats the code:

 function create(){
    cd 
    python create.py "$1"
    cd Desktop
    mv c:/Users/chorn/Desktop/"$1" c:/Users/chorn/Desktop/Github/
    cd Github/"$1"
    git init
    touch README.md
    git add .
    git commit -m "'$1'"
    hub create "$1"
    git push origin master
    code .
}

And heres the website where i found it
https://hub.github.com/hub-create.1.html

tepid nymph
#

oh thats neat. thanks for the share

heavy knot
#

np if you want i can send you the code for the pyton script and then you can just use that one command and the parameter to create your git repo

mossy dock
#

Github cli can do that now fyi

heavy knot
#

cool and thx for the post of it

tepid nymph
heavy knot
#

i made a main.py and a command.sh

# main.py

import sys
import os

dirName = "/Path_to_dest_folder/"

try:
    # Create target Directory
    os.mkdir(dirName+str(sys.argv[1]))
    print("Directory " , dirName ,  " Created ") 
except FileExistsError:
    print("Directory " , dirName ,  " already exists")

# command.sh

function create(){
    cd 
    python create.py "$1"
    cd Desktop
    mv c:/Users/chorn/Desktop/"$1" c:/Users/chorn/Desktop/Github/
    cd Github/"$1"
    git init
    touch README.md
    git add .
    git commit -m "'$1'"
    hub create "$1"
    git push origin master
    code .
}
#

what does hub create do?

#

set upstream?

heavy knot
#

thanks. did not know about it

cloud prawn
#

I have an aws lambda and python question. Is this the right channel for it?

#

I'm working with openpyxl in aws lambda, and I'm trying to format a column so it would show long ints as integer instead of string.

#

offline it works and converts the column to integer, but when I run it through aws lambda, it doesnt turn the column into a int.

#

This is how I turn each cell into integer:
ws is an openpyxl Wokrbook

ws["B" + current_row].number_format = "#"
inner pollen
#

There are two ways to know the flow of the program. One is to log things into console using logging module and other using pdb. Which one do you guys prefer?

tawny temple
#

It depends on how much detail is needed

#

I'd prefer to have both available

#

Logging for a broader overview (even with trace logging it can be considered relatively broad)

abstract gyro
abstract gyro
#

do I need to use pylint if i am already using black ?

#

and how to use pylint and black together ?

leaden tartan
abstract gyro
#

if i use both black and pylint, will there be conflict ? and how to resolve them ?

willow rover
#

hey can anyone help me how to host my bot coded in discord.py on azure?

white gazelle
#

ive been scouring for a way to render rsts in a convenient/pretty way in Django, preferably with Sphinx for its table of contents/navigation/layout, has no one ever thought to do this or am i overcomplicating it? the most relevant package i seem to have found, django-sphinxdoc, has an outdated dependency and arduous setup of elasticsearch etc

whole ridge
#

Is there a general consensus on which Github API wrapper Python library is better of the two very active ones, PyGithub and github3.py?
I've been using PyGithub and it's a pain that the classes aren't hashable, which isn't a huge issue but I figured I'd check if anyone has any opinions on the two.

indigo igloo
#

s3keyring does not work for me. It always show "s3keyring: command not found"

#

Have anyone used this PyPi module?

#

I'm currently running this command in Ubuntu 20.04 LTS and Python 3.8.5

whole ridge
#

@indigo igloo Is ~/.local/bin in your path?
Do file ~/.local/bin/s3keyring

willow rover
#

hey is anyone here using education host?
i need some help

tropic walrus
#

Does anyone have a suggestion on how to port output to VIM while the program is still running?
I build a file and want the user to have the option to edit anything live before continuing.

Not sure if there's a module or another type of wrapper

wet dune
#

is there a way to sort that?

#
raise Exception(f'FileError. Unsupported type {file[-3] + file[-2] + file[-1]}')
#

@full ledge can u help

full ledge
#

uhhh i know nothing about this lol

wet dune
#

xD

#
def connect(file):
    if not file.endswith('.txt'):
        raise Exception(f'FileError. Unsupported type {file[-3] + file[-2] + file[-1]}')
    elif file.endswith('.txt'):
        with open(f'{file}') as f:

connect('hi.py')
#

like if i have this

#

it will say

#
Exception: FileError. Unsupported type .py
#

how do i sort the {file[-3] + file[-2] + file[-1]}

night quest
wet dune
#

okay thanks

night quest
# wet dune okay thanks

However you should use file.rindex(".") to get valid extension name (for example .py has length 2 and .txt has length 3)

wet dune
#

yeah

sly sleet
#

coughs in pathlib

haughty veldt
#

can someone give me some help with this script ```
from plyer import notification
import time
import psutil

name = "Device User"
webAlert = "Beware of online browsing, unsecure websites may possess malicious content!"
emailAlert = "Beware of Phishing attacks. Do not open emails and do not click on links from unknown senders!"

def alertUser(title, message):
notification.notify(
title = title,
message = message,
app_icon = "C:\Users\Claud\Desktop\faculty.ico",
timeout = 10,
)

def recognisedProcessEmail():
for process in psutil.process_iter():
if process.name() == "Outlook.exe":
alertUser(name, emailAlert)

def recognisedProcessWeb():
for process in psutil.process_iter():
if process.name() == "chrome.exe":
alertUser(name, webAlert)
recognisedProcessEmail()

if name == 'main':
while True:
recognisedProcessWeb()
time.sleep(60)

#

i get an alert for having the web browser open but then loads of errors on console and nothing. im trying to get the script to run in a loop and detect when a browser or email application is open. detecting this through the process name.

heavy knot
#
I have weird question about CMD and ENTRYPOINTT directives in a Dockerfile.
at the moment I only have a CMD ["php-fpm", "-F"] directive. at this point I just want to add an entrypoint without changing the CMD directive to get the same functionality.

[docker-entrypoint.sh}
#!/bin/sh
exec "$@"
----

COPY docker-entrypoint.sh /docker-entrypoint.sh
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["php-fpm", "-F"]
does this do what I want?
snow sage
#

Ok, I think I just accidentally made my %USERNAME% folder a git repository

#

Any way I can remove this repo without deleting all my files?

heavy knot
#

rm -rf ./.git

snow sage
#

Nvm got it working

tawny temple
#

Why do you want to do this?

heavy knot
#

at this point I just want to add an entrypoint without changing the CMD. once I've done that 'correctly' I want to extend the entrypoint script

#

gount to bed now :)

#

gn

meager ore
#

How do i replace values from all the queries(table) at once in powerBI desktop?

heavy knot
oak mica
#

hello, can you please suggest a good tutorial about how to make a python bot for instagram?

novel slate
#

How do I make a repo on GitHub?

#

What's a README.md

#

I'm so confused

stone yacht
#

Do you know how to work with git?

novel slate
#

I just don't know how to create them

#

I created something but I think I messed up bad and now I'm not even able to delete it

stone yacht
#

Git is a version control system. It's usually used from the command line, but there are GUIs, and it's often integrated with IDEs. GitHub is a website not affiliated with the creators of Git; it allows you to host your Git repos online.

novel slate
#

hmm

#

basically like a source for your code

#

how do I create a git

#

or gist

#

whats it called

stone yacht
#

git init creates a new repo in whichever directory it's called in

novel slate
#

wait what

stone yacht
#

There are many git tutorials online, just look around - it's not tied to GitHub. The most basic stuff is git add . to add files and git commit to create a "commit", which is a "snapshot" of what your repo looked like at that time.

novel slate
#

this is my profile

#

how do i delete the readme thing

novel slate
#

okay github is too complex i quit

stone yacht
#

Hm, my profile doesn't look like that. I don't think I've seen that format before but it's probably yet another feature GitHub added recently

stone yacht
#

But first learn Git, then worry about GitHub

novel slate
#

but learning it is the problem

#

whats git

novel slate
#

hmm

#

okay

tulip hare
#

Any good IDEs for Python you recommend?

#

So far I've tried VS code and Atom, but don't love them

wooden ibex
#

PyCharm is only other one that most people use

tulip hare
#

Thanks!

crude lynx
#

spyder is fine too

thin crescent
#

Has anyone used poetry?

#

looking at swtiching my project from venvs to something

#

poetry looks nice

mossy dock
#

I use pyenv + pipenv

ripe junco
#

How can I build my docker image using files from other directories inside this tree? My Dockerfile is inside the docker_dev directory but I need to use files from the root and from config_db and from database_info.

I get this error while building the image error checking context: 'can't stat '/home/diogo/koerber_digital/koerber_pipeline_watchdog/docker_dev/tmp''.. tmp is a volume I mounted in docker-compose

tawny temple
#

You can cd to the root and then run docker build --file ./docker_dev/Dockerfile . too (notice . is the build context here)

#

Docker Compose has something similar for specifying the compose file docker-compose --file docker_dev/docker-compose.yml build if you run it in the root

#

I don't know what's wrong with the tmp directory. You'd have to show how you mounted it I suppose.

ripe junco
#

From what I've read, it had something to do with directory ownership of tmp, once I did sudo chown -R <username> docker_dev it worked

#

Now I've solved it by moving Dockerfile to the root, but I'm gonna try it out once again, with these commands and test it out

silent escarp
#
king = False
kingo = True
if king:
	 print("hi king")
if kingo:
	 print("hi kingo")
elif king and not(kingo):
	print("u r noob")
elif kingo and not(king):
	print("Pog") 

now the proplem is how do i make it print pog with changing the True or False

#

it sounds basic but something is wierd

abstract gyro
abstract gyro
#

but no! thats the tutorial for building a new actions

#

i am trying to make an workflow

rapid sparrow
#

hmm

abstract gyro
#

good thing, is that, docker is pre installed in gh ubuntu environment

rapid sparrow
#

actually... why not repeating all necessary steps into workflow

#

that make docker build

#

all we need...

abstract gyro
#
name: Docker build and test

on:
  workflow_dispatch

jobs:
  build:
   runs-on: ubuntu-latest
  
   steps:
     - uses: actions/checkout@v2
     - name: Build Docker image 
       run: docker build -t samplepy .

abstract gyro
rapid sparrow
#

installing docker inside the workflow
and building our container

#

literally two lines to add in theory

sleek token
#

Hello, i want to use the same mongo db for many projects, im running monogo in a container, is it a good practice to do so ??( i want to do that so i can avoid data redundancy)

night quest
sleek token
night quest
sleek token
night quest
sleek token
#

yep thats what i tend to do the only thing that im not sure if that is a good practice tho

night quest
bright ore
rapid sparrow
#

with git add -p filename we can select what we stage

#

how to stage one specific line from hunk?

rapid sparrow
#

I found a simple guide how to deploy django into kubernet

apiVersion: apps/v1beta2
kind: Deployment
metadata:
  name: django
  labels:
    app: django
spec:
  replicas: 2
  selector:
    matchLabels:
      pod: django-container
  template:
    metadata:
      labels:
        pod: django-container
    spec:
      containers:
        - name: django-web
          image: localhost:32000/apapacy/tut-django:1.0.0
          ports:
            - containerPort: 8000

to have two replicas behind.. service with next conf

kind: Service
apiVersion: v1
metadata:
  name: django-service
spec:
  selector:
    pod: django-container
  ports:
  - protocol: TCP
    port: 8000
    # targetPort: 8001
  type: ClusterIP
  # type: NodePort```
#

my question, what is exactly it bringing to make it better

#

does it make randomization, to which pod to send users?

#

what's exactly point to make replicas?

#

or actually this scheme only allows quickly to launch same docker containers at few different ports

#

but to randomize which one to use, should be done by something else, which is not done yet

burnt thunder
#

the advantage of replicas is that you can run the same application on multiple nodes at once, meaning you don't need a single machine capable of handling all the traffic your website gets

#

you generally have a load balancer or an ingress which directs the traffic smartly across the pods

rapid sparrow
#

so... kubernet can be used, to replicate my docker container to multiple machines

#

with minimum efforts?

burnt thunder
#

yeah

rapid sparrow
#

that's EXACTLY what I need

#

(without distributed traffic though)

#

actually

#

I need those docker containers running with different environment variables

#

can be each node with different environment variables, right?

burnt thunder
#

maybe, I don't know enough about kubernetes to answer that

rapid sparrow
#

omg, found really good tutorial how to put my django into kubernetes
with parts how to add into kubernetes, postgresql as pod
then redis and celery
then... no idea what it is
then monitoring and logging as addition
aww, it looks like more for one evening to handle

sage zealot
#

hey

#

help me

#

@rapid sparrow

rapid sparrow
#

if only I could help myself

rapid sparrow
sage zealot
whole ridge
#

No problem!

bleak oar
#

if I'm looknig to deploy, is it useful to learn nginx or should I just hop straight into learning AWS?

finite fulcrum
#

I began experiencing issues with pycharm's Find in Files dialog since the last update I believe, any idea what it could be? For example I can find occurrences normally through the in file search but a project/directory wide search missed it

foggy reef
#

is there a way to add a repo as a subtree but only a shallow clone of it? e.g. --depth=1

#

cant find anything about this in the git subtree docs

tribal sapphire
#

Hello! I hope I'm asking this in the appropriate channel!
I have already checked online and I guess it may have been asked many times here but for a super basic program, what do you recomend(pros cons of each), pyinstaller or py2exe to convert the program into an exe?

I have gone for PyInstaller at the end!

heavy knot
#

hi

wheat field
#

Hello, can someone help me with a small script?
Please DM me (if possible in german)
Thanks

soft axle
#

I'm having trouble with figuring out a deploy system with my Discord bot.

#

My concept is that the finished product is a modular "framework" for making your own customisable bot

#

You download and run a program, and it generates a couple config files and stuff.

#

You set up the config with your required settings, and you move a few "extension" files into a directory to add functionality to the bot.

#

Then, once it's done, you can run it again and it'll start the Discord bot.

#

However, I feel like I may have bitten off more than I can chew here - this is my first "proper" open-source project, and I'm encountering lots of issues.

#

The biggest issue is I have no idea how to do build/execution/deployment - I'm clueless with everything starting from version tags and good usage of Git(Hub) and ending with Docker containers, compilation, and cross-platform support.

#

Does anyone have any advice? Thanks in advance.

#

||(Please do @mention me if you have anything to say!)||

wooden ibex
#

Like they run your app, get the config files then it loads everything into container

soft axle
#

Ok, so Docker's the way to go, thank you.

next scroll
#

!ban 615243826579243064 Came in to just spam crash videos

rancid schoonerBOT
#

:incoming_envelope: :ok_hand: applied ban to @broken dust permanently.

wooden ibex
#

and almost anyone can run it, Docker Desktop is now available for Windows 10 Home because WSL so just about everyone can run containers

soft axle
wooden ibex
wooden ibex
#

it's pretty hard to hand Python Code to others and be like run this. They may not have right version, they may not understand pip

soft axle
#

Could I bundle Python together somehow, maybe using a venv?

#

Or is that a stupid idea?

hoary atlas
#

Is there a way to cut down on repetition in an action like the below? One where you still want parallel/independent jobs to run.

name: main

on:
  workflow_dispatch:
  push:
    branches: [main]
  pull_request:
    branches: [main]

jobs:

  pylint:
    runs-on: ubuntu-20.04
    steps:
      - uses: actions/checkout@v2.3.4
      - uses: actions/setup-python@v2.2.2
        with:
          python-version: 3.9
      - run: |
          pip install -U pip setuptools wheel
          pip install . pylint~=2.7
      - run: pylint --rcfile ./.config/lint.ini ./src/wikiman/

  flake8:
    # ... REPETITION OF THE SETUP IN EVERY JOB ... #
          pip install . flake8~=3.9 flake8-bugbear~=21.4 pep8-naming~=0.11
      - run: flake8 --config .config/lint.ini

# ... OTHER LINTERS WITH A LOT OF REPETITION HERE ... #

  pytest-cov:
    runs-on: ubuntu-20.04
    steps:
      - uses: actions/checkout@v2.3.4
      - uses: actions/setup-python@v2.2.2
        with:
          python-version: 3.9
      - run: |
          pip install -U pip setuptools wheel
          pip install . pytest~=6.2 pytest-cov~=2.11
      - run: pytest --cov
      - uses: codecov/codecov-action@v1.4.1
soft axle
#

Ok, thank you.

hoary atlas
#

@soft axle I'm not practiced in Conda, myself, though. So you may need to look into more sources to confirm my advice.

#

But the idea is that you have Conda running on a certain version of Python, as its "engine", and yet Conda can supply/bundle different versions of Python as needed in an "environment", distinct from the "engine". This is all very hand-wavey, I understand.

tawny temple
#

Unfortunately, GH Actions doesn't have anything more powerful to reduce redundancy (like Azure Pipelines does with templates).

#

Maybe you can use a matrix, but it's quite limited.

hoary atlas
#

Thanks for the advice @tawny temple. I figured there wasn't a magical solution, based on my Googling. I may just do shell scripts to reduce redundancy.

I have a minor concern that a shell script could be modified in a malicious pull request, which might be less obvious at a glance than a pull request that modifies a GitHub Workflow. But I guess that anytime you have GitHub Actions at all, you must be diligent with your environment secrets, and vigilant of malicious pull requests.

I see that Sebastiaan has implemented very sophisticated GitHub Actions on Sir Lancebot, I may try to learn from them. The caching and artifact generation for line highlights is particularly interesting!

https://github.com/python-discord/sir-lancebot/blob/main/.github/workflows/lint.yaml

tawny temple
#

Actually that isn't relevant, since by default pull_request restricts access

#

I thought pull_request_target had something to do with running the jobs in a different context but I think it only applies to the GH token

hoary atlas
#

I went down the rabbit hole after the Codecov "breach" this week.

The company had a publicly hosted bash script being called by all of their CI/CD workflows. Someone got ahold of a credential and inserted an innocuous curl command into that script. It took a diligent dev (outside the company) checking the hash to find the vulnerability two months later!

Anyone who used the Codecov GitHub Action from January through March had their workflow environment exported to the malicious domain.

These "supply chain" attacks fascinate me. I doubt that anyone will target a random hobby repo of mine, but I'm trying to establish best practices in my GitHub Actions.

Maybe if I point my workflows at bash scripts, I will verify the SHA256 checksum of the script before running it.

https://www.reddit.com/r/programming/comments/mrgnub/codecovs_bash_uploader_for_coverage_reports

forest frigate
#

hello, im new in python, and i want to compile a py script in exe with py installer, in my program, i have a lot of lib, and recently the size of the .exe was increased by 30 mo. I think i add a big lib, but i don't know which one it is. There is a tools to check the size of imports of a python program ?

hoary atlas
#

@forest frigate There may be a library that helps you do it, but you could just check your site-packages directory in your Python environment with a disk size analyzer like ncdu.

forest frigate
elder beacon
#

hey guys does anyone knows how cipher = AES.new(key, AES.MODE_EAX)

#

cruipdome

#

cryptodome

night quest
elder beacon
#

it's Cryptography

#

okey

#

thx

graceful moat
#

hey guys, I installed docker desktop to learn and use but ever since, my python environments have been messed up. Do you know why?

#

I try to run simple Python script and it says it cannot fnd the file in directory

#

ok nvm gotit

sand thistle
#

having issues connecting to my managed db on digital ocean

#

all the params are correct

#

it was working fine last week, i didnt change anything i believe

#

cant run my program locally because i get an internal server error

silent sedge
#

I noticed that some tools I use log in this format, which I cannot identify but somehow Google Cloud parses it just fine:

I0422 15:24:39.761239 8 event.go:282] Event(v1.ObjectReference{Kind:"Ingress", Namespace:"auctus", Name:"ingress-grafana", UID:"ec5a0fcb-e95b-42b5-9f10-01e88c625b48", APIVersion:"networking.k8s.io/v1beta1", ResourceVersion:"8193895", FieldPath:""}): type: 'Normal' reason: 'Sync' Scheduled for sync

Does it seem familiar to anybody? I assume the first I is for info, the ] is a little odd, no idea what 0422 is for

#

another line: W0422 14:44:33.067272 8 controller.go:977] Service "auctus/apiserver" does not have any active Endpoint.

the part before ] gets recognized as "source" and here you can see W for warning... still no idea what the 0422 means

rugged flame
#

Is anyone else unable to run mypyc on MacOS? When I try I get a bunch of errors like this: /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/stdio.h:386:41: error: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Werror,-Wnullability-completeness] int (* _Nullable)(void *, const char *, int), All of them complain about a missing nullability type specifier (not 100% sure what that is 😅) in either stdio.h or stdlib.h. I think it needs the -Wno-nullability-completeness C flag, but I couldn't see a way to pass this in.

pallid wing
#

Not expert in this field but I feel you need signed instead. Unless your shell script is assumed to be static or you can verify checksum in secure way.

#

If someone's credentials get hacked, it's pretty problematic though.

hoary atlas
# pallid wing How do you verify SHA checksums though?

In the case of Codecov, their script was hosted at https://codecov.io/bash (putting it in code ticks so as not to link, it literally downloads a bash script). So the attacker was able to surreptitiously modify the script hosted on Codecov's website, through a compromised credential. Then the GitHub Action was blindly pulling that bash script into the workflow and running it. If the workflow did a checksum to the incoming text, it would be able to halt the action upon failing checksum verification.

This effectively makes it necessary for an attacker to compromise their bash script and their GitHub repo, changing the bash script at https://codecov.io/bash and the expected checksum in the repo. Of course, Codecov could just host the bash script inside the repo instead. But it fuels a number of their actions across a number of platforms, so I guess they want to keep it centralized.

Here's the Pull Requests in which they implemented checksum verification in their GitHub Action

https://github.com/codecov/codecov-action/pull/282
https://github.com/codecov/codecov-action/pull/287

pallid wing
#

Oh I see that makes sense

#

It's pretty hard to track down shasums for random things and know they are authentic

hoary atlas
#

Yeah. And for my own personal projects, the chance that I will need to checksum my own stuff isn't likely. But if I'm explicitly pulling in something that I don't control, especially a bash script like the one at https://codecov.io/bash, I might remember this news in the back of my mind and try to do my "due diligence" to verify the checksum against a version I knew was safe. Of course a single (non-malicous) change to such a file would break it, as well...

pallid wing
#

I think signing is still more secure since you can't add a checksum to malicious file without more action

hoary atlas
#

Do you mean to require signed commits in repos you control?

pallid wing
#

I mean something like certificate or gpg

#

I think for gpg you need a passphrase to sign something so they have another layer of security. Would need to be able to compromise further.

hoary atlas
#

I see, something like what is described in this resource. So, if you have a particularly security sensitive thing, either figure out how to do it yourself properly, or go hire a security consultant lol
https://gnupg.org/gph/en/manual/x135.html

pallid wing
#

Definitely more effort than a simple checksum though

mint tusk
#

Hey everyone. I'm trying to start up postgres from my vscode terminal and I can't figure out how to do it. Do I need to download one of the VScode extensions or can I do it without it? I feel like I did it before without it but now I can't figure it out.
Specifically vscode isn't recognizing the psql command
I have added the \bin and \lib directories to path and it is recognized from the normal windows command prompt

mint tusk
#

I forgot to install postgreSQL in my condas environment

heavy knot
#

I'm using Ansible and I'm trying to figure out a proper way how to send out a notification at the end of a run if server/s are unreachable during the run. It can be done with registering a variable for a task and ansible will add a field: "unreachable" to the registered variable

#

but how to do it properly with multiple tasks? and some of my tasks already register a variable for other purposes

#

another alternative is to have a specific task at the beginning to check for reachability at the start, but some of our servers are on wonky networks and those servers can become unreachable during a run

heavy knot
#

?

smoky lava
#

Get a better network in the end what you could check at end of you have some resource available but if it fails on the go umm :/ unless like all the stuff can handle network unavailability and move on within some sane time frames

rapid sparrow
#

seting up github runner for python project with steps
build -> pylint -> pytest
all in one job....

name: Runner

on: [push]

jobs:
  main-workflow:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - name: Set up Python 3.8
      uses: actions/setup-python@v1
      with:
        python-version: 3.8
    - name: Install dependencies
      run: |
        python -m pip install --upgrade pip
        pip install pylint
        pip install -r requirements.txt
      
    - name: Analysing the code with pylint
      run: |
        find . -path ./venv -prune -o -type f -name "*.py" | xargs pylint --exit-zero
    - name: Pytest
      run: |
        pytest test.py

is there a point to make those steps in different jobs?
(they just look there cooler in github interface)
if yes, how to do it?

I tried with

name: Pylint

on: [push]

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2
    - name: Set up Python 3.8
      uses: actions/setup-python@v1
      with:
        python-version: 3.8
    - name: Install dependencies
      run: |
        python -m pip install --upgrade pip
        pip install pylint
        pip install -r requirements.txt
    
  pylint:
    needs: build
    runs-on: ubuntu-latest

    steps:
    - name: Analysing the code with pylint
      run: |
        find . -path ./venv -prune -o -type f -name "*.py" | xargs pylint --exit-zero
  
  pytest:
    needs: build
    runs-on: ubuntu-latest
    
    steps:
    - name: Pytest
      run: |
        pytest test.py

but pylint and pytest jobs don't receive data from build in order to run correctly

#

I guess, I am supposed to use cache for that

#

or oh well, steps should be enough too. Since the only proffit here... is getting just better visual output
but it would cost me performance for sure, if I would do so

rapid sparrow
#

Hmm, VPS is so cheap
hard to choose
EU, or USA? hmm

#

thinking to use it as 'show off' thing for my little web site project
plus to get for myself VPN with unlimited internet speed

#

30 Euro per year
for 10 GB SSD, 1 GB EEC, Intel Xeon 1 vCPU core.
I wonder if there is better offer

#

mm yeah, there are offers which are the same, but with payments per month, which is nicer i think

rapid sparrow
#

hmm, there is quite cheap one with payment per hour, which is even nicer

hoary atlas
#

@rapid sparrow

is there a point to make those steps in different jobs?

Pretty much just to guarantee that both your tasks run, rather than one failing and blocking the other, I think.

For example I still want my tests and coverage tasks to run even if flake8 raises a minor issue with my code.

tawny temple
#

That's not necessarily a good reason because steps can be configured to run even if previous ones failed.

#

I don't really see a point in separate jobs besides organisational purposes. Separate jobs makes runs slower because it takes time for a new agent to spin up.

#

And depending on what you're doing in the jobs you may also need to checkout the code again etc.

#

Separate jobs are useful for having different environments like different operating systems or different python versions, though a build matrix abstracts that away for you.

#

It's also useful if the things you are building are completely independent of each other, but this is relatively rare to have (I would expect this to be avoided by keeping them in separate repositories).

hoary atlas
#

Ah, I wasn't aware of the ability to flag steps as continue if failed. Good to know. I usually get into the documentation of things as I go, but the feedback loop for learning/building CI/CD stuff is so agonizing.

I wish there were a better way to test GitHub Actions and workflows without having to commit+push the YML to the remote and then trigger the workflow after every minor change. I end up with a bunch of garbage commits.

Can you "promote" the X/check of a step to be visible at the "top-level" in the GitHub UI? I guess you could have a thin wrapper job that just shows the status of a "buried" step inside another job.

rapid sparrow
#

I discovered cool feature about flake8
It can have a hook to git, which prevents commit, until you fixed the errors

#

Nice quality control feature

hoary atlas
#

That's cool, I didn't know flake8 bundled an optional hook like that.

rapid sparrow
#

boi. I love the click. Just started to use and got rid of all my shell files

#

its nesting/grouping commands feature is awesome
it makes my documentation shorter too
hell, it is even self documented!

hoary atlas
#

For building CLI tools with Python, I've been using fire, myself. I've heard that click is good, too, though.

rapid sparrow
#

tox is funny thing

#

same as github/gitlab runners
but works offline

#

cool, in order to make tests for dependencies on multiple python versions

#

technically, it could be used to speed up pipline run

#

instead of using 'matrix' mod, which creates new containers for each version

#

we can use tox, which does the same without it

rapid sparrow
#

I wonder if there is point in any tools besides docstrings and Sphinx for documentation of Django

candid kayak
#

generally it'd start up on my computer start up but sometimes randomly it doesn't

rapid sparrow
#

makes things much easier

#

speeds up learning

#

and work

#

and experimenting

candid kayak
#

true but that's not the immediete solution to this problem

#

or is it 🤔

rapid sparrow
#

Sphinx is awesome

#

it can auto generate most of documentation based on docstrings ;b

#

enables search / navigation automatically

#

I should learn Google style docstrings to make it better though

potent walrus
potent walrus
#

you can chose which app don't run after startup you want

candid kayak
#

fixed it with a restart, thanks

marsh hemlock
#

A Question for More Advanced Developers since I am a beginner could I still use Microsoft Learn to learn Python or do I have to study at Python.org ??

mortal cape
#

I am sorry if this channel is inappropriate for this question :C

May i ask for recommendations for python packages that helps extract or convert music into some sort of data?

outer reef
#

I just didn't wanted to work for that

smoky stratus
#

Can someone recommend a great solution to hosting a FastAPI on multiple servers so the load can be balanced and if one goes down the other can still handle the requests?

rustic carbon
#

can anyone help me with my HTML code?

tepid flax
still tusk
#

hey, does anyone know how to define the find-links for a package when using setup.cfg ? for example when i install the package with pip i use pip install torch==1.8.1+cpu --find-links https://download.pytorch.org/whl/torch_stable.html

#

but i want to have this insluded as a dependency wehn installing my package

icy elbow
#

If I'm converting python2 code to python3 is there any way to figure out which objects and libraries will require changes?
I've run 2to3, but it didn't flag things for attention that it couldn't fix like it said it would.
Right now my list of things to change includes:
Regular expressions on binary, buffer, and reviewing all division operations to see if it needs to be reviewed,
but there must be a better way to get a full list of interfaces or important internals that have changed

#

Even just a page on the python docs for each import that documents what to look out for would be better than a shot in the dark

spring chasm
#

hello, i need help with pyinstaller. can anybody help me (if it possible in german pls). i didnt know where i bind in utils like psutil or other

stoic quiver
#

hey - can i get a professionals thoughts on bamboo? It seems theyve dropped cloud support and one of the first results when you search atlassian bamboo is "is atlassian bamboo dead?". For context I'm trying to write a hypothetical recommendation to a large company. Im not sure if its dying or I'm just reading all the bad things from articles

rapid sparrow
shy locust
#

😦

#

welp, my place uses Atlassian

#

Confluence, bitbucket, and their Jira product

#

no native dark mode annoys me infinitely

stoic quiver
#

lolll ill use no dark mode as a reason

#

im comparing to gitlab - especially the free version + the free ultimate edition for startups. I've said gitlab would be best for startups. Would you say gitlab is best for ftse 100 companies too then?

shy locust
#

no clue. I've not noticed the slow loading yet, so my main gripe is dark mode, and we can't install plugins to get around that. My company is very big though, so not sure

wooden ibex
#

GitHub and other cloud build systems can be too restrictive depending

lusty blaze
rapid sparrow
#

has anyone deployed wiki to github pages?

#

I succeded but I don't have automatic redirect for index.html

#

looking how to fix it

#

Oh, nice, it is working

wind salmon
#

I was informed by AWS that I've used 25GB of my storage.

I ran du -h -a / | sort -n -r | head -n 10 to find out the biggest files and it’s looking like most of it is ~1MB and from Docker…?

~$ sudo du -h -a /  | sort -n -r | head -n 20
du: cannot access '/proc/...': No such file or directory
du: cannot access '/proc/...': No such file or directory
du: cannot access '/proc/...': No such file or directory
du: cannot access '/proc/...': No such file or directory
1021K    /snap/core18/1997/usr/lib/python3.6/pydoc_data
1021K    /snap/core18/1988/usr/lib/python3.6/pydoc_data
1020K    /var/lib/docker/overlay2/.../merged/venv/lib/python3.8/site-packages/gssapi/raw/ext_dce.cpython-38-x86_64-linux-gnu.so
1020K    /var/lib/docker/overlay2/.../diff/usr/local/lib/python3.8/site-packages/httptools/parser
1020K    /var/lib/docker/overlay2/.../diff/venv/lib/python3.8/site-packages/gssapi/raw/ext_dce.cpython-38-x86_64-linux-gnu.so
1020K    /var/lib/docker/overlay2/.../merged/usr/local/lib/python3.8/site-packages/httptools/parser
1020K    /var/lib/docker/overlay2/.../merged/usr/local/lib/python3.8/site-packages/httptools/parser
1020K    /usr/share/perl/5.30.0/unicore/Name.pl
1020K    /usr/share/locale/it
1020K    /usr/sbin/tcpdump
1020K    /usr/lib/modules/5.4.0-1038-aws/kernel/arch/x86/kvm/kvm.ko
1016K    /var/lib/docker/overlay2/.../diff/var/lib
1016K    /var/lib/docker/overlay2/.../diff/venv
1016K    /var/lib/docker/overlay2/.../merged/usr/local/include
1016K    /var/lib/docker/overlay2/.../merged/usr/local/include
1016K    /var/lib/docker/overlay2/.../diff/usr/local/include
1016K    /usr/share/locale/sv
1012K    /var/lib/docker/overlay2/.../merged/venv/lib/python3.8/site-packages/werkzeug
1012K    /var/lib/docker/overlay2/.../diff/usr/share/locale/de
1012K    /var/lib/docker/overlay2/.../merged/usr/local/include/python3.8
#

Running sudo docker system df shows that docker with all the images, volumes, etc. only uses < 5GB,

~$ sudo docker system df
TYPE          TOTAL   ACTIVE  SIZE    RECLAIMABLE
Images         5       5     2.224GB  1.049GB (47%)
Containers     7       7     1.312MB  0B (0%)
Local Volumes  4       4     50.12MB  0B (0%)
Build Cache    0       0     0B       0B

Can someone give pointers on how I can figure out how my server is using 25 GB?

rapid sparrow
#

Perhaps cache from other layers during builds

#

There is command to clear it

wind salmon
#

@rapid sparrow when I ran docker system df it did say Build Cache is 0.

#
~$ sudo docker system df
TYPE          TOTAL   ACTIVE  SIZE    RECLAIMABLE
Images         5       5     2.224GB  1.049GB (47%)
Containers     7       7     1.312MB  0B (0%)
Local Volumes  4       4     50.12MB  0B (0%)
Build Cache    0       0     0B       0B
#

I also said this in another community:

#

Also had unused volumes cleared by running docker system prune --volumes and 0 B was cleared after running that.

tawny temple
#

What does df -h show?

rapid sparrow
rapid sparrow
# wind salmon Also had unused volumes cleared by running `docker system prune --volumes` and 0...

docker rmi $(docker images -a -q) to clear all not active at the moment layers
docker rmi $(docker images 'PROJECT_NAME' -a -q) to clear layers for a specific image name

if you had for example used image ubuntu 20.04
this cleaning will lead to repeated downloading from public storages

and if you had your container not running
next build will be forced to rebuild all layers from zero

P.S. if you will run this thing every time, it will increase your build time

tawny temple
#

Also I think the method you propose is obsolete with more recent Docker versions that added docker image prune

#

In any case I would expect sudo docker system df to have already shown the space that docker image prune would clean up.

shy locust
#

Is there a discord for aws devs/sys/ops people

#

I'd be in there in a second

stray jackal
#

Hangops

#

errr nope that's a slack

wind salmon
#

Full output:

~# df -h 
Filesystem      Size  Used Avail Use% Mounted on
/dev/root        30G  5.3G   24G  18% /
devtmpfs        484M     0  484M   0% /dev
tmpfs           490M     0  490M   0% /dev/shm
tmpfs            98M  1.3M   97M   2% /run
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           490M     0  490M   0% /sys/fs/cgroup
/dev/loop0       34M   34M     0 100% /snap/amazon-ssm-agent/3552
/dev/loop1       56M   56M     0 100% /snap/core18/1988
/dev/loop2       70M   70M     0 100% /snap/lxd/19188
/dev/loop4       33M   33M     0 100% /snap/snapd/11402
/dev/loop5       71M   71M     0 100% /snap/lxd/19647
overlay          30G  5.3G   24G  18% /var/lib/docker/overlay2/6b3166bf004f50a45110ff0d855f6d2f3c058a9ac68c8ab7a3c40ce3c118d049/merged
/dev/loop6       56M   56M     0 100% /snap/core18/1997
/dev/loop7       33M   33M     0 100% /snap/snapd/11588
overlay          30G  5.3G   24G  18% /var/lib/docker/overlay2/2f072eb2d9b6e555c8b9c8cdc4de18c90828f3a4267a2cd19ec046b73c0d0b0f/merged
overlay          30G  5.3G   24G  18% /var/lib/docker/overlay2/6998b7925356ff5f30a23eaa0a5b29bbcfd0fa42a70380212ecaf2621abf8759/merged
overlay          30G  5.3G   24G  18% /var/lib/docker/overlay2/de96dece2092b986e46b9a6574133554a8c6bde78af74b5a53b8ab5881e2f20d/merged
overlay          30G  5.3G   24G  18% /var/lib/docker/overlay2/dd3b77593cde8307f0a00a03380b7c49812e94a5bd0cd14d32f2b79efd5e9616/merged
overlay          30G  5.3G   24G  18% /var/lib/docker/overlay2/09be3e30556a91b602534ac65709700c569f44364f91fcb31a617e5725819e8d/merged
overlay          30G  5.3G   24G  18% /var/lib/docker/overlay2/8f80297ce43b53902a785dc53f354119971d43ea5b98f6e76fd52d305f37eb27/merged
tmpfs            98M     0   98M   0% /run/user/1000
tawny temple
#

You read it correctly. Only 5 GB used.

#

I'm not familiar with all of AWS's services. Do you have some external volume that you're also paying for?

#

Or maybe they were talking about bandwidth rather than storage?

#

Ultimately, you should be able to just contact them and ask. You are a customer, after all.

stray jackal
#

The 25 number is surprising since you have 30gb allocated.

wind salmon
#

Thanks @tawny temple !

shy locust
cloud elbow
#

how can I connect to DockerClient inside the docker container (dockerpy)?

turbid tusk
#

Hey i made a program in python to drag images and convert them to PDF. I tried to make it exe with pyinstaller but when i drag an image it says permission denied while it works fine in the terminal

ripe junco
#

Hello! I'm trying to test a CI pipeline on GitLab. Basically, I use a python image (3.7.9) and I install all the necessary things on the build stage (not sure if necessary) and then I try to run the script but I keep getting this error python3: command not found. Here's my .gitlab-cy.yml

image: python:3.7.9

stages:
  - build
  - test

building:
  stage: build
  script:
    - apt-get update
    - apt-get install -y python3
    - apt install -y python3-pip
    - python3 -V
    - python3 -m pip install --upgrade pip
    - echo "Moving on to requirements install"
    - pip3 install -r requirements.txt

testing:
  stage: test
  script:
    - python3 oauth2_sign_in.py
  after_script:
    - echo "Test successful"

#

I've tried to read numerous pages and forums, but still couldn't find a solution, and I think it must be something really stupid

wooden ibex
#

Multistage build requires you to copy stuff over and you are not

#

and with Python, looking at your build, there isn't a big reason to multistage build

#

also Python Image comes with PIP so why do this: - apt-get update - apt-get install -y python3 - apt install -y python3-pip

#

Ok, Gitlab CI doesn't throw out last stage stuff but it's possible you are messing up with previous stage with your apt-get of install of python, use the baked in one and also just called "python" most python 3 docker containers map "python" -> "python3"

ripe junco
#

OK, in short, I should just skip the apt-get installations and only run python <script>?

#

@wooden ibex

rapid sparrow
wooden ibex
#

So just pip install requirements.txt and run python

rapid sparrow
#
image: python:latest

before_script:
  - python -V  # Print out python version for debugging
  - pip install -r requirements.txt

pylint:
  script:
    - python scripts.py test pylint

flake:
  script:
    - python scripts.py test flake

unit:
  script:
    - python scripts.py test unit
    - python scripts.py test cover
#

in python images, we have already pre installed python3
weirdly enough it is invoked through python

tawny temple
#

It's not that weird. The only reason python3 even exists is cause of Python 2 occupying python on many systems. This is fading away and doesn't matter at all for the container since it only has Python 3

ripe junco
#

Just another question @wooden ibex @rapid sparrow , in this case, what I'm testing is a Flask app, but, of course as it does not get any input, it just waits for input endlessly. How can I perform test in a Flask app?

#

Sorry for bothering this much tho

wooden ibex
silent sedge
#

With git rebase -i, is there a way to fold a commit into the next commit, e.g. like fixup but down?

void lotus
#

When using pyproject.toml instead of setup.py for publishing packages to PyPI, I don't know how I can supply the long description. In setup.py I could use some handy python code for that, but I don't know how to achieve the same in a toml file. thx for the help

fleet bloom
#

anyone have any experience coding bots to buy items online?

#

is that possible/doable in python

supple venture
rapid sparrow
#

Then it will not run server when not needed, and you can easily program additional behavior

#

Running tests

#

Or click scripts

supple venture
tawny temple
supple venture
tawny temple
#

I guess it counts your username as part of the repo name

#

But it's case insensitive so it's weird that it is complaining

#

Well, I suppose buildx doesn't know that GH is case insensitive. Fair enough

supple venture
tawny temple
rancid schoonerBOT
#

.github/workflows/main.yml lines 123 to 125

tags: |
  ghcr.io/Shivansh-007/griff-ify:main
  ghcr.io/Shivansh-007/griff-ify:${{ steps.sha_tag.outputs.tag }}```
tawny temple
#

Just make the S lowercase

supple venture
#

ok cool, lemme try that

#

even cache from would be moved to s right?

tawny temple
#

Probably. I assume it'd have the same issue with it being uppercase

supple venture
#

pushed, lets see the workflow output

#

just a short question, say there are two ppl with same repositories, say a, and their names are Mark and mark, how will buildx differentiate between the two?

tawny temple
#

It's case-insensitive on GH, so Mark and mark are the same person

supple venture
#

ah ok

tawny temple
#

Np

river pasture
#

@pliant plover Let's talk here

#

Your Procfile needs to be worker: python Main.py

#

I thought your file was named main.py

pliant plover
#

noo

#

@river pasture

river pasture
pliant plover
#

itis there

river pasture
#

You still have an error when you push your code?

pliant plover
#

yup

#

@river pasture

#

what to do

#

ok i will talk later

river pasture
#

How did you created your app?

pliant plover
#

I created a bot

#

@river pasture

river pasture
#

Considering that I can't voc rn, here's a video on how to setup a discord py bot on heroku : https://www.youtube.com/watch?v=BPvg9bndP1U

How to host your discord bot for free using heroku. This tutorial shows you how to host your python bot for free using heroku services. We simply need to setup a few things to heroku, upload our code and turn the bot on!

Text-Based Tutorial: http://techwithtim.net/tutorials/discord-py/hosting-a-discord-bot-for-free

Heroku: https://heroku.com
...

▶ Play video
#

That's the one I followed when I started developping mine and had no problem deploying it

last blade
#

Groovy#7254: ``

sterile drum
#

I need some help

#

Anyone here familliar with mcp?

river pasture
#

@candid kayak What should I chose to make it free? The lowest options seems to be 7.7$/mo

candid kayak
#

in the series, choose N1

#

and the lowest machine type which i now forget

river pasture
#

4.79 by choosing a standard disk

candid kayak
#

i get it down to 4.88 monthly with the f1-micro

#

it's free because up till certain limit, compute engine is free

#

it's some sort of quota which i now forget, let me see if i can find it

river pasture
#

Well thanks to free credits, I could host my bot for 55 mounts lul

candid kayak
#

i just stay within the free trial limits for compute engine, so in effect it is totally free (doesn't deduct fromthe credits either)

river pasture
#

Oh ok

river pasture
candid kayak
#

Tutorial for?

#

oh setting up a discord bot?

#

just...install the dependencies and run the thing :p i think digital ocean has a few tutorials on deploying discord bots on their platform, just skip through until you reach the part where they ssh in

river pasture
#

Managed to get my bot on the vm

river pasture
candid kayak
#

🤔 are you sure the version you specified is right

river pasture
#

Managed to install chess via pip on my computer but not on the vm

candid kayak
#

and are you sure you're using the correct version of pip

#

python and pip by default are python2 and the corresponding version of pip i think

#

i generally make a virtualenv and install into it

candid kayak
river pasture
#

I have two python versions I think

#

3.6 and 3.9

abstract dove
#

cooooool

river pasture
#

The chess lib only supports python 3.7+ and the latest official version of python on ubuntu was 3.6

candid kayak
#

ah nice

#

yeah it seems to come with 3.6 default which is annoying 😔 i use 3.8 for almost everything

kindred walrus
#

Can anyone help me with git ?
Q. The problem is I want to change the default location of repository's being saved by git , like whenever i clone a repository , git clones it in the default location in my c: drive that is User/hp in my case. Now i want to change the default locations to save the repository from c: drive to another drive on my pc. Can anyone help me like how do i change the default location ?

river pasture
#

Now the last step is adding all my env vars

#

I found how to install ffmpeg, opus and gtk

river pasture
#

I got everything to work

candid kayak
#

super cool 👍

placid hatch
#

I'm trying to make a simple Python script that reads a text file and then runs a .exe file, giving the .exe parameters that are found in the .txt file 😛
Is there any... efficient way to do this? lol

night quest
#

!d subprocess.run

rancid schoonerBOT
#
subprocess.run(args, *, stdin=None, input=None, stdout=None, stderr=None, capture_output=False, shell=False, cwd=None, timeout=None, check=False, encoding=None, errors=None, ...)```
Run the command described by *args*. Wait for command to complete, then return a [`CompletedProcess`](https://docs.python.org/3/library/subprocess.html#subprocess.CompletedProcess "subprocess.CompletedProcess") instance.

The arguments shown above are merely the most common ones, described below in [Frequently Used Arguments](https://docs.python.org/3/library/subprocess.html#frequently-used-arguments) (hence the use of keyword-only notation in the abbreviated signature). The full function signature is largely the same as that of the [`Popen`](https://docs.python.org/3/library/subprocess.html#subprocess.Popen "subprocess.Popen") constructor - most of the arguments to this function are passed through to that interface. (*timeout*, *input*, *check*, and *capture\_output* are not.)
night quest
#

!d subprocess.Popen

rancid schoonerBOT
#
class subprocess.Popen(args, bufsize=-1, executable=None, stdin=None, stdout=None, stderr=None, preexec_fn=None, close_fds=True, shell=False, cwd=None, env=None, ...)```
Execute a child program in a new process. On POSIX, the class uses [`os.execvp()`](https://docs.python.org/3/library/os.html#os.execvp "os.execvp")-like behavior to execute the child program. On Windows, the class uses the Windows `CreateProcess()` function. The arguments to [`Popen`](https://docs.python.org/3/library/subprocess.html#subprocess.Popen "subprocess.Popen") are as follows.

*args* should be a sequence of program arguments or else a single string or [path-like object](https://docs.python.org/3/glossary.html#term-path-like-object). By default, the program to execute is the first item in *args* if *args* is a sequence. If *args* is a string, the interpretation is platform-dependent and described below. See the *shell* and *executable* arguments for additional differences from the default behavior. Unless otherwise stated, it is recommended to pass *args* as a sequence.

An example of passing some arguments to an external program as a sequence is:
night quest
#
Popen(["/usr/bin/git", "commit", "-m", "Fixes a bug."])
placid hatch
#

yea, ive been reading about that online.. didn't know if there was a... more common way to do it 😛

#

ah tysm

night quest
#

!d os.system

rancid schoonerBOT
#

os.system(command)```
Execute the command (a string) in a subshell. This is implemented by calling the Standard C function `system()`, and has the same limitations. Changes to [`sys.stdin`](https://docs.python.org/3/library/sys.html#sys.stdin "sys.stdin"), etc. are not reflected in the environment of the executed command. If *command* generates any output, it will be sent to the interpreter standard output stream.

On Unix, the return value is the exit status of the process encoded in the format specified for [`wait()`](https://docs.python.org/3/library/os.html#os.wait "os.wait"). Note that POSIX does not specify the meaning of the return value of the C `system()` function, so the return value of the Python function is system-dependent.
placid hatch
#

@night quest is there a way to surpress the print statements but also saving it?
I see a capture_output, but...

#

I'm doing:

FNULL = open(os.devnull, 'w')
result = subprocess.run(["myargshere"], stdout=FNULL, stderr=subprocess.STDOUT)
``` this surpresses the print statements... `result` is now an instance of CompletedProcess..
#

lel just needed capture_output=True:

result = subprocess.run(["myargshere"], capture_output=True)
``` and now I can use `result.stdout` !! 🙂
rough robin
#

I want to download this library called Pydome https://github.com/badassdatascience/pyDome, but it is not updated for Python 3.0.

Someone made a pull request to update to python 3.0, and I want to download that version instead. How can I do this?

#

for now i just went to the files and viewed the raw text and simply copy pasted them, but is there a better way?

rapid sparrow
#

there is no better way in the current situation, except for downloading the rep

rough robin
#

ahhhhh yeah that's what I need thanks!

rapid sparrow
#

Can you give me advice

#

from which stage of project development, a person which takes fully devops position is highly needed

#

project is full of microservices, with multiple services
at the current stage with one big server, and only few services deployed to other servers, but the amount of servers will grow quickly in a matter of several months

#

I am a little bit unsure, if we already need him desperately right now
or may be a month/two months later

#

Am I correct that DevOps can be taken, which next roles

  1. to setup proper development cycle and deploying system
  2. to think of a better microservice architecture of the project, how to make the load balanced, to setup stuff like that
  3. he can have network skills too, to help with stuff where regular developers can be missing

and perhaps:
4) he can be also taking administrative/talking role with internet-server providers/thinking of a project development direction?

Technically at least coding part of development cycle I was able to set properly with having gitlab piplines / static code checkers / unit testing
I am severally only missing proper deployment system
doing it with just....mix of python/shell/docker scripts at the moment

ripe junco
#

Hey all! Can you help me in a issue here?
I have a file which creates a simple k8s namespace inside the GitLab cluster

apiVersion: v1
kind: Namespace
metadata:
  name: kpw

I run the following command inside my deploy stage, in a job called deploy-code

kubectl create -f ./k8s/namespace-creation.yaml

It returns the following error Error from server (Forbidden): error when creating "./k8s/namespace-creation.yaml": namespaces is forbidden: User "system:serviceaccount:gitlab:default" cannot create resource "namespaces" in API group "" at the cluster scope

It has something to do with authorization or could it be a path issue?

bleak ether
#

If i create binaries on the image for a different microarchitecture will the docker image not run? i.e. if i compile with avx512 instructions

willow flame
#

I hadn't this issue until I update pip

willow flame
#

could anyone help me please?

rapid sparrow
willow flame
#

normal pip was broken

#

I don't want to use venv

#

I only want to use pip in all cases

rapid sparrow
#

I don't even always install pip to global env usually

#

Not really needed

willow flame
#

even if it is, I care that pip was broken

rapid sparrow
#

Leaning venv takes no effort, it is just four commands tov remember

willow flame
#

I need to solve this problem

rapid sparrow
#

Venv could repair pip with infernal pip possibly

willow flame
#

my friend, I don't want to use venv

#

okay?

rapid sparrow
#

Okay, but you make a big mistake

willow flame
#

I only use venv when i need it

#

but I don't need now

#

I want to install anything via pip on my machine

#

but pip was broken

rapid sparrow
#

In your windows case, it should work

#

(Don't ever do it if you are in desktop linux ;b)

willow flame
#

but, does anyone have any other suggestion?

rapid sparrow
#

Try btw, python -m pip --help

#

And check same with pip3

willow flame
rapid sparrow
#

Hmm

#

?

willow flame
#

I have this problem after I updated pip via "pip install --upgrade pip"

#

isn't the latest pip version stable?

rapid sparrow
#

Try
C:\python38\Scripts\pip.exe --help

willow flame
rapid sparrow
#

No, insert full path

#

With exe

#

Oh yes

#

You did

willow flame
#

I think this is so weird

rapid sparrow
#

Mm yeah

#

I think only python reinstallation will work in your case

Unless you have secondary package manager that can reinstall only pip
(conda, or May be chokolatey can)

#

Although

#

You could try repairing pip

#

With files from another installation :b

#

But tbh it has no meaning to do that

#

Reinstallation is faster, easier and reliabler

willow flame
#

I don't understand why that happens
I have this issue after I update it
I think the last version of pip is not stable and has problems

rapid sparrow
#

Some bug with broken compatibility about it with 38

#

Or just linux developer, which missed to check windows compatibility

willow flame
#

may be

#

if anyone knows the proper solution please let me know

tawdry needle
#

@willow flame on windows you should never do pip install -U pip, only python -m pip install -U pip

#

usually the first one just doesn't work, but in this case it seems like something got corrupted

willow flame
#

I added the scripts folder to path

#

And Pypi recommends to use just pip

#

And, I and many of the developers use pip only

shy locust
#

The latest version of pip recommend using python -m pip

#

When i upgraded from v19.03 to v21, anytime I installed something using just pip I'd get a depreciationwarning

willow flame
#

I don't get anything like that

#

Even if it is, there is no change

willow flame
shy locust
#

Reinstall mate, that's so weird

tawdry needle
# willow flame Why?

because on windows things get weird when a program tries to modify the file that is currently being executed

#

this is not a problem on linux and mac because the operating systems work differently

#

you can use pip install for other things on windows, just not pip itself

stable void
candid juniper
#

hi everyone. just wondering what the best way to manage python installs on macos (or linux) is these days? I've heard a few people mention it is better to avoid using python installed via Homebrew (on mac anyway) as it will update it as needed which can screw some things up so its better to use another tool to manage python for development and just left Homebrew do its thing for Python that it needs to do its job?

candid juniper
#

thanks will check it out!

#

oh yeah looks great, exactly what I was hoping for. Something that just sets up different python installs without screwing up the Homebrew version 👍

pliant plover
#

anyone pls help me to host my bot on heroku

half shore
#

are there any DAG schedulers like luigi, airflow but more like luigi in its simplicity? I think airflow is pretty heavy weight for some simpler tasks

willow flame
#

I have coded a module.
This module is for probability. It returns True or False output based on a probability.

>>> from probability import Probability as pr
>>>
>>> pr.Prob(1/2)
False
>>> pr.Prob(1/2)
True
>>> pr.Prob(1/2, num=5)
[False, False, True, False, False]
>>>
>>> # it is recommended to create an instance
>>> myobject = pr()
>>>
>>> # use iProb instead of Prob
>>> myobject.iProb(5/8, "50%", "2/11") # for more accurate results give them as str
[[True], [True], [False]]
>>> myobject.count_values()
{True: 3, False: 0}
>>> myobject.history
{0.625: [True], '50%': [True], '2/11': [False]}
>>>
>>> # you can also set a constant
>>> myobject.set_constant("7/15")
>>> myobject.iProb()
False
>>> myobject.iProb()
False
>>> myobject.iProb()
False
>>> myobject.iProb()
False
>>> myobject.iProb()
True```
Can you suggest a name for my module? (my module name is also used in Pypi)
heavy knot
#

Any1 know why my discord bot wont host on heroku? It says done and deployed I have it on on heroku but it wont come online idk y and Ive done this for other bots couple days ago n they all worked

heavy knot
#

Omerfi name your module Omerfibulous...

willow flame
rustic flame
#

Some variation of Boolean probability?

normal nebula
#

Is anyone else having problems with github desktop?

#

It stopped responding for an hour so I restarted my laptop and tried to start it and it wouldnt so i uninstalled and when i reinstall it it keeps on saying there was a problem installing

rapid sparrow
#

if you are in windows, use SourceTree

#

if in Linux, well, git bash + git cola

supple venture
#

if you really wanna stick with gui, then use gitkraken

#

It makes switching branches and repos very easy, It visually shows different branches compared to others, and it is easier to stash/un-stash files in the interface, Gitkraken makes it super nice to do the commits

rapid sparrow
#

plus it is free

supple venture
#

never heard of it, can you share the link?

rapid sparrow
#

the only problem, it is windows/ mac os only

#

no linux(

#

Here how it looks

#

really comfortable multi repository one, looking through files to reset/revert in hunks and lines

#

oh wait a second, perhaps I was able to find alternative for linux

#

going to try SmartGit, perhaps it would do the trick

supple venture
#

smh no linux :(, gitkraken looks better than that imo, why would you choose the two over it?

rapid sparrow
#

it is free, working smoothly, no bugs
great customization

#

gitkraken is laggy and buggy in my opnion

#

I had really big trouble with its accounts during setup

supple venture
#

yeah, accounts setup a bit difficult on git kraken

#

not difficult, but confusing rather

rapid sparrow
#

Dammit. SmartGit is not free as well

#

hmm, perhaps just to try Wine installation

#

Technically.... GUI is for the weak ;b

#

CLI rulezz

#

but still, I miss them a bit

burnt thunder
#

honestly, I haven't felt much of a need for a dedicated git GUI. I have used tortoiseGit before and it does have some nice things, but all I really want is editor integration for git stage in order to allow for granular commits in a way that is nicer than git stage -p

rapid sparrow
#

oh wait a second, SmartGit is allowed to be used for free for non comercial purposes

#

not bad

rapid sparrow
#

as well as git checkout -p

burnt thunder
#

haven't gotten much usage from git checkout -p tbh, I don't like using it all that much.

#

it is useful for fixing really messed up histories though.

rapid sparrow
#

well, smart git is sort of having all I need

#

slightly weirder interface, but I can get used to it

#

quite powerful GUI

supple venture
#

stackoverflow helps me out with git stage and resets :D

#

used git kraken earlier

smoky stratus
#

Someone who's familiar with Cloud Functions - how can I pass in a variable when I call the HTTP function? For example if the trigger URL is https://test.cloudfunctions.net/test I'd like to do something like https://test.cloudfunctions.net/test?abc123 and then print that variable in my function:

def start(x):
    print(x)
shy locust
#

Your url is a string right? Split your string on '?' And print item [1] of the resulting list

#

If there are multiple ?s in your url then pop the [0] item and join everything else back together

normal nebula
#

@supple venture Thanks a lot GitKraken made it much easier and better to use git

#

and I could understand what was going on

supple venture
#

np lemon_hyperpleased

mild grove
#
</div>
<div class="trn-defstat">
<div class="trn-defstat__name">Total XP</div>
<div class="trn-defstat__value" data-stat="PVPTotalXp">
15,935
</div>

How can i use urllib.request & BeautifulSoup to pull data number inside PVPTotalXp ??
i want it get data and print out 15,935 only

mild grove
#

I tried

#
import urllib.request
from bs4 import BeautifulSoup

user_agent = 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.7) Gecko/2009021910 Firefox/3.0.7'

url = "https://r6.tracker.network/profile/pc/Moddy"
headers={'User-Agent':user_agent,} 

request=urllib.request.Request(url,None,headers) #The assembled request
response = urllib.request.urlopen(request)
text = response.read()
soup = BeautifulSoup(text, "lxml")

data = soup.findAll('div',attrs={'class':'trn-defstat__value'})

print(data)

for div in data:
    links = div.findAll('a')
    for a in links:
        print(a['href'])
#

but it print all the

#

I just want the only number/info inside

night quest
# mild grove I just want the only number/info inside

!e

htmlstr = """
<div class="trn-defstat__value" data-stat="PVPTotalXp">
15,935
</div>
"""
from bs4 import BeautifulSoup
soup = BeautifulSoup(htmlstr, 'html.parser')
for div in soup.find_all("div"):
  print(div.string.strip())
rancid schoonerBOT
#

@night quest :white_check_mark: Your eval job has completed with return code 0.

15,935
night quest
#

.string gives you content of the div element, .strip() is to remove whitespaces

mild grove
#

Thanks

rapid sparrow
brazen pasture
#

can someone help me setup heroku

#

please

muted notch
junior linden
#

Hey guys,

Docker newbie here!

I think I understood the basic concept of Docker, but there are some questions that remain unanswered. Google and co. can unfortunately only partially or very incomprehensible clarify my open questions.

Why do I want to learn Docker?

  1. I want to keep my system (Mac user) clean and not cluttered with hundreds of different environments (e.g. diff. Node or Python versions, diff. DB's and so on).

  2. I think it is good for my professional career.

What questions do I have?

I would like to use docker not only for production environments, but also go so far that all my local dev environments run within Docker containers.

Here I would like to hear from experienced users the advantages and disadvantages of Docker and local development.

  1. Is it possible, for example, to run a NodeJS container and use it "globally" for all my software projects or do I have to run a separate NodeJs container for each NodeJs project. I've heard of the concept of mountings, but haven't fully understood it yet.

E.g. If I run a MongoDB container, I can assign a port here and use it 'globally / system-wide'.

  1. Can / should one also run git inside containers or rather directly on the host?

For me it is very important not to do without hot reloading of my dev environment, whether Express Server, Flask Server, React / NextJS and so on, without having to create a new image and restart it after every change.

So all of my questions relate more or less to whether you can 'Dockerize' the whole subject of software development or whether you can not avoid installing some tools on the host anyway (e.g. NodeJS)

I look forward to your feedback.

Thanks! 😃

tawdry needle
#

@junior linden use docker compose

#

Have "dev" and "prod" versions

#

In the dev version, mount your files as a "volume" so you dont have to rebuild the container to run your updated code

supple venture
#

for the 2nd question, yes you should be able to
port mapping host:container

tawdry needle
#

Yep, specify all that in docker compose

#

Better still, run nginx in docker compose too and put all your stuff behind it

junior linden
#

Thanks @tawdry needle @supple venture

supple venture
#

not as of now, see if you find a mongo compose file and play around with it

short peak
#

@junior linden I use separate containers per project or service, I rather not use docker compose though it facilites management sometimes. It actually depends on your needs and skills. I do git stuff in my Mac, not inside containers. Restarts happen when file changes so if you setup your docker volumes correctly, you should be able to enjoy those features even with containers. Although, I usually have Node and Python installed in my host as well, basically to help my IDE :). brew, pyenv, poetry and nvm help a lot with that part

junior linden
short peak
#

difference can't be noticed by my limited brain

junior linden
short peak
#

I don't think so but let me check

#

@junior linden you might want to check this instead of my stuff - https://docs.docker.com/samples/

Docker Documentation

Learn how to develop and ship containerized applications, by walking through samples that exhibits canonical practices.

tawdry needle
#

@short peak you're talking about app restarts right? you have your source code loaded as a volume?

#

my docker compose files at work look kind of like this

version: "3.8"
services:
  mongo:
    image: mongo:4.4.3-bionic
    container_name: myapp-mongo
    hostname: myapp-mongo
    restart: always

  server:
    container_name: myapp-server
    hostname: myapp-server
    build:
      context: .
      dockerfile: Dockerfile
    ports:
      - 8888:8888
    volumes:
      - .:/myapp
short peak
#

@tawdry needle, yeah, I usually do

wooden ibex
#

While you can do Mongo as container, which is fine for dev work, databases don't always make greatest container dwellers in prod

tawdry needle
wooden ibex
#

or you are locked to Single Host which is problematic in itself

tawdry needle
#

oh, yeah honestly idk how thats all set up

#

i know the mongo server uses replica sets

#

and i also know that theres 0 reason for us to be using mongo

#

and we should just be using sql..

wooden ibex
#

Sure, but plenty of clouds provide SQL setups where they provide all that

tawdry needle
#

indeed

#

i dont know why they went with mongo

#

wasn't my decision, i joined after it was already in place

supple venture
#

Personally I never worked around with mongo, was going to but never got the time, and ideas to use it, Postgres is what I always used

#

Mostly django ORMs

wooden ibex
#

Because you can cluster really easy

stoic quiver
#

hey. I'm trying to write an essay about Docker and Kubernetes. I understand that Kubernetes manages nodes such as docker. I was wondering if that is needed in a small company where not much processing power is likely needed?

violet hatch
#

company size and processing load are not super strongly related

#

and

#

well, yes, Kubernetes is used for container orchestration

scarlet crystal
#

Hi guys ! Can I use Python Kivy to create (or access) a directory in Android like I do on Windows PC??
like making a directory : os.mkdir()
Am I able to do that on Android device ??

dim belfry
#

hey how can we control bluetooth of our pc using python

#

is there any library available?

jolly cloak
#

Something's wrong with Anaconda Navigator 😦

Tried almost every solution available on the internet. But since no errors are seen, not able to pinpoint the issue.

Could someone please help me out? 🙂https://stackoverflow.com/questions/67395489/anaconda-navigator-doesnt-get-past-the-initializing-screen-doesnt-give-any-er

supple venture
supple venture
ripe junco
#

Anyone has experience with GitLab CI? I'm trying to create a deployment stage inside my pipeline, and I already have built my Docker image and it's already registered inside my Container Registry. But when I try to kubectl run from a file (I'll append it), it does not push my own image, instead it will try to push an image from Docker Hub. How can I tell GitLab to use my own image stored in the Container Registry?

Here's my k8s deployment description file (kpw is the name of the image inside Container Registry)

apiVersion: apps/v1
kind: Deployment
metadata:
  name: kpw
spec:
  selector:
    matchLabels:
      app: kpw
  template:
    metadata:
      labels:
        app: kpw
    spec:
      containers:
      - name: kpw
        image: kpw:latest
        resources:
          limits:
            memory: "128Mi"
            cpu: "500m"
        ports:
        - containerPort: 65203

P.S: its very simple, but its supposed to at least for now

rapid sparrow
#

I am familiar with GitLAB CI only to run different testings and to deploy automatically sphinx docs to gitlab pages

#

it would be cool to learn how to deploy too

supple venture
#

Not sure if gitlab and GitHub CIs are related, but you can have a look at @rancid schooner ‘s source, we use k8s to deploy the containers

#

Or any other pydis projects

uneven dagger
#

Does anyone have any insight into what is going on with anaconda? It's going on 6 months since the last release, which is the longest span between releases in years.

tawdry needle
still hound
#

What is devops?

tawdry needle
# still hound What is devops?

developer operations. basically stuff related to deploying software and other things that help software developers do their jobs.

rapid sparrow
#

Devops can build the pipline 👆
Making it more or less fully automated

frozen steeple
#

datetime module by default lists values in utc right?

supple venture
rapid sparrow
#

testing/deployment with load_dotenv becomes much easier

junior linden
#

Hey guys,

is someone here who has Python running in conjunction with a linter and code formatter in a Docker container and is ready to help me with my setup? (VSCODE Remote Container)

Thanks! 🙂

scarlet crystal
#

Is it possible to keep kivy app run in Android background ? For example, I want my kivy app to do smth each hour, so I must keep the service run in background to check the time.....

frozen steeple
tawny temple
#

You need to include the Python interpreter somehow. That could be by installing it normally, or by bundling it with the app into a single package, like what pyinstaller does. There are also some more out of the box ideas like Nuitka, which links your app against libpython.

#

You can look into containerisation, which makes it easier to deal with installing a Python environment for deployment.

#

I don't have much experience with turning Python to a binary executable, but I feel that it would just add more steps to the pipeline and more reasons for your app to somehow break, so I'd personally avoid it for production deployment given that it's possible to be in full control of the environment.

floral smelt
#

Hello there. I've been using Docker fairly often for my Python images and I couldn't help but notice Docker took a lot of disk space despite me pruning my containers and images not long after I've been using them. Is this normal? What's happening behind WSL 2?

#

Docker is awesome when I'm having compatibility issues, but I just wish the memory purging would be smoother.

tawny temple
#

What is taking up the space? You can check with docker system df

night quest
night quest
floral smelt
tawny temple
#

I suspect it might be a volume in your case 🤔

#

The other common reason is that you have intermediate layers saved from old builds. But if you're not building images a lot, then that should not be a concern.

#

And of course, the base images themselves use up some space, but not that much.

floral smelt
#

Probably because I was struggling with database creation through my ORMs. I tried the factory pattern with create_app() but I always need to refresh my Flask app twice so the creation works, then open flask shell and use db.create_all()

tawny temple
#

Next time you see high disk usage, run that command to see a breakdown of what's using up disk space.

#

You can run it with -v to see a more detailed breakdown

#

But yeah, building often can really kill your disk space quickly.

#

Especially if your Dockerfile isn't optimally using layers, meaning you end up rebuilding large layers and having a bunch of old versions of those layers still saved.

floral smelt
#

Unfortunately yes. I'll take that in mind next time I'm building my Python backend

frozen steeple
#
  File "main.py", line 21, in <module>
    print(gethumantime(givendt))
  File "main.py", line 6, in gethumantime
    time = realdt.strptime(time,None)
TypeError: strptime() argument 2 must be str, not None```
#
def gethumantime(time: str):
  time = realdt.strptime(time,None)
  humantime = dt.strftime('%A, %b %d %I:%M:%S')
  return humantime
frozen steeple
#

My goal is to convert a string into a datetime

mint tusk
#

Hey guys. Not sure if this is the right place for this but I just wrote a quick script that pulls some info from a database hosted on my local machine. It loops over a list of like 20k tables and pulls some info from each one. The first time I ran it it took maybe 10 minutes to complete. Then I ran it again and it took maybe 30 seconds. I noticed the 2nd time it didn't access my C: drive at all, and the first time it ran my C: drive was maxxed out at 100% the entire time. I'm wondering what happened here and if there's anyway to take advantage of that behavior in the future

#

nvm found it

rough marlin
#

Does python generally get installed as python rather than python3?

rapid sparrow
rough marlin
#

What about OS X?

rapid sparrow
#

no idea. never used OS X

supple venture
#

on linux, it gets installed as python3 if there is no python, if you have python3.6 as python3, and you wanna install python3.8, it would be installed python3.8

#

so it depends from case to case

#

that's what i have seen, not sure if that's what actually happens

rough marlin
#

this is a lot more complicated than I thought. I'm trying to update onboarding documentation for a library.

shy locust
#

Hey guys, got a question about kms keys in AWS, does the default aws managed alias keys always exist in each account by default, and there's no way to get rid of them, only remove permissions for those keys?

E nvm I got my answer, can't get rid of them

crude summit
#

Hi, I have been stuck at one problem for a while and I need your help guys.

#

I'm new to regex and I'm unable to parse addresses with it

#

I'm working on text extractor that extracts address for helping people who are affected by Covid

#

but I'm having a hard time figuring it out how to extract addresses with it

#

Real Example Addresses:

Apollo hospitals jublihills , Hyderabad
Location :Mata Roop Rani Maggo Hospital, Uttam Nagar, Delhi
Address: Yashoda Hospital Somajiguda.
Address: Rama Hospital, NH-9, Delhi-Meerut Expressway, Near Mother Dairy Pilkhuwa, Hapur (Ghaziabad)
Hospital: Pinnacle Hospital
Hospital name: medicover arilova
Hospital : Sparsh Malhotra Hospital Location: Agra
Suyash hospital raipur
floral smelt
#

Depends how the format is for the addresses.