#tools-and-devops

1 messages · Page 34 of 1

dire quartz
#

Yeah, that's what I usually do

#

Postman

tawny temple
#

Paw looks nice but I don't us macOS unfortunately

slow wasp
#

then postman

tawny temple
#

Alright thanks. I've heard of it before but was just seeing if anything else may be good

#

Gonna try it out now

#

In an insane sort of way I enjoyed doing it through CLI with the REPL

dire quartz
#

You so crazy

slow wasp
#

well, actually I see the reasons, sometimes I would also go for REPL to test APIs

tawny temple
#

The UI is already giving me issues

#

I want to keep the window small

#

but stuff isn't fitting too well

slow wasp
#

well yes, postman has not the best UX, but functionality is great and the other options are even worse.

misty jungle
#

what I wanted to ask earlier was how can I use selenium to click on a button that has neither a id nor a class name

#

its not my webpage I am just trying to automate something in that so I can't really change the html

#

also on a different note, for some who has an intermediate knowledge in python what would you recommend he/she to focus on, numpy, pandas, flask etc

civic hound
#

if a button has no id or class name then most likely the site is protecting itself from you being able to click on it. the Terms of Service should answer if you are allowed to scrape the site or not.

#

any button you can find with selenium you can click on.

misty jungle
#

right now I am using something like this

#

driver.find_element_by_xpath("//button[4]").click()

#

it just clicks the fourth button, which happens to be the one I want to click but if I replace button[4] with button[x] it fails for some reasons, x having valid values

#

so the whole thing is a string and I must be formatting it before passing in x?? it just occurred to me, I will trythat

civic hound
#

you need to use an integer as value for indexing

misty jungle
#

I checked the class it is an integer

#

I just checked turns out it had to formatted before giving it there

#

'//button['+str(x)+']'

#

is there an alternative or is this how one normally does these??

civic hound
#

what is x ?

misty jungle
#

x is a random integer I generate

#

x=random.randrange(1,5)

civic hound
#

then you can just use x inside the index

misty jungle
#

the whole point of what I was trying to do was to create a script that run for 4 times with each time clicking a random button, but since I had no id or class I was stuck with random generation

#

yeah but for some reasons it wasn't working

civic hound
#

then it is not an int

misty jungle
#

xpathString='//button['+str(x)+']'
driver.find_element_by_xpath(xpathString).click()

#

doing this way it worked

#

driver.find_element_by_xpath("//button[x]").click() was not working

#

I might be messing around something here, I just started this like 5 hours ago

#

so I don't really know what I am doing lol

civic hound
#

that is because you are using a string "//button[x]"

#

so the x will not be converted to the correct int

#

you can use f-string to add the x into that string

#
f"//button[{x}]"
#

!f-string

#

!f-strings

rancid schoonerBOT
#
f-strings

In Python, there are several ways to do string interpolation, including using %s's and by using the + operator to concatenate strings together. However, because some of these methods offer poor readability and require typecasting to prevent errors, you should for the most part be using a feature called format strings.

In Python 3.6 or later, we can use f-strings like this:

snake = "Pythons"
print(f"{snake} are some of the largest snakes in the world")

In earlier versions of Python or in projects where backwards compatibility is very important, use str.format() like this:

snake = "Pythons"

# With str.format() you can either use indexes
print("{0} are some of the largest snakes in the world".format(snake))

# Or keyword arguments
print("{family} are some of the largest snakes in the world".format(family=snake))
tawny temple
#

Hello

#

Can someone think of a strategy for making a cross platform version of the following? bash pipenv run /usr/bin/env bash -c "git ls-files -- '*.py' | xargs pre-commit run flake8 --files"

#

It's someone I want to be able to put in the [scripts] section of a Pipfile.

#

It could probably be written in Python and executed with python -c, but that isn't very clean

#

Well, it doesn't have to be particularly clean cause it will essentially be an alias after all.

#
import subprocess, sys; files = subprocess.run(['git', 'ls-files', '--', '*.py'], capture_output=True).stdout.decode().strip().split('\n'); args = ['pre-commit', 'run', 'flake8', '--files'] + files; subprocess.run(args, stdout=sys.stdout, stderr=sys.stderr)```
#

Any better ideas?

tacit pollen
#

Hi Everyone! Someone gave me a script to use at work (I'm new to Python a little bit), and I'm having trouble making sure one of the modules are installed (mozscape).. I have python3 installed and pip, setuptools, wheel, etc..

#

But I'm not sure how to ensure that the modules that a particular script is using are installed and ready to be used by that script

#

I'm working via the command line

#

Should I have asked this in another topic?

vivid cargo
#

type pip list | fgrep -i 'mozscape'

tacit pollen
#

returns nothing

vivid cargo
#

try pip install module-name-here

tacit pollen
#

I've tried pip install mozscape

#

I get: Collecting mozscape
ERROR: Could not find a version that satisfies the requirement mozscape (from versions: none)
ERROR: No matching distribution found for mozscape

vivid cargo
#

search on pypi for your module then

tacit pollen
#

ok, thx, I've not heard of pypi yet. 😃 This is llike my second or third day using python

vivid cargo
#

aah

#

young padawan

tacit pollen
#

lol

#

Apparently, the module I'm looking for is a private one (just contacted the developer).. I appreciate your help, sry for wasting your time

vivid cargo
#

np

plush tree
forest bay
#

@tawny temple take that python code, put it in a file that you call from the pip file

tawny temple
#

But I don't see the point in having it be an external file

mild lynx
#

Any idea of a good encoding finder other that findencoding.com since that is down

tawny temple
#

There's a python package than can do that

#

It's called chardet

heavy knot
#

Apparently I do not have the ScrolledText module

#

My current Python version is 3.7.1, I am using Linux Mint 19.1, how would I obtain the module?

heavy knot
#

Anyone know how to get VSCode to stop highlighting flake8 errors about tabs not being multiples of four... when it's set to use spaces, and to input 4 spaces instead?...

plush tree
#

You can set the number of spaces in the bottom right corner, or ctrl+shift+p indent then select the indent size option

tacit sparrow
#

Hello, in VSCode, I've no autocompletion for discord.py (and for pymysql too). I've no idea what's wrong.

#

Nobody can help? )-:

tacit sparrow
#

Pls help 😄

tacit sparrow
#

Is my question written false?

eternal flicker
#

I’m not home so I can’t check, do you have auto completion for other stuff?

tacit sparrow
#

Oh sorry. I've downloaded PyCharm (JetBrains) and I'm using that now.. Works better

chrome loom
#

At the bottom it should have shown the Python version. You might have to click and change to match where you're installing packages

pastel fog
#

I'm trying to change an old commiter email address/name with ```git filter-branch --env-filter '

OLD_EMAIL="WRONG_EMAIL"
CORRECT_NAME="MY_NAME"
CORRECT_EMAIL="MY_EMAIL"

if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]
then
export GIT_COMMITTER_NAME="$CORRECT_NAME"
export GIT_COMMITTER_EMAIL="$CORRECT_EMAIL"
fi
' --tag-name-filter cat -- --branches --tagsright now, but after doing so git is warning meWARNING: Ref 'refs/heads/master' is unchangedand git --no-pager show -s --format='%cn <%ce>' COMMIT_HASH``` is also showing me the old name/email... what am I doing wrong?

tawny temple
#

@pastel fog I'm not familiar with those commands so I couldn't tell you what's wrong

#

But here's a perhaps crazy alternate approach

#

You can use git format-patch to create patches of all commits and then write a bash script or use some existing tools to change all the emails and names in the patches

#

You can then use git am --committer-date-is-author-date *.patch to apply the patches

#

I believe you'd have to remove the original commits before applying their patches

#

This might mess up the history too much though, I'm not sure. I've only ever done it for bulk-amending commit messages

#

Actually, just try not using export for your command

opal oasis
#

does anyone know how to fix syntax highlighting in vim? When I turn syntax on in a python file, keywords get boldened or underlined, but I can't get a color scheme to show color

#

hmm $TERM is set to vt220. maybe that has something to do with it

stable cloak
#

Since it's better suited for Py3

#

(Other than that I know nothing about VIM)

opal oasis
#

I see colors now! woohoo

#

sorry, python2.7 per forces i have no control over

#

solution was setting my $TERM variable to xterm-256color

calm wraith
#

