#tools-and-devops

1 messages Β· Page 58 of 1

night quest
#

I cannot help 😞 I haven't tried yet to package Python

knotty kettle
#

That’s ok thanks!

keen gull
#

Are there any pycharm users here?

sly sleet
#

@olive warren it won't be on pip because that's only for python packages

#

either do what mark said

#

@wise scarab uh why do you need to unzip the wheel anyways

#

@keen gull whats your question

#

around half the server uses pycharm

#

anyone can answer your question

#

if you actually bothered to ask it

keen gull
#

I use a terminal that allows to run python scripts and they provide a sdk file that mimics the calls available in the terminal. How can I import that sdk file into my project in pycharm?

warm pollen
#

Hello wonderful people, I'm trying to upload a package to the Test PyPi repos with poetry, but it is failing with a HTTP Error 405: Method Not Allowed and I'm not sure why. I am using those two commands:

poetry config repositories.testpypi https://test.pypi.org/simple/
poetry publish --build -r testpypi -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }}```
Any help would be really appreciated! 

Full workflow: <https://github.com/Akarys42/bestpy/blob/f3614a85f45f9cb6e30759304eccbff93a1bdc01/.github/workflows/publish.yml>
CI output: <https://github.com/Akarys42/bestpy/runs/1576826297>
warm pollen
#

Solved it, if you are wondering I had to use the legacy endpoint

cloud elbow
#

I created feature branch, made changes, commited a few changes.

merged into main. I pushed it to remote server

is it possible to go back and squash those changes in feature branch?

stable cloak
#

Running into an annoying issue with Sublime Text 3. Whenever I open a new window, it spans across all 3 of my monitors. Just a big ass window. Any way to fix that?

stable cloak
#

If anyone else has encountered this or found a fix, ping me please. Will be away from my computer for a while

wise scarab
#

but I have arch linux for unzip .whl. I tried test demo with python.

#

I have 7-zip on python but 7zip not found in command line.

pallid wing
#

If you create a python env using conda and a custom file path, is there any way to give it a tag for conda activate instead of putting whole path?

undone tangle
#

how to get a json file

heavy knot
undone tangle
#

i solved it i just dumb

#

just need to add.json

heavy knot
#

lol

#

it's fine

ruby nebula
#
from bs4 import BeautifulSoup
import time

url = ('https://google.com')

r = requests.get(url)

soup = BeautifulSoup(r.content, 'html.parser')

g_data = soup.find("div", {"class": "play-video"})

print('Link:',g_data.replace('src',''))```



im getting a "TypeError: 'NoneType' object is not callable" error when running, i think its because of the text replace part but im still not sure how to fix it, can anyone help?
mortal cosmos
#

@ruby nebula can you print the whole traceback?

ruby nebula
#

yeah hold on

#

Traceback (most recent call last):
File "C:\Users\puddl\Downloads\pyhtondads\notepad4.py", line 13, in <module>
print('Link:',g_data.replace('src',''))
TypeError: 'NoneType' object is not callable
[Finished in 0.9s with exit code 1]

btw line 13 is the last line

#

@mortal cosmos

mortal cosmos
#

add a print(g_data) before the last print

ruby nebula
#
from bs4 import BeautifulSoup
import time

url = ('https://google.com')

r = requests.get(url)

soup = BeautifulSoup(r.content, 'html.parser')

g_data = soup.find("div", {"class": "play-video"})
print(g_data)
print('Link:',g_data.replace('src',''))```
so like this?
mortal cosmos
#

yes, the idea is just to prove that g_data is None, because soup.find() probably did not return anything

ruby nebula
#

g_data is something tho

#

i tested it

mortal cosmos
#

Ok, but .replace() is a string method, so g_data may not be a string.. yet. try

print('Link:',str(g_data).replace('src',''))
ruby nebula
#

ok i will, thanks

#

IT WORKS! now\ that im thinking about it i totally didnt think of that, thanks so much man

slow nova
#

what do you guys think of this concept?
https://stackstr.io/
StackStr
AI o11y
For monitoring real-time metrics from models over time

agile thorn
#

Thanks all, I fixed my problem

obtuse saddle
#

I do dev both on laptop and desktop. I enjoy the "setting sync" Pycharm feature, but it seems it doesn't sync my plugins, so I have to curate my plugin list separately on both installation.

#

Is there any solution to that?

#

Okay, apparently the problem is that setting sync supports plugin, but setting repository doesn't. Weird.

heavy knot
#
for i in range(10000):
    exec(f"a{i} = {i}")

print(a42)
``` for some reason its telling me the variable is not defined
#

in vs code

sly sleet
#

@heavy knot because pylance does static analysis

#

and it can't tell that the exec will create 10000 variables just by looking at the code

heavy knot
#

oh ok thanks

sly sleet
#

generally these types of things shouldn't come up at all in actual prod code

heavy knot
#

what does "prod" mean?

sly sleet
#

production

#

so there's no benefit to implementing it anyways

heavy knot
#

I have a question, please @ me if you have answer. Is it possible to deploy a python console application?

#

I have a couple of modules it needs to run, but other than that the only requirement is python 3.8 or better

sly sleet
#

define "deploy"

#

like package into an executable?

#

@heavy knot

heavy knot
#

Executable @heavy knot

#

Or both tbh

stark cave
#

i got two files, neither with .extentions.
On the left, pycharm does this cool highlighting of the file.
On the right, pycharm reads it like a normal text file.

poorly worded question: how do i get pycharm to change how it looks a file?

livid swallow
#

Question - Just starting to learn and using VS Code. When I do my opening ( or ' or ", it also autopopulates the ending character. Do you just have to press End to get to the end of the line or is there a key I can use to act as Enter/Return to go to next line without putting my closing ) or quotes on the new line too?

pliant anchor
#

thats just python

#

you may have to read the manual or docs for pycharm

#

i will find a link for you

#

thats why u need to understand and know your tool first

#

goodluck learning ❀️

limpid stag
#

Hi, I’m also a noob coder with little python knowledge. I’m wondering what are some very good tools/videos/websites, that are free, I could use to learn more. I’m open to anything, as long as it isn’t sketchy.

candid kayak
#

!resources check these out

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.

limpid stag
#

Thanks for this, anymore options?

candid kayak
#

i'd recommend https://realpython.com/ , they have a lot of content on many topics, really well made.
also, this channel isn't really for this, so maybe continue this conversation in #python-discussion or an off-topic channel

limpid stag
#

Ooh, whoopsies. But thank you very much, trying to get all I can get my hands on.

lament gust
#

which gui framework should i use? Like kivy, django, Tkinter or what else? to code a bot or monitor for cookgrous (reselling)

heavy knot
#

anybody here knows python, gitops, kubernetes, ansible and json files?

wanton oriole
#

I am started on trying to lear how to use tkinter for GUI programming. Any tips and guide on how to learn it the right way [eg: resources, tips]

candid kayak
#

does anyone have any good article/tutorial on how to use sphinx?

heavy knot
#

anyone familiar with dockers

rich nymph
#

Hey I have installed the Discord Rich Presence Extension on vsc, but it still is not showing me playing a game.
Does anybody know why?
And how i can fix that

pallid notch
rich nymph
#

just because i want to

rich nymph
pallid notch
#

ahh

#

didnt even know there Discord rich XD

rich nymph
#

not helpful

heavy knot
night quest
candid kayak
#

ah, i should probably go through it too again πŸ˜„

#

thank you!

night quest
#

Maybe there is some video tutorial or something but I am using official resources if it's possible πŸ™‚

thin warren
#

Hey guys, I have some questions concerning FTP server, I am in the right topic ?

dense pelican
#

hello guys, I need a help with pyinstaller. my application(PyQt5) doesn't have window, but is not a console app... it's only a system tray and a menu. the packaged application works fine in console mode, but it crashes in window mode. I've tried all possibilities to build the package that I found in doc, without success. In debug mode, I have no error, no stdout even stderr messages.. it's running smooth, but when I build it in windowed mode, I get the error: 'Failed to execute script...'

heavy knot
#

anybody here familiar with kubernetes, ansible and gitops?

potent shard
#

someone now why im getting this error after compiling a pyarmor obf script? like the first part of the script runs good but then i got this

fair pasture
#

Guys any one use nerd tree

restive roost
#

Not sure if its the corrrect section

#

but i have a prolem with importing modules from pip into sublime text

#

can anyone help me with it

calm crystal
#

Is it okay to ask about Windows' WSL2 here?

#

Okay from the description of this channel, this seems to be the right place.

#

If I start a service(SSH server, flask, etc) within WSL2 I can;t access it from other machines. This is a known issue: https://github.com/microsoft/WSL/issues/4150

So, I have this script (from here https://github.com/microsoft/WSL/issues/4150#issuecomment-504209723 ) which forwards the IP address of WSL2's virtual network adapter to Windows:

$remoteport = bash.exe -c "ip addr | grep -Ee 'inet.*eth0'"
$found = $remoteport -match '\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}';

if( $found ){
  $remoteport = $matches[0];
} else{
  Write-Output "The Script Exited, the ip address of WSL 2 cannot be found";
  exit;
}

#[Ports]

#All the ports you want to forward separated by comma
#Added 1883 for MQTT
$ports=@(80,443,1883,8083,8883,10000,3000,5000);


#[Static ip]
#You can change the addr to your ip config to listen to a specific address
$addr='0.0.0.0';
$ports_a = $ports -join ",";


#Remove Firewall Exception Rules
Invoke-Expression "Remove-NetFireWallRule -DisplayName 'WSL 2 Firewall Unlock' ";

#adding Exception Rules for inbound and outbound Rules
Invoke-Expression "New-NetFireWallRule -DisplayName 'WSL 2 Firewall Unlock' -Direction Outbound -LocalPort $ports_a -Action Allow -Protocol TCP";
Invoke-Expression "New-NetFireWallRule -DisplayName 'WSL 2 Firewall Unlock' -Direction Inbound -LocalPort $ports_a -Action Allow -Protocol TCP";

for( $i = 0; $i -lt $ports.length; $i++ ){
  $port = $ports[$i];
  Invoke-Expression "netsh interface portproxy delete v4tov4 listenport=$port listenaddress=$addr";
  Invoke-Expression "netsh interface portproxy add v4tov4 listenport=$port listenaddress=$addr connectport=$port connectaddress=$remoteport";
}

This script runs post user login at startup through the Win Task Scheduler. So it opens up a powershell window, but this can take somewhere from 2-10 minutes to execute. Until then I have to stare at the blank blue screen of Powershell. Sometime I close the Powershell window and execute the script on my own.

#

Some thing I have observed: If I stay at the post-PowerOn login screen of Windows for ~5 minutes, the script is executed faster, around 10s after login and sometimes the script has already been executed when I login.

Possible Reason: I think this is happening because other services are being prioritised by windows. Maybe I need to increase the script's priority, so its executed before some other services are started.

Does anyone have any ideas how I can make sure this script is executed fast/earlier?

#

Please @ me if someone can figure this out^

wicked robin
#

this is Python (the language), not FTP support.

sly sleet
#

!ot

rancid schoonerBOT
wooden ibex
#

WSL was never designed to be Linux server. It’s Linux development environment

limpid stream
#

Hello, may I ask something? Does wsl could be installed in gaming laptop?

#

because I think linux is not compatible with gaming laptop

sly sleet
#

yes

#

wsl doesn't require any special features afaik

tawny temple
#

As far as I can tell, the only hardware requirement is an x64 or ARM CPU - which virtually any new PC sold will have these days.

#

Other than that, if your laptop supports Windows 10 1607 or later then it supports WSL.

limpid stream
#

hmm i see, thanks!

rich nymph
#

Hey so in vsc how can I check where a specifc object is being used across the entire project?

tight haven
#

I m using vscode instead of jupyter notebook,where i convert the jupyter interface to a simple python script and add cells using the percent markdown using jupytext

#

The problem is notebook to script conversion works successfully but script to notebook conversion doesn't add the newly addded cells to the notebook

#

I tried pairing syncing updating but still it doesn't update the cells

#

Any reason why this might be happening?

tranquil creek
rich nymph
#

which I didn't know before

tranquil creek
mild bloom
#

i think its the good chan

#

I have a project to make a voice assistant with python, so I found a piece of code that I'm modifying, shortening, enlarging and all, and what I want to do is that my assistant starts listening to me when I tell him the word that calls him so for me: Hey Bob.
https://pastebin.com/sed4PuNZ

#

pls @ me if you know

heavy knot
#

is there any guide for the module mem-edit?

sly sleet
sharp geyser
#

Finally I understand PEP517/518. I didn't know that package building process now creates isolated environments with exact build dependencies installed as configured in pyproject.toml. This is so neat.

#

Unfortunately there're uncovered cases of frontend/backend interactions. E.g. pip as a frontend, when invoked as pip install -e ., doesn't actually use backend (like flit) and requires setup.py to exist. Of course in case of flit I must use flit install --symlink, but I had to rant about another case of leaky abstractions.

narrow folio
mild bloom
#

hi i want to make a vocal assist, i use pyttsx3 and speech recognition, i want if i say the code to start like HEY GOOGLE, how to do that ?

#

and add action after like Hey Google wath the weather like and other

tiny shuttle
#

Hey dumb question: is there any way to get Sublime text to have goto definition also look inside imported packages installed in, well, wherever pip installs stuff

#

Oh okay i figured it out i need to do add folder to project

#

\o/

mild bloom
#

someone can help me about pymiere ?

torpid pendant
#

Hey guys how do I stop this

#

its in an inifinite loop and since its no terminal I cant CTRL C

#

well done CTRL ALT M i forgotthe name of my extension

mild bloom
#

alt f4

heavy knot
#

Hello

#

I am trying to add docstrings to my code

#

and I am using the sphinx template

#

:rtype: [type]

#

there is this element

#

but

#

I need to replace [type] with an actual type

#

the function returns a class

#

so can I just type

#

the name of the class?

#

or do I need to type something like

#

:class: MyClass

#

I am new to docstrings

#

Thanks in advance πŸ˜„

#

and what if it can return different classes

leaden tartan
#

Is there a tool that can help me run multiple development servers easily?
Right now I use this script but it comes with a lot of issues (example: I can't stop the servers once I am done with them):

#!/usr/bin/env bash

# Start the django development server
cd /home/vagrant/bynkc/bynkc
python3 manage.py runserver 0.0.0.0:8000 > /home/vagrant/bynkc/bynkc-backend.log 2>&1 &

# Start the nuxtjs development server
cd /home/vagrant/bynkc/bynkc-frontend
npm run dev > /home/vagrant/bynkc/bynkc-frontend.log 2>&1 &

# Start the documentation development server
cd /home/vagrant/bynkc/bynkc-docs/website
npm run start > /home/vagrant/bynkc/bynkc-docs.log 2>&1 &
rigid vapor
leaden tartan
#

I could use them, but i also need django and npm's hot reload option. Could nginx support that?

#

@rigid vapor

rigid vapor
#

I mean it calls your django server, its just working as a reverse proxy n stuff. So afaik yes

leaden tartan
#

ok thanks will try it out

old rose
hearty basin
#

Hi, Guys. Just been playing around with CUDA and OpenCV. Since you have to build from source OpenCV inorder to use the GPU CUDA, if say you would want to package the application using PyInstaller afterwards, would this then be useable if i distribute the application to other systems that have CUDA (same version) out of the box?

#

Or am i missing something here

heavy knot
#

how can help me to bypass cloudflare pls

sly sleet
#

!rule 5

rancid schoonerBOT
#

5. Do not provide or request help on projects that may break laws, breach terms of services, be considered malicious or inappropriate. Do not help with ongoing exams. Do not provide or request solutions for graded assignments, although general guidance is okay.

heavy knot
#

#help-chestnut if someone is able to help me. some users wrote something but then stopped responsing...

plain ravine
#

anybody who can make this run for me?

mild bloom
#

Heu, no because its a cheat

#

!rule 5

rancid schoonerBOT
#

5. Do not provide or request help on projects that may break laws, breach terms of services, be considered malicious or inappropriate. Do not help with ongoing exams. Do not provide or request solutions for graded assignments, although general guidance is okay.

crude palm
#

Hey guys I want to encode a quote into ascii, how would I do that without having to encode one character at a time. this is my code so far

#
def main():
    print(ord("We've all got both light and dark inside us. What matters is the part we choose to act on. That's who we really are."))
main()
heavy knot
#

You can do that using a for loop

#

For I in string: lst.append(ord(i))

slow hollow
#

Anyone know nexus

night quest
cloud elbow
#

so I created new branch to test a feature,

there are modified and unstaged files.

now I am done and don't care about this branch. how do I delete it completely?

honest cairn
#

git branch --delete <branch name>

cloud elbow
#

but unstaged files?

#

will all be gone?

#

cause I want them to be

#

well, your solution sucks

tawny temple
#

What's the problem with that solution?

honest cairn
cloud elbow
#

not with the unstaged files modified files

#

it was very spesific question

tawny temple
#

Try this: ```sh

Assuming that you currently have the branch to delete checked out.

git reset --hard
git switch master
git branch --delete <branch name>

#

The reset will delete staged and unstaged files

#

The switch is necessary because the branch cannot be deleted if it's currently checked out

safe mantle
#

Hey Does anyone know aboutGit lfs?

crimson stump
#

@safe mantle what do you want to know?

arctic flicker
#

how can i restrict pycharm from opening a tab to the external module that threw the error?

stable olive
#

Hey

wintry arch
#

can anyone explain me what are refspec in git?

rancid schoonerBOT
#

Hey @wintry arch!

It looks like you tried to attach file type(s) that we do not allow (.pdf). We currently allow the following file types: .3gp, .3g2, .avi, .bmp, .gif, .h264, .jpg, .jpeg, .mkv, .mov, .mp4, .mpeg, .mpg, .png, .tiff, .wmv, .svg, .psd, .ai, .aep, .xcf, .mp3, .wav, .ogg, .webm, .webp, .flac, .afdesign, .m4a, .csv.

Feel free to ask in #community-meta if you think this is a mistake.

wintry arch
tawny temple
#

A refspec is a formation specification for repository references

arctic musk
#

hey guys, so this is a very blatant and basic question: How do you round a result (in terms of numbers)

tawny temple
muted cobalt
tawny temple
#

Because depends_on is naΓ―ve and just makes sure the db container is started

#

Of course starting the container β‰  the database being ready

#

A common workaround I've seen is to have the API container poll the database to make sure it's ready before starting the web server

muted cobalt
#

Using a healthcheck?

#

Happy new years πŸ‘

tawny temple
#

Thanks

#

No, not a healthcheck. You'd need to write your own code to poll it - Docker can't really do this afaik

tawny temple
muted cobalt
#

Alright, I'll add a system for it to retry the db connection x amount of times

kind veldt
#

How can you talk in chats?

desert night
#

I am following a blockchain tutorial in python. I am gonna use flask but I don't want it in my system so I decided to use a virtual environment for that(I will remove the project from my system after it's done). In addition to that I need a mysql server. This mysql server will run on a docker container. These two technologies are fairly new to me and I want to use them for learning purposes but I am not sure how the structure should be. Should I run blockchain on my host and mysql on a container or both on a single container? What is the best practice?

sly sleet
#

run both in separate containers

#

@desert night

#

if you're using containers, you always want to have 1 service/container

desert night
#

oh okay thank you

#

can I create those containers in a single dockerfile?

sly sleet
#

no

#

each dockerfile is for a separate container

#

use docker-compose for multiple containers

desert night
#

okay thank you very much

restive wren
#

does anyone use repl.it here? i need help

cloud elbow
#

regex for any path that starts with /mnt/ and ends with /npm

can be

/mnt/c/nodejs/npm
or
/mnt/c/whatever/w/w/npm

shy egret
#

I'm wanting to write a python 3 script to SSH into a remote server and then tail a given log file. I was thinking of just using Paramiko to connect and then running the usual tail -f command on the system. Is there anything intrinsically wrong with this approach?

tawny temple
shy egret
#

I'm adding this feature to a larger CLI toolkit written in python, otherwise I think that'd be the way to go

tawny temple
#

Okay, that makes sense.

shy egret
#

Thanks for your input

edgy maple
#

so my friend gets an error of:

running sdist
running check
warning: sdist: manifest template 'MANIFEST.in' does not exist (using default file list)

warning: sdist: standard file not found: should have one of README, README.txt, README.rst```
#

he ran: python setup.py sdist

sly sleet
#

@edgy maple whys he running setup.py in the first place

#

does pip install not work

edgy maple
#

yes

sly sleet
#

wait a minute

#

whys he using distutils

edgy maple
#

hm?

#

he's following the guide..

sly sleet
#

setuptools is better

edgy maple
#

setuptools?

#

it's pretty much the same thing right and it's built in?

sly sleet
#

setuptools is a 3rd party

#

should be a drop-in replacement for distutils

edgy maple
#

but wouldn't people need to install it?

#

by pip?

sly sleet
#

doesn't pip depend on setuptools or something

edgy maple
#

so the pip commands already downloads it right?

ember lagoon
#

it should be default

edgy maple
#

alright

#

so import setuptools right?

ember lagoon
#

what happened to LuigiDancer94?

edgy maple
#

what?

ember lagoon
edgy maple
#

He'll need to move over:

setup(
  name = 'asuna_api',
  packages = ['asuna_api'],
  version = '0.1', 
  license='MIT', 
  description = 'An async python wrapper for the asuna api',
  author = 'JDJGIncOfficial',
  author_email = 'jdjgbot@gmail.com',
  url = 'https://github.com/JDJGInc/asuna_api',
  download_url = 'https://github.com/JDJGInc/asuna_api/archive/0.0.02.tar.gz',
  keywords = ['wrapper', 'api', 'random'],
  install_requires=['aiohttp','yarl'],
  classifiers=[
    'Development Status :: 3 - Alpha',      # Chose either "3 - Alpha", "4 - Beta" or "5 - Production/Stable" as the current state of your package
    'Intended Audience :: Developers',      # Define that your audience are developers
    'Topic :: Software Development :: Build Tools',
    'License :: OSI Approved :: MIT License',
    'Programming Language :: Python :: 3',
    'Programming Language :: Python :: 3.4',
    'Programming Language :: Python :: 3.5',
    'Programming Language :: Python :: 3.6',
    'Programming Language :: Python :: 3.7'
  ],
)
sly sleet
#

eh not really

#

just replace the import

edgy maple
#

not sure about [metadata]
description-file = README.md

sly sleet
#

since it should have back-compat

edgy maple
#

for the .cfg

#

so setuptools.setup ?

#

so from setuptools import setup?

#

that's it?

sly sleet
#

yeah

edgy maple
#
setup(
  name = 'asuna_api',
  packages = ['asuna_api'],
  version = '0.1', 
  license='MIT', 
  description = 'An async python wrapper for the asuna api',
  author = 'JDJGIncOfficial',
  author_email = 'jdjgbot@gmail.com',
  url = 'https://github.com/JDJGInc/asuna_api',
  download_url = 'https://github.com/JDJGInc/asuna_api/archive/0.0.02.tar.gz',
  keywords = ['wrapper', 'api', 'random'],
  install_requires=['aiohttp','yarl'],
  classifiers=[
    'Development Status :: 3 - Alpha',      # Chose either "3 - Alpha", "4 - Beta" or "5 - Production/Stable" as the current state of your package
    'Intended Audience :: Developers',      # Define that your audience are developers
    'Topic :: Software Development :: Build Tools',
    'License :: OSI Approved :: MIT License',
    'Programming Language :: Python :: 3',
    'Programming Language :: Python :: 3.4',
    'Programming Language :: Python :: 3.5',
    'Programming Language :: Python :: 3.6',
    'Programming Language :: Python :: 3.7'
  ],
)```
#

so this?

sly sleet
#

i think setuptools should work with setup.cfg

edgy maple
#

πŸ€”

#

okay

sly sleet
edgy maple
#

does he need to make a new github release for this change?

sly sleet
#

normally most packages only github release whenever the package version gets bumped

edgy maple
#

or do I only need to worry about it?

sly sleet
#

but your package hasn't been uploaded yet

#

so you dont really need to even release at all

edgy maple
#

it uploaded earlier

#

there's one version for the pip

#

the main issue is trying to deal with the no description

#

he's trying to use the READme.md page for the description there

sly sleet
#

oh

#

cant you just use long_description or whatever its calle

edgy maple
sly sleet
#

hm you usually just open("readme.md") and then set that as the readme

edgy maple
#

which this one doesn't have such issue

sly sleet
edgy maple
#
    long_description = f.read()```
```long_description=long_description,
    long_description_content_type="text/markdown",```
#

that only?

#

wait what about setup.cfg?

#

does he get rid of it now?

sly sleet
#

so yeah you only need the long_description in setup.py

edgy maple
#

so he can yeet it?

sly sleet
#

yep

edgy maple
#

so he can run python setup.py sdist again?

#

btw he's using windows

sly sleet
#

yeah

edgy maple
#

he created:

writing asuna_api.egg-info\PKG-INFO
writing dependency_links to asuna_api.egg-info\dependency_links.txt
writing requirements to asuna_api.egg-info\requires.txt
writing top-level names to asuna_api.egg-info\top_level.txt
writing manifest file 'asuna_api.egg-info\SOURCES.txt'
reading manifest file 'asuna_api.egg-info\SOURCES.txt'
writing manifest file 'asuna_api.egg-info\SOURCES.txt'
running check
creating asuna_api-0.2
creating asuna_api-0.2\asuna_api
creating asuna_api-0.2\asuna_api.egg-info
copying files to asuna_api-0.2...
copying README.md -> asuna_api-0.2
copying setup.py -> asuna_api-0.2
copying asuna_api\__init__.py -> asuna_api-0.2\asuna_api
copying asuna_api\client.py -> asuna_api-0.2\asuna_api
copying asuna_api\http.py -> asuna_api-0.2\asuna_api
copying asuna_api\image.py -> asuna_api-0.2\asuna_api
copying asuna_api.egg-info\PKG-INFO -> asuna_api-0.2\asuna_api.egg-info
copying asuna_api.egg-info\SOURCES.txt -> asuna_api-0.2\asuna_api.egg-info
copying asuna_api.egg-info\dependency_links.txt -> asuna_api-0.2\asuna_api.egg-info
copying asuna_api.egg-info\requires.txt -> asuna_api-0.2\asuna_api.egg-info
copying asuna_api.egg-info\top_level.txt -> asuna_api-0.2\asuna_api.egg-info
Writing asuna_api-0.2\setup.cfg
creating dist
Creating tar archive
removing 'asuna_api-0.2' (and everything under it)```
#

he got that

#

also he asks if he should upload the manifest file the program generates

#

he says it doesn't seem to hav emade one lol

#

is that a good or bad thing?

#

@sly sleet thank you πŸ˜„

heavy knot
#

Hello. I need a help. I hope this is appropriate channel to ask. I was googling without luck a lot, so please help me figured out here.......

I am coding in Atom. And I have autocomplete-plus enabled, cause I like suggestions, but I am facing a problem here. Whenever I type first 3 words and the pop-up with suggestions shows up, I let's say select a suggestion and insert it with Tab or Enter (depend o settings, but I try them all with no difference), the suggested word just append on the end of my first 3 words typed, and its useless cause then I need to delet those first 3 words, so I have even more work to do....

I hope I explain clearly enough..... So, let's say I type : pri, then pop-up shows up, I select "print", and instead of replace my first 3 words with "print", atom do - priprint..........

Tnx in advance for help....

graceful patio
#

weird

heavy knot
#

Hey, I'm having a small hiccup in trying to set up a git server with Apache. I have a test repo on my server, but attempting to clone it gives a 403 error. There is some documentation about how to do this, chiefly at https://git-scm.com/book/en/v2/Git-on-the-Server-Smart-HTTP. The issue I'm having is, I think, a result of how my domain is set up. I decided not to set up my git server at <domain>/git, but instead at git.<domain>. I also host my personal website at this domain. This means that I have two directories named <domain> and git.<domain> in /var/www/html. I also have two .conf files, <domain>.conf and git.<domain>.conf in /etc/apache2/sites-available. The <domain>.conf file is pretty standard, as is the git.<domain>.conf file, with the exception of the inclusion of these lines:

SetEnv GIT_PROJECT_ROOT /var/www/html/git.<domain>
SetEnv GIT_HTTP_EXPORT_ALL
ScriptAlias / /usr/lib/git-core/git-http-backend/

I suspect that the issue is in either the first SetEnv or the ScriptAlias, but I'm stumped. I have confirmed that the issue is not with file permissions, and changing the / in the ScriptAlias to anything else causes a simple repository does not exist error. I have also confirmed that the test repo is functional, as cloning it via SSH works completely fine.

<domain> is just a placeholder for the actual domain, as I have yet to implement any security, and don't want to reveal an insecure domain.

zinc marlin
#

I'm looking for a cross-platform solution that manages Python even when it's not present initially and the Python virtual environment. Normally most people would suggest freezing the program but for my type of application that's really not a feasible solution. The closest I found is pyflow https://github.com/David-OConnor/pyflow. Any suggestions?

tawny temple
zinc marlin
tawny temple
#

Yeah, get conda through miniconda rather than Anaconda. Those are just distribution names, but conda is the actual tool.

twin hull
#

Hello, is possible to directly clone a repo with the head at a specific commit?

#

not working git clone https://github.com/author/repo/sha1_commit.git

night quest
twin hull
#

thanks, actually it seems I'm reinventing the wheel, in that case git submodules

night quest
twin hull
#

yeah but I wasn't using it at first πŸ˜… submodules is exactly what I need

stable veldt
#

Base10 is for the weak

pearl tapir
stable veldt
#

lol

muted cobalt
muted cobalt
#

Image is what he wanted us to use

tawny temple
#

I believe the only difference is whether you prefer to interact with docker directly through its CLI or through YAML.

muted cobalt
#

The YAML version sure looks much cleaner

#

What I dont understand at the moment is the correct way to migrate

#

Where do I look for the correct syntax to do it like we've done it

#

@tawny temple

#

I think I got it

wooden ibex
#

I mean, you should use Docker Compose

exotic ember
#

Hello people, could you please advise, do you use Atom for Python coding?

night quest
#

And I can recommend this IDE

#

There is free version too

exotic ember
night quest
#

It's all-in tool

#

You can easly create venv to manage multiple projects, create run actions and don't even open terminal πŸ™‚

exotic ember
night quest
#

Your welcome!

heavy knot
#

Hello, I am into system/platform automation, would like to read good python code with sys, os ,re, requests, shutils and similar related modules that would help me in my job and career, what code/repos would you advise me to check? I was thinking maybe Ansible? or is there like an awesome list for sre/devops/automation/system-engineering?

buoyant atlas
#

Hello, is this good place to ask about CLI tools?

rich nymph
#

so i have a file which is supposed to create the tables for the db, but how would i run that file in docker?

desert night
#

@rich nymph volumes: - ".data/mysql:/var/lib/mysql" - "./dump/:/docker-entrypoint-initdb.d"

#

I store these files in "dump" directory and mount it in the docker like that

#

if you want to run them at start up ofc

rich nymph
#

huh?

#

i am confused

#

i couldn't figure out how to do it so i decided to add another RUN psql -d rationals -f db/init.sql in dockerfile

#

btw this is my docerk-compose

version: "3.8"

services:
  postgres:
    image: postgres:latest
    init: true
    restart: always

    environment: 
      postgres_db: ...
      postgres_user: ...
      developer_password: ...
    
    env_file:
      - ./.env

    expose:
      - 5432

    volumes:
      - ./db/init.sql:/docker-entrypoint-initdb.d/init.sql

  Rationals:
    container_name: Rationals
    init: true
    restart: always

    depends_on:
      - postgres

    env_file:
      - ./.env

    build:
      context: .
      dockerfile: Dockerfile

    volumes:
      - ./logs:/Rationals/logs:rw
      - .:/Rationals:ro

    ports:
      - "5005:5000"
desert night
#

after database created

rich nymph
#

yes

desert night
#

then make a directory in your host

rich nymph
#

huh

desert night
#

then mount it at /docker-entrypoint-initdb.d

rich nymph
desert night
#

nvm go to the directory in which docker-compose resides

#

then make a directory

#

place these sql files in there

#
      - ./db/init.sql:/docker-entrypoint-initdb.d/init.sql```
#

this should be

#
      - ./db/:/docker-entrypoint-initdb.d/```
rich nymph
#

why?

desert night
#

you cannot mount to a file

rich nymph
#

ok first of all could u explain to me what's happening in volumes

desert night
#

you can mount to a directory

rich nymph
#

i don't get what u are saying

desert night
#

okay when you are creating a docker container it's like another computer but you need a way of sharing persistent data

#

so say hey container I have this db directory I want to sync with your /docker-entrypoint-initdb.d/

rich nymph
#

ye the first part i understand but what is happening in volumes

desert night
#

if you don't use that volume thing. when container is removed the data is gone when you use "volume" container writes to "db" so db is always there when you create another container

rich nymph
#

ohh i see so one more question

#

do i simply do docker compose up?

desert night
#

read the man pages

#

docker-compose up --help

#

docker-compose --help

#

for general usage

rich nymph
#

i don't get it

#

@desert night could u please explain how i am supposed to run my containers now

desert night
#

docker is a complex technology, I get the impression that I am making things harder for you. I suggest that you find some good tutorial and read the documentation before getting into it. There is a huge learning curve

rich nymph
#

u are not making anything harder for me

#

i just don't understand how i am supposed to run the docker container

turbid phoenix
#

What are people using to host small python scripts/bots? I am currently spinning up containers for them but they aren't very resource heavy and it seems like a waste to have a separate containers for each script. Just looking for some options that people like/prefer.

wooden ibex
#

containers are best way to roll

#

but I don't use Python for scripts so I can't speak for that

timber silo
#

Hello, I have a question regarding GITHUB, i hope this is a good channel. I am having two branches master and test. I am trying to merge test into master, I've run git merge command and it merged the branches but only in my local repository, how do I push this into github?

#

Is it possible to merge github branches from command line or do I have to use the website?

#

Im so dumb.... Even though git status doesn't show anything after merging you just write git push and i works

heavy knot
#

can someone help me how to deploy fast api on a ubuntu server?

#

Any guides or anything?

#

Its a simple api (2 routes) which just has get requests, and doesnt need any authentication or anything for now.

#

On the fastapi documentation it says you can do uvicorn main:app --host 0.0.0.0 --port 80 but i was thinking if that is the correct way for production? And if that uvicorn thing is fast/slow or can be faster?

soft axle
#

I heard that PyCharm Professional has a free license for students, but it seems that they mean university students only. Is there any way for me to obtain a free license in secondary school? Thanks in advance.

heavy knot
#

Why do you need professional version?

soft axle
#

I don't need it as such, it's just that it's got a bunch of useful tools which the community edition doesn't have. It would be nice to get it for free though, if the option exists.

sly sleet
#

@timber silo just git push it to update remote

analog kettle
#

My coworker wrote a directory of Python files and she doesn't know what the dependencies are. Also I can't install it on my computer--I can only use it on an SSH connection. Is there a command line tool that determines (not necessarily with perfect accuracy) what the top-level dependencies of all the files in a directory are?

#

She just gave me a pip freeze of her whole python environment.

wooden ibex
#

Could maybe a linter could scan the code repo and report on all missing libraries?

analog kettle
wooden ibex
#

did that work well enough?

sly sleet
weak mulch
#

Hello

#

Is this the right channel to ask for PIL help?

floral olive
#

Hello, because I've already got Visual Studio for something else installed I've tried to set it up for python. Python support is installed, but it doesn't know async/await syntax. Does that work for you?

wooden ibex
#

it should

floral olive
#

Everything above 1GB is just annoying. Maybe the install is just damaged. It's not VS Code, but they should have the same language support.

sly sleet
#

@floral olive define "doesn't know"

#

lint error?

#

from pylint?

#

or is it a runtime error

shadow crow
analog kettle
shadow crow
#

Well, she known what libraries the project is using, right?

analog kettle
#

I haven't tried it yet because I'm glued to the coverage coming out of DC lemon_cut

shadow crow
#

how so πŸ‘€

nova igloo
#

hello I have a question concerning MYSQLCLIENT, does 64 bit version of python work ona 32 bit version of windows?

sly sleet
#

i dont see what that has to do with mysqlclient but ok

#

answer is no

#

@nova igloo

#

64 bit progams dont work on 32bit

floral olive
#

@sly sleet , VS underlines "def" after "async" and lists that as error "unexpected def". But it runs completely fine.

import asyncio

async def test():
    print("hello world")


asyncio.run(test())

sly sleet
#

@floral olive that aint vscode

#

visual studio is really shit for python

#

use a better ide

nova igloo
#

Thanks @sly sleet

floral olive
#

I've noticed it πŸ˜‚ Thanks, that was what I wanted to know. Like I wrote I don't want to have a bunch of 10GB IDEs on my disk. Than I will keep using Sublime Text or IDLE, or is there something lightweight and powerful?

sly sleet
#

hmm sublime should be fine if you're used to it

floral olive
#

It's a bit of configuration work. Like setting up running the script directly from the editor. Then I'm going to look a bit closer!

wooden ibex
#

Visual Studio is ok for Python but I would only use it if you are .Net developer normally

swift spindle
#

Anyone know of a tool to strip comments (TODOs and such) out of a python module before packaging? Or have any experience with minifiers?

sly sleet
#

why though @swift spindle

#

theres no point to trimming a few hundred bytes of comments at most

#

same for minifiers

swift spindle
#

Boss wants TODOs and such stripped out before packaging eyeroll

#

"For security"

sly sleet
#

wtf

#

if you want "obfuscation", you can use pyarmor or something

#

though security by obscurity is a bad idea

analog kettle
#

This code appears like 30 times in a directory I'm using:

                if "\t" not in line:
                    raise InvalidAnnotationError("Line chunks in ANN files are separated by tabs, see BRAT guidelines. %s"
                                                 % line)

I never want that exception to be raised, so I want to insert continue between line: and the line break

#

is there a fast way to do that from bash?

#

(this is in a for loop btw)

warm pollen
#

Hmm

#

Can't you just use the replace feature of your IDE?

#

It will be easier for sure

mild lance
#

Hey guys, I'm not really sure where to put this, but I have no idea how to use macOs ( lemon_sweat I really only know how to use *nix os'), but would I just brew link --override node? What does that do and are there any negative consequences

For preface, node seems to be already installed from something else, but it's a very old version and I deleted everything related to node that I could find. I want to reinstall it with homebrew, which is what I'm doing now

mild lance
#

sudo rm '/usr/local/share/systemtap/tapset/node.stp' I also ran this

compact valley
#

Oh boy

#

--overwrite will replace the files it should be installing if they already exist

#

It may end up ok. Realisticcally, there should have been an uninstaller to run, but probably too late now

#

The suggested dry-run command would be a good thing to run, so you can manually search the directories of existing node stuff to erase them.

#

As for the systemtap error,

#

Run brew doctor and take all the warnings seriously and see what you can fix up.

#

@mild lance

mild lance
#

so, i should run brew link --overwrite --dry-run node?

#

@compact valley

compact valley
#

Yes

#

What on earth

#

So, this is probably an artifact of an OS upgrade breaking brew. Probably. I'll see if we can fix it nicely.. loading

#

Ok

#

lets try this

#
$ sudo mv /usr/local/share/systemtap/tapset/node.stp ~/.throwaway
civic hound
#

was there a macos question @mild lance ?

compact valley
#

brew is a MacOS package manager

civic hound
#

yes, im aware. πŸ˜„

compact valley
#

<

mild lance
#

hold on one second, can work on this soon

#

afk for a moment

#

ok, I'm back :D

#

sudo rm '/usr/local/share/systemtap/tapset/node.stp', I ran this before, so it shouldn't have been there i think @compact valley

compact valley
#

You do have a .throwaway right?

#

I just dropped it in there because I didn't want to specify a directory

#

just, somewhere taht isn't there so it can't cause problems and I guess is undoable

#

which may be an undue amount of caution

mild lance
#

mkdir ~/.throwaway

compact valley
#

ugh

mild lance
#

But, I already deleted the file previosuly

compact valley
#

then you'll just have to do sudo chown -R :admin /usr/local/share/systemtap

mild lance
compact valley
#

Then I suspect the issue is node's installer creates the folder with wrong permissions

#

wouldn't be the first time

mild lance
#

well, it was there previously

#

I just removed it

#

because I thought it was the source of the problem

#

ohh, I see, yes let me take ownership of the file

#

@compact valley

compact valley
#

You.. are on an admin user right?

#

I guess try username:admin instead of just :admin?

#

:admin should have worked though

mild lance
compact valley
mild lance
#

should I change the folder ownership back to normal now?

#

@compact valley lemon_ping

compact valley
#

Nope

#

that's how it's supposed to be

mild lance
#

Alright, is my account not an admin account then, if we had to do that?/what is an admin account

compact valley
#

No, just some stupid quirk probably

#

Admin accounts are, I believe, part of the "admin" group since osx uses mostly unix-like perms

#

the :admin is supposed to change the accessing group to "admin" so all admin accounts to do it, but I'm too tired to bother figuring out why it didn't work

#

probably something fucked in the permission bits, now that I think of it

#

yeah, it defaults to XR for group, which is stupid

#

but whatever

mild lance
#

anyway to check if I am part of this "admin" group

compact valley
#

$ id -Gn bast

mild lance
#

yeah, I am

#

weird

#

is the folder normally with :admin access, and I just couldn't access it for some reason?

#

I'm still on catalina, I doubt updating would fix the issue though

compact valley
#

Things in user/local are supposed to be

#

But various installers are lazy and drop things with bad permissions a lot

#

For example, sudoing into making files as root:root

rich nymph
#

Is there an extension in vsc that sorts your imports?

atomic crest
#

does anyone know what ide this is

wooden ibex
#

might be pycharm, hard to tell

#

Why?

atomic crest
#

i dont know

#

i thought it looked nice

#

πŸ“š Video courses from JomaClass:
πŸŽ“ New to programming? Learn Python here: https://joma.tech/35gCJTd
πŸŽ“ Learn SQL for data science and data analytics: https://joma.tech/3nteQih
πŸŽ“ Data Structures and Algorithms: https://joma.tech/2W89H33

πŸ’¬ Chat with me on Discord:
https://discord.gg/EQwMWFsmQs

⭐ Support my channel to access my Private Discord Chat...

β–Ά Play video
wooden ibex
#

probably some text editor

#

if you were working massive app, you would probably want IDE just for all unit testing/git management

teal sundial
#

@atomic crest not sure tbh but prob doesn’t matter depending on da specific project

soft axle
#

I have this issue where PyCharm thinks __init__.py is a Django file, and it's quite annoying. Does anyone have any suggestions for fixes? Thanks in advance!

soft axle
heavy knot
#

how do I run code in atom

#

it just says python wasn't found

#

or something like that

sly sleet
#

did you install python

#

and is it on PATH

warm ingot
#

how do i change the colour scheme to a dark black one in Sublime text

frozen anchor
#

[Pycharm]
hi, can sb explain me why the "detail.css" is not properly marked as a css file? I tried deleting it, creating a new file (that displayed as css) and renamed it to detail.css - which then changed the symbol back again

sly sleet
#

use vscode /s

tawny temple
#

There is no fix on your end besides disabling the plugin for atom icons

heavy knot
#

how do i open multiple folders in the same window in pycharm?

random drum
#

wdym, a subfolder?

#

@heavy knot

heavy knot
#

i have 4 folders

#

html, js, python, and c source codes

#

i wanna open them all in one window

random drum
#

just create a parent directory and put all these inside it

heavy knot
#

hmm

#

i was thinking of that only

random drum
#

yeah

#

bro i just found out

#

there is a way

heavy knot
#

but is it possible without creating a parent folder?

random drum
#

can i screen share

heavy knot
#

oh what?

heavy knot
random drum
#

i donno how to explain that

heavy knot
#

im in class rn

random drum
#

ok

#

w8

heavy knot
#

send the ss

#

kk

random drum
#

yah i can upload files right

#

w8 a sec

heavy knot
#

oh thnx

#

kinda dumb ques tho

random drum
random drum
heavy knot
#

kk thanks!

heavy knot
random drum
#

@heavy knot

heavy knot
#

oh ok thanks man!!

random drum
#

np

heavy knot
#

bye gtg

random drum
#

i just found it out when i tried it

#

thanks to u

heavy knot
#

maam is asking questions to me

soft axle
tawny temple
#

Yeah I reported it to the developer

#

They introduced that bug after they fixed another bug I reported regarding the flake8 file having a django icon

mild lance
#

Hey guys, so, I recently needed to start using pyenv. However, after installing it, I can't seem to get it to work. Does anyone know how I could fix it?

muted cobalt
#

My github actions workflow is not being ran on pull_request

name: Lint & Test

on:
  push:
    branches:
      - 'rewrite'
  pull_request:
muted cobalt
#

Please mention me if you reply, I'm going to sleep.

unique perch
#

Hi all!

**Quick question **- is there a VScode setting or extension that will allow me to see variable values **within the code **during a breakpoint of debugging?

The longer version of the same question - Going back to Uni, we've been told that this semester we must use VScode. I come from using PyCharm, a fellow student from thonny. When we would debug in PyCharm or thonny, during breakpoint stages you could see what each variable was holding at that particular stage.

I've been running through the VScode and Python documentation to no avail.

unique perch
tawny temple
unique perch
tawny temple
#

It's a setting, if that wasn't clear.

#

You can also see some of the variables if you open the debug side panel

#

Additionally you can watch certain variables so the side panel can show their values in real time

#

Well, maybe real time is the wrong word. I just mean watched values will automatically update as you step through the code.

unique perch
#

@tawny temple comes in with the goods! (Well, for me anyway!)

heavy knot
#

trynba make a bot that lists all users of a role how would i do this? and make it auto updating every 10 secs

unique perch
#

Thanks @tawny temple again for the assistance. You've no doubt saved what little hair I have left.

tawny temple
#

You're welcome

tawny temple
#

@elder sable press ctrl + shift + p

#

Then search for "convert indentation"

#

And choose to either convert it all to tabs or spaces

#

Whichever you prefer

elder sable
#

that problem is fixed... but now 4 other errors popped up

#

I'll just work is out for now

timid tendon
#

Hello XlanKar Terminal I want the summer to stand side by side, but it doesn't work.

muted cobalt
#

My github actions workflow is not being ran on pull_request

name: Lint & Test

on:
  push:
    branches:
      - 'rewrite'
  pull_request:

I've tried specifying '**' as branches for both of them but still doesn't work

#

Only working on push

woeful spruce
#

anyone here that could help me out with docker and vscode?

#

im pretty new to this

rain ether
#

Whats the state of pipenv in 2021?

night quest
muted cobalt
#

I mean ```yml
on:
push:
branches:
- ''
pull_request:
branches:
- '
'

#

Which should be the same as

on:
  push:
  pull_request:

?

#

But we want to specify a branch on push

night quest
#

Hmm... Are your actions working for some branches and for some not?

muted cobalt
#

It's weird because it works on our forks

#

But not in our main branch

night quest
#

Or they are not working at all

muted cobalt
#

It works on push

#

Not on pull request

#

On forks pull request also works

night quest
#

How about repo options? You can disable some jobs there

muted cobalt
#

wdym

#

Ah I see the issue

#

The issue was not in the repository settings, rather the organization secrets

tardy sun
#

I have a very basilar question, where do I post it?

#

I've run into lambda, but I don't understand it quite well, at least given the explanation that has already been delivered, can anyone give me a definition of its use? Thanks

#

I don't know where to post this either

night quest
undone salmon
#

I need help with vs code please help

#

When i am writting mv filename .. the file should be moved from the inner folder to the original one

#

But it's showing mv can't stat 'file1.py': No such file or directory

#

Got the problem i was in wrong location

#

Kinda new in these things

open cosmos
violet grove
#

Rasheed

#

You're a good guy man

#

Nice to meet you

heavy knot
#

pipenv's dependency solver doesn't work good enough for us. Had a few cases, where we had to manually aid it in order to build a working environment

#

poetry's solver could handle cases where pipenv failed

rain ether
#

I heard good things about poetry, but i dont like the fact that theres yet another tool for the same purpose

heavy knot
#

Sure, but having to manually solve dependencies since the solver can't do it is a killer criterium

#

that's its main job

#

others at work agreed and we're now going into a test phase for poetry, so I can't tell yet, if it's the better alternative

#

but so far everything hints to it

#

that article was updated in May 2020 just in case you think 2018 is not up to date

#

and that's an example where pipenv fails

#

and yes, got a lot of negative bias towards pipenv, since it's been a constant struggle to use it till today (only a half year)

shrewd adder
#

what you think about pycharm?

#

its better than vscode for python?

silver sedge
# shrewd adder what you think about pycharm?

Personally, I love Pycharm, since it is an easy to comprehend IDE(Also the new update is really cool), but at one point, for advanced programmers, I'd say it's functionality starts to become limiting. This is the point where u really should start to look for more advanced IDE's

#

However, I would definitely not say vscode is better, and especially for beginners, Pycharm is far easier to understand, although I know many people who disagree. It all boils down to what you are looking for in an IDE

night quest
#

If you are advanced one you can work even with vim/nano/whatever but for newcomers I recommend PyCharm

shrewd adder
#

thank you for your opinion!

sly sleet
#

never used pycharm

#

but based on my experience with intellij I feel like jetbeans IDEs all have a lot of built-in features which may overwhelm users

night quest
lunar holly
#

My development laptop's mobo died 2 months ago. I bought a new laptop and fixed my old laptop, and am now in the process of setting up my dev environment on my new laptop. I am realizing this is going to be a bit of a pain in the butt. So, I figure, maybe I should get smarter about this.

First I thought... maybe I will setup the dev environment inside of a VM. And that thought process, evolved into:

A bunch of people in the past sang the praises of Docker and how a lot of the cloud services support docker. AND, I have been wanting to move my app to the cloud, or at least an offsite server. Would it be a good idea for me to setup my dev environment in a docker VM? Previously my dev environment was in Windows, with VSCode, Python 3.8, Pandas, Numpy, and a few other packages.

I am not a professional developer, so please be kind.

smoky shuttle
#

Hi @lunar holly , I think it makes a lot of sense to learn docker in your particular context

#

The way I would think about it is that you can "dockerify" one of your projects, i.e. set it up in a way such that it can run in a container or a set of containers, instead of directly on your laptop (sometimes it really takes surprisingly not so much effort to do so)

#

For that, I find that docker-compose is very nice (it's a tool that makes it easy to coordinate a project which requires multiple containers running and talking together)

#

Note however that although they share some features, a docker container is not a VM in the traditional sense

long mantle
#

Hello everyone !
I've created a CLI tool that bootstraps a project from a published template on GitHub. It downloads the template, replace user-defined properties with given values and put everything in a new directory.

For example, now I can create a new Flask project from a published template ( https://github.com/helkaroui/simple-flask-server.slh ) by running the following command :

slh new helkaroui/simple-flask-server.slh ./

The tool is simple to install, just run pip install silhouette-cli
Just thought I would share. Any ideas of directions I could take this project in ?

Here is the GitHub page : https://github.com/sharek-org/Silhouette
Thanks !

wraith kernel
#

what can i do after learning python to make money
i don't want to be an employee of any company
i just provide serveice on my own
and earn on my own as much as i work

rancid schoonerBOT
#

6. No spamming or unapproved advertising, including requests for paid work. Open-source projects can be shared with others in #python-general and code reviews can be asked for in a help channel.

long mantle
night quest
long mantle
#

just kidding, I love the rules myself

heavy knot
#

Im New I Dont Know How To Code

night quest
#

!resources

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.

heavy knot
#

i am currently trying to make a proxy scraper that scrapes proxies from multiple sources, can anyone help?

heavy knot
#

hello

#

hey

#

????

#

Help me please

sinful trout
#

Why doesnt it make the folders as intended ? import os
import shutil

current_dir = os.getcwd()

for f in os.listdir(current_dir):
filename, file_ext = os.path.splitext(f)

try:
    if not file_ext:
        pass

    elif file_ext in ('.py'):
        shutil.move(
            os.path.join(current_dir, f'{filename}{file_ext}'),
            os.path.join(current_dir, 'Python files', f'{filename}{file_ext}'))
    elif file_ext in ('.jpg', '.png', '.gif'):

    else:
        shutil.move(
            os.path.join(current_dir, f'{filename}{file_ext}'),
            os.path.join(current_dir, 'Andre filer', f'{filename}{file_ext}'))                        

except (FileNotFoundError, PermissionError)        :
    pass
zinc thunder
#

@sinful trout we can discuss your topic in #unit-testing if you'd like to

heavy knot
#

please,

#

my spammer webhook bug:

#
    webhookSend = DiscordWebhook(avatar_url=avatar, username=username, url=url, content=msg)
    webhookSend.execute()
    print('\n\nThe webhook spam has just been activated.')
    cls()
    main()
#

I want the webhookSend.execute() to work all the time even when I come back to main

obtuse flint
#

What is a popular version manager for python similar to nvm (node)?

#

meh, gonna give venv a try

dusty maple
#

venv/virtualenv help set up development environments although if you need a build tool/dependency manager that also automatically works with virtual environments for you, you might want to look into pipenv and poetry

#

Both have their own merits, but pipenv is more commonly used for "live" projects as in applications and poetry leans more towards pip-installable packages

stiff dragon
#

I've been getting my hands dirty (and enjoying) pytest, but I find myself asserting on things like os.path.isfile/isdir or data structure which doesn't seem pythonic if I have to include an example an example dir to provide a case that always works

#

I peruse the big OSS projects for test inspiration, but I don't see a lot of test coverage involving file-checking, mostly logic or numerical checks

#

Am I approaching testing wrong?

tawny temple
stiff dragon
pastel topaz
#

What exactly is Docker? From what I have been able to understand, it generates an isolated place to run an app? So is it sort of like a Virtual Machine?

#

Please ping me when you reply

night quest
pastel topaz
viscid cipher
#

Is it possible to remove windows from a laptop an install linux for free

tired phoenix
#

@viscid cipher you can install linux on windows using virtual box

wooden ibex
#

In most cases, yes

tired phoenix
#

No need to remove windows

viscid cipher
#

Whats vitural box

near topaz
#

Hello

#

I'm trying to merge a folder of a different repo into mine via git

#

Not submoduleing

#

repo B has a utils folder which I want

#

I want the history and the folder on top of my head

heavy knot
viscid cipher
#

is there a way to switch to a different linux distribution and still keep your stuff from the previous one?

graceful patio
#

what kind of dstuff

random drum
#

guys my pycharm shows a red line under this line

from LabelGenerator import CreateLabel, PrintLabel```


but no errors while running this is a python file in the current working directory pycharm doesnt recognize it
neon torrent
#

I hope this is the right channel, I have to come up with an "cloud" architecture for a project and I'm kinda stuck at what to use and how it could work.
Basically, I have IoT devices that connect to this "cloud" via websocket and keep the connection open permanently, these devices would sign up with an ID/key or something like that to identify what user-account they belong to. From the other side the "cloud" provides a REST API where users can control their IoT devices, again with authentication and providing the ID of what device they want to control.

All that doesn't sound do complicated if it's only one application that handles all websocket connections and all REST requests, but what if the websocket connections scale to over a million, I doubt that one application would be capable of handling that? So I'd need to be able to run multiple instances of this application and have some form of "load balancer", right?

But, that's the biggest piece where I'm stuck. If I have multiple instances, how do I know which instance is handling the websocket connection that the REST request wants to send something to? Hope that whole thing makes sense

heavy knot
#

.

#

ok so i used activity.log the first time

#

so it went off after couple mins

candid kayak
#

i don't really know much about linux and process managers as such, but tmux was rather simple to use

#

it's a terminal multiplexer

heavy knot
#

i actually know how to use tmux , but didn't use it
i didn't think it will work

#

ok I'll use tmux and see if it works

candid kayak
#

well it works for me

#

ask mesub how he does it though, this may not be best practice

#

i just used what i thought of, and as it worked fine i didn't bother trying to find other options

heavy knot
#

oh yeah , thank you so much , i tried it and the bot seems to stay online rn ,

graceful yew
#

How to develop app

chrome pagoda
#

hello, does anybody know how to operate the atoms code editor on mac or knows another good code editor

frozen anchor
#

Hi, I want to ensure the following:
for github actions, every pull_request includes a push - is that correct?
I have a github action like this:

on:
  push:
    branches:
      - master
      - prod
  pull_request:

master and prod are protected branches. It is not possible to push to them directly, you need to do a PR.
So should I just change it to:

on:
  pull_request:
      - master
      - prod
```?
tawny temple
#

I don't believe PRs create push events for their target branch

#

PRs create pushes for their source branches

#

Based on those branch names, I doubt you'd be opening PRs from a master or prod branch.

#

So yeah, the latter should be correct

#

Actually, I'm not sure what the branches mean for pull_request

#

If it's specifying the source branch then that's incorrect

#

If it's the target branch then it's correct

#

It seems to filter on the target branch. Just don't forget to include branches: in your YAML.

#

That's not really intuitive since the documentation says a PR event's ref will be refs/pull/:prNumber/merge, but also says that the specified branches for on: are matched against the ref. Since that ref never includes the branch name, I don't see how this works, but I'm reading from multiple sources that it would indeed filter on the target.

wooden ibex
#

PR don’t create merge so GitHub actions won’t fire

#

It should fire on merging of PR

tawny temple
#

Every push creates a commit which simulates a merge into the target branch

#

That commit is what CI checks out by default.

hearty swift
#

i have problem with nginx and docker

#

nginx.conf
events{}

http{
    upstream django {
        server api:8000;
    }
    server {
        listen 80;
        root /project/static-media/;

        location / {
            try_files $uri @django;
        }

        location @django {
            proxy_pass http://django;

            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";

            proxy_redirect off;
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Forwarded-Host $server_name;
        }
    }
}
#

and ofc django uploads them there

#

but nginx dont see them

#
version: "3.9"
services:
  db:
    image: postgres:13.1-alpine
    environment:
      - POSTGRES_DB=db
      - POSTGRES_USER=postgres
      - POSTGRES_PASSWORD=postgres
    ports:
      - "5432:5432"
    volumes:
      - postgres:/var/lib/postgresql/data

  api:
    build:
      context: ./project
    command: /bin/sh -c "/entrypoint.sh"
    volumes:
      - volume:/project/static-media/
    env_file:
      - ./.env
    ports:
      - "8000:8000"
    depends_on:
      - db

  nginx:
    image: nginx:1.17
    build:
      context: ./nginx
    volumes:
      - volume:/project/static-media/
    ports:
      - "127.0.0.1:80:80"
    depends_on:
      - api

volumes:
  postgres:
  volume:
#

thats my compose ^^

#

any idea?

#

entrypoint just migrate,collectstatic and host with gunicorn

heavy knot
#

ports: - "127.0.0.1:80:80"

#

not sure if this is valid

night quest
heavy knot
#

Ah ok, just something i found odd. So it might have been a cause of a problem

split steeple
#

Is this the correct place to ask about stubs in vscode?

#

I'm just gonna go ahead. I'm trying to make typing stubs work with vscode (python 3.8.5) which, from what I understand, should be able to provide type information for various libraries, much like facades to js when using scala.js

#

However I'm unable to make even numpy and matplotlib stubs work

#

I pip3 install data-science-types but I still get scary squiggly lines

#

For types such as int64

hearty swift
#

valid

#

and i fixed issue

oblique hamlet
#

I am starting a new project to create a tool for developers. Where can I post asking for collaboration. My github: https://github.com/Inaruslynx/SmtApi

red shuttle
#

how to create an rpm for a rest api with unit file?

#

rpmbuild?

heavy knot
#

can someone help me, im trying to make a PDF Invoice generator from this website https://invoice-generator.com/, i cant locate the textboxes can someone help me?

void dust
#

what do you mean?

sly sleet
graceful moat
#

Hi can anyone help me with PyInstaller issues?

#

I've narrowed down the culprit libraries to: Matplotlib, OpenCV and Scikit-Image

barren iron
#

@graceful moat can I get a bit more information?

graceful moat
#

idk how but it's working now...

#

I spent hours upon hours but the last steps I remembered were uninstalling/reinstalling pyinstaller, wxpython, setuptools in my conda

#

but much appreciated

#

I have another issue with PyInstaller and Cefpython3 though...

barren iron
#

Got the error message?

graceful moat
#

hey I'm a bit busy rn but thanks so much for the response!

#

I might check in later tonight when I have time.

#

πŸ˜ƒ

lethal ermine
#

Hi guys !

#

I need someone to help me with a regular expression (regex)

#

"Some word here other_word_here"

#

I need the regex to find a group of words that are only separated with 1 space

lethal ermine
#

Found it: ^\S+( \S+)*

tawny temple
#

That doesn't seem to be completely accurate

#

For example

#
word word word  word word word  word word word
#

That regex would only match the first three

#

even though the middle word of the 2nd and 3rd groups technically is also only separated by one space

#

And depending on what you even mean by separated by one space, one could argue each group matches and its the groups that are separated by more than 1 space, not the individual words

muted cobalt
#

What's the normal way of running tests that include a database?

urban stirrup
#

im using sublime for python but the suggestions arent showing any help?

ember verge
#

Hiya, just found this discord. A question - does anyone know of any tools that can make code more minimal?

I'm looking for anything that can, for example, reduce this:

var_a = "a"
var_b = "b"
if var_b == "c":
    pass
if var_a == "s":
    pass
print(var_a)

to:

var_a = "a"
print(var_a)
#

The endgoal in mind is to create minimal working examples from large scripts

mild lance
#

Hmm, pyenv has decided to break, I'm in a virtualenv, but pyenv is still taking control of the path

#

Any ideas on how I could fix it?

neat lynx
#

What VPS's do you all use?

candid kayak
dusty maple
rich nymph
#

Does anybody know how I would specify vscode to use flake8 as linter?

heavy knot
#

If you type linter in the command bar, don’t you have a select linter entry ?

heavy knot
#

Hello, i have a problem with Python in Doom Emacs

rich nymph
#

got it thx

heavy knot
#

Does anybody know how to solve this?

tulip flame
#

Hello I am planning on making a web app that would be a bug tracker, the question that I wanted to ask is:
In your opinion, what are the features every bug tracker needs?

tawny temple
#

Being able to keep tickets private e.g. for reported security vulnerabilities

#

Support marking duplicates and showing which tickets are duplicates of others

arctic flicker
#

how come that, in debug mode, pycharm will sometimes kill my program after error, and sometimes let me execute more code in the debug console?

carmine sparrow
stable olive
#

hey
i wanna stucked in python
When I Type Python to open it in my Terminator
I don't know Why its not openning

rancid schoonerBOT
#

@idle cosmos Per Rule 6, your invite link has been removed. If you believe this was a mistake, please let staff know!

Our server rules can be found here: https://pythondiscord.com/pages/rules

winged apex
#

@stable olive maybe u messed up the installlation

prisma cipher
#

please @ me if you have a solution

supple venture
mild lance
dusty maple
#

@mild lance Does python exist on your venv/bin?

#

Might be a platform-specific thing but venv on Mac not producing the python alias is understandable

mild lance
#

Changing it to .env seemed to fix it, but I'm not sure if it's because I just created an entirely new venv or renamed it

warm pollen
#

The Python interpreter in your venv is just a symlink, you could change which file it is pointing to @mild lance

sly sleet
#

@prisma cipher one of them is a tab, one of them is 4 spaces

#

convert all tabs to 4 spaces

fair robin
#

How to code πŸ™‚ ?

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.

leaden tartan
#

i made a web based app using django and vue. Though it is web based, it is supposed to be used locally. The vue code can be made available easily (I can simply package the dist folder that is generated). But for the backend (made using django), I have no idea what to do. Should I make a script that users can run so that a virtual environment is created automatically and activated every time this app is used? Or are there better ways to do this?

wooden ibex
#

Containers

leaden tartan
#

Please tell me if I haven't been clear. I will try to explain more

wooden ibex
#

Or if you can trick whatever server runs Django to serve up your Vue app would work

leaden tartan
# wooden ibex Containers

I don't really want to use them since containers are large and people tend to avoid them for small use cases. However I would keep them in mind

wooden ibex
#

And venv is light?

leaden tartan
#
argon2-cffi==20.1.0; python_version >= "3.6"
ariadne==0.12.0
asgiref==3.3.1; python_version >= "3.6"
cffi==1.14.4; python_version >= "3.6"
django-cors-headers==3.6.0; python_version >= "3.6"
django==3.1.5; python_version >= "3.6"
gitdb==4.0.5; python_version >= "3.4"
gitpython==3.1.12; python_version >= "3.4"
graphql-core==3.0.5; python_version >= "3.6" and python_version < "4"
gunicorn==20.0.4; python_version >= "3.4"
pycparser==2.20; python_version >= "3.6" and python_full_version < "3.0.0" or python_version >= "3.6" and python_full_version >= "3.4.0"
pytz==2020.5; python_version >= "3.6"
six==1.15.0; python_version >= "3.6" and python_full_version < "3.0.0" or python_version >= "3.6" and python_full_version >= "3.3.0"
smmap==3.0.4; python_version >= "3.4" and python_full_version < "3.0.0" or python_full_version >= "3.4.0" and python_version >= "3.4"
sqlparse==0.4.1; python_version >= "3.6"
starlette==0.13.8; python_version >= "3.6"
typing-extensions==3.7.4.3
#

Thats my requirements.txt

wooden ibex
#

Ok

#

Not sure what your deployment plan is

#

Containers are easiest way to go

leaden tartan
#

By containers do you mean docker?

#

The users should have docker installed in their system then, right?

gilded siren
#

any one got suggestions on dual booting kali linux with chrome os

heavy knot
#

Are there tools to somehow input keyboard events into a running process in Windows?

#

Or if the process is opened / user is interacting with it?

twin nymph
#

hello anyone that knows how to use win32printing module ?

#

idk if iam at the right channel

mild lance
#

If I have 8 pods in k8s, is it possible to load balance to 7 of the 8?

#

I've never used kubernetes before, which is why I'm asking

#

Another question is: What's the point of having multiple containers in a pod and why would that be useful? As well as: How would you distribute information to the different containers in a pod?

wooden ibex
#

Why would one pod be left out?

wooden ibex
mild lance
#

I'm not sure if I'm supposed to run multiple applications which do different things in one cluster

wooden ibex
#

you can if you want

honest glade
#

New job issued me with a Win10 laptop on which I'll be mainly doing Python development. Does anybody know of a good alternative to direnv on Windows?
Can't be bothered to develop on wsl only for that dependency but I am just too used to it as it's such an elegant solution to avoid cluttering the system with too many project env vars

safe heart
#

Hey guys, I am new to auto deploying and have run into an error.

I've been following this tutorial to deploy my script to my server on git push to master, but I've run into a problem:

2021/01/20 12:38:58 ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain

Tutorial I've been following: https://www.youtube.com/watch?v=gW1TDirJ5E4

Would be this be the appropriate way to structure my yaml file?

name: Deployment Workflow
on:
  push:
    branches: [ master ]

jobs:
  job_one:
    name: Deploy
    runs-on: ubuntu-latest
    steps:
    - name: testing Cetti Server ssh connection
      uses: appleboy/ssh-action@master
      with:
        host: IP-ADDRESS
        username: USERNAME
        key: ${{ secrets.DEPLOY_TEST }}
        port: 22
        script: |
          cd deploytest
          git pull origin master
          git status
heavy knot
#

Could someone please help me set up a venv on pycharm? A link to a decent tutorial would be appreciated also since none of the ones I could find were very informative

night quest
heavy knot
#

So for example discord.py and all its' dependencies

night quest
heavy knot
#

Oh that makes sense, tyvm

night quest
#

Additionally when you import unknown library in your code, like urllib3 for example, PyCharm is going to ask you about installing this library

heavy knot
#

For some reason the libraries are available to the project even if it's not in the venv libraries, that's what's confusing me the most

night quest
heavy knot
night quest
night quest
heavy knot
#

I see, I'll try it out. Tyvm πŸ™‚

night quest
#

Your welcome

muted cobalt
#

How can I merge a change on the master branch to a different branch? (github)

mild lance
muted cobalt
#

Yeah I figured, thanks

mild lance
#

No problem, in the future, it's ideal to seperate branches by features, master, and hotfixes so that you can merge a hotfix branch into development rather than into master and master into the feature branch.

#

@muted cobalt

muted cobalt
#

Thanks, will save that

mild lance
#

Awesome, glad I could help :D

muted cobalt
#

How should we do tests that require a db connection?

#

Is there anything we can use to mock a postgres server?

mild lance
#

Hmm, could you make a test database?

umbral jay
#

I am using anaconda python 2020.7. Will conda update --all be good enough to upgrade my existing version to 2020.11? Are there things that I am missing out if I don't install 2020.11 directly from installation file?

zealous bison
#

does anyone know how to check XPath version?

heavy knot
scarlet garnet
#

I have another pipenv shell session running in another directory on tmux, I'm trying to run a new one in a different directory, says ones already activated and can't exit the other one for some reason

glass geyser
#

I am using vs code for python but the output box contains the whole file directory and then the output. How do I remove the directory and only let it show the output?
https://imgur.com/TbB7LBm

rancid schoonerBOT
#

:x: According to my records, this user already has a mute infraction. See infraction #26977.

#

:incoming_envelope: :ok_hand: applied mute to @true lark until 2021-01-21 19:09 (9 minutes and 59 seconds) (reason: duplicates rule: sent 4 duplicated messages in 10s).

mild lance
#

I have a postgres database that I want to access from inside a docker container, how should I do so? Right now, I am forwarding port 5432 from the host machine to 5432 of the container, but it doesn't seem to work.

clever raven
#

are you using docker-compose?

mild lance
#

Here's my dockerfile

clever raven
#

right, so, just so I understand

#

you've got postgres locally?

#

and then you wanna access that postgres from inside a docker container?

mild lance
#

Yes, or, ideally, on a VPS, I would access the external (local to the VPS) database from the container (on the database)

clever raven
#

right, let's see the dockerfile. you'll basically need to grant the container access to the local network to do this

#

which feels a little hacky to me

mild lance
#

The database is on localhost

clever raven
#

yeah

mild lance
#

Is the database supposed to run inside the container?

clever raven
#

often, you would have a container for the database

sly sleet
#

1 container per service

clever raven
#

and then you'd set up a virtual network between the two services

#

which docker makes very easy

#

especially with docker-compose.

#

this is how we do it in our infrastructure here at python discord, for example

mild lance
#

If the container dies wouldn't all of the data be lost?

clever raven
#

no, you'd store the data in a volume of some sort

mild lance
#

ah

#

So, the server is running on a container, but the data is stored via a volume?

#

I'll need to figure out how to create a database server on a container

clever raven
#

postgres have an official image

#

so it's very easy to set up.

mild lance
#

awesome!

clever raven
#

on our website, we have a docker-compose file with postgres set up so you can see an example of that

#

we only use it for local testing, but still

mild lance
#

I've actually never used docker-compose before, so I'll use that

clever raven
#

so actually this docker-compose does not have data persistence for postgres, but basically you just add another volume and you're good

mild lance
#

Sounds good, thanks for the help :)

clever raven
#

no problem, poke me if you get stuck

glass geyser
#

I was configuring vs code to look more like repl.it

sly sleet
#

your file needs to end with ".py" for vscode to detect it as a python file

#

normally the run button would be in the top right if it was actually a python file

#

@glass geyser

glass geyser
#

how do I remove all that text

sly sleet
#

i dont think you can

mild lance
placid junco
#

Anyone know if they can help with this issue?

rich nymph
#

Hey guys even though for vsc my font is set to Fira Code, why isn't it changing it???

sly sleet
#

@rich nymph check the settings.json

rich nymph
#

ok

zealous bison
#

is there any possible to make text-to-handwiriting on python

#

?

analog kettle
#

If I write unit tests in pycharm using unittest.TestCase, pycharm immediately knows that those modules are unit tests. But now I'm using pytest and it doesn't know that.

#

I don't know how to get that functionality

analog kettle
analog kettle
stoic bear
#

theres a library i dont remember the name of which does that

#

it cannot be too hard, if i work hard i think i can make it myself

#

like, i can just store every letter and number by writing on the same paper, than read the text, and use pillow or something to join the images according to the letters

#

not that neat but could work out

#

maybe

sly sleet
#

just use a handwriting number like mnist and then lookup

wary oasis
#

code ```py
total_fuel = 0
for mass in module_masses:
while (mass := mass//3 - 2) > 0:
total_fuel += mass
print(total_fuel)

#

not detecting the walrus assignment?

zealous bison
#

@stoic bear i remember someone told that need ML (tensorflow)