#tools-and-devops

1 messages · Page 45 of 1

thorny shell
#

not easily

covert kindle
#

@brittle tide

Don't know if this helps, but I recently found out you can run scripts in interactive mode from the cmd line. Just add the -i argument.

brittle tide
#

yeah thats what i was talking about but whenever i change the file i need to reload the prompt

grim furnace
#

Can someone help me with git? I have config.py in .gitignore, but when I try push to repo I get errors. When I try git pull I get conflicts (screen) then git creating for me file with other name, type, but the same content.

drowsy galleon
#

So, anyone ever had this happen with pycharm when adding an existing venv?
@tough stratus corrupted data

uncut oxide
#

I had that happen when I had a venv of a Python version I had uninstalled IIRC

heavy knot
#

Is it possible to make it so you can use your computer normally while you operate a task with pyautogui like moving your mouse like do the same but virtually only in the application and use your mouse as you want

heavy knot
#

Does anyone have a good solution to sync projects between different computers?

buoyant canopy
#

github is good at that

digital trout
#

Does anyone know the extension SQLite on vscode? and if so I have a problem with it, i don't know how to close a table in a dataset if anyone can help me would highly appreciate it

modest heron
#

someone please help me

#

with xml parsing please

heavy knot
#

Hey guys. Can someone maybe tell me how I can fix this problem

#

Pycharm usually has 4 windows at the bottom: python console, terminal, todo and a window called "run" where you can see what your coude would look like

#

sadly after I updated its gone

#

dont know what to do

manic marsh
#

hi guys is there any channel for pillow ?

rough marlin
#

not that i know of

#

@heavy knot try window > default layout

random sage
#

Hi i'm trying to figure out how to install "pip" but i can't, if you can help me and don't go tell me to go search on google because i can't find on google.

thorny shell
#

@random sage It's possible that you already have it -- have you tried python3 -m pip?

random sage
#

some commade make just a space of a line and that's it, is that normal?

#

@thorny shell

thorny shell
#

sorry I didn't understand that

#

what operating system are you using?

random sage
#

that is to say ?

thorny shell
#

I didn't understand that, either 😦

random sage
thorny shell
#

I think you typed four commands, and I can see the output from the first one, but I can't see what you typed.

#

try ```py
c:\users\whatever> python3 -m pip --version
pip 20.0.2 from /Users/xyzzy/Library/Python/3.8/lib/python/site-packages/pip (python 3.8)

#

if you see output like that, then you already have it

random sage
#

no i have juste a space of 1 ligne

thorny shell
#

oh

#

what was the first command you typed earlier?

random sage
#

python3 -m pip

thorny shell
#

and that produced a lot of output?

#
python3 -m pip

Usage:   
  /usr/local/opt/python@3.8/bin/python3.8 -m pip <command> [options]

Commands:
  install                     Install packages.
  download                    Download packages.
  uninstall                   Uninstall packages.
  freeze                      Output installed packages in requirements format.
  list                        List installed packages.
  show                        Show information about installed packages.
  check                       Verify installed packages have compatible dependencies.
...
random sage
#

output ?

thorny shell
#

lines?

random sage
#

look my screen, he has line breaks

thorny shell
random sage
#

@thorny shell you are french ?

thorny shell
#

non, c'est pourquoi je vous suggère d'utiliser Google Translate !!

#

Je suppose que vous parlez français

random sage
#

i use google translate

warm pollen
#

Si tu as besoin d'aide pour traduire tu peux m'envoyer un MP, je suis français :) (if you need help to translate you can DM me, I'm French)

thorny shell
#

Je pense que vous avez déjà _pas_pip, et pouvez l'invoquer comme python3 -m pip.

covert kindle
#

"Baguette, croissant" ~ in French

thorny shell
#

It's like those French have a different word for everything. "Oeuf" means "egg".

spark lynx
#

hey guys, im getting into python and I just installed python off the microsoft store (i don't have admin) and vs code. how do i run my scripts with microsoft store python? I also don't have access to command promt

warm pollen
#

The ms store version is pretty much all broken, if you can avoid it that would be great, if not, you have to find the path to the interpreter and feed it to vsc

stark basalt
#

I'm new to python and programming

#

can someone summarise what git is

thorny shell
#

it's a "revision control system".@stark basalt

#

it lets you keep snapshots of your code over time, in case you mess up and want to go back to something older that worked

#

it also keeps multiple programmers, working on the same code at the same time, from stepping on each other's toes

#

it doesn't have anything to do with python specifically, although it's common to use both together

#

just like a web browser doesn't have anything to do with python specifically, although lots of people use both at the same time

round escarp
#

After rebasing my testing branch to my master branch, i’m left with now two identical branches

#

What do I do with my old test branch?

#

Can i delete it?

warm pollen
#

If you have the commits in master, yeah

#

git branch -r test

round escarp
#

ty! :D

crisp light
#

Hello, i am new to python and was wondering if anyone could point me in the right direction, I've started to code a very small program but want to try and display the raw data each on a separate line, I'm also not sure if my if statements are optional, I don't need you to do the code for me just point me in a direction of learning please

this is the code,
https://pastebin.com/zf5ZmCJH

round escarp
#

Hmmm, not sure if this is what you wanted, but maybe try putting it on a gui like tkinter or pygame?

kindred lake
#

@round escarp are you good with tkinter?

crisp light
#

are the if statements okay like that? i wasn't sure if i had to add else: or not

round escarp
#

Lol, I'm not really good with tkinter honestly i just know it exists

vapid sigil
#

hey

#

uys

#

guys can someone help ?

quaint saffron
#

@vapid sigil probably better to post the entire thing here or at least send message link to question in case #help-pear closes

vapid sigil
#

ok

#

where do i put it

frosty hornet
#

i would wanna ask i normally use visual studio community
but today VS asked me about licanse key
sorry typo
ik it is not about python but i need help

#

if i look to the settings the VS would say You're using Enterprise 2019

civic hound
#

i think you need to renew your lisence ever so often with VS community

#

i think you do that by signing in again

frosty hornet
#

well i signed in program again

civic hound
#

this is one of the things that is writen in the link above

frosty hornet
#

i know

#

i signed today with my two microsoft accounts but nothing changed

civic hound
#

if your VS say you are using Enterprise, you need to uninstall and reinstall

frosty hornet
#

ok

civic hound
#

are you using VS for something else?

#

you might want to backup your settings and such

frosty hornet
#

i just made some python programs

civic hound
#

only python?

frosty hornet
#

that i still have
algorithm

civic hound
#

then why Visual Studio?

#

why not Visual Studio Code?

#

its made for python development

frosty hornet
#

idk my friend said you can use this

civic hound
#

he probably ment VS Code

#

and not VS Comunity

frosty hornet
#

could we also pragram C# or C++ or Unity with VS Code?

civic hound
#

i do not think so, vs code is a bit limited for other languages

#

it supports C# and C++

frosty hornet
#

for deleting VS i gotta have upgrade it first ... xd

#

anyways thanks eivl it was really helpfull

civic hound
#

Visual Studio is so large, it kinda supports almost all languages ever made, but it is primarily made for windows development.

#

VS Code is a text editor that excells with python development due to its ease of use and feature rich tools.

frosty hornet
#

hmm ok

#

downloaded

#

where can i change langueage

#

sorry typo again

#

and how do i add python in it

#

anyways got it

#

Is this legal?

#

and is it free

#

and where can i open my account

austere dome
mild lance
#

How would someone clone a git branch from GitHub?

#

Or would the best way be to clone the repo and then checkout the branch?

tawny temple
#

You can specify the branch to checkout in the clone command

#

I think with the -b option.

mild lance
#

@tawny temple What would the command look like?

#

git clone url -b branch?

tawny temple
#

Yes, exactly

#

Or maybe -b has to go before the URL

#

But basically yes

mild lance
#

sounds good 👍

#

One more thing @tawny temple . If I am cloning one of my own repo's. How would I add connect the clone on my pc with the GitHub repo?

tawny temple
#

That's called a remote

#

Git will automatically add one when you clone

#

Check git remote -v to see a list

#

You should see origin listed

#

You can use git remote add/remove too if needed, like if you had a fork and wanted to add the upstream as a remote.

mild lance
#

@tawny temple What if it is a pre-existing GitHub repo that already has changes and such?

#

I need to install my repo to a different computer and then connect them back to the repo

tawny temple
#

Yeah it will add the remote when you clone

mild lance
#

Alright, thanks for the help :D

west sorrel
#

is it possible to change the color of an specific word on a txt file using atom?

tired aspen
#

txt files don't have colors

west sorrel
#

for some reason WARNING changes color

cold gate
#

Code editors can add "syntax highlighting" logic to files

#

there's usually a style associated with it, although I'm not that familiar with Atom

#

It's not a part of the text file, but rather of how the highlighter interprets the file and how it's configured to display it

#

It's like Python syntax highlighting: The colors are not part of the file, but how the editor/IDE displays the file

heavy knot
#

After today's Python extension update, VSCode is showing me import warnings for the following setup:

opened_folder/
  my_app/
    models/
      points.py
    core.py

The folders have __init__.py files too but I've omitted them here.

In core.py, I have the following import:

from models.points import Point```

It works fine when I run the code, but VSCode shows the following warning:

`unresolved import 'models.points'`

VSCode doesn't give warning if I do `from .models.points import Point`, but of course Python gives an error for that.

I tried to install the previous version of the Python extension, but I still got the warning. This warning didn't appear before today. 

If anyone can tell me how to fix it, it'd be great. 

I'm on a Mac, in case it helps.
zenith sequoia
#

I have started learning IDLE in python. Can someone please tell me what I am supposed to learn next?

covert kindle
#

@zenith sequoia

IDLE is a code-editor that comes with Python. It's features are VERY limited, so I'd recommend getting comfortable with an editor that has more real-world features such as Visual Studio Code, Atom, Sublime Text, or maybe even PyCharm.

As for tutorials, I'm a big fan of the "Python Crash Course" book. It'll take you from 0 all the way to visualizing data and building a web-app with Django.

heavy knot
#

im trying to get notepad++ to execute python scripts, cant seem to get further than it just opening python, i have tried searching for it but im still kinda confused

craggy badger
#

i need help with tipeeestream api

#
import requests
import urllib3
import selenium

apiKey = input('apiKey: ')
refreshToken = input('token: ')
provider = input("provider: ")

payload = {"provider": provider,"access_token": apiKey,"refresh_token": refreshToken, "origin":"login"}
r = requests.post("https://www.tipeeestream.com/login", data=payload)





#

ignore that selenium

#

i want to make a script which logs you in tipeeestream with just api key

grand sierra
#

I have an issue with VScode. It always worked good and now i am getting this (see picture)

I tried uninstalling it many times and change path also. Please help

#

i have this in bottom left

fierce swan
#

have you clicked it?

#

the "select python interpreter" button

grand sierra
#

yes i put my pyhton path

#

but still there..

fierce swan
#

umm, idk

grand sierra
#

i'm struggling since this afternnon

#

was working since 6 months

#

no issues

#

and yesterday update

#

and now..

edgy matrix
#

how do I get python in my cmd

#

or make a UI for my program

proven plaza
#

Hello, i am new to python and was wondering if anyone could put me through on how to create go about Html letter crypter

jolly dock
#

can anyone help me setup my pycharm with python 3.8.2?

#

pls

#

pls anybody

#

i dont know how to use pycharm

#

nor python by itself

#

and i want to learn

#

so that i can code and make a website too

#

pls

opaque perch
#

pls

#

pls

jolly dock
#

dont mak fun

#

pls

#

i really need help

#

to setup my pycharm

#

in 3.8.2

#

version

#

pls

violet belfry
#

!tempmute 284366407771095040 18H Mocking other members will not be tolerated

rancid schoonerBOT
#

:incoming_envelope: :ok_hand: applied mute to @opaque perch until 2020-05-14 12:55 (17 hours and 59 minutes).

violet belfry
#

@jolly dock it would be easier for someone to help you if you actually asked a question

covert kindle
#

Can someone provide me with the .gitignore glob that would ignore .git folders and .gitignore files in subdirectories?

I'm working through a new project-based textbook and I want to have a repo that I can push to GitHub as I complete each chapter. However, I'd like each chapter-project to have its own repo in-case I need it.

#
Book_folder
.git
.gitignore
chapter_1
  | .git
  | .gitignore
chapter_2
  | .git
  | .gitignore```
#

My tree is gonna look something like that.

austere dome
thorny shell
#

👋

jolly dock
warm pollen
#

@covert kindle if you have git clones isnide another clone, you should probably use git submodules

nova plume
#

vscode orvim

#

?

dull vale
#

anyone here knows how I fix indentation for python on VSCode?

#

like that 'print' for example

#

I need to manually go and put a tab there

#

which is annoying asf

#

I already installed the 'python' plugin for VSCode

#

using autopep8

#

maybe some indents cant be automatically recognised, thus have to be manually fixed?

warm pollen
#

Have you restarted VSC after downloading the plug-in?

split isle
#

ReSharper is really the star, but none the less nice that they made the IDE

#

visual studio with resharper is probably as good as (probably slightly more developed than-) rider

hazy garden
marble vessel
#

does anyone have atom? i need help with it

#

i switched to a new PC

#

and i had to reinstall atom etc

#

and then i ran a hello world program to chekc but it said this

#

so i tried the link and ms store

#

apparently its bugged or smth

#

so i downloaded latest ver from py website

#

but it still says that

covert kindle
#

A new book I'm starting has me using Conda for virtual environments. However, it doesn't look appealing since from what I read Conda doesn't use pip, it uses its own channels. I only have experience with venv, but I've also heard about pipenv and virtualenv. I'm not an advanced user, but I would like to pick one that will let me grow into more feature that I might find useful down the road. Any recommendations between venv, pipenv, virtualenv, or Conda?

pipenv looks good, but seems pretty much dead* (no release in almost 2 years, but occasional commits)

#

I do like that venv creates the folder in the project itself. The folders presence reminds me that I have to activate the virtual environment.

heavy knot
#

Does anyone know a workaround for pyinstaller to use the local venv instead of the global enviorment to build executables?
(It happens even when pyinstaller is executed from "./venv/Scripts/pyinstaller.exe")
Thank you in advance!

#

Currently my External tool Config for PyInstaller looks like this. python

analog kettle
#

I'm setting up a remote environment on my work computer (Linux) that I can use from my laptop (Windows), which appears to be working, except that if I right-click on the tests directory of my project, I don't have the option to run all the tests.

#

In fact I get a message about not having a perl interpreter for this project.

maiden nova
#

@analog kettle Using which tool(s)?

analog kettle
#

Oh, with PyCharm. Forgot to say.

#

However now I'm having an entirely different issue.

maiden nova
#

What's that?

analog kettle
#
Error
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/unittest/case.py", line 59, in testPartExecutor
    yield
  File "/usr/local/lib/python3.7/unittest/case.py", line 628, in run
    testMethod()
  File "/usr/local/lib/python3.7/unittest/loader.py", line 34, in testFailure
    raise self._exception
ImportError: Failed to import test module: test_model
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/unittest/loader.py", line 154, in loadTestsFromName
    module = __import__(module_name)
  File "/tmp/pycharm_project_950/medacy/tests/model/test_model.py", line 11, in <module>
    from medacy.model.model import Model
  File "/tmp/pycharm_project_950/medacy/model/model.py", line 9, in <module>
    import joblib
  File "......lib/python3.7/site-packages/joblib/__init__.py", line 113, in <module>
    from .memory import Memory, MemorizedResult, register_store_backend
  File ".......lib/python3.7/site-packages/joblib/memory.py", line 33, in <module>
    from ._store_backends import StoreBackendBase, FileSystemStoreBackend
  File "...../lib/python3.7/site-packages/joblib/_store_backends.py", line 17, in <module>
    from . import numpy_pickle
  File "...../lib/python3.7/site-packages/joblib/numpy_pickle.py", line 15, in <module>
    from .compressor import lz4, LZ4_NOT_INSTALLED_ERROR
  File "......../lib/python3.7/site-packages/joblib/compressor.py", line 24, in <module>
    import lzma
  File "/usr/local/lib/python3.7/lzma.py", line 27, in <module>
    from _lzma import *
ModuleNotFoundError: No module named '_lzma'
#

I've been looking into it. It might be an issue with 3.7.

maiden nova
#

@analog kettle It seems that your python installation is incomplete (missing the _lzma.cpython-37m-x86_64-linux-gnu.so file which should be in the /usr/lib/python3.7/lib-dynload folder). Try reinstalling/updating it.

analog kettle
#

figures. I'll see if I can install 3.8

maiden nova
#

Can you check if you have the file?

analog kettle
#

Let's move to a help channel, which will be pretty ironic.

heavy knot
#

Hey i was wonderin if anyone here would be able to help i got a small probem with a theme in atom called "glass-syntax" witch allows you to set a background picture but in their example they are showing a transparent codeblock and i was wondering why im not getting the same result? is there a way for me to edit the theme or make my own?

maiden nova
heavy knot
#

Please @ me if you know i way i can do this

fierce sun
#

good diffing tools? Ive used beyond compare, but I would like something thats free

covert kindle
#

@heavy knot
By code block do you mean the main editor?

You can customize the color of it and set it to transparent. That should give you the effect you want.

Just noticed you're on atom. It still applies, you can make the change, just google it.

heavy knot
#

@covert kindle I mean the stuff syntax themes edit

covert kindle
#

Yes, that's still customizable. What you specify in your settings file overrides what the syntax theme says.

#

Can't remember how to do it in Atom, but I know i've done it.

#

Do a search

heavy knot
#

Wich settings file are we talking about?

#

@covert kindle

heavy knot
#

why all of a sudden my python interpreter is all of a sudden invalid XD

elder rock
#

How Can I Start Rich Presence In Pycharm ?

true vapor
#

You need an extension

warped topaz
#

how to create your own repository in git

heavy knot
#

@warped topaz

#

one of the better tutorials for beginners

rancid schoonerBOT
#

Hey @sage oriole!

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, .m4v, .mkv, .mov, .mp4, .mpeg, .mpg, .png, .tiff, .wmv, .svg, .psd, .ai, .aep, .xcf, .mp3, .wav, .ogg.

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

oblique heath
#

Hi guys, anybody knows how to take a screenshot of an inactive window?

#

I tried some stackoverflow solutions but do not work with Python 3.8 :(

analog kettle
#

I have a gaming laptop that's a bit heavy, and I'm considering the possibility of getting a smaller laptop for next school year, unless of course we don't have in-person lectures again

#

I've heard about people putting different versions of Linux on a chromebook, but I assume that machines designed for ChromeOS don't really have enough resources to run IDEs effectively?

heavy knot
#

oh if you're concerned about your privacy i suggest librem os

heavy knot
#

How can I configure Atom to run a shell?
Like input commands
Using the atom-runner
package

eager ginkgo
#

How do I get rid of this stupid line that keeps wrapping my text to the next line when I breach it in PyCharm

tawny temple
#

Go to your settings and search for "wrap" and you'll fine an option to turn it off

#

If you want the line itself gone, search for "margin" I think

eager ginkgo
#

Unfortunately I already have soft-wrap off

#

Seems to be this I found when I searched margin

tawny temple
#

Yes, that's it

#

Wrap on typing should be ticked off

#

And remove the "120" from the text box

eager ginkgo
#

I set it to 180 instead but it works as hoped 😊

#

Ty

serene oxide
#

Hello all,

I have a query regarding click. Will it be possible to provide an undefined number of values to an option via CLI?

I have gone through this link:- https://click.palletsprojects.com/en/7.x/arguments/#variadic-arguments and found that it could be possible via an argument, but for an option, as defined here https://click.palletsprojects.com/en/7.x/options/#multi-value-options, it seems we need to hardcode the exact number of input values beforehand.
I am actually adding a possibility of providing the files present in a directory using the regular expressions like *.md to one of the option --file-path, to a click project. As there can be any number of files present at a location. I would need to process all those files.
Let me know if it can be possible or if there is a workaround about it.

lethal hound
#
File "C:\ProgramData\Miniconda3\lib\site-packages\lxml\html\__init__.py", line 53, in <module>
    from .. import etree
ImportError: DLL load failed: The specified module could not be found.

Having trouble running scrapy from VS Code; haven't tried other editors yet. I installed from miniconda and am using the correct interpreter as far as I can tell

#

Seems like something is wrong with lxml

#

Wells turns out I have to force reinstall the correct version on windows

#

And I have to do it through the conda command prompt

chilly gazelle
#

Hello everyone.
My task is to create a reporting tool. And I need a tool that converts from markdown to .docx and .pdf. Found a tool called pandoc, understands many formats. But this tool terribly converts, markup just floats, images often crawl beyond the borders of a document, etc.

warm lynx
#

Hi Guys,
Anyone facing issues with Kite causing high memory and cpu usage ?
Kite is eating 1G of RAM and burning hot CPU

austere dome
#

I've heard about people putting different versions of Linux on a chromebook, but I assume that machines designed for ChromeOS don't really have enough resources to run IDEs effectively?
@analog kettle depends on the Chromebook. If you get Something like the high-end Chromebooks from Google themselves they can run VS Code (or so I've seen demos of)

analog kettle
#

@austere dome Thanks for your input. I'd prefer to have PyCharm, but my classes this coming year might be in a mix of languages, in which case I might as well get used to VSC.

finite fulcrum
#

Pycharm should handle some other languages fairly well if that's a concern

#

Pro basically has some of the other jetbrain ides integrated

analog kettle
#

I have Pro for at least another year, per the student package

#

but I'd be willing to pay for an annual subscription once they take that away.

finite fulcrum
#

IDEA has a bit more plugins, but that also includes python only being a plugin so I believe you don't get some of the pycharm pro features like profiling

analog kettle
#

I only write in Java when my classes require it, and unless my capstone project also requires Java, I think I'm safely done with Java going forward.

#

In which case I would have a little party where I uninstall IntelliJ.

finite fulcrum
#

Still have some other languages like Kotlin which it's suited for

#

But depending on what langauges exactly, pycharm can cover them

analog kettle
#

which sort of begs the question

#

why doesn't JetBrains just have one modular IDE?

#

I guess it's more profitable to offer several different ones?

finite fulcrum
#

Some feature like the aforementioned profiler may not be as easy to implement and distribute in that way

#

but that's pretty much a guess from me

#

Although that should just be invoking something like cprofile and then just visualizing it, so don't really know

analog kettle
#

Also, I'm just now learning that Kotlin was created by JetBrains. So that's cool, I guess

warm lynx
#

@analog kettle You can always get your student license renewed for another year as long as your student ID is not expired.

analog kettle
#

I think Jetbrains also has means of checking if you're an active student on top of whether or not you have an edu email.

warm lynx
#

They can but as long as you have a valid student ID that is not expired, they don't mind renewing student license for another year

#

Edu email is not a mandate
Either your institution should be listed in their database
or
you need to upload a valid student ID

rich sigil
#

i already deleted that plugin

#

but the error message still appears

#

any way to get rid of it?

rich sigil
#

just reinstalled it and its gone x

minor herald
#

Anyone knows how to debug python in a docker container? I've tried this in my launch / tasks.json:

    {
      "name": "Docker: PyChan",
      "type": "python",
      "request": "attach",
      "preLaunchTask": "docker-compose-start",
      "pathMappings": [
        {
          "localRoot": "${workspaceFolder}/python/src/",
          "remoteRoot": "/work/"
        }
      ],
      "port": 5678,
      "host": "127.0.0.1"
    }``````json
    {
      "label": "docker-compose-start",
      "type": "shell",
      "command": "docker-compose up --build -d",
      "isBackground": true,
      "problemMatcher": [
        {
          "pattern": [{ "regexp": ".", "file": 1, "location": 2, "message": 3 }],
          "background": {
            "activeOnStart": true,
            "beginsPattern": "^(Building py-service)$",
            "endsPattern": "^(Creating|Recreating|Starting) (py-container) ... (done)$"
          }
        }
      ]
    }```
#

I can't seen to attach to it no matter what, anyone has a clue on how to do this with vscode?

austere dome
minor herald
#

@austere dome thank you, I actually have the 2nd one, but everytime I remote connect to the container, I'll have to setup python inside it as well, right?

#

Rebuilding often wipe it as well

#

Like in order to actually do debugging, don't I have to setup launch.json and setting.json again

austere dome
#

@minor herald you don't need to do a remote connection in the second case; it's just like running any other Python app in that scenario. Since VS Code is running inside the container then it has access to everything inside of it. So at that point it's like running locally

minor herald
#

That sounds great! I'll give it a try again, thank you

minor herald
#

It works great, thank you again @austere dome

austere dome
chilly gazelle
#

Hey.
For more than a month now, my pycharm IDE has been buggy. During operation, friezes occur every 5 minutes. The whole system hangs. Because of this, it is impossible to work. How to deal with this? I have installed the ubuntu 18.04, 16 gigabytes of RAM.
I had to move to the VS Code IDE, but it doesn’t utterly exhaust me.

dull halo
#

how do i commit to github from pycharm

finite fulcrum
#

it should detect git in your project dir and then you can access it through the vcs tab or the checkmark in the top right corner

#

@chilly gazelle Not sure how much I'll be able to help but did you try going back to 2019?

dull halo
#

it should detect git in your project dir and then you can access it through the vcs tab or the checkmark in the top right corner
@finite fulcrum i tried clicking commit

#

but when i open github

#

nothing changes

#

do i have to select some options when commiting?

#

like?

chilly gazelle
#

I'm not sure if switching to version 2019 will help. Has anyone already had the same problems?

#

@finite fulcrum

finite fulcrum
#

@dull halo you have to push to remote for it to take effect there

dull halo
#

how do i tho

finite fulcrum
#

ctrl shift k in pycharm if you have the project properly set up

#

Performance on pycharm is pretty flawless for me (although there are some other issues) and I haven't seen anyone here ask about it; but reverting to an earlier release could do something

dull halo
#

great

finite fulcrum
#

I'm on windows myself can't help much beyond that if it's something specific to your os

dull halo
#

now i can ctrl + shift + k

heavy knot
#

hey

deep estuary
#

what is the error you are getting @heavy knot? what editor/ide?

heavy knot
#

idk what you mean by what errors bc i sent them but im using vs code

deep estuary
#

I'm not sure why it would be trying to lint that path

heavy knot
#

lint?

deep estuary
#

to lint is to check software for programming errors automatically https://en.wikipedia.org/wiki/Lint_(software)

lint, or a linter, is a tool that analyzes source code to flag programming errors, bugs, stylistic errors, and suspicious constructs. The term originates from a Unix utility that examined C language source code.

heavy knot
#

if it maters my in app cmd is not working

tepid ridge
#

I'm having some weird troubles with virtualenvwrapper. I'm using VSCode's integrated terminal, and Git Bash as the default shell (on Windows). Virtualenvwrapper used to work in VSCode's integrated terminal, but now it only works in Git Bash prompts outside of VSCode. I'm not sure what happened. Any clues?

heavy knot
#

ya for me nothin in terminal

deep estuary
#

@heavy knot this is out of my depth for sure, you can leave it here and you may get a response from some of the people behind the VSCode Python integrations or else you can join their Discord server at https://aka.ms/python-discord-invite

heavy knot
#

side question but what does it mean to be a discord partner ?

deep estuary
#

community program ran by Discord

heavy knot
#

Dont get it but anyway thanks for the help

austere dome
#

@heavy knot did you customize paths in your settings for where to look for Python files? Or did you open bulitins.pyi?

heavy knot
#

i dont even know what bulitins.pyi is

soft bridge
#

guys how do you add sublime text application to yur status

#

as in itll show playing sublime text

#

like how it is for eivl

urban elbow
soft bridge
#

aight ill check it out

#

thxx

heavy knot
#

anyone here knows well about lambda functions?

#

i need to run python in aws console

thin warren
#

hello

#

please Ive installed playsound but if I import and use it in a code it tells me theres no such module

sharp sorrel
#

Hi guys, I am getting a strange error when trying to use the decimals module.

from decimal import Decimal
print(Decimal('8.8') - Decimal('0.2'))```
#

I am using PyCharm 2020.1, Windows 10, Python 3.8 -- If I run the same code in Geany I get no errors and it runs as expected

quaint saffron
#

The file you’re running is also called decimal.py

#

So python is trying to import the file you’re running, not the decimal library

#

@sharp sorrel

sharp sorrel
#

@quaint saffron I hope that was it, my file is named deci.py now but not sure if I originally had it as decimal.py. I started a new venv in PyCharm and it is working correctly now

#

thank you

quaint saffron
sharp sorrel
#

I think that's where its trying to import modules from? Those aren't the directories with my python programs

quaint saffron
#

I’m not sure to be honest

#

Are you still getting the error? @sharp sorrel

sharp sorrel
#

Me either -- It's fixed now, I had actually installed VS code, had module import issues with that too and then came back to PyCharm, messed with the venv settings and now it's fine

quaint saffron
#

Yea, not quite sure what caused the issue but it’s fixed now 🤷‍♀️

sharp sorrel
#

Geany always worked and I suspect its because it doesn't create virtual environments

quaint saffron
#

Yeah, venvs do kinda mess things up when you don’t properly understand them

sharp sorrel
#

I could probably do some reading up on them

#

thanks for the help though, it always helps to get more eyes on the problem!

warped cliff
#

guys VS code python extenction is not working well for me

balmy venture
#

GUYS I NEED HELP QUICK who uses atom when i press ctrl+s everything is deleted and does't save

rose thunder
#

maybe you messed the keybinds

vale wedge
#

anyone here firm on gitlab actions/conditions - im error-blind on whats preventing the release upload for setuptools_scm to trigger a task

#

(also asked in the pypa channel on freenode)

digital cove
vale wedge
#

@digital cove at first glance it looks like the code is not ready for the cID variable to be none, however it is, you either have to handle that case or ensure itdoesnt happen, but thats all i can guess from the error

digital cove
#

cID is a Tkinter entry

vale wedge
#

the exception clearly indicates its None

finite fulcrum
#

This would probably be suited to a more general help channel, but if you pack it or something immediatelly then that returns None

rose thunder
#

!code

rancid schoonerBOT
#

Discord has support for Markdown, which allows you to post code with full syntax highlighting. Please use these whenever you paste code, as this helps improve the legibility and makes it easier for us to help you.

To do this, use the following method:

```python
print('Hello world!')
```

Note:
These are backticks, not quotes. Backticks can usually be found on the tilde key.
• You can also use py as the language instead of python
• The language must be on the first line next to the backticks with no space between them

This will result in the following:

print('Hello world!')
rose thunder
#
def multiply(a, b):
  a * b

guys what is wrong with this code??

finite fulcrum
#

You don't do anything with the a*b value you calculate, but you'll probably want to hop into a general help channel (see #❓|how-to-get-help ) unless it's related to some of the tools you're using

dusky tide
#

Hello, i am a new. My english is not very good, because i speak french

chilly pike
#

Hey ya'll, I am using git, when merging a branch I have, i.e. branch-a to master, do I get to keep and see all the commits i did in branch-a?

tawny temple
#

Yes. The branch does not get deleted.

chilly pike
#

So even if I delete branch-a after merging, I keep the commit history?

tawny temple
#

Yes, of course

#

Branches are just aliases to commits

#

Even if you delete the branch, the history will exist somewhere

#

Since you merged the commits into master, the history will be in master

#

But if you deleted a branch without merging it, I think the commits stay for a while and eventually get automatically deleted

chilly pike
#

I see, thank you 🙂

true vapor
#

Is it possible to have nested git repositories? Assuming it is possible - how terrible of an idea is it?

#

e.g I want a setup like this

main-repo/
    frontend/
        this is its own git repo
    backend/
        also its own git repo```
finite fulcrum
#

Not that experienced with git but I believe you can use submodules/subtree; or nothing's stopping you from tracking the .git although that does sounds like a horrible idea

thorny shell
#

yep, submodules it is. It's not a terrible idea, but last I checked (a couple of years ago) it was awkward with a bunch of sharp edges

#

try it though, it might be worthwhile.

#

There are some alternatives too iirc

warm pollen
#

The issue with submodules is that they are pinned to a specific commit

#

and that can be bad in some cases

thorny shell
warm pollen
#

Well, this book is the official book

thorny shell
#

@warm pollen I had the vague sense that that book wasn't updated as often as the man pages that are part of the git distribution. Am I wrong about that?

warm pollen
#

Well, I never had any issue with this book, it seems pretty up-to-date

#

There are almost never breaking changes with git anyway

twilit stratus
#

Anybody know how to use pygithub? I don't like the documentation

#

I wanna know how to retrieve the text from a specific folder in a repository

#

Ping me plz if you're answering

tawny temple
#

This isn't really the right channel for this. If you have more questions regarding this, I suggest you open a help channel. See #❓|how-to-get-help

twilit stratus
#

ok tyvm

#

ill try it

sand thistle
#

should I place a new .py file (my dashboard) in a separate branch on github?

#

is that good best practices

thorny shell
#

depends 🙂

#

does the new file belong with the existing files?

#

you should make a branch if you expect to have two or more versions of your project at once

#

with some difference between them

#

but if you're just improving the project, there's no big need for a branch

sand thistle
#

well

#

the new file is the dashboard

#

the current file is the backend logic

#

im doing analytics

thorny shell
#

Sounds like a whole separate project really

sand thistle
#

?

#

i guess im clueless how to use git

#

so it shouldn't even be in the same repo?

#

im confused

astral stirrup
#

Anyone dealt with Catchpoint api before?

void warren
#

Not sure if this is the right channel. Happy to delete it if not.
This appears to be correctly formatted JSON, but I've seen where "options" would have a colon (:). Does that matter?
[
{
"greeting": "WelcomeToSeattle.wav",
"Retries1": 3,
"name": "CityHallMain",
"Retries2": 3,
"description": "1 CitySeattle"
},
[
"options",
{
"id": "3xo1tGbXCbEmGeiNlpaZ",
"digit": 1
},
{
"id": "c7BKvyTBZyeSlgmF0HS4",
"digit": 2
}
]
]

thorny shell
#

as it stands now it's correct

#

if there were a colon after options, it'd be bogus, because options is in a list, not an object

#

granted that's a surprising way to lay out the data; it'd make sense for options to be an object key. But that's not how whoever wrote that, chose to do it

sand thistle
#

did you see what i wrote sir?

void warren
#

Well I wrote it and I'm trying to do it as best as possible. What do you recommend doing differently? I do see what you mean by making options and object key. It looks the way it does because I'm merging two arrays.

#

Ok I think what you said let me down some googling which yielded this which I think looks much better.
{
"name": "CityHallMain2",
"Input": 2,
"Match": 2,
"description": "1 800 ",
"greeting": "WelcomeToSeattle.wav2",
"options": [
{
"id": "3xo1tGbXCbEmGeiNlpaZ",
"digit": 1
},
{
"id": "c7BKvyTBZyeSlgmF0HS4",
"digit": 2
}
]
}

mellow willow
#

hi I have an nginx question.

i want to serve my flask app using my public ip address (of my local machine), and im using windows.
i currently setup an nginx server, and everything works fine using localhost. but when I try to visit my public IP, nothing's appearing

#

is it possible to do this? am I missing a firewall step? or should I have my own static ip or someshit?

austere flame
#

is your router configured to route traffic to your server?

rustic flower
#

have you forwarded port 80 to your app?

hushed orbit
#

Can you edit text files in a docker build process? We have a config file that needs a line replaced for a specific environment, do we just create a new config for this environment, or is it possible to do a find and replace during a build?

flint sphinx
#

Hi, I'm currently trying to split apart a diff into several patches but one of my smaller patches has this error /mnt/D/github/tpp> git apply /mnt/D/patch patch fragment without header at line 122: @@ -1368,6 +1369,59 @@ class give_avatar_item_handler(Command): however I cannot see what could be missing as it's in the middle of a bit I copy-pasted from thge larger diff.

rancid schoonerBOT
#

Hey @flint sphinx!

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

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

flint sphinx
#

oh ffs

#

well I would post the patch but the bot is a pain

tawny temple
#

You can share it via this

#

!paste

rancid schoonerBOT
#

Pasting large amounts of code

If your code is too long to fit in a codeblock in discord, you can paste your code here:
https://paste.pydis.com/

After pasting your code, save it by clicking the floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.

flint sphinx
#

I can't find a good guide to the git diff syntax or a checker that can tell me what's wrong, so I'm kinda stuck

#

I mean I could just go through the hastle of moving it manually but then I have to retest it and won't know how to fix this when it happens again

tawny temple
#

Can't say I'm familiar with manually editing patches either, sorry

#

Most I've done is edited commit messages in patches

#

@hushed orbit you can add a command in the dockerfile that replaces the line

#

This can be put in an if statement that is controlled by a build argument

warm pollen
#

You are missing the file name above the header at line 122 @flint sphinx

tawny temple
#

Is that what you're asking?

hushed orbit
#

Not exactly, the docker file will always build the same environemtn

#

but we have many other ways of deploying / testing

#

so i need the docker file to edit a line in a .cs file to disable https

#

else ican set an env var and write logic in the cs file

tawny temple
#

So why is my suggestion not going to apply here?

hushed orbit
#

I'm unsure what you mean by command, that's the part I'm actually asking about

tawny temple
#

And yeah you honestly should read an env var cause manually patching code sounds hacky and fragile

hushed orbit
#

It's what other pipelines do :^)

#

we're very fragile

flint sphinx
#

the patch I was splitting didn't have a filename there though as it was a second change to the file at line 110

tawny temple
#

So you can run a shell script within your dockerfile

warm pollen
#

This can be put in an if statement that is controlled by a build argument
(Can you make a conditional statement in a dockerfile) blobthinkingdown

tawny temple
#

I'm on.mobile so I can't really write any example

#

I've done something like this before

flint sphinx
#

wait the whole patch fails too pithink

warm pollen
#

Oh, using an unix if?

flint sphinx
#

OK it looks like I pulled out a part of that file already

tawny temple
#

iirc like RUN /bin/sh -c 'if [ build arg set ]; then replace line ; fi'

warm pollen
#

Ahh, that makes sense

tawny temple
#

@hushed orbit

warm pollen
#

IIRC you don't need the explicit /bin/bash if your image is properly configured

tawny temple
#

Yes you are right

#

I just wasn't sure at first

flint sphinx
#

Ok deleting a blank line made it spit out a different error

#

now it's complaining it won't apply

tawny temple
#

I also don't recall if builds args are available as environment variables. If they aren't then you can set some env variable with the value of the arg using a simple ENV

warm pollen
#

Yes they are

flint sphinx
#

OK that fixed when I tried it on the correct branch

heavy knot
#

is there any way to import pycharm keymap in vscode?

#

there is an extension, but it doesn't work that well

vapid torrent
#

it seems python does not handle junctions well

wooden ibex
#

Windows file junctions?

scenic chasm
#

Hey, can anyone good with PyCharm help me? I have a problem with virtual environments and i am so confused.

true vapor
#

just ask your question

#

someone here will probably be able to help

#

although it probably isn't me

scenic chasm
#

So I made a project and I started using pipenv - but then i got a lot of problems so I though i could switch to use virtualenv. But as I make a new interpreter for the project in the settings - it does something for a bit and says new virtualenvs installed but I cant see any vens folder not when I open the terminal in Pycharm it has any virtual environment activated

#

I have a requirementes.txt which I want to install - but I only want them to install to the project

#

So basically I want to assign a new virtualenv for existing project (I used previously pipenv) and install the packages from requirements.txt - and if this is even possible in to do in PyCharm

true vapor
#

I've got something I need to fix - and I'm really not sure how.

#

I have a docker container running PostgreSQL

#

and it's not currently using volumes or anything

#

I think I can get the data out and into a volume using just dockery stuff right?

#

if not, is the only solution to manually connect to the postgres instance and grab the data that way?

wooden ibex
#

@true vapor "docker export" might help you, but it's probably easier to just connect and do database dump

true vapor
#

alright thanks - I'll have a look at exporting, but probably just do a dump I guess

tranquil creek
#

@scenic chasm

I haven’t used virtualenv since venv is now built into python depending on your version

I suggest using it https://docs.python.org/3/library/venv.html

All new projects I create start with: python -m venv .venv

Nice. Clean simple.

Just remember to activate it and then do your pip install.

source .venv/bin/activate

I bet PyCharm will see that just fine.

#

if not, is the only solution to manually connect to the postgres instance and grab the data that way?
@true vapor

You could commit your container, then run the new image with a volume.

true vapor
#

I don't understand volumes all that well - but I'm pretty sure my dockerfile that I'm using is already pretty borked - would that mean the export stuff is likely to break things? Or should it be fine?

tranquil creek
#

With a named volume your container will store its data on the host.

Then you can kill the committed image/container and start a fresh Postgres container with a volume pointing to same named volume.

Theoretically. DBs are weird with docker. I wouldn’t do this for production.

true vapor
#

Hm - I think the best solution is just going to be exporting the data, creating the container correctly in the first place, then getting the data into it as actual data

#

It's probably gonna save work in the long run. Thanks for the suggestion of commit though - that's something useful to know about

tranquil creek
#

No prob

old fulcrum
#

Im working with Audio files / streams, and need to merge(overlap) multiple streams into one.

So far I have managed to do this with both pydub and ffmpeg-python.
But I ran into some issues with slow performance with pydub, and ffmpeg-python is very bare bones.

I wantet to ask here if there is anyone with experience with audio processing in python and had some tips.

#

I see there are quite a large number of modules for this.

full epoch
#

python isn't working and i installed the extension + python.exe

barren spoke
#

@full epoch I would check the pythonPath in the Python extension settings. look at both the User and Workspace paths.

full epoch
#

you should look closely what VSCode im running

wooden ibex
#

What does that matter?

full epoch
#

im running the insiders edition

wooden ibex
#

and?

barren spoke
#

and?

full epoch
#

so some things are updated

wooden ibex
#

ok, I'm pretty sure sommersoft advice is still valid and if not, you shouldn't be running the insiders edition

full epoch
#

wut

barren spoke
#

i think Rabbit's point is: if you're expecting stable software, don't run un-stable builds.

full epoch
#

im expecting beta tests

wooden ibex
#

I'm saying insider builds are for those who know the product and want to test it understanding they get limited support, if you are neither, you should no longer be beta and revert to stable

full epoch
#

oh

#

why am i sometimes stupid

wooden ibex
#

considering VSCode gets monthly releases, it's not like you get a ton of new features way before anyone else

full epoch
#

i installed the insiders

#

without PATH cuz i hate restarting the shell

wooden ibex
#

you have borked your VSCode apparently

full epoch
#

wdym

#

ahh s**T

#

do i really have to uninstall the insiders

#

i only did nothing but install it

#

not borking it

wooden ibex
#

if you bork everything just by installing insiders, you shouldn't be running it

full epoch
#

i installed the users edition after the insiders

barren spoke
#

i would imagine they use the same location to store application data (settings, config, etc).

full epoch
#

if i borked it's files my VSCode is unfortently corrupted

wooden ibex
#

I don't think they do

full epoch
#

does that mean i borked the users edition?

wooden ibex
#

🤷

#

rip them both out and reinstall stable

full epoch
#

k i will delete the insider

#

along with python

#

rip stable

#

btw im new to registry so i will keep away from the registry editor

#

🤞

#

ohhhh s**t

#

i didn't bork it

#

cwjafoDW

#

it was the disk space

#

awkward slience

frozen anchor
#

Hi, I was wondering about the gitignore function of github when creating a new project. I thought gitignore notates the files to exclude, and not the language. And it also doesnt declare the language the gitignore is written in... What is the difference between gitignore:Python and gitignore: C for example?

wooden ibex
#

It loads standard ignore file that excludes common files that language will put out but shouldn’t be committed

#

For python, it’s pycache files

#

GitHub publishes those files on GitHub somewhere.

frozen anchor
#

okay, thanks

#

So without gitignore it would push - for example - my venv - which it doesnt if I have a gitignore.

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

-from the gitignore

wooden ibex
#

Yep

tranquil creek
#

Also check out gitignore.io website. You can list severa things out like language or editor or platform. And it’ll build a good ignore file for you.

granite rose
#
    os.execv("/home/secret/Desktop/hack_bot.py", sys.argv)
OSError: [Errno 8] Exec format error
#

how to fix it

smoky grail
#

You need a hashbang because a Python file by itself isn't an executable, i.e. something like #!/usr/bin/env python in the first line of your script

neat haven
#

with requests, when i request an api that gives me a link

#

how do i get that link into a variable

#

the api only returns a link

heavy knot
#

Example for defining a request’s output:

import requests

r = requests.get(url)
t = r.text```
#

or requests.get(url).text. there is no difference except how both look like and how many lines it takes

neat haven
#

and when i try to print the api contents with exactly what you did i get an error

#

oh...

#

you dont need the () at the end

#

like with json

#

thats... the problem

#

ok

fresh beacon
#

how to run python files in vsc

neat haven
#

rightclick and

heavy knot
#

So basically what i want to do is make a python script that will change a value in a script (it will ask the user what to change it to) and then pack the file to a .exe , would really appreciate someone helping me 🙂

tribal tartan
#

Anyone uses poetry here? I've just installed scikit-learn with poetry add but when I do import scikit-learn in a python session (run with poetry ofc) I get invalid syntax.
I've chexked the .toml file and the package is there, also with other packages I didn't have this problem. Any idea where that could come from and how to fix it?

clever raven
#

@tribal tartan try import scikit_learn instead

#

dashes are the minus operator in python

#

not permitted in variable names

#

actually it looks like it might be import sklearn

#

so try that and you should be okay

tribal tartan
#

import sklearn works, huge thanks !

clever raven
#

this is often true, by the way, so make a mental note that pypi packages often have dashes but imports cannot

tribal tartan
#

Why is it that the name used to import the package isn't the same as the package name tho?

clever raven
#

so if the pypi package has a dash and replacing it with an underscore doesn't work, then look at the documentation for what to import

tribal tartan
#

Oh

clever raven
#

it's not the same because python doesn't know what to do with scikit-learn, that looks like you're trying to do scikit - learn as in subtraction

tribal tartan
#

Ok, I didn't think to check the doc, thought the problem came from me

clever raven
#

basically dashes are not allowed in imports, not allowed in variable names.

tribal tartan
#

Yeah that's probably why it made an invalid syntax, while underscore gave me no module named ...

clever raven
#

yeah exactly.

#

sorry I gave you the wrong one first, I've never used scikit-learn myself

tribal tartan
#

How did you know what would be the name then :o

clever raven
#

I went to their website, looked at the first guide

#

located here

tribal tartan
#

Ahh lmao

clever raven
#

and there's a code example with an import statement :)

tribal tartan
#

Anyway thanks for the help !

heavy knot
#

Question anyone have experience with q learning??

merry trout
#

Hi apologies if this is the wrong place to ask. I'm trying to run a subprocess on a bash command for MinIO client
subprocess.run(['/users/bin/mc', 'ls'])
^Running this command just outputs the help doc message for 'mc'. It does not seem to register the 'ls' argument.
Anyone know how I can get it to work?

true vapor
#

I'm trying to understand the role of ansible - and Wikipedia's reference to Ursula K Leguin isn't helping. Could anyone ELI5 it for me? Moved this question to OT

scarlet stratus
#

hi i coded a simple login and registration program

import stdiomask
print('++Login/register++')

# register
login = input("Put login: ")
password = input(stdiomask.getpass("Put password: "))
country = input("Put country: ")
phonenumber = input("Put phone numer: ")
adresemail = input("Put email adress: ")

if login == password:
    print('Invaild login!')
else:
    print('Good login!')
if country == phonenumber:
    print('Invaild country!')
else:
    print('Good country!')
if phonenumber == adresemail:
    print('Invaild phone number!')
else:
    print('Good phone number!')
if password == adresemail:
    print('Invaild password!')
else:
    print('Good password!')

print(login, password, phonenumber, country, adresemail)

# login
login2 = input('Put login: ')
password2 = input(stdiomask.getpass("Put password: "))

if login2 == login:
    print('Good login!')
else:
    print('Invaild login!')
if password2 == password:
    print('Good password!')
else:
    print('Invaild passwprd!')
print(login2, password2)

time.sleep(3)
mighty maple
#

In Pycharm, How can I switch to the testing area (Run area) to type an input values to test my codes, without having to use the mouse to click in that box down there?

high aspen
#

alt+4 maybe

mighty maple
#

Wrong

true vapor
#

Alt+4 works for me

mighty maple
true vapor
#

not f4

#

just 4 @mighty maple

mighty maple
#

Oh shit thanks my bad sorry

deep estuary
#

@scarlet stratus not really the channel for this 😃, feel free to republish your gist in #303934982764625920

scarlet stratus
#

ok sorry

deep estuary
#

no worries!

maiden nova
#

@heavy knot Which plugin are you using with Sublime?

heavy knot
#

@maiden nova sidebar enhancements and sublimeREPL

#

also i got it to work

civic walrus
#

Hi, I want to deploy an app where I am running Quart (an async flask module) and a discord bot in the same loop. My plan is to do it on heroku, what should I type on the procfile to have both running as planned?
here is my main file:

if __name__ == '__main__':
    loop = asyncio.get_event_loop()
    loop.create_task(client.start(os.getenv('DISCORD_TOKEN')))
    app.run(loop=loop, port=3000)

maiden nova
#

@heavy knot Glad to hear that.

heavy knot
#

@maiden nova ^v^

thorny shell
#

@civic walrus a web server and a bot on the same async loop? That sounds needlessly complex; couldn't you make them separate programs that communicate via (e.g.) a database, or some sort of RPC?

civic walrus
#

@thorny shell I figured it nvm

#

I am running into a different problem though which is async related

stone lance
#

Does anyone have any opinions on the best editor for OS X? I am just starting out and using Atom, just curious if anyone recommends anything as a better alternative

thorny shell
#

there are so many, and the choice is so personal

#

atom is probably OK

#

just tell it not to insert tabs

stone lance
#

yeah there is a huge variety and features

thorny shell
#

people here seem to like IDEs a lot

#

pycharm seems decent

#

Visual Studio Code too

#

I don't use any of those 🙂

stone lance
#

ive just been using atom and terminal

thorny shell
#

try 'em all

#

probably not much to be learned from us, unless we warn you away from something truly awful

#

like, don't use IDLE

stone lance
#

well so far it seems to work out, just wanted to make sure there wasnt something that was going to blow my socks off

thorny shell
#

there might well be, but since it's so personal ... 🤷

#

gotta try 'em all

stone lance
#

true that

wooden ibex
#

Only issue I see with Atom is possible future

#

Since Microsoft now owns two editors

tranquil creek
#

Agreed. VS Code is definitely pretty dominant. Especially in the Python community funny enough. Listen to the end of pretty much any Talk Python podcast. 😄

#

The Python extension for VS Code is the #1 extension by number of downloads by almost a factor of 2x (or was).

supple verge
#

Hi,Now i have situation like these,when im trying to open the file for the first time or open the file after when i closed it, when i open the PyCharm it gives screen like these.Can i skip these screen automatically in some way because i have just one interpreter.İf i can skip these screen with any way should i do it or is it better to pick interpreter version for everytime for situations like these.

heavy knot
#

Okay, this might be stupid question, but it's driving me nuts.
I just started learning programming and i'm using Visual Studio for my coding needs.

After sometime application changes behavior and if i click in middle of code it starts replacing letters instead of adding them.

#

It's a bit hard to explain

warm pollen
#

You have toggled a key on your keyboard, insert, most probably

heavy knot
#

Oh my god, so simple fix and i have been battling this thing for quite some time.

Funniest thing is that insert in my keyboard requires FN + Ö letter for this to happen and i have no clue how i managed to press it so many times.

Thank you!

warm pollen
#

Anytime!

proud trout
#

I recently started learning docker and I have a question regarding different base images.
I can use an Ubuntu as a base and then install python or directly use the Python image, whats the actual difference in the OS ?

warm pollen
#

The python images have different base images depending on what you want

#

Basically, python images are built above the distro images

#

If you don't need python, you can directly go for the base image and add other tools you need, but if you need python, it is recommended to go for the official python image based on the distro you want, so everything is managed by the PSF and correctly setup

proud trout
#

how do I know or configure the base image of the Python image

warm pollen
#

Container images are layered, you have the base distro image, the PSF adds python on top of that, and you put your app on top the two

#

The Python image is on the dockerhub

#

You can access it by using the right FROM clause at the top of you dockerfile

#

FROM python:3.8-slim will pull the 3.8 image based on debian slim I think

proud trout
#

ooh debian

#

kay

warm pollen
proud trout
#

so i guess using the python image is a shortcut for using a distro as base and then installing python

warm pollen
#

Yup

proud trout
#

right, thanks!

warm pollen
proud trout
#

wow thats complicated

warm pollen
#

Yup, that's why you don't really want to have to deal with that 😄

proud trout
#

okay

wooden ibex
#

Use Python images unless you have some really weird setup, however, you will see alot of blog articles recommending python:<version>-alpine, it's a trap

#

stick with python:<version> or python:<version>-slim

dreamy onyx
#

guys, what is a page fault? i dont understand it what happens when one occurs

wooden ibex
#

in what context?

true vapor
#

I know not to use alpine, but why is it so recommended?

wooden ibex
#

because it's "smaller" in disk/compute in theory

#

in practice, getting it to work requires such compromises that almost in all cases, it's neither of those things

#

one of those, let's go for optimization in all costs even when it makes our life hell

true vapor
#

I have a Django container that's got the static files stored in the container (bad practice, I know), the dumb thing is that it wasn't started with a volume - literally started with the simplest run command possible. Is there a way to attach a volume so that static files which were added at runtime aren't lost on a restart?

wooden ibex
#

Charlie, like you need to add files?

#

why not rebuild the container?

#

But yes, new run command with volume specified should attach a volume

#

I have containers with static files. If it doesn’t change and not too big, volumes are too much trouble

tight haven
#

I m writing the mux16 in hdl(frm nand2tetris)
Mux(a=a[0],b=b[0],sel=sel,out=a);
Now i will copy this line 16 times
I want a vim substitution command using regex that inserts the index in increasing order upto 15

#

Is there any way of implementing this?...would be really helpful

true vapor
#

The problem is that the users uploaded photos and stuff at runtime (and they now live in the container). Surely just running a new run command won't fix that?

wooden ibex
#

oh, no, you need a volume

#

yea, probably extract the content, move it to volume

warm pollen
#

Yup, that's the best way to do that, ideally you want all the data that should remain between reboot to be separated form the container, in a volume or so

true vapor
#

My understanding of what a volume is actually doing is probably wrong. But basically I have a bunch of static files in a container. If I kill that container, will the static files stay there?

#

stop not kill I guess

#

(my docker knowledge is very bad - I just type run and hope it works)

warm pollen
#

They probably would, but if you pull the container back to update it or so, the whole docker filesystem will be reset and you'd lost them

#

Basically, a volume is a binding container folder - host folder

#

So if you pull the container again, your files stay on the host filesystem

wooden ibex
#

it should

#

pretty sure container will hold onto data it has

#

you could test it easily I'm sure

true vapor
#

alright. So I stop the container, re run it with a volume, and I'm a bit safer? If so, this is a much simpler problem than I thought; for some reason I assumed it was harder than that

#

I'll test it first to make sure

wooden ibex
#

problem is, if you mount the volume where files are, I don't think the files will be pulled into volume

#

I think they will be overwritten

warm pollen
#

You have a command to create the container, and you need to add the binding within your run command, you should use docker-compose for that :)

#

They'll stay on the docker filesystem and be shadowed yeah

#

You have to copy them from within the containers

wooden ibex
#

like if you are storing files in your container in /app/files and then you put a mount point of /usr/dockercontainer1/files and mount them into /app/files, everything in /app/files will go poof

#

so I think the step is docker stop, docker export container, move the files you need into host file system, docker start mounting a volume where you moved the files

true vapor
#

Alright - I'll try that, thanks for he help

wooden ibex
#

some downtime required unfortunately

true vapor
#

that's fine - this is an archery club website with like 50 total users

wooden ibex
#

got it

toxic sentinel
#

Hi all. Quick Q: given a wheel for some package, is it possible to install just the dependencies but not the package itself? I know I can install just the package with pip install --no-deps, but I'm wondering if there's some incantation for doing the opposite...

Longer version if anyone wants context or can tell me a better approach: I've got an app I'm deploying with docker; right now my Dockerfile does a multistage build, where in the first stage I'm (among other things) building a wheel for my app (I happen to be using poetry for package management), and then in the second stage that wheel gets copied in and pip installed. My problem is that the app has a lot of dependencies (some of which are large, e.g. numpy, etc.) and I've realised that any time I change my app's code, the wheel changes, meaning that when I pip install the wheel in the second stage it reinstalls all the dependencies, pulling them from pypi again, etc. Obviously this is slow and results in bigger changes to my images than I'd like. So my thinking is that if I can install just the dependencies, and then just the package, that would separate that into two layers, the first of which could be cached nicely.

heavy knot
toxic sentinel
#

I figured out how to solve my problem: poetry export -f requirements.txt and then just pip install from that

ripe dew
#

@wooden ibex thank you for the link about python alpine docker image

tranquil creek
#

Research alpine and python image. I believe there are some performance issues because of the different libc in alpine?

#

@ripe dew ^

wooden ibex
#

thebouv, my link was "Don't use Alpine"

#

either python-slim or just python

ivory flax
#

I have multiple bad commits in a row under good commit in git and I already pushed everything.
How can I get rid of bad commits? There are no conflicts between them. I need to remove and the most recent good one

wooden ibex
#

you don't remove commits

ivory flax
#

ok I cherry-picked recent commit to a different branch

wooden ibex
#

that's fine

#

checkout the good commit

#

well, git revert is what you are looking for

#

yes, your old bad commits will show in history

#

but in many professional places, that's fine, it happens

ivory flax
#

I am making 2nd PR to for the repo and made a big commit on top of another PR branch so I had to force push cherry-picked latest commit

warm pollen
#

You can git reset them, but that's bad if you are working with a team, since it breaks the history

wooden ibex
#

that's why I said to revert

#

since while you cna reset a private repo, it's not considered ok in any team setting (like a workplace)

whole imp
#
class ServerData(JsonManager):

    def __int__(self, ServerId):
        super().__init__('./storage/ServerData.json')
        self._Server_Id = str(ServerId)

    '''
    
    decorator
    
    '''

    def conditional_decorator(cls : function, condition):
        def decorator(func):
            if not condition:
                # Return the function unchanged, not decorated.
                return func
            return cls(func)

        return decorator

    '''
    
    Server Data
    
    '''

    def ServerInitialization(self):
        return True

    '''
    
    User Data
    
    '''

    @conditional_decorator(True)
    def UserMaster(self, user_id):
        try:
            user_id = int(user_id)
        except ValueError:
            raise Exception('Please chose a valid int')
        if str(user_id) in [k for k in self.json_manager["user"]]:
            return self.json_manager["user"][user_id]
        else:
            new = self.json_manager
            new["user"][user_id] = {
                "is_kick": False,
                "is_ban": False,
                "is_mute": False,
                "is_admin": False,
                "reason": None,
                "time": None
            }
            self.json_manager = new
            return self.json_manager

Why my decorator is wrong ? and how I make it fonctionnal ?

tawny temple
eternal mirage
#

i need help with git

#

is it ok if i ask my question here?

thorny shell
#

yep

eternal mirage
#

so im using gitlab

thorny shell
#

ayup

eternal mirage
#

and my project is pretty large

thorny shell
#

ayup

eternal mirage
#

.git is nearly 100gb

thorny shell
#

ai yi yi

#

that is large

eternal mirage
#

and ive bypassed my gitlab limit. i cant push anymore

#

i know why this is happening

#

i have long txt files that ive been commiting

#

and they arent really desparate priority

#

for git commiting. but i didnt git ignore them in the begging, and now im paying the price for it

thorny shell
#

yeah, and of course just doing "git rm" on them won't help

eternal mirage
#

i want to completly erase my repositorys history of these files existence from the commits

thorny shell
#

there's a way.

#

I forget how, and I've never done it anyway

#

but there's a way

eternal mirage
#

as if they never existed. and push the changes to gitlab. but also keep them on my local disk

#

which seems like its supposed to get the job done but im incompetent and dont know what im doing

thorny shell
#

well, if you're incompetent you have three options:

  • become competent
  • find someone to help
  • live with it
#

otoh, no matter what the tool, you ought to be able to try it out on a toy repo

eternal mirage
#

im trying to do number 2

thorny shell
#

alas I ain't your guy

eternal mirage
#

atm im not concerned about erasing the big txts in question from my local disk as i have them backed up

#

(the logs are generated on a remote server and i just drag and drop them to my local disk anyway)

thorny shell
#

you should be concerned about screwing up the rest of your repository.

eternal mirage
#

yes thats why im nervous

thorny shell
#

have you considered the nuclear option: just throw away the current repo, and start a fresh one with the current commit (without the big files)?

#

you lose all your history, but it's awfully easy 🙂

eternal mirage
#

and the end goal is that these repository changes are pushed to gitlab so gitlab doesnt remember them either

#

assuming i get to the point of succesfully making the local repo changes

#

have you considered the nuclear option: just throw away the current repo, and start a fresh one with the current commit (without the big files)?
@thorny shell yes. thats the backup

thorny shell
#

you actually sound like you're in OK shape

#

you understand the basics -- i.e., it's safe to futz with your local repo

#

you just need to settle on a tool and try it out. If it's awful, restore from a (hopefully local!) backup, and try again

eternal mirage
#

my local repo is 50 commits ahead of whats currently pushed to gitlab. ide probably kms if i lost that

thorny shell
#

get a reliable storage medium and back up there

#

obviously.

#

or maybe pay gitlab more money, push there, fix the repo, push, then stop paying gitlab

eternal mirage
#

the .git is 80 gb

thorny shell
#

lotta options

eternal mirage
#

my bad 90 gb

thorny shell
#

I believe you

#

get a cheap USB drive and back up to that before you do anything else

eternal mirage
#

usb drive? what is this the stone age?

thorny shell
#

🤷

#

whatever

eternal mirage
#

ill just make a 2nd directory

thorny shell
#

that works too

#

wait wait use floppy disks

eternal mirage
#

hold on lemme do some math rq

eternal mirage
#

i would need 66296 3.5 inch floppys to hold my git repo

thorny shell
#

off you go, then

eternal mirage
#

just curios, assuming i can bfg nuke that out of my repos history, would it be possible to simply "push" the changes to gitlab, and have gitlab side of the repo erase that from its history too

thorny shell
#

doubt it

eternal mirage
#

then how would i get gitlab to do it

thorny shell
#

I assume you're going to have to delete the gitlab repo, and create a new one

#

you should poke around in their docs; they might have some guidance for this sort of situation

marble beacon
#

hello

#

does anyone manage G-suite with python?

wooden ibex
#

You could probably wrap GAM tool using python

valid thicket
#

Guys does GitLab support collaborations?

digital warren
#

how do you guys manage packages on an enterprise level? any infra / ops engineer have any advice? we're currently adopting python but have concerns around our users being able to install any packages they wish

wooden ibex
#

reomowhiskey, you could run your own pip server

#

we just have 3rd party tool that scans applications for security issues including libraries with security issues

valid thicket
#

Guys does GitLab support collaborations?

tawdry needle
#

what do you mean by "collaborations"

#

i think you can add collaborators to your repo, or create a team and add other people to the team

valid thicket
#

Oh can u? nice

marble beacon
#

@wooden ibex I was thinking more down the lines of using the google directory API rather than GAM

wooden ibex
#

Agunigugu, ok, then see if Google Directory library available

marble beacon
#

yup, found something

wooden ibex
#

GAM is written in python, you might be able to take that

marble beacon
#

I'm new to Python so I just want to get to know it by using some scenarios that I know

#

making api calls and manipulating data, works well for me 😄

wooden ibex
#

Enjoy

marble beacon
#

coming from powershell and I'm trying to bridge the knowledge

wooden ibex
#

I'm not a G Suite admin, just a G Suite user

#

but I was aware of GAM

marble beacon
#

yeah, thx 😄

wooden ibex
#

have fun with G Suite, I'm certainly not

digital warren
#

@wooden ibex thanks!

#

i see a few sites recommend bandit for security scanning. would you suggest this one to start with?

wooden ibex
#

it sucks, I'd highly recommend not doing it

#

sure, ours is HP Fortify, can not recommend

digital warren
#

probably won't go with hosting my own pip server

#

lol thanks. i'll check out a few

hearty bramble
#

hey y'all, does sphinx napoleon's google docstring mode support describing the structure of a tuple? i'm trying to do something like this

#

(that obviously doesn't work or else I wouldn't be asking ahahah, but i hope that describes well enough what i'm trying to do)

#

that renders to this, which isn't terrible, but isn't fantastic either

#

and it obviously sticks out like a sore thumb on the page

sand thistle
#

I am building a dashboard, and I'm curious how I should be structuring my git tree

#

should I have the actual dashboard on one branch, and the logic for data parsing in it's own branch?

thorny shell
#

heck no

#

make branches if you expect to merge them

sand thistle
#

so it's totally cool to have 2 .py files on the same branch

thorny shell
#

uh

sand thistle
#

even if they do different things

thorny shell
#

it's totally cool to have thousands of directories and files on one branch

sand thistle
#

gotcha

#

I had pictured it like, different aspects of the project go on different branches

thorny shell
#

ooohhh no

#

you might make different repos if you intend to keep the code separate, like if each bit of code gets its own pypi package.

sand thistle
#

you can have more than one repo?

#

oh nvm I see what you mean

#

ahh oh no

#

warning: CRLF will be replaced by LF

#

what have I done

forest bay
#

Separate repositories is a good idea

sand thistle
#

I did a git init, then I did a git add origin

#

then I did a git add .

forest bay
#

That warning is fine, git is just telling you it's replacing CRLF with LF when it commits, since CRLF is a Windows artifact

sand thistle
#

oh

#

oh mfer, i have my venv inside my repo oh no

forest bay
#

add the venv directory to a .gitignore file

sand thistle
#

gotcha

#

well

#

my .py file is in the venv directory thoug

#

I guess I just move it out and add the venv folder

forest bay
#

it's easier to use pipenv to manage your environment, then you don't need to worry about where the venv folder is

sand thistle
#

yeah i like pipenv

#

I forgot to use it and used pip instead on the last couple projects

forest bay
#

pipenv uses pip

#

it's basically pip+virtualenv/venv+lots of other useful features

sand thistle
#

I used it in the past

#

it's my go to usually. I had a nightmare incident while installing homebrew

#

it broke all my sym link

#

I used pipenv to help

#

how can I check what I already have committed, like what files

#

I don't need the log

wooden ibex
#

in commit log

#

something like Git Lens or other graphical git applications will show you

#

so will GitHub if you check

sand thistle
#

the log only holds the messages

#

not the content

#

or am I mistaken?

tawny temple
#

the log can show changes too git log -p

#

The output format can be customised a lot

sand thistle
#

so much to learn, such little time

tawny temple
#

I'm not sure if there's a simple command to show all checked in files like you're asking

#

I wouldn't be surprised if that exists, but I don't know of it.

#

You could do it by looking at the log but that may be tedious if you have lots of commits

#

As it only shows files for each commit, not all at once

#

Easiest way is just to go on GitHub or whatever and have a look

sand thistle
#

idk when I do git -log i only see the messages i log them under

tawny temple
#

git log --name-only

#

I guess it's not so bad, since you can specify the range to only show unpushed commits

#

Ah here's a way to do it. Man git has so many commands. I was trying to do it with log, but it's simpler with diff git diff origin/master..HEAD --name-only cause I don't have to worry about commit messages showing

sand thistle
#

.>

#

thank you

#

just kind of... wow.... so many commands, so many things to learn.

thorny shell
#

git has about 1,000 commands 😐

warm pollen
#

Well, at least 950 of them are just internals

mighty apex
#

hello

#

can someone share their sublimeREPL keybind setting

heavy knot
#

When using Anaconda, is it a good idea to put the src directory inside ~/anaconda3/env/[EnvironmentName]/ ?

#

*~/anaconda3/envs/

heavy knot
#

or the site-packages folder inside there?

What I am trying to see is what the best practice is to avoid having to change sys.path or the environment variable

sharp warren
#

Hey there, help with aws glue. Error "java.lang.IllegalStateException: User did not initialize spark context!", Am using my existing pyspark scripts. How can I initialize spark context

tawdry needle
#

what kind of src directory? @heavy knot

#

generally no i wouldnt mess with the env directly like that

#

or with any anaconda internals

hollow shell
#

Hey guys, I think this is the correct channel but if not please let me know
So I am making an api with python and flask and I want to document it but I am not really sure how. I know about sphinx and I've read a few things about it but I am still not really sure how my comments should look like? So any links or pointers that could help?

wooden ibex
#

Spyros, look at FASTAPI

#

comes with built in documentation

heavy knot
#

PyInstaller isn't working for me... I've done all the steps necessary, installed python (to Path), and ran the command needed to build my executable. However it gives me this error in cmd/terminal...

#

and yes, I have installed PyInstaller

hollow shell
#

Spyros, look at FASTAPI
@wooden ibex I have heard of it before. So far I have barely started so I guess I could take a look. Is the advantage that it is actually faster (and docs) or is it more fine tuned for apis and it will actually make my life easier?

wooden ibex
#

It's designed for REST APIs

#

like nothing else

#

So if your intention is building APIs, it's great

#

and it's pretty damn speedy

hollow shell
#

Okay cool, my intention is to build the api and have a different web app and desktop/phone apps that talks to it so yeah, I'll give it a try

#

Thanks for the recommendation

wooden ibex
#

I use it at my company for Ops stuff

#

We also use it for our interview code challenges

hollow shell
#

Then I should certainly give it a look in case I want to work for your company haha

wooden ibex
#

no

#

I use it to test people ability to read REST API

#

it's backend server I run on my laptop for them

hollow shell
#

Huh alright, it was a joke anyway but interesting

wooden ibex
#

We do alot of API work at my division

#

so coding test is: "We have web API at http://127.0.0.1:8080 and you can read the docs at /docs please have your application hit API, Multiple 898 by 46565, greet you by name and get weather for KLAX"

hollow shell
#

I assume I can use SQLalchemy with it, right? I don't really mind writting my own sql but I'd rather use something like sqla to easily be able to use a different database

wooden ibex
#

I don't use SQLAlchemy with it but I don't see why not

hollow shell
#

Okay thanks, I'll look into it more

wooden ibex
hollow shell
#

You can easily adapt it to any database supported by SQLAlchemy, like:
Postgresql
..
SQLite
Sounds great to me haha

wooden ibex
#

We use Azure at company so I use CosmosDB

hollow shell
#

What I am making will be self-hosted, so SQLite will be enough, but if I decide to host something public my self I want to be able to use PostgrSQL there just in case it gets big

analog kettle
#

I might have asked this before, but why do you think IntelliJ (the Java IDE from the makers of PyCharm) costs more than PyCharm?

wooden ibex
#

Java tends to be used by established corporations who have money

#

thus, if their java developers want expensive IDE, they will pay for it, there also isn't alot of competition

finite fulcrum
#

It also has a more plugins which offer features that lean towards things like pycharm or their other ides/tools

viral marlin
#

If I have to code in Java I would potentially pay in blood for a good IDE that helps overcome some of the more tedious parts of Java.

#

Especially if I'm building something that needs to interface with weird COTS plugins that have limited support and restrictive implementation requirements

wooden ibex
#

agreed, most of divisions at work code in Java, they all use either Eclipse or IntellJ and we happily pay for either

#

my group is one of rare ones that doesn't

analog kettle
#

@viral marlin I will not code in Java unless the IDE is handling the verbosity for me.

#

@wooden ibex does your division use Python, then?

wooden ibex
#

Stelercus, .Net Core, I use python for my SRE stuff

#

and for personal discord bot

true vapor
#

I might have asked this before, but why do you think IntelliJ (the Java IDE from the makers of PyCharm) costs more than PyCharm?
@analog kettle

Intellij ultimate includes all features of all jetbrains ides. It can do everything pycharm can and more

hoary dock
#

'and more' ?

#

pretty much the same within their different stack,

true vapor
#

No - IntelliJ ultimate lets you install the features of every single IDE that jetbrains makes

#

It can do Python, Go, PHP, JS, everything

#

Pycharm can only do Python and JS

#

If you have IJ ultimate properly configured, you don't need any other IDE (except maybe Visual Studio)

stable orbit
wooden ibex
#

looks like a trojan?

#

AV software is notorious false positive prone

#

if you are building EXEs, it's something that comes up alot

finite fulcrum
#

the actual exe bootloader is shared between the pyinstaller installs