Beginner here. Was using VSCode but I couldn't get Python linting working, and I didn't want to spend more time on it, so I installed PyCharm. Using the same font in both programs, PyCharm's font looks smaller and thinner. Doesn't even look like the same font now that I'm looking at it more. Seems like it's just changing the font in the program menus but not in my files that I have open. Am I missing something here?

#

Ofc I got it right after I asked it. You have to change it in the 'Editor' menu, not 'Appearance and Behavior'

snow sentinel
#

If I reinstall python, and then IdeX stops working, how do I fix it?

wispy rampart
#

I have a Q:

I have a file which I uploaded with git.. I no longer want git to track & update the changes in that file since it will update by itself online, so do I use the git rm --cached FILENAME.txt command to make git ignore the changes?

tawny temple
#

Try git update-index --assume-unchanged FILENAME.txt

#

Your command would end up removing it from the repository I believe, which doesn't seem to be what you want.

wispy rampart
#

oh yeah, definitely not

#

and would I only need to run this command once (i.e. not every time I push changes?)

barren iron
#

@wispy rampart I find doing file.txt.default is the strategy I use.

#

Then in your README explain how you copy and paste that file

#

Remove the default

#

And change your code to accommodate that change

#

Is that roughly what you want to do?

wispy rampart
#

sorry, I don't quite follow

#

what does putting the .default accomplish?

barren iron
#

@wispy rampart What file are you trying to keep on your repo?

#

Maybe I'm misunderstanding what you want.

wispy rampart
#

i'll add more context, it's basically a csv file I pushed with some default values

#

there's some discord commands I have in my bot which change the values

barren iron
#

Ok so.

wispy rampart
#

so if I make some changes in the code of my bot and push those changes, it would push back that default value csv file

barren iron
#

By making a default file, this can be uploaded to github

wispy rampart
#

which I don't want

barren iron
#

So people can see what it'll look like

#

Then your bot will edit a different file.

#

Does that make sense?

wispy rampart
#

oh

#

I see what you mean now

#

I guess I could do that

calm wraith
#

If I use tab to indent in PyCharm, I get a pep8 error stating that 'indentation is not a multiple of four', but if I use 4 spaces in the same code, I get no error. Am I supposed to do 4 spaces instead of hitting tab?

rotund kelp
#

You can choose which you use, but you can't mix or change it.

calm wraith
#

Is one recommended over the other? And how do I change it in PyCharm so I'm not getting errors?

rotund kelp
#
File OK:
def some():
     print("ok")

def some():
     print("ok")
File NOT OK:
def some():
     print("nok")

def some():
<tab>print("nok")
File NOT OK:
def some():
     print("nok")

def some():
  print("nok")
#

the most commonly used would be 4 spaces

#

But also the most commonly used is pressing tab and the editor replaces it by spaces.

calm wraith
#

I'll check google on how to change tab in PyCharm to 4 spaces

#

yeah. thank you for the help

rotund kelp
#

pycharm: settings>editor > code style > python "Tab and indents"

calm wraith
#

I wound up there, everything is unchecked by default with tab size set to 4

rotund kelp
#

Then it's alright most likely

calm wraith
#

well if i hit tab i'm getting the error

rotund kelp
#

It's possibly that your file already contains a tab or something wrong before you edit it.

#

Press CTRL-ALT-L in the file and reformat it.

calm wraith
#

that worked, not sure why, but tab doesn't throw an error anymore so thanks

rotund kelp
#

With enough setting changes you can have it so pycharm shows you the tabs and trailing spaces

coarse rapids
#

Nice tip.

obsidian valley
#

how do i use vscode to upload new code i'm learning to my github?

#

there's an extension but i'm not sure how to follow with configuration

humble seal
#

Anyone got a program/web based tool that can turn python code into a flow chart

#

without having to iinstal a program

barren iron
#

@obsidian valley You shouldn't need any extensions, you use a tool called git,

#

Have you heard of it before?

clever moat
#

anyone have any good emacs plugins for python?

peak juniper
#

look into elpy and jedi

clever moat
#

thanks!

peak juniper
#

:)

#

you're welcome my fellow emacsen

clever moat
#

coming from years of vim, emacs is beautiful but hard ;-;

#

emacsen?

peak juniper
#

kinda like a demonym for emacs users

clever moat
#

demonym? biskthink

peak juniper
#

heh

clever moat
#

i know like
almost nothing about emacs

#

i have MELPA and SLIME enabled and thats literally it lmao

peak juniper
#

well if you have any questions, i'm more than happy to answer them, been using emacs for over a decade

#

@deep estuary uses it too, hi joe

deep estuary
#

hi fisk

#

ayy emacs

peak juniper
#

ayyyy

clever moat
#

thanks, appreciate it :)

tawny temple
#

Uh, what the hell? Installing dependencies from Pipfile.lock (f6ba85)��� An error occurred while installing click==7.0 --hash=sha256:2335065e6395b9e67ca716de5f7526736bfa6ceead690adf616d925bdc622b13 --hash=sha256:5b94b49521f6456670fdb30cd82a4eca9412788a93fa6dd6df72c94d5a8ff2d7! Will try again. An error occurred while installing flask==1.0.3 --hash=sha256:ad7c6d841e64296b962296c2c2dabc6543752985727af86a975072dea984b6f3 --hash=sha256:e7d32475d1de5facaa55e3958bc4ec66d3762076b074296aa50ef8fdc5b9df61! Will try again. An error occurred while installing gunicorn==19.9.0 --hash=sha256:aa8e0b40b4157b36a5df5e599f45c9c76d6af43845ba3b3b0efe2c70473c2471 --hash=sha256:fa2662097c66f920f53f70621c6c58ca4a3c4d3434205e608e121b5b3b71f4f3! Will try again. An error occurred while installing itsdangerous==1.1.0 --hash=sha256:321b033d07f2a4136d3ec762eac9f16a10ccd60f53c0c91af90217ace7ba1f19 --hash=sha256:b12271b2047cb23eeb98c8b5622e2e5c5e9abd9784a153e9d8ef9cb4dd09d749! Will try again. An error occurred while installing jinja2==2.10.1 --hash=sha256:065c4f02ebe7f7cf559e49ee5a95fb800a9e4528727aec6f24402a5374c65013 --hash=sha256:14dd6caf1527abb21f08f86c784eac40853ba93edb79552aa1e4b8aef1b61c7b! Will try again. An error occurred while installing markupsafe==1.1.1 --hash=sha256:00bc623926325b26bb9605ae9eae8a215691f33cae5df11ca5424f06f2d1f473

#

I haven't even touched the lock file and suddenly everything is failing

#

Okay something bigger is going on

#
fetch http://dl-cdn.alpinelinux.org/alpine/v3.9/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.9/community/x86_64/APKINDEX.tar.gz
WARNING: Ignoring http://dl-cdn.alpinelinux.org/alpine/v3.9/main/x86_64/APKINDEX.tar.gz: temporary error (try again later)
vivid cargo
#

Just install it without piplock

tawny temple
#

This is in a docker container

#

I need to make sure it works with a lock file

vivid cargo
#

Wait all locks are failing?

tawny temple
#

Everything is fucked though, it can't even get package index for alpine

vivid cargo
#

Strange

tawny temple
#

I'll just restart the system

#

Yeah that fixed it

vivid cargo
#

really?

#

boi

tawny temple
#

It's a VM so I think when I suspended and resumed it earlier it fucked shit up for docker

prisma nexus
#

is there a place to get .vimrcs for various settings prewritten that i can customize from there?

tawny temple
#

Not that I know of, but there are some people who upload theirs to GitHub

#

That's how I got mine

prisma nexus
#

kk!

random breach
#

how do i add multi-line example code in pycharm docstrings?

#

does every line have to start with >>>?

tawny temple
#

Yeah I believe so

#

Well not exactly

#

There's also ...

#

that's for when you're inside a statement

random breach
#

ty

random breach
#

im looking to try out the new shared_memory stuff in the 3.8 beta

#

this imports fine but looks like pycharm doesnt pick up on its existence

#

all i did was add the 3.8 python.exe as an interpreter

#

do i need to do something else too?

slow wasp
#

try to invalidate cache

random breach
#

oh no... ok here goes

#

it always takes like 15 minutes to rebuild D:

#

pray for me

#

oh that wasnt so bad

#

invalidating cache didnt fix it though unfortunately

#

still red

slow wasp
#

hm

heavy knot
#

does git merge, merge from, or merge to a branch

vivid cargo
#

Google it

tawny temple
#

If you currently have a branch named feature checked out

#

and you do git merge origin/master

#

The commits from origin/master will be put into your feature branch

lost rock
#

I think as a rule of thumb, it's always your current branch that will be modified if multiple branches are involved in an action

stable cloak
#

@vivid cargo If you don't have anything actually constructive to add to the question, then don't say it. "Google it" isn't an acceptable answer we give here

#

Clear?

vivid cargo
#

Okay

forest hemlock
#

Does anyone know why VS code is making these massive tabs? I checked the tab to spaces conversion and its 4... but these massive tabs are 8 for some annoying reason. Please help

pearl cloud
#

IIRC there's editor setting and project/workspace settings, so make sure to check both

eternal flicker
#

on the bottom right of the screen, on the bar there’s a button that says Spaces:

manic minnow
#

ok this has been driving me absolutely crazy

#

vscode will remember your last session if close and open it EXCEPT

#

if you have vscode closed, and use a context menu or something to directly open a file in vscode

#

it will launch vscode and only open that file, and completely lose your old session

#

does anyone have a clue how to stop it from doing this?

#

its absolutely insane behavior.

calm wraith
#

All of my fonts look thinner/skinnier in Pycharm compared to other editors. Does anyone know why?

tawny temple
#

So I have a strange situation. I'm using a local directory as a volume for docker run. Problem is that my local venv doesn't work in the container. That's fine as the container has it's own working venv, but in a different directory. So how can I tell pipenv to use that venv instead of the one in the current directory?

#

I was hoping there was some environment variable for it, but I can't find one.

#

It does support .venv files but if I use one then it would also get used locally

#

Supposedly it does honour VIRTUAL_ENV which would be set when activating the venv myself

#

Yet it doesn't doesn't show the message I sometimes see saying "pipenv has detected a virtual environment blah blah blah...."

tawny temple
#

Never mind, fixed using PIPENV_PIPFILE

clever moat
#

whats a good emacs colorscheme?

peak juniper
#

i'm currently using darktooth

eternal flicker
#

speaking about emacs, I failed to convert to the dark side, and am back on neovim

peak juniper
#

boooooooo lol

plush tree
#

molokai is pretty good

clever moat
#

i like lighter themes tbh

#

i code in the dark a lot, makes it easier to see the keyboard

plush tree
#

HERESY

clever moat
#

F I T E M E

#

currently using tango. it's lighter, but not super bright which is nice

#

just kinda boring

#

is there a way to execute a shell command, similar to vim's !?

#

oh, M-!

plush tree
#

oo graham is nice

#

@eternal flicker what turned you off?

peak juniper
#

maybe kosa just can't figure out how to exit vim so they never got to try emacs in the first place

plush tree
#

@peak juniper Do you know how to create an html-like doc note in org-mode?

peak juniper
#

man i wish, i've seen it done, but i just have not sat down and really taught myself org-mode yet. I've played around with table generation though, which was fun

#

i mean, it's not terribly complicated i guess, but i haven't done it

plush tree
#

It's such a cool way to write docs, it's just so god damn deep

peak juniper
#

yea it's awesome, the LaTeX generation is super cool too

plush tree
#

I was hooked when I saw you can generate readthedocs style html with it

peak juniper
#

yea i feel you, that shit is tight as fuck

plush tree
peak juniper
#

ah nice yea, it's so deep

#

i've been using emacs for 11 years and i still feel like a beginner when i watch the stuff on http://emacsrocks.com/

plush tree
#

Oh damn, I'll check it out

eternal flicker
#

I tried but couldn’t get into it, maybe I didn’t try hard enough

#

org-mode’s definitely the most interesting part for me though

peak juniper
#

go down the org-mode rabbit hole and it'll be the last time you write :q

tawny temple
#

I don't get the "hype" for org-mode here

#

I guess I don't have enough things to do to the point that I'd need such level of organisation

peak juniper
#

that's my problem too actually, i really want to use it because of how powerful it is (and how fun it looks to use), but i also just don't have the need for it right now

plush tree
#

You can do stuff like run in-line code and display the output, generate tables with cell formulas, track time and schedule todos, manage tasks with a multiple inheritence system, integrate mathmatic notation, etc.

I just use it for project management, but it's got basically everything you could ever want.

#

I'm definitely on the hype-train, but it's hard to suggest because of how much time it takes to learn

#

Also I'm just a sucker for sexy docs

tawny temple
#

What does it have to do with code docs?

plush tree
tawny temple
#

That's a backwards way of doing it from the perspective of generating from docstrings

plush tree
#

For sure, definitely not a replacement

#

I use only really use it for READMEs and project todos

tawny temple
#

I didn't that in a bad way really

#

Just pointing out it's quite different

plush tree
#

True

clever moat
#

the more i use emacs the more i hate emacs

#

why the fuck is json-mode so terrible?

barren iron
#

I think Emacs is like Marmite

#

You either love it or fucking hate it

#

And like Marmite, I fucking hate Emacs

#

Vscode all the way

runic kindle
#

vscode for life

#

idk how but they got the dark mode color scheme exactly right

#

the font and everything

barren iron
#

It's Gruvbox + Fira code for me

#

👌👌👌

lost rock
#

vscode is meh

#

not as terrible as I used to think of it, but even after using it for a couple weeks again anyway, I'm still not friends with it

barren iron
#

I don't understand that at all.

#

@lost rock Can I be rude and ask what things annoy you? I'm interested :d

lost rock
#

I'm right now using it for devops script/config editing, like e.g. ansible, terraform, bash, lots of yaml files etc

#

It just doesn't feel as powerful as it could be, e.g. with autocompletion, formatting, ... Maybe there would be better plugins but I installed the popular/recommended one for those file types already

#

And its git integration is unspeakably terrible

#

it keeps losing some of the repos in my list, has no way of conflict handling, is totally unintuitive even though it can barely do anything...

tawny temple
#

There's a really popular plugin for git

#

I don't know if it solves the problems you brought up; I rarely use VSCode let alone git on it

#

"GitLens"

rain kiln
#

I've found anything-Lens to be super annoying and in the way

prisma nexus
#

i dont like vscode personally, but that's bc i was never able to get it to work right for me. And this was weeks of trying to get it to work through researching as well as asking my professor for help :/ (granted, that's not just vscode, i have really bad luck with editors/ides and pycharm's the only one i've ever been able to get working out of the box)

tawny temple
#

Yeah GitLens seemed to have more features than I needed, though I think it's just a matter of configuring it how you want

rain kiln
#

tbqh I use VSCode/VSCodium strictly as a replacement of vim with better mouse support and easier to manage plugins

#

(easier if you're not familiar with vim plugins, I guess)

earnest current
#

any good configs for vscode + vim ? I have never been able to get it to work nearly as good as vim as a pretty basic user

lost rock
#

I have GitLens too, but while it has more features, its UI is awful and idk how to use it properly

#

so yeah JetBrains anything is still my goto

#

I'd love if they published a DevOps IDE tailored to shell scripting, and full config file support for all kinds of tools from docker over ansible to terraform etc

tawny temple
#

I think there just isn't a large enough market for that

#

And it'd be a lot of effort to support a whole range of things

#

Basic syntax support is simple, but you said an IDE so you seem to expect more than that

lost rock
#

yeah

#

I haven't seen any editor yet that would at least properly highlight complex bash syntax, I think

tawny temple
#

That is very true. I have felt that

#

Many have tried and failed

#

I always misses something

#

I actually tried writing some bash in PyCharm today and was surprised to find they had code inspections for it 😄

#

I usually use VSCode for bash actually cause I find its bash extension better than sublime's

#

It has language server support too but it requires running a docker container

#

Which I could live with if I wasn't on Windows

rain kiln
#

VSCode has a "Bash Debug extension that I've had okay use with

#

Also if you're using shell scripts, then shellcheck.net is 💯 awesome. There's even a docker image on dockerhub for a local install, particularly handy if you can't access outside your intranet

tawny temple
#

Ooh I'm gonna paste some of my scripts in right now

rain kiln
#

I've learned a lot about bash coding while using shellcheck.net. Like every tool, it won't find everything you're doing wrong but it will find many of the most common things that can cause problems

tawny temple
#

Basically getting a lot of these "Declare and assign separately to avoid masking return values."

#

Cause I use local a lot

rain kiln
#

If you click on the error number / message there's usually more detailed information including "why" the offending line of code is poor practice. If you think it's a false positive, you can also add a comment to disable shellcheck linting for that

tawny temple
#

Yup I already saw the wiki

#

Really neat

#

I actually did get a false positive for something. I used a local var in two different functions but with the same name

#

So it thinks the variable is also an array in the 2nd function... weird

#

Really cool tool though, will definitely be using it more 👍

#

Does it support different flavours of sh?

rain kiln
#

The github project is quite active btw if you want to file a support issue for shellcheck

#

Yeah it parses the shebang

barren iron
#

VScode on windows + docker is my combo

#

Its great

rain kiln
#
#!/usr/bin/env zsh
^-- SC1071: ShellCheck only supports sh/bash/dash/ksh scripts. Sorry!
barren iron
#

And @lost rock , there is a yaml extension done by red-hat, it supports much more than just what it says it does

#

So that might help

lost rock
#

I might have that one already, not sure

heavy knot
#

hello, I'm new here, I'm looking for where I might be able to post a question about a "helper script" for Asterisk (the VOIP software). My question doesn't really concern Asterisk it's the helper script, written in Python, I'm having trouble with

lost rock
#

I think just any of the help channels should be fine.

prisma nexus
#

anyone have experience with neovim + vim-plug?
I used https://vim-bootstrap.com/ to generate my init.vim file, and it worked just fine but whenever I try to add another plugin (like vim-surround), I add it as

plug 'tpope/vim-surround'```
but then when  I go to start vim again I get ```
E492: Not an editor command: plug 'tpop/vim-surround'```
even though I'm entring it in the middle of other plug lines and i don't get any errors from them.
#

i did plug instead of Plug

heavy knot
lavish mantle
#

Hello, is there a tool like hastebin, pastebin for development, the problem is I have a large text with over 50,000 chars, and I want to upload it to the internet, then to my private database, so earlier I used to store my large text in hastebin and the link in my databace, it worked for most till I noticed that the site create note stoped working :<, so I need a solution for that anyone with any suggestion?

heavy knot
#

does using $ git config --global affect other accounts on your computer

#

if so, how can I make it only affect my current account

tawny temple
#

No it just affects the config in your home folder

errant umbra
#

Hey, I was wondering if there are tools to create a simulation of a self driving car

#

I followed the udemy AI course and kivy's documentation seems a bit lacking

#

I was wondering if theres any better alternatives. Thanks!

west sorrel
forest bay
#

That's probably related to either the Python extension or the VSCode Python language server

west sorrel
#

@forest bay how would i go by removing it

#

Its quite annoying

forest bay
#

Not sure, I don't use VSCode heavily and am not terribly familiar with the internals.

west sorrel
#

hmm ok

#

might use sublime instead then

forest bay
#

Does it appear even in new terminals you create?

west sorrel
#

@forest bay think so yeah

#

im new to vscode too

west sorrel
#

@forest bay fixed it

#

Just sharing ^^

heavy knot
#

So in your opinion, what is the most robust python linter out there?

#

I have used Pylint, Flake8, PyFlakes. Some catch this error, some 1 error, some catch different errors.

#

So what python linter out there catches the most errors?

tawny temple
#

I feel like PyCharm is among the best out there, but it isn't an external tool you can run to lint your code unfortunately

solemn ore
#

@heavy knot I like FLake8 the best of the ones that you've listed. It's not quite an answer to your question, but you may also want to check out Black https://github.com/python/black

GitHub

The uncompromising Python code formatter. Contribute to python/black development by creating an account on GitHub.

heavy knot
#

I don't mean out of those that I have listed

#

I mean in general

solemn ore
#

My answer is still Flake8 - it's the one I use day-to-day

#

I guess I meant "of actual linters", because Black (the other thing I brought up) is a formatter, not a linter.

#

But it's still worth checking out.

heavy knot
#

I see

#

looks very...

#

uncustomizable

#

is there a very customizable formatter, like pylint?

tawny temple
#

Well it's customisable in the sense that you can write your own plugins for it

#

Apart from that all you can do is ignore warnings I guess

heavy knot
#

I see

runic kindle
#

is there a way to reject vscode's suggestion but also make a newline

#

sometimes when i want to make a newline it gives a word completion that i dont want, so i cant press enter to make the newline without accepting the suggestion

eternal flicker
#

does ESC cancel the suggestion?

runic kindle
#

yes it does

#

is there any other way to do it?

#

hitting escape is a reach

iron basalt
#

ctrl + enter will ignore the suggestion and newline

eternal flicker
#

^^ I was going to suggest that next

#

it didn't occur to me that ESC was hard to reach since I have CAPSLOCK bound to that haha

iron basalt
#

is that because of Vim?

#

i found it odd when I was learning Vim that there's such a focus on keeping both hands on the keyboard, yet leaving insert mode requires esc, and I learned that many people bind it to capslock for that reason

prisma nexus
#

^ i remap them, and i started because of vim, but i never use capslock and i use esc for vim, as well as other things so i always remap them idk

eternal flicker
#

yes it's because of vim, and it also helps prevent accidental caps locking, I rebound Shift+Capslock to actually lock caps

runic kindle
#

@iron basalt thank you, i was looking for this shortcut for so long

#

because this also goes to the end of the line and then makes a newline right

#

like shift + enter in eclipse

heavy knot
#

@west sorrel how is sublime as python tool? always looking for something outside of pycharm

cold gate
#

ST3 is the code editor I use most.

#

I really like it

heavy knot
#

what do u like about it?

#

and how is debugging on ST?

heavy knot
#

Ok so thisi s an odd question

#

Lets say I have this repo

#

now it has this folder of "weapon_images"

#

which I just copied from another open source rep

#

is there a way

#

using github / git

#

to push the latest changes to that one folder

#

onto my repo's folder

#

so its essentially part of another repo inside my repo

#

that I can fetch latest changes to that specific folder, and update that specific folder?

tawny temple
#

Submodules can do a similar thing. However, you cannot do partially

#

It can only be the entire repo as a submodule

heavy knot
#

is there a better way?

#

I can't take the whole repo

tawny temple
#

Not that I know of. I don't think git in general supports partial checkouts

heavy knot
#

what do you mean by checkouts?

#

are submodules like a seperate branch?

tawny temple
#

I mean that you can't partially download a repository

#

That restriction doesn't apply only to submodules but rather all of git

#

Like when you do git clone you cannot choose to only clone a specific folder

heavy knot
#

ok so... how do I use submodules?

tawny temple
heavy knot
#

so is there a way

#

to after setting up the submodule

#

only import part of it?

tawny temple
heavy knot
#

Interesting

#

where can I learn more about this?

tawny temple
#

Should be documented but I don't know how well and how prominently

hollow mountain
#

hi guys I would like some assistance getting SVN/CVS to work, I haven't used it before and i'm sure what I need to do is easy but I really dont get it.

coarse rapids
#

haven't used that in a pretty long time, everything seems to be git now... but ask away

hollow mountain
#

well my work has a web svn server and i have a user/pw for it

#

what I want is to be able to access it through file explorer

#

and i cant for the life of me work out how to do this

#

i tried downloading tortoise

#

and using the repo browser

#

but it doesnt like the web svn link

#

i feel like this is pretty basic and im missing something?

coarse rapids
#

I don't know enough about svn to know if any random web svn server can be accessed by Tortoise

#

but it does say it can handle https.

hollow mountain
#

will try that

#

yeah its https

coarse rapids
#

worked?

hollow mountain
#

nope, I couldn't figure it out

#

all I can see how to do is make a new repo

#

which isn't what I want.. I think

#

I will take another look tomorrow I need a break, thanks for trying to help tho

runic kindle
#

how can i make vscode show documentation manually?

#

like the bubble above a function

#

like i can show autocompletions manually with ctrl + space, is there one for the docstring

delicate gorge
#

That does not depend on your visual studio code settings but on your aitocompletition providers

eternal flicker
#

ssh or https for github?

mint briar
#

I prefer SSH

#

It's more reliable on dodgy connections and doesn't require you to enter your token each time you need to clone

tawny temple
#

I thought there was a way to configure it to save credentials

mint briar
#

But when I'm at a library or something I use HTTPS because port 22 will typically be blocked

#

oh yeah probably

tawny temple
#

I use ssh too tough.

mint briar
#

yeah there is, my b

#

but yeah I've sometimes had errors like curl: closed with outstanding read data remaining when cloning huge repos over HTTPS

tawny temple
#

You'll probably be using ssh for other things anyway so it's nicer to just manage it all together I think

eternal flicker
#

hm, so if the firewall blocks the ssh port I’ll just tunnel ssh through the https port?

mint briar
#

ye that works

eternal flicker
#

sounds good

plush tree
paper stump
#

🤔

heavy knot
#

What is the best text editor out there?
I was thinking Sublime Text or Atom

plush tree
#

It depends on who you're asking

prisma nexus
#

I’m not a fan of atom personally, But that’s mostly because I rely on vim bindings and the atom vim bindings just don’t cut it for me

#

If we’re talking python, I prefer pycharm over an editor. But for editors I use neovim. But like zero said it’s highly subjective.

plush tree
#

I use spacemacs, the timeless and infinitely powerful editor

#

VScode is another good one, just a matter of what you want out of it

prisma nexus
#

Did you start w spacemacs? Or did you come from vim or emacs? It looks really interesting, and ultimately I know I need to just see if I like it but I’m curious what got you to switch and stay?

plush tree
#

I started with neovim. It pulled me in with its A+ vim emulator and all the layers you can get. It honestly feels like neovim with all the packages you'd want for each language.

#

The extra emacs bindings are useful as hell too, very intuitive

#

It is more resource hungry though, running it as a daemon helps a lot with load speed.

prisma nexus
#

Ooh ok. That honestly sounds amazing. I just got Neovim all set up for myself. But there’s a couple sorta bugs I need to iron out. So I’m definitely going to give this a look. Thank you for that video!!

#

(The sorta bugs are basically auto indentation not working exactly how I’d like, and so far I’ve been too lazy to fix it)

plush tree
#

That's where I was at. After installing plugins for 2 hours, spacemacs caught my eye. Does everything I want out of the box feelsGladMan

prisma nexus
#

Hell yeah! I spent a day trying to install extra plugins with vim plug unsuccessfully..... because I was overlooking the P instead of p in plug. Oops

eternal flicker
#

I’m using Neovim because I prefer something leaner, and I like to pick and choose my setup

heavy knot
#

@plush tree why do u prefer emacs over vim?

#

or anyone here

plush tree
#

@heavy knot I don't. I wouldn't use emacs without evil mode. I prefer emacs and vim over vim.

lunar fjord
cold gate
#

I think it's the mini_diff setting. You should be able to set it to false

lunar fjord
#

Yes, thanks 😃

dusk dune
#

Any1 expert in Appium who can help me with my project?
I am trying to measure users QOE on using an Youtube app in android.
I am trying to measure the buffers,stalls, bandwidth, resolution changes etc.. while the user is watching the video.

random breach
#

ive got this script that runs a process via subprocess.Popen

#

when it's run through pycharm, its stdout is empty

#

however when run through command prompt it works

#

i saw this example where the inconsistency was caused by a difference of PATH between the two environments

#

but according to the dev of the program im running as the subprocess it doesnt rely on any environment variables at all

#

any ideas what else the problem could be?

#

how does pycharm set up its terminal environment?

rotund panther
#

When I try to run my bot through heroku I get this error messege ```On branch master
Untracked files:
master

nothing added to commit but untracked files present```

jolly idol
#

How to use pygame?

eternal flicker
#

check the documentation, I think there’s either a QuickStart or a beginner’s tutorial

dusty nexus
#

How to fold function definition in vim automatically. I've installed this plugin https://github.com/tmhedberg/SimpylFold, but I'm having trouble with understanding how to use it. I'm working with python 3

glossy ingot
dusty nexus
#

Yes, I installed this plugin

glossy ingot
#

but did you read the usage instructions? are they working?

dusty nexus
#

I've taken a look at help fold-commands briefly

#

I know what zf, zc, zo, etc does

glossy ingot
#

I'm a bit confused about what you're asking then? it seems like that is all the functionality right there

#

or do you mean specifically how to use them?

dusty nexus
#

The problem is

#

when I want fold function I must enter visual mode, select function's body and then run zf command

#

Is it possible to do this in one command without entering into visual mode and selection text manually?

glossy ingot
#

huh seems odd, i havent used this but i would assume that zc would just fold the function/class you are in without needing manual selection

#

lemme try installing and give it a go

#

ye, using zc and zo it seems to auto detect function defs in Normal mode

#

zf is for defining custom folds

dusty nexus
#

But

#

Is it possible that the reason is I've written code first and then installed plugin?

glossy ingot
#

did you try closing and reopening the python file

#

and could you maybe provide a snippet of the file so that i can try it on my end?

dusty nexus
#

I created new file and wrote simple function and it works

glossy ingot
#

weird, maybe theres something odd about your other function that is causing issues

dusty nexus
#

I don't think so, I keep it all nice formatted in accordance with pep8

glossy ingot
#

can i see a function def thats not working?

dusty nexus
#

This is funny, I just copy whole text and paste to newly created and everything works perfectly 😜

glossy ingot
#

huh that is really weird

#

at least it works now!

dusty nexus
#

yes, I must just copy and paste few more files

#

mayby seesions are guilty, anyway thank you for the responses

subtle grove
#

anyone got a tftp cliente made with the struck function

runic kindle
#

this says that vscode ships with git integration

#

where can i find that?

eternal flicker
#

do you have git installed?

tawdry needle
#

whats everyones favorite open-source python IDE? i'm so spoiled from pycharm but it'd be nice if something FOSS existed. spyder is alright for data science work but for development it's just not that full-featured

tawny temple
#

Are there even any other IDEs besides PyCharm, Visual Studio, and Spyder?

#

The rest are technically editors

vivid cargo
#

@tawdry needle
I prefer atom for its natural look and versitality

tawdry needle
#

@tawny temple I know of wing and ninja

#

But I haven't used them much

#

I think eclipse also has python support

tawny temple
#

Haven't heard of those, so news to me

#

I was tempted to mention Eclipse but got the feeling support for it was dead or something

#

Though to address your question, I feel like you could get away with substituting an IDE with an editor these days. The difference is that you'll be doing more configuration whereas an IDE has features out of the box

#

Of course you may still lose some nice integrations but that's just like candy and something I can live without. With PyCharm specifically, the only thing I miss when I am not using it is its wonderful linting capabilities. The Python tools like flake8 and pylint just don't live up to it

vivid cargo
#

Well,with atom you can setup linting too

prisma nexus
#

what about spacemacs? i feel like thats a bit more than an editor? but might be wrong

tawny temple
#

I'm not saying editors don't have linting, but rather that it's poor in comparison to PyCharm

#

I've had bad experiences on both VsCode and Sublime trying several different linters

#

Sublime has especially been bad cause the language server just crashes sometimes

#

Wondering if it was even worth the bother

vivid cargo
#

You ever tried linting on atom?

#

Real time linting

tawny temple
#

No I've not tried Atom

vivid cargo
#

I suggest you try it out

tawny temple
#

Do I have to configure it/get a plugin?

heavy knot
#

what are you guys using to take notes? any apps/tools you would recommend?

barren iron
#

@vivid cargo Have you used both atom and vscode?

random breach
#

having a bit of trouble with sphinx

#

but i dont get any question about the autodoc extension

#
C:\Users\admin\Documents\Projects\audio-player\docs>sphinx-quickstart
Welcome to the Sphinx 2.1.2 quickstart utility.

Please enter values for the following settings (just press Enter to
accept a default value, if one is given in brackets).

Selected root path: .

You have two options for placing the build directory for Sphinx output.
Either, you use a directory "_build" within the root path, or you separate
"source" and "build" directories within the root path.
> Separate source and build directories (y/n) [n]: y

The project name will occur in several places in the built documentation.
> Project name: audio-player
> Author name(s): 0xf0f
> Project release []: 1.0

If the documents are to be written in a language other than English,
you can select a language here by its language code. Sphinx will then
translate text that it generates into that language.

For a list of supported codes, see
https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-language.
> Project language [en]: en

Creating file .\source\conf.py.
Creating file .\source\index.rst.
Creating file .\Makefile.
Creating file .\make.bat.

Finished: An initial directory structure has been created.

You should now populate your master file .\source\index.rst and create other documentation
source files. Use the Makefile to build the docs, like so:
   make builder
where "builder" is one of the supported builders, e.g. html, latex or linkcheck.
#

do i need to install something else first?

#

@heavy knot google keep

twilit steppe
#

I'm having an issue with pylint (using VS code). I have need to access code from a subdirectory inside my main directory, so I put a __init__.py inside the subdirectory, but when I do that pylint starts finding problems with all the imports inside the subdirectory. The code runs as expected. How do I make pylint cooperate?

twilit steppe
#

ended up swapping to a different linter

runic kindle
#

@twilit steppe i use black

#

it works great

#

separate question: is there a way to fix this mouse pointer in vscode

#

and it looks really weird when i hover over the line numbers

tawdry needle
#

Might be a vscode bug tbh

heavy knot
#

it's not a bug, it's normal behavior

#

most text editors have mirrored mouse above line numeration

twilit steppe
#

It being mirrored is intended, but it's kind of weird that the resolution and design changes. Should be possible to just take the normal one and mirror it, no?

sinful zinc
#

have you changed your mouse cursor recently?

#

do you have multiple monitors and/or any monitors in high DPI mode?

#

it looks like vs code is not multiple monitor dpi aware

stable cloak
#

So are these installations that you had prior to installing Anaconda or are these ones that you installed via Anaconda

#

@royal marsh

royal marsh
#

I installed a version the day before Anaconda, I ran into errors and read that Anaconda was user friendly

#

Currently, I'm waiting on an uninstall - it's taking a long time - looks like Add/Remove Programs doesn't work, since I deleted Anaconda already but shortcut still showing up smh

stable cloak
#

You deleted Anaconda or you Uninstalled it

#

And you should be able to just uninstall the Python version you installed the day before you installed Anaconda from the Add/Remove Programs thingy. I'm just trying to make sure I understand what's going on

royal marsh
#

I deleted it because uninstall had an error

stable cloak
#

You might try to reinstall it and then uninstall it then reinstall it again. Sounds crazy, I know, but it might help allow you to resync up the files

#

And you might temporarily disable your anti-virus if you have it, as it might be conflicting with the install process

royal marsh
#

Great idea trying now! I've been searching everywhere for files

stable cloak
#

Leave the grunt work to the computer. If we still don't have luck after this, we can try scrounging out the files, but in theory this should do it.

#

I do have another idea if this one falls flat, though

royal marsh
#

Sorry about long delay working on this now, you rock @stable cloak

royal marsh
#

I'm installing anaconda again, python by itself is giving me so many issues - not installing modules/packages/pip etc - this is taking WAY too long, can't wait for my new pc

royal marsh
#

@stable cloak ugh still having major issues

stable cloak
#

What's happening

royal marsh
#

Can't import packages - anaconda doesn't use pip - should I delete anaconda again and go with Python? My hangups (when it's working correctly) are not having the correct packages/modules loaded, and then 'path variable' or environment variables are wrong or accessing formerly deleted files

#

I'm trying one last thing to import modules through anaconda prompt

stable cloak
#

Unless you have a specific setup in mind that you already found on Anaconda or you know you're going to be working with a group that has setups already there, then it's usually better to just use regular Python

#

At least in my experience

royal marsh
#

It's complicating modules way more than I expected... back to Python. Phew this is an exhausting and fruitless endeavor

stable cloak
#

There's always something to take away from an experience. Anaconda is more just a specialized tool. It certainly has its purposes, but tends to not be a good one for just general purpose coding

royal marsh
#

I was given a program from a friend, custom built, I'm trying to learn without any training, and I am, however, I've had several issues I'm unable to figure out despite hours and hours

#

Going back to python (I think I installed this the first time after realizing I needed help installing packages)

stable cloak
#

So do you have experience with Python or are you just starting out?

royal marsh
#

Basically starting out, I'm just trying to get this script to run, I've done a few basic tutorials in the past. I know the script is working, I just have issues with gathering the required modules essentially

#

I have a vague familiarity with how it works. It's taking a very long time to uninstall however

royal marsh
#

@stable cloak Alright, after lots of troubleshooting (pip3 instead of pip to get modules) I'm still having a looping issue with the code

stable cloak
#

Well if we're at a code issue we can move the question up to one of the regular help channels. Explain what's going on, show your code, etc.

stoic quest
#

Hello guys

#

I want to ask for help if how can I create a REPL for a specific programming language in SUBLIME TEXT ?

#

I already installed SublimeREPL and created a REPL for Python

haughty crag
#

This is the first time I've installed visual studio, but it gives error in python commands

chrome zealot
#

discord module probably isn't installed in your venv

#

I had this same issue actually... had to do with microsoft language server

haughty crag
#

Well, I'm more or less understanding what you're using, so what's the solution?

prisma nexus
#

is there a way to get pycharm to use the flake8 precommit hook?

violet belfry
#

It's a git configuration, you shouldn't have to do anything special beyond installing it

prisma nexus
#

hmm. it didnt seem to use it when i was working on seasonal bot, so i switched to command line git. ill mess around w it

onyx oracle
#

Hi all, can blockchain also be discussed in this topic? It is essentially a tooling right?

random breach
#

i think this channel is more geared towards python specific tools i.e. ides, package managers, etc @onyx oracle

placid hatch
#

How much I gotta pay someone to teach me the overall idea of GitHub and to use it via Sublime Text 3 😛
My "repository" (I believe it's called) will be for a Discord bot.

tawny temple
#

There's plenty of free information available on the internet

#

No need to pay anyone

lost dust
#

You have git tutorial on codeacademy..

placid hatch
#

I will be honest. I had no idea it was on git.

#

Also, been trying to learn with their tutorials and information and videos online.. I just can't wrap my head around it.

tawny temple
#

Try another resource then. Sometimes things aren't taught in a way that suites you

placid hatch
#

Thank you @lost dust and @tawny temple
Codeacademy seems to be teaching me well.

lost dust
#

Ay it's good for beginners

onyx oracle
#

@random breach of course, a blockchain written in Python.

viscid basalt
#

Is there someone here with Celery-expertise that knows how to have revokable but retryable tasks?

As soon as I try to run a revoked task I get an error saying it will be discarded because it has been revoked. Looking through the docs and code of celery I found that it stores the revoked task in a list in memory until the worker is restarted. So maybe I can remove this single task somehow from that list?

https://docs.celeryproject.org/en/latest/userguide/workers.html#persistent-revokes

#

Or is there another way to cancel a running task instead of revoking it?

heavy knot
#

I need help with my VS Code

#

I cannot rename the files

tawny temple
#

You probably get a chance to rename them once you attempt to save them

heavy knot
#

@tawny temple

#

Wdym

#

They save their selves

#

I wanna change it to a py file

#

But I cant

#

I even reinstalled visual code

#

visual code has too much problems

#

that nobody can fix

tawny temple
#

They don't seem saved to me

#

press ctrl + s to save it

heavy knot
#

Done and nothing

#

Visual code is a pure cock

delicate gorge
#

What if you right click them in the file tree

heavy knot
#

I already did that

delicate gorge
#

Yeah but now it's safed

heavy knot
#

Visual coee sux

#

Is the worst program for code

prisma nexus
#

try ctrl + shft + s to save as

heavy knot
#

It always has problems

prisma nexus
#

but if you don't like vs code, don't use it

delicate gorge
#

That it doesn't work for you but for hundreds of others does not mean it's bad

prisma nexus
#

grab vim, neovim, or spacemacs

#

if you want an ide, grab pycharm

tawny temple
#

When you saved it you were supposed to change the file extension and give it a name

heavy knot
#

Well how do I fucking reset my settings To default

#

CUz visual code has too much problems

prisma nexus
#

seriously then stop using it. Don't just continue to shit on a program.

Are you required to use vs code?

tawny temple
#

I think you're being too impatient. But like AvianAnalyst said, if you don't like it, try something else.

heavy knot
#

yes cuz no other program works

#

@tawny temple

#

I cant change it to a py file

#

Thats the thing

#

vs code is broken

tawny temple
heavy knot
#

nope

#

wait wat?

#

I did see that but python wasnt on it

#

I even have python installed

#

On my PC

tawny temple
#

Did you install the Python extension for vsiual studio?

#

Regardless, you can just replace the .txt in the name with .py and it'd work

heavy knot
#

works now

clever moat
#

jedi-emacs yells at me for missing libcrypt.so.1 when i run jedi:i-s

#

any clues?

#

fedora renamed it, of course

delicate gorge
#

It actually had good reasons for that if you wonder @clever moat

clever moat
#

it looked like there was a lot of discussion around it

#

but it broke my gosh darn emacs

#

hope that symlink doesnt break anything lmao

delicate gorge
#

Well because

In Fedora 28 we replaced glibc's libcrypt with the fully binary compatible libcrypt library from the external libxcrypt project.

clever moat
#

yeah, that's what it looked like

#

wait, "we"? are you involved with fedora?

delicate gorge
#

Well that's copy pasted from the fedora wiki however unrelated to that yes I am

clever moat
#

lol nice

delicate gorge
#

I actually got involved with it one version after :p

#

However the reason was that libcrypt internally relies to the (pretty old and unsafe) DES algorithm and thus no application should be allowed to use it without explicit consent (in form of installation) by the user

clever moat
#

ah, i gotcha

#

time to undo that symlink

delicate gorge
#

Hahaha

clever moat
#

replaced it with a link to libxcrypt :P

delicate gorge
#

👍

hearty bobcat
#

Im trying to set up my discord bot for a vpn, is this the right channel to ask for help with thsi?

delicate gorge
#

Not exactly ....but why would you even want to use a VPN on your discord bot

hearty bobcat
#

i think i used the wrong word, i meant im trying to use digital ocean, i heard its good

delicate gorge
#

That'd be a VPS

#

Not a VPN

hearty bobcat
#

yes

delicate gorge
#

And you might find help with that in #unix

random breach
#

is there something like IDLE that lets you save/load sessions?

tawny temple
#

Maybe bpython does

random breach
#

just gave it a go

#

doesnt seem to like windows much

#

had to install a wheel for curses and then when i ran it it just keeps spitting our errors over all sorts of things

runic kindle
#

how do i log into a different github account in vscode?

violet belfry
#

With what extension?

coarse rapids
#

Holy shit am I ever mad at PyCharm right now.

#

Decades of Linux have trained me that when a program exits in a terminal, I can press up arrow, up arrow, enter to rerun the command before that

tawny temple
#

o fuck

#

RIP

coarse rapids
#

after I realized what happened I literally screenshotted my work before clicking in the editor

#

(since that's what triggers it to refresh the view)

tawny temple
#

Should have extracted the file from RAM pensive_snake_cowboy

eternal flicker
#

ohno

coarse rapids
#

apparently PyCharm's terminal has its own command history and it's possible to be part of the way through the list instead of at the end

bold junco
#

Hello, how can I set filesize limit in youtube-dl?

#

Alright, the solution is to add max_filesize to python ydl settings

lost rock
#

You probably typed it down already by now, but you should have been able to restore your last state from reflogs, I guess... 🤔

#

next time, prefix dangerous, one-shot commands with a space, that way they don't end up in history.

steel dune
#

@lost rock 😲 I like that space tip !!

heavy knot
#

still kind of new to developing with python, was wondering if projects should always be done in virtual environments with either pipenv or virtualenv?

barren iron
#

@heavy knot Pipenv is the best way to go around this

#

It is "pretty much" industry standard

heavy knot
#

i see, and the requirements.txt file is like the file that describes all of the dependencies of the project right?

barren iron
#

Ah, that's for pip

#

pipenv uses something called a pipfile and a pipfile.lock

heavy knot
#

oh okay

barren iron
#

The pipfile is the config file

#

But you can edit it with pipenv install and pipenv uninstall

heavy knot
#

but obviously the dependencies inside a pipenv would only go inside that environment, and nowhere else on your system tho right?

barren iron
#

The "lockfile" is a hash checker - it ensures all the dependencies are from where they say they are

#

Yes

#

Unless you do pipenv install --system

tawny temple
#

How can I make a JS library be known to PyCharm when I am working on client-side code?

prisma nexus
#

do u have pro?

tawny temple
#

Yes

#

This is how I am including the library html <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key={{ config['GOOGLE_KEY'] }}&libraries=places"></script>

#

It seems it only works if the file is downloaded locally

lavish cosmos
#

I think the problem is that key thing

austere otter
#

how do I tell git to ignore whitespaces?
I want all future pushes/pulls to ignore em

young hedge
#

that sounds like a good job for a precommit hook or something of that nature

#

but honestly the easiest solution is to have a common linter between team members

versed vault
#

my friend has a problem with vs code, we've been trying to fix this for a couple hours to no avail

when he runs any .py file, he gets an error saying "Timeout waiting for terminal connection"
fresh vs code installation, fresh python installation, it works fine for me. only difference is that he's on windows 7, i'm on 10

vivid cargo
#

@versed vault can he run it on terminal outside vscode?

#

like a powershell

versed vault
#

Yeah

vivid cargo
#

okay so problem's in his vscode config

random breach
#

Is there a way to add documentation for a variable above it in a way that pycharm will pick up?

#

i.e. currently it only picks up on this:

suggestions = (
    # several lines of code here
)
"""
documentation goes here
"""
#

what i'd like is something like this:

"""
documentation goes here
"""
suggestions = (
    # several lines of code here
)
tawny temple
#

Nope, don't think so

#

PyCharm has kinda poor support for rendering docstrings so I stopped bothering

#

Though in this case it's just following what other tools support so you can't really blame PyCharm for this

random breach
#

ah rip

random breach
#

say you've made some changes on a file that should ideally be separated into multiple commits

#

does pycharm have a way of doing this? making commits at previous points in local history?

#

or just some way to like, highlight specific lines in specific files and just commit changes to those

#

does git itself have something like that built in?

tawny temple
#

Do you mean make an amendment to an old commit?

#

Cause I believe I've seen that in PyCharm (though it's broken for me)

random breach
#

sort of related i think but not quite, since there haven't been any commits yet

#

e.g. say youve got two classes in a file

#

you work on both but then later on want to commit the changes to them separately

#

i.e. one commit says 'added soandso to class x' and the other says 'added soandso to class y'

#

if all the changes to one class occurred after another i suppose you could copy/paste everything in the file, revert local history to the point right after youve finished working on class 1, commit, paste, then commit again

prisma nexus
#

yeah you can select which changes you want to commit

tawny temple
#

I don't quite follow your explanation

random breach
#

but then thats not really doable when you keep jumping between them and changing things between each of them at random

tawny temple
#

But like AvianAnalyst said, you can select individual diffs to commit

prisma nexus
#

this is the commit menu in pycharm, you can select and deselect individual commits

#

so if you wanted to commit changes a c and d but not b or e, you can just deselect b and e and give the others a commit message, and hten commit again with b and e to give them their own commit message

random breach
#

im aware of this, but is there a way to select specific diffs in one file to commit?

tawny temple
#

Yes, there is

#

That's what I was saying

#

In the commit menu, select a file and then it shows the diff for it at the bottom

#

each diff will have a check mark next to it

#

Though it's not super fine grained, it just does it in blocks of changes

prisma nexus
random breach
#

ahh i see, cool cool

#

thanks guys

prisma nexus
#

np :D

#

pardon me while i make sure to not click commit on that gibberish

random breach
#

i had from .file_index_task import FileIndexTask there ages ago

#

then now added the __all__

#

at first it was showing up as two separate diffs but as i opened the commit window they merged into one

tawny temple
#

I couldn't figure out how in PyCharm

#

But with git you can use git add --patch or --edit

#

The former shows the diffs in chunks which I believe is similar to how PyCharm does it

#

and --edit lets you do it line by line

random breach
#

ty

lethal flax
#

I'm trying to set up TeamCity to test & package Python projects

#

Is that a bad idea or something? It seems like not a lot of people do that.

#

The repo and all is in-house so I need an on-premise CI

#

I'm having a lot of trouble with virtualenv, e.g. pipenv creates a new environment for each build step (not build) and then complains about not finding pytest etc

pure pulsar
#

i did my CI with gitlab-ci in previous job, had gitlab-ci-runner in docker running the scripts and building either wheels for some projects (libs) or installers (setup.exe) for deliverable, then had a step to upload that to either my private pypi repository, or to our webserver for the executables, took quite some time to setup, but it did work

dusky blaze
#

Sorry if this is the wrong channel

#

There's a lot of overlap

#

But I've been using windows to develop python apps using pipenv but I'm finding the whole experience a bit hit and miss

#

Is Docker on Windows worth looking at. Or should I just wait for WSL2 to go mainstream and use Ubuntu on WSL etc

#

I'm not sure about the limitations of Docker in Windows

violet belfry
#

What are your issues with pipenv and why would using Docker be the solution?

dusky blaze
#

I find pipenv a bit slow sometimes

#

As well as my target deployment is docker based as well. So production parity

zealous torrent
#

I mean I generally prefer poetry but the speed issues are probably just do to Python itself & stuff like dependency resolution

vivid cargo
#

@dusky blaze
Docker on windows is not ideal dev enviroment since commands and some functionalities can get lost
I'd recommend spinning up a vm

dusky blaze
#

I hear ya

#

I should probably just set up a ssh remote environment in vsc to a linux box

violet belfry
#

It’s still insiders only but it’s wonderful

dusky blaze
#

Yeah I saw that

#

I'm waiting for mainstream

dire quartz
#

In Pycharm, what determines the default module path set when you generate a unittest run configuration by for example right-clicking a method in the editor and selecting "Run Unittest for..."? I want the module path to rooted in my project root but for some reason it's rooted a couple of levels down instead and the test fails to run.

#

If I have one issue with Pycharm, or Jetbrains IDEs in general, it's that issues are ungooglable.

#

Way too much irrelevant official documentation cluttering up high-ranking search results, and the posts that aren't are rarely the same issues because there are so many issues with similar terms.

#

Maybe this is just an issue with IDEs in general, I dunno.

tawny temple
#

Does it display the run command it used in the console for the unittest run config?

#

Are you asking why the sys.path is the way it is?

pure pulsar
#

Wsl is quite nice already, even if a tad slower than native linux, it's quite useful already.

dusky blaze
#

Doesn't work for docker though I believe

#

Which is the main thing I want it for

#

Don't get me wrong I do use WSL but it has drawbacks atm

violet belfry
#

There's a remote docker extension but that seems a bit unnecessary

dusky blaze
#

But I would still have to run the docker host in a vm or remote host

violet belfry
#

Why?

lethal flax
#

I set up pytest to produce coverage and TeamCity seems to pick it up though I have no idea how it does that

#

But it only shows the global coverage, I'd love to be able to drill down into detailed results

#

Does anyone have an idea how to do that with TeamCity ?

eternal flicker
#

what happens if you don’t put [flake8] at the start of a .flake8 file?

#

ok the answer I got was that flake8 won’t read and load the configuration

lost rock
#

at least it doesn't segfault, like mine did yesterday 🙈

eternal flicker
tawny temple
#

@eternal flicker Did you ever fix it?

eternal flicker
#

the pipenv error? not yet, I’ve had it for days now

tawny temple
#

Okay, I'll do some digging for you

#

Is pipenv up to date?

eternal flicker
#

It should be, but I’m not home right now
thanks for helping, I’ll provide information when I can

tawny temple
#

Cause the traceback doesn't really line up

#

5/6 days ago there was a commit that updated code that is responsible for the error

#

Not saying that commit is responsible, but the code it modified is code that searches for the python version

#

Ok this code is so convoluted I can't even follow it, sorry'

#

Maybe you can report this issue to them

random breach
#

ive accidentally done way more in this one commit than i intended to. it should just be adding one file.

#

whats the cleanest way to tidy this up

#

should i revert the commit and do it over again?

#

oh, and it hasnt been pushed yet

tawny temple
#

It's just a single commit?

#

If so, I would do a git reset to HEAD~ so it undoes the commit but keeps its changes unstaged

#

then you can stage whatever you need and commit that

#

Oh I see it's in the middle of the history

rotund kelp
#

Aye, that's the difficult part

tawny temple
#

There's an interactive rebase option that lets you stop at a certain commit

#

And then you can pretty much do the same reset thing

#

Just make sure you do commit all of the changes if future commits depend on it

#

They can just be split up into as many commits as you like in between

rotund kelp
#

I think I would

git checkout -b fix_branch
git reset --hard <SHA of commit you want to change>
git reset --soft HEAD~1 
-- Make your commits properly now
git rebase <your original branch name>
#

hm

#

but that rebase would bring the original commit back

tawny temple
#

What will that do to the original big commit?

#

Interactive rebase is great, highly recommend

random breach
#

yeah it's just one commit. i wasnt paying enough attention and didnt scroll down so didnt see all these other files ticked in the commit dialog 😅

#

ok im gonna make a copy of the entire folder and try to fix this mess in there with that interactive rebase thing

#

fingers crossed :S

rotund kelp
#

for some reason if i git rebase -i <original branch> it doesn't actually do what i think it would.

#

I want to change commit '1'

tawny temple
#

The basic way I understood is that the refspec you give it tells it how many commits to show in history

#

At least that's how I use it

rotund kelp
#

so i reset the 4, then edit 1

#

My log goes to

#

and then git rebase -i <original branch> does

#

i was actually expecting the list of 5 commits where i could delete the line with commit 1.

tawny temple
#

I am not following how you used it

rotund kelp
#

Yea I guess my rebase command is wrong

#

I don't normally use it to pull from another branch.

tawny temple
#

Creating a new branch is irrelevant, you don't have to but can if you want

#

The arg you give to rebase should be the SHA of the oldest commit you want it to show in interactive mode

rotund kelp
#

you don't have to but it's way safer so you can't screw up the original.

tawny temple
#

That way it will list from head to <commit given>

#

and then you can edit or I think even break at that commit you want to fix

rotund kelp
#

Oh shit it can break

#

Well yea then that's way easier

random breach
#

what the hell

#

this folder is ~2gb

#

how even

tawny temple
#

All you really need to back up is the .git folder

random breach
#

ok turns out what i thought were symlinks actually were full on copies...

#

oh just the .git folder?

tawny temple
#

Yeah cause git keeps tracks of all diffs

#

Iäve done it before, swapping a backup back in

random breach
#

i thought pychamr might move the files/change them around or something

tawny temple
#

I don't know what you mean. If git is tracking it, then it should be covered by backing up .git AFAIK

random breach
#

i was gonna try that interactive rebase thing you were talking about

#

not sure what it does so just wanted to be safe in case it makes alteration to any of the actual files

#

thought it might try to revert commits or something along those lines

tawny temple
#

You could just do it on a new branch

#

If you want to be safe

random breach
#

oh yeah thats right

random breach
#

ok, took several tries, but all done

#

cheers Mark 😄

eternal flicker
#

if you ask, there might be people who know how to help

eternal flicker
tawny temple
#

Well it doesn't mention your error message

#

I've seen that part of faq before and I never made the connection

heavy knot
#

so git pages

#

Since it is free if you have the website open source

#

could I possibly use that as my personal website

#

like leptospira.github.io

#

if so, how do I set it up

#

the tutorial on github doesn't work

#

and im pretty new to web design and stuff

pure pulsar
#

i think you just need to setup a repository named after the url the page would have (youruser.github.io)

heavy knot
#

it doesn't work

#

what does it mean having a project page in the /docs folder or something

pure pulsar
#

just created it

#

will delete it pretty soon 😄

#

@heavy knot

#

let me know when i can delete it 😃

lost rock
heavy knot
#

see when I do that, it just says it doesn;t exist

#

@lost rock Yeah I followed that and I am pretty confused

#

@pure pulsar I made that repo, except it says the page doesn't exist

pure pulsar
#

maybe case is important

heavy knot
#

github automatically turns any github.io redirect into all lowercase

pure pulsar
#

i mean in the repo name

heavy knot
#

trygoing to
https://LePtOsPirA.github.io/

#

I tried the repo name too

pure pulsar
#

ok, weird, maybe ask on #github in freenode (irc) in my experience they can be pretty reactive here

#

though it's not a security issue, so it might not be high priority for them, i don't know

heavy knot
#

why do I get all the issues?

#

:C

lost rock
#

no, the repo name might need to have the same case as your user name. Not the .io url

pure pulsar
#

i read a page where a dev decided to note all the bugs he met in a week a few years ago, it was hilarious

lost rock
#

might also be they're having some lag right now and it just takes a couple more minutes for the site to build and deploy

heavy knot
#

hm

lost rock
#

did you check the /settings page of your repo to see what it says about Pages status there?

pure pulsar
#

i mean, i setup one in a minute just when the question was asked

#

it was live the second i pushed i think

heavy knot
#

says its currently being built

#

thats it

pure pulsar
#

omg, i just deleted the repo, and refreshed the page, and the old page, i had deleted weeks ago is now available shocked

heavy knot
#

oof

pure pulsar
#

last edit 2013

lost rock
pure pulsar
#

i guess nobody ever creates a repo, then delete it, then create a new one, then delete it

lost rock
#

well that does sound like some server side weirdness overall then though...

pure pulsar
#

oh no, it makes sense actually

#

i though i had deleted it, but the other repos is the old url, with github.com at the end

#

let's nuke that

#

page is still up… great

#

😱

heavy knot
#

thats a big oof

#

Hey wait

#

wait

#

what

#

my page just

#

.. worked?

lost rock
#

that's called wrapping

#

it's probably somewhere int he settings, but idk where exactly. Don't have vsc available right here

lethal hemlock
#

Hello, I was recommended to come to this channel from a help channel