#tools-and-devops
1 messages ยท Page 31 of 1
in that case, make a gitignore
if you want to ignore the whole folder, you can also write foldername/ in it instead of *.txt
unless I do git add those red files, it wont be added in future adds-commits-pushes right?
yes
you can also make a local gitignore that is only on your machine and not tracked in the repo, if that is what's bothering you
but just leaving them un-added is... not the best practice
ah that sounds neat
yea
i'll keep that local gitignore in my mind
I assume you make a .gitignore, add .gitignore in .gitignore with any other file?
no
you can write to .git/info/exclude to exclude files only in this repo, but only locally without committing/pushing the exclude file
same syntax as .gitignore
is there xcode rpc support?
Anyone know how to fix this?
Whenever I try and run python in atom it does this
'python' is not recognized as an internal or external command,
operable program or batch file.
[Finished in 0.132s]```
Anyone have any idea? Really need some help
did you add Python to your path?
@main elm
Also quick question regarding Github/Projects. Say I want to deploy a new version/update/fix to my project. Should I start a new branch and then merge it? or just add-commit-push?
cant decide
?
How do I get dark mode on visual studio (ping me)
Tools > Options > Environment > General > Visual Experience > Color Theme > Dark will give you the default dark color theme, @sour hearth
Thank you so much!!!
Hey I need some help with VScode
For some reason whenever I open my file, it doesn't show on the left side.
Well, it used to show on the left hand
I don't like it being on the top, I accidently pressed a button or something and it removed it.
The tabs have always been at the top
The left side is project view
Tabs are just open files
I think there's a tab on the left for open editors though
I'm looking to develop a stock market program, could anyone help? โค
@heavy knot usually the kind of help that is offered on this server is like how to do a particular task or overcome a particular error
My bad, was just offering a paid job
this forum is more intended for helping developers with issues, and not hiring of developers, although you may get a bite in #career-advice (I'm not sure about rules on this thing) and online job offers should have some description of the tast, the amount of time needed, and the pay
Hello folks, I have just asked a question in #help-coconut and the nice folks over there told me that it's more related to your field of expertise
Very quick, I have Sublime and Pycharm, running stuff on Sublime returns 'py.exe' is not recognized as an internal or external command,
operable program or batch file." but PyCharm works fine
This is a work PC therefore no changing PATHS
Or nothing that requires admin rights
Yeah, it was already set up like that
I'm googling around a bit to see if I can edit the path its looking at
Oh that just sets it to... right, I should have read further
'cause the default one is not working
Hi, so I tried to install pipenv just now, but it doesn't seem like PyCharm finds the executable. However I followed the guide under the jetbrains website here: https://www.jetbrains.com/help/pycharm/pipenv.html#executable-path and did exactly what was written there.
I specified the path there using my username, and it said roughly translated WARNING: Saved data will be narrowed down to 1024 characters, SUCCESSFULL: Given value was saved
Sounds like the path was far too long
How though setx PATH "%PATH%;C:\Users\DarthDelay\AppData\Roaming\Python\Python37\Scripts
Doesn't look too long, although I'd wonder what path you actually gave PyCharm
Ah wait yeah okay
Yeah it's because your entire path is that big
If you're going to edit your path, use the gui editor
Not a command prompt
Ah ok well I'll do that very quick
Let's see if that worked
Wonderful
Thank you @copper compass ^^ I really appreciate your help
And now it perfectly automatically sets up the pipenv. Nice
hey, i had some questions about the macbook pro2015 edition, and just mac in general, if anyone has the device and is alright with answering some of my questions please pm me ๐
You could also just ask your questions publicly
Also this is probably not the channel or the server for those sorts of questions...we're a Python server, not tech support.
Or just purchase a real laptop
Cool meme
is there anything like pyinstaller/py2exe/cx_freeze that'll download the dependencies during setup instead of having to pack them in?
i have a pyqt5 program whos cx_freeze size is almost 300mb
260 of that is PyQt5...
anyone use VS Code? When debugging/running code, how can I keep the terminal from exiting the python environment?
how are you running the code?
@eternal flicker just hitting F5 (debug code)
How to setup visual studio for python 3, ping me
@barren iron is it any better than visual studio?
Visual studio is a IDE
Mostly designed for c++ development
Where as Visual Studio Code is a text editor
Ah ok
That works well with Alot of languages
Including python (that's what I use it for)
You can find it easily be searching for it. And when you open up a python file, it will give you the option to install the Python extension, and that will really help you get up and running
It looks very similar to VS
Ah ok, thanks for the help Iโll look into it
np!
Iโm having a buggy ass time with VSCode and python. Not recognizing indentation or new lines, ignoring defining of functions because it thinks theyโre part of the previous function despite proper indentation, which throws lots of exceptions
I disabled pylint and itโs still crud. Same code works perfectly in terminal by itself, thonny and pycharm
Alright this is a dumb question, but I'm looking and I can't find what I'm after. I'm looking for an option in pycharm to stop making certain things italic:
I can get into settings and find general appearance/editor options fine
@ember dragon the colors are determined by the theme you're using
"workbench.colorCustomizations": {}, in your settings.json
Is there anything applied to this setting?
no
!t ask
Asking good questions will yield a much higher chance of a quick response:
โข Don't ask to ask your question, just go ahead and tell us your problem.
โข Try to solve the problem on your own first, we're not going to write code for you.
โข Show us the code you've tried and any errors or unexpected results it's giving
โข Keep your patience while we're helping you.
You can find a much more detailed explanation on our website.
Hi, is it possible in Pipfile to declare packages versions automaticaly from Pipfile.lock instead of updating those manually? Because now in Pipfile all versions is with "*", which means it always install latest version.
That doesn't make sense. The lock file is created based on the Pipfile
whats a virtual environment?
so your computer in general will have stuff like python.exe pip.exe and some python libraries installed that every program can see and use
thats your 'global environment'
sometimes you want to use a different version of the exes or a different set of packages
to do that you use a virtual environment
generally you have a tool that changes which executables you can see or where they look for packages
that way you can use python3.7 and pygame on one of your programs, and python 3.5 and pyaudio on a different one
and they are all kept separate
@sand sequoia hope that helps
yeah generally they will have a fresh package list with nothing in it but pip
so you switch to that virtual environment, install the ones you want. then every time you want to run your program, you run it in that virtual environment
that also means other programs and the operating system cant mess up what packages you have installed
eg if your program relies on v1.0 of a library and another program needs 2.0
they wont be happy in the same environment
ok thanks
i assume that if i just delete the venv folder from pycharm everything will be fine right?
or should i not
well pycharm prob expects it to be there, you would have to tell pycharm to not use a venv anymore
and you can prob tell pycharm exactly which environment to use
however i recommend keeping the venv, and just installed packages in to it
otherwise your os environment will get messy fast
okay, another question, sorry, but how do i install a library into a virtual environment?
activate the virtual environment, if you are using venv then you can just cd <project directory that *contains* venv> and source venv/bin/activate
then pip install libraryname
once your activate the virtual environment it stays active in that terminal until you close it
if you're on windows just open the directory and type activate
also on windows it'll be in venv\Scripts\activate i believe
oh okay
yeah this works for me on windows
on linux it goes inside bin and has to be sourced
kk sorry i use linux and wasnt sure if windows was differnt
its okay
Ok what do I even do now....... this is the python 3.6 interpreter and it doesnt work, there is nothing wrong with code which was working before at my school pcs
^ im on linux
tkinter is a separate package on linux
why does python keep marking import pandas as pd import numpy as np import matplotlib.pyplot as plt as an error and then when i say to "optimize the imports" it deletes them
its annoying me
ignoring doesnt work
this is after i click optimize
it's because it doesn't see those imports being used anywhere in the module
Pycharm failed to install python packaging tools what do I do now my IDE can't run code without this
Your Python installation is broken, I think
You're missing distutils, which should come with Python
without it, setuptools won't work, and you won't be able to install anything
I'm not a fan of all these colorful vscode themes; I like the black/charcoal gray style for my desktop. If I could just get a profile that looked like high contrast, but with slightly lighter black to it so it doesn't strain the eye, I would be happy
Yeah I think your best bet is to modify the source code of the one you like best
Oh nevermind
@dense helm
Okay, in VS code in the editor, there is a weird secondary editor background that fills up unused background space, and for some reason it is a redish color ๐ gotta figure out what that space is called so I can edit it, too
...okay, that block of redish color only appears on 1 of my three monitors, and only in VS Code... the heck? I hope my graphics card isn't crapping out or something,
...but the color isn't purely visual, if I screenshot my desktop I can see the red in the screenshot on all three monitors =_=
are all your monitors on the same graphics card?
yup
wait
so it's red in the screenshot no matter where it is
but only visibly red on one monitor?
yup; if I move VS code to a different monitor it disappears, but if I move the screenshot of vscode it stays redish
...no i mean
if you take a screenshot of VS code while you are in a monitor where it disappeared
is it still red
also can you post the screenshot
how are your monitors arranged? are any of them to the left or above your primary monitor (post a screenshot of the monitor layout control panel if you don't understand the question)
nope, if I screenshot vscode in a monitor that doesn't show the red, the screenshot doesn't show red;
you see them, too? the faint red?
the monitor the red appears on in vscode is my center 144hz monitor, the monitors unaffected are to the left and right of it
maybe it has something to do with my custom monitor color profile being screwy again..
maybe
it's weird that it'd only apply to part of the window though
the "red" color is #2A272A, the neutral background is #27282A
that's such a subtle difference that some monitors might not be able to display it, but that doesn't match with the behavior you said you saw when moving the screenshot
[a surprising number of older monitors only support 6-bit color]
actually I see a faint brown color on my left monitor where the red was; and if I resize vscode and position the window on the monitor just right, a rectangular chunk of that red color flickers on and off
the flickering is one of the things some monitors do to fake being able to display more colors
[some monitors do dithering instead, some just don't bother]
it seems to flicker in time with the flicker of the text marker O.o
both monitors I see the effect on are TN panels, but my IPS monitor I can't see any effect
if you put the window halfway across each monitor what does the screenshot look like
it changes color halfway from one monitor to the other; one sec, let me see if I can figure howe to disable my custom color profiles...
when vscode is between two monitors, mostly in center monitor
when vscode is between two monitors, mostly in left monitor
ok so the whole thing changes colors, so that's probably the color profile
but on both of them it has some effect
I don't get that effect with any other program I try, that is weird it happens that way for VS code
okay, I get a similar effect when moving Nvidia Experience from one monitor to the other, it does that same arbitrary shift in color partway during moving the window
that sounds like a monitor issue then
that means according to dear pep8, there should be two blank lines between function defs and the previous line
do you all use pycharm for your ide?
I use VSCode
there are people who use vim/neovim, or emacs, or Sublime Text
just go with the one you're comfortable with
Hello
error: Microsoft Visual C++ 14.1 is required.
When trying to add packages on PyCharm
(even though I've installed C++!)
This is using the PyPy interpreter
Thanks to anyone who tries to help
Anyone?
in VS Code, what is the keyboard shortcut to comment out multiple lines with #?
The tutorial guy I'm watching keeps doing it, selecting multiple lines and suddenly they each have # at the front; it'd be really handy for me to learn
i want to set up vsc for python
@dense helm press and hold scroll while moving your mouse down then youll get multiple cursors across multiple lines
@sour hearth install the python plugin, follow the instructions and you should me mostly good to go
@dense helm
Thanks both of you~ lol I had read the ctrl-/ before, only now did I realize why it wasn't working because I was pressing ctrl-\ lol
Hello
error: Microsoft Visual C++ 14.1 is required.
When trying to add packages on PyCharm
(even though I've installed C++!)
This is using the PyPy interpreter
Thanks to anyone who tries to help
where are custom idle themes stored?
i dont want to download a new IDE for my old computer i just want something fast and easy but the default IDLE themes hurt my eyes
sorry i don't have a good answer to your question, but if you want something fast and easy i would recommend perhaps notepad++ with a nice custom theme (perhaps dracula https://draculatheme.com/notepad-plus-plus/ )
i hate to give you B when you're asking for A but i feel like in this case it's justified, IDLE is just 
notepad++ is so so
its very cluttered
i mostly just wanted something to transfer over to my pc quick via usb
@sand sequoia Assuming you are on Windows, you should be able to find your IDLE highlighting config at C:\Users\(Your user)\.idlerc
The file that has the highlighting is called config-highlight.cfg
thanks so much
I use a theme that I found elsewhere on the internet called Obsidian
can i see?
Just copy and paste this into config-highlight.cfg
definition-foreground = #678CB1
error-foreground = #FF0000
string-background = #293134
keyword-foreground = #93C763
normal-foreground = #E0E2E4
comment-background = #293134
hit-foreground = #E0E2E4
builtin-background = #293134
stdout-foreground = #678CB1
cursor-foreground = #E0E2E4
break-background = #293134
comment-foreground = #61afaf
hilite-background = #2F393C
hilite-foreground = #E0E2E4
definition-background = #293134
stderr-background = #293134
hit-background = #000000
console-foreground = #E0E2E4
normal-background = #293134
builtin-foreground = #E0E2E4
stdout-background = #293134
console-background = #293134
stderr-foreground = #FB0000
keyword-background = #293134
string-foreground = #EC7600
break-foreground = #E0E2E4
error-background = #293134```
alright
if you wanna you can check out my theme its pretty neat
mines kinda like that
normal-foreground = #b7f2e7
normal-background = #000000
keyword-foreground = #ff7700
keyword-background = #000000
builtin-foreground = #900090
builtin-background = #000000
comment-foreground = #44b537
comment-background = #000000
string-foreground = #aa2274
string-background = #000000
definition-foreground = #0000ff
definition-background = #090909
hilite-foreground = #000000
hilite-background = #acacac
break-foreground = black
break-background = #ff4a4a
hit-foreground = #ffffff
hit-background = #000000
error-foreground = #000000
error-background = #ff7777
cursor-foreground = #fffdff
stdout-foreground = blue
stdout-background = #000000
stderr-foreground = red
stderr-background = #000000
console-foreground = #b7f2e7
console-background = #000000
context-foreground = #000000
context-background = #ababab```
more dark though
Cool, always looking for more themes
Tbh I'm not 100% on my current theme, but its good enough so I haven't bothered
Hello
error: Microsoft Visual C++ 14.1 is required.
When trying to add packages on PyCharm
(even though I've installed C++!)
This is using the PyPy interpreter
Thanks to anyone who tries to help
@frozen fox What package are you trying to install? What version of Windows?
i need help installing python on vsc
what OS are you on? generally you install python separately from VSCode
@sour hearth
im on windows 10 @eternal flicker
ive installed python already
but i need help setting it up on vsc
the first one
ivr got that
right
the easiest way to run python code in the integrated terminal would be to set the keybind
in the top menu, click File, then Preferences, then Keyboard Shortcuts
ah ok
in the search bar, search for Run Python File in Terminal, then set it to your keybind of choice
uh
hm?
right, do you have a folder of choice to store your Python files in?
nope
you should think of one ๐
you can do it in Windows, just create a folder somewhere
mhm
File > Open Folder
yep
do you see the sidebar?
windows?
yes?
wait was the yes? regarding windows updating or the sidebar
is thsi the side bar
yes
the first icon is the Explorer, which is that panel you see right next to the sidebar
yes
theres the section OPEN EDITORS and PYTHON ... <- the folder you added, right?
in the section that has the name of your folder, there is a New File button
ah
right click the file named Python and rename it to Python.py
python files have the extension .py
uh can u tell me on screenshare?
I'm on Linux
select the first icon with the +, and name it <anythingyouwant>.py
on the python part?
great
now you already have the file open, lets do the first thing every programmer does
do i install linter?
you can if you want
print("hello world")
type that in the text file, save it, then press your keybind you set just now
which one do i click?
TERMINAL
oh xD
I'm not yelling at you, the screenshot has full caps
tada
tkinter should come with your Python install, so you can just import tkinter as tk in the first line and you shouldn't get any errors
if you're just starting out learning, yep
you can experiment with other stuff, vscode won't bite (probably)
lol
i am a meh programmer for python
i can make decnt stuff
any otehr plugins u recommend?
but thanks for your help
what is that @eternal flicker
I think itโs called One Dark Pro or something
@forest bay All packages show the same error
I'm on Windows 10 Professional, unlicensed
Would you guys recommend a particular IDE, or just use IDLE ?
I'd recommend literally anything but IDLE
I use PyCharm, but editors like VS Code are more suitable for beginners
As in, Visual Studio Code Editor?
honestly it depends on you, VSCode or PyCharm, there are people here who could help you if you have any problems
just pick one and go with it
Fair enough. Thanks
Is anyone familiar with BuildBot?
@marsh vigil definitely sublimetext
what IDE aree you using
vscode
Nah i'm just using IDLE still. Trying to figure out VS Code
but not having much luck.
Can't figure out how to set the working directory
I'm using xlrd and xlwt libraries to read/write to an existing .xls file, but can't get VS Code to recognize the file without putting the full directory
figured it out, that was easier than i thought
Ah ok, Iโm new to vscode to
having an issue with pycharm where it refuses to provide autocompletion options for a specific class
autocompletion for this same class works in other projects but not this one
ive tried invalidating caches and no results
any ideas?
how do i stop this from saying this
Which IDE is that? PyCharm?
You can either disable the inspection or add the word to the dictionary
anyone tried using multiple github accounts in pycharm?
it keeps bugging out on me and using the credentials of the first account
I have done this in their java application, so guessing it should work in pycharm. not sure i remember how i did that. I remember that if i did not set a default account, it would ask me each time when i did something
though i cannot seam to remember if i used ssh or normal auth..
what auth are you using for this?
normal auth, just a token
and the token have enabled repo and gist scope?
i might be on a tangent here, do you need to enable those scopes? might be a thing to check first...
yep, gist and repo enabled
the error message is giving me access denied, but with the name of the first account i added
rather than the one ive marked as default for this project
well. there ends my knowledge about pycharm. sorry @random breach ๐ฆ
it's all good, thanks for trying
it's a relatively new feature
so theyre still working out the kinks i guess
it was my all in suggestion ๐
we have no android channel, so the normal help channel would be the correct place
though I am not sure many uses qpython, if it is very similar to python you can get much help there
@turbid cipher
Thanks
any time ๐
is there a way to make todo lists in pycharm?
Doesn't that only aggregate the todo comments left?
Possibly not what kazo is looking for
yea i want to make one, how do i do that?
What amazing visual studio code extensions do you all use?
I'm looking into improving my experience a bit.
@sand sequoia I'm not entirely sure what you mean by todo list?
Pycharm will aggregate those comments for you as Mark said
neat thanks
would this be the best play to ask for help using sphinx for automatic docs generation?
I am starting to get a bit frustrated by my current problem :/
Basically I want to know how to make it so that I can specify certain classes to not show any documentation for certain properties, (also I want to get rid of it showing __init__ in the documentation...)
Using autodoc btw also
@loud gulch i have some sphinx experience. want to jump to #help-falafel?
oh man. time machine strikes. that comment was a little stale. oops. ๐
why not discuss it here? Pretty sure it's on-topic
All good. I'm just in a meeting right now. Is it all right if I ping you when it is done?
sounds good to me. i is still learning the lay of the land here.
@loud gulch sure thing!
@loud gulch i'm hopping off for the night. if you can point me to where your sphinx files live, i can take a peek tomorrow. someone may even drop in and beat me to it! ๐
Ok no worries! Meeting just finished so I was just about to come back to this
Will send a link through in a sec
@barren spoke ok, I'll try and put as much detail as possible.
The current commit is here: https://github.com/Macquarie-MEG-Research/BIDSHandler/tree/e64abeb41a86096651a090cca22697df565bac5e
Sphinx is auto-building the docs and that's all good, but there are two problems I have.
The first is that the __init__ method is always documented. I have 'exclude-members': '__init__' but it doesn't seem to do anything.
The second issue is that because a number of the classes are subclassed from QueryMixin which has a number of properties that are needed so the code doesn't break, I really only want it to document one of the inherited methods (the query method). Again, I tried to do 'inherited-members': 'query', but again this had no effect.
Hello.
I saw someone having rich presence for PyCharm but don't know how they do it.
Does anyone happen to know how? :P
You just go into the plugins menu search for discord rich presence and hit install?
Oh, um, I'm new to using an IDE so idk where that is on PyCharm yet. e.e
Awesome, thank you very much. :D
@loud gulch i've been playing around with the Sphinx for an hour or so, but can't get any of the autosummary parts to build. keep getting failed to import on each one, and /generated/ remains empty. i've tried playing with the conf.py (sys.path, etc) which hasn't helped.
What does your project directory structure look like, what are you configuring in Conf.py, where are you running sphinx from, and what arguments? @barren spoke
you might need to actually install the package. If you build setup.py and pip install it it will find it
@barren spoke
@loud gulch yeah, i pip installed as an attempt to get it building. didn't help. i'll keep plugging at it. ๐
@forest bay I'm trying to help monkeyman get their sphinx building how they want. link is further up if you've got some tips.
is there a blessed method for generating a package like ujson-mybranch that actually provides a ujson import?
using the regular infrastructure. I
I'm pretty sure I can just publish to my local pypi instance but I'd like to make this available to others
so with a numpy array
how do I get the 8 values around it
without 8 lines of code?
is there a shortcut?
around it?
the neighbouring elements in a 2d grid, I assume
no builtin function me or a quick google search is aware of apparently
I found https://stackoverflow.com/questions/34905274/how-to-find-the-neighbors-of-a-cell-in-an-ndarray
but that's a general function for any dimension
and not exactly a shortcut with less than 8 lines
why don't you want to just use the 8 lines?
it looks ugly af
but the answer you provided is a bit hard to understand and over the top for my needs
I just want to say
numpy.neighbors(x, y) += 1 or something along those lines
which would add 1 to all the adjacient cells of the x y
wait
Can you get the values of a submatrix
like from [3, 3] to [6, 6]
that would be all the values inside there
in a set or list or tuple or something
you should be able to
got an idea
@eternal flicker
what if I take the submatrix of the x-1:x+1, y-1:y+1
and then uhh
how do I not add the center value?
and does this even work?
x and y?
what do you mean by that?
also shall we move to a channel that is not #tools-and-devops ?
so you just get a tuple of all the indexies of a submatrix
well numpy is atool thats why I was here
the channel desc reads
For discussing editors, IDEs, and tools like pip or pipenv.
but since there isn't much activity here right now I guess we can continue here
if you get the slice and then do a ndenumerate on it, you should be able to get both the index and values, but I'm not sure
not sure if the index is relative to the original grid or the slice
but will that be for the submatrix or for the real matrix?
you might have to test that out
what does this mean?
google isnt making much sense at explaining
i just put print('\n') next to something and it displayed that
What does the rest look like?
There's an if missing for that elif
as in there can't be anything on the same indentation and inbetween an if and elif
np ๐๐ฝ
How do you change the default version of python with pycharm?
I installed pycharm with python 3.7 but I no longer have 3.7, I have 3.6 (had to downgrade for a module which didn't support 3.7)
@me upon response please
Ok guys so I'm in a bit of a pickle atm
Would you recommend PyCharm, VScode, or Spyder, for regular development and data analysis?
I feel like they all have their own strength and it's really hard to choose
VS code looks best and looks like it's the most customisable but I'm kinda lost
I just spent 4 hours trying to set it up, and its autocompletion is dreadfully bad
For example it doesn't see inherited attributes from astract classes
I'm wondering if I'm the one screwing up somewhere. Because damn does it look sweet and clean.
can you paste an example? I'll try it out in VSCode
I can't really, it's very long and complex classes
Of course or I wouldn't be able to do anything xD
But it's so weird, VS code gives me a lot of lint errors and all that when my code works
And was done in PyCharm with literally 0 warnings
It's a library I've deployed in production for like two weeks and am using heavily and I just wanted to give vs code a shot
but I don't understand what's happening
I'd really like to drop PyCharm because of poor scientific mode support (paid version) and ugly layout
Do you have multiple Python environments?
Yes and I'm pointing to the right one
Just to be sure, by "pointing" you mean this one?
yes, I'm using an anaconda environment
VSCode Python by default lints with Pylint, what sorta warnings are you getting?
And it's running, my code's working
The thing is, even with my code working I get almost no autocompletion working
PyLint literally tells me it's an unresolved import
Except it resolves properly when I run the code ๐ค
Like I really want to use VS code because it looks so good
that happens if your workspace is not started at the root of the project
I chose the same root as my previous PyCharm project
But the import was from another package in my pythonpath
Tbh here's how I see things:
- PyCharm: medium looks, decent user experience, poor scientific/cell execution support, good variables explorer, good autocompletion but not working for dict keys or pandas columns
- Spyder: horrible looks, medium user experience, great scientific/cell execution support, good variables explorer, actually knows how to autocomplete pandas columns and such
- VS code: great looks, medium user experience, terrible scientific and variables explorer support, but still cell execution support ๐ค , and maybe good autocompletion if you get it to work lol
Am I completely missing something?
Also vs code has a great and gorgeous variables explorer, but for some inane reason you can only use it debug mode and not anywhere else
maybe because it's used for debugging ๐
Is there any way to make VS Code use docker as a Python environment? I use docker for my project and I'd like to have autofill and stuff for Python imports, but I don't want to use venvs unless i absolutely have to
I would think you'd be using venvs during development for this reason, and then testing the docker image and deployment afterwards to ensure it works fine separately.
In a pipenv Pipfile, is there an elegant way to combine multiple script aliases into one that runs all of them?
I tried something like this, but pipenv run all does nothing, probably because the command is not evaluated in a shell:
[scripts]
serve = "python rrserver/app.py"
lint = "python -m flake8"
test = "python -m pytest"
all = "pipenv run lint && pipenv run test && pipenv run serve"
I guess all = "bash -c 'pipenv run lint && pipenv run test && pipenv run serve'" would work, but that doesn't seem elegant.
(it does work, but is there a better way?)
Looked at this a few weeks ago, didn't find anything unfortunately
You would have to push both branches eventually.
not sure how strictly you want to follow git flow, but the general idea is to branch off develop into a feature branch, make your commits there, then merge back to develop when it's ready. Once your develop is in a releaseable state, you'd make a release branch off develop, do anything necessary to finalize that version, and merge that into master. Then IIRC master is to be merged back into develop so that you have those release changes included.
Sure, in the beginning, both master and develop will be empty and meaningless
But you still have to create them in the remote, so I'd just push the "empty" branch
or you could be like me and commit and push everything into master please don't be like me
another case of "do as I say, not as I do"
you can use your existing .vimrc, and there are guides online on how to do so
but the nvim config is in
~/.config/nvim/init.vim
@heavy knot
Itโs a shortcut for $HOME, or /home/<yourusername>
Oh
there wasn't a init.vim... There was a Plug.vim I created one but nothing changed after I put in set number and restarted vim
hm, thatโs weird
you have an init.vim file in ~/AppData/Local/nvim but the settings donโt show after you restart neovim?
and you put in set number but itโs not showing line numbers?
Is there a way to automatically generate documentation template for the function ?
I am thinking of something which creates a basic numpydoc like layout with all the parameters passed and the return value using the variable names
and then we can fill in the details
location of vundle.vim
part of init.vim that should load vundle (i copied this .vimrc https://github.com/nickaigi/config/blob/master/.vimrc#L12)
pic that shows it fricking doesnt work
does anybody know why it doesn't work by looking at these screenshots?
typing the full thing or doing back slashes doesn't work either
@tepid pulsar We don't allow recruitement on this server and please don't spam the same message to multiple channels.
I'm trying to do CMD/ on my mac to comment out code in pycharm but its not working
it seems to find the command, it hightlights it in the GUI, but doesnt actually insert anything
it's mapped to the numpad / and i didnt even have a numpad
smh
so reconfigure your keyboard
@eternal flicker
I am sorry. I want something which creates a template in the comments.
where I can add all the necessary details.
Not something which reads the commends and creates documentation out of it.
Like the kind of comments written in numpy source codes.
Something like this.
https://github.com/NilsJPWerner/autoDocstring
But not VS specific
every time i try to commit something in pycharm it keeps automatically including these files:
how do i stop this?
put them in a .gitignore file?
though for these IDE-specific files, you might want to make a global gitignore file for all of your projects, so that you don't have to write it in each single project
doesn't work unfortunately
did i do it right?
thanks for the global gitignore tip, that didnt occur to me
ill see if pycharm has an option for that
that's at least the right format
You'll have some trouble if those files were committed before though
nah, ive always manually deselected them
theyre not anywhere to be seen on the repo so i think im safe
hmm let's see if restarting pycharm solves it
nope, still there
seems like pycharm doesn't care about the gitignore file at all
confusing
did you name it gitignore or .gitignore with leading dot?
.gitignore
hmm
it's the one that was provided with the base code jam repo
oh, there is a .ignore plugin for pycharm
not sure if that is needed so that those are respected in the commit dialogue, but worth a try. It's useful anyway.
Check the settings/plugins
cheers, ill check it out
awesome, i think that did it
not sure exactly how, but after another commit, theyre not showing up in the dialog any more.
thanks @lost rock
๐
does your IDE placing a ) after your cursor when typing( have a name?
is there a name for this function of the IDE?
bracket completion?
@heavy knot can you please add a nickname that uses normal ASCII so it fits in with our nickname policy:
https://pythondiscord.com/about/rules#nickname-policy
k
it is easy to mention at the moment actually
hey can i do find & replace in pycharm?
Yeah, the key combo is Control + R
okay thanks!
it's the navigation bit at the top of the editor where it shows where you come from
like how if you're in the windows file explorer, it shows the previous directories as clickable in anything windows vista+
oh i see, thanks!
just with packages, modules, objects
yea like itll show the args a function takes
@sand sequoia looks like this
in this case i've got my cursor in a section of a method uptime which is in the class Uptime
oh so it refers to classes?
it refers to the where you're at in the module, yes
no probs
i tried editing the color of escape characters in the atom stylesheet but it has no effect, can anybody show me what im doing wrong?
syntax--constant syntax--character syntax--escape { color: silver; }
i got the class name when i inspected a escape character with the dev tool
Anyone use spotipy (spotify api) on an ec2 before? trying to run my script but can't get past oauth since it's browser based.
@sand sequoia i open the thing and it says i have to make my own debugger and idk what to put for the settings
if u could send a screenshot of urs if u use pycharm
yea send screenshots! i use pycharm but im not an expert in it, if someone else sees it they might be able to help though! ๐
mine looks exactly the same but mine still runs
no module named
youre clicking this button to debug right?
im clicking the play button
when i do that button
C:\Users\jaxru\AppData\Local\Programs\Python\Python37-32\python.exe "C:\Program Files\JetBrains\PyCharm Community Edition 2018.3.5\helpers\pydev\pydevd.py" --multiproc --qt-support=auto --client 127.0.0.1 --port 54857 --file
Traceback (most recent call last):
File "C:\Program Files\JetBrains\PyCharm Community Edition 2018.3.5\helpers\pydev\pydevd.py", line 1741, in <module>
main()
File "C:\Program Files\JetBrains\PyCharm Community Edition 2018.3.5\helpers\pydev\pydevd.py", line 1574, in main
setup = process_command_line(sys.argv)
File "C:\Program Files\JetBrains\PyCharm Community Edition 2018.3.5\helpers\pydev\_pydevd_bundle\pydevd_command_line_handling.py", line 136, in process_command_line
setup['file'] = argv[i]
IndexError: list index out of range
Process finished with exit code 1
thats the tradeback
did you set up a file configuration ๐
that turned off my nvidia recorder lol
lol try closing that for now
im not sure i dont have nvidia recorder
hm
up to u
uh no thanks not really in a place to get in a call right now ๐
thats ok
I have been using atom for some time now
someone told me PyCharm is better
any advice?
should the .idea folder be gitignored?
can you give me some advice on PyCharm
Like what?
I dunno normal tips?
I guess?
wait so idea should be ignored right?
@violet belfry
you can use anything as long as you pick one and stick with it
Eh, you can just use ctrl + shift + a and find everything you need
(you can also add it to global gitignores to avoid every stressing about it again)
faster than looking at a piece of paper imo
i have never used that mark
why did you not tell me about it when we won it
i blame you for my poor choices
lol
IIRC the "find action" interface also shows shortcuts next to the actions so it makes it easier to memorise shortcuts as you use it
ideally you'd only use shortcuts and not "find action"
@hardy cedar Didn't come to mind. I rarely use it myself
For how much I use Pycharm, I don't remember a lot of shortcuts. I still right click to go to definitions lol
ctrl+shift+p i think was vscodes
it does nothing noticeable on pycharm, so i assumed it didn't exist
(and i'm lazy to go through a key reference)
lol
well hope you get good use out of it now
I mainly use it for really obscure settings
cause itรคs faster than opening the settings menu and searching there
i probs will forget about it until i remember it after fixing something
i'll try though
i don't even use the project run configs yet
other than for seasonalbot
(because i redid the installation instructions)
yeah i just interact mostly in terminal
What about debugging?
You need a config for that
Do you just use the cli debugger?
wot
yep
It's so nice though
Though I concede it's usefulness varies depending on the nature of the project
Sometimes you can just get away with logging
i do a metric ton of logging
so i've not tended to needed it
plus i have inspection logging in some projects
Itรคs nice when you have an alg or some complex logic and you have no fucking clue why the output is wrong
so you can step through code and see the values of everything along the way
Wow I did not know about CTRL-SHIFT-A
The built-in debugger is actually super useful
every one of my projects use asyncio. this is part of why i have not bothered too much with debuggers
If you have a codebase that's doing fairly normal things
Maybe I'm mixing it up with csharp async debugging, don't remember
coding in sync is legitimately weird to me
And runs in a normal way (cough the bot)
though i can deal with sync code a bit if it's an event based model still
doesn't feel as weird
It's very nice to set breakpoints tho, then look at the memory viewer to see the current state of all variables
I am fairly sure with async the debugger just steps through a lot of backend asyncio stuff before it gets to the actual line that you see in your code
so it's pretty annoying to work with
So instead of sticking prints everywhere, you can go to where you're interested, inspect the variables, then step through and watch how they change
i've definitely done the print debug meme lol
This includes things like attributes and function parameters
but these days i prefer logging modules
Yeah, I use logging everywhere
loguru does investigative logging for exceptions too doesn't it @quaint needle
However it means debugging sometimes turns into logging.critical(variable) ๐
i think so
showing values encountered
if you do like logger.catch or smth like that
oh yeah loguru looked really cool
it's actually quite nice
wow fancy ascii
Turns the pattern of
try:
...
except Exception as ex:
log.debug(str(ex))
log.debug(traceback.format_exc())
into a decorator
oh yeah it uses better_exceptions
uh wait
i do that far too much lol
with std logging module you can do log.error()
logger.catch is a good idea
especially when debugging
if it's in an except block it will see the exception and log it ๐
log.exception()
oh, is that what it's called
ye
yeah that not error
I separate it because might want the error message at the ERROR level but the full dump at DEBUG
that's fair too
You could probably subclass one of the logging things to handle that but too much effort I guess ๐
Depends, but yeah you could
depending on what youre trying to debug, asyncio can log stuff automaticallly when in debug mode
if you happen to be using aiohttp there are interactive tools like aioconsole and visual tools like aiodebugbar
why did you decide to?
wanted to try contributing to seasonalbot, and since the Getting Started guide has specific instructions for PyCharm as well, felt like trying it out
Forgive me but I've got a really dumb question
Why is this tick next to the icon for one of my scratch files in PyCharm? It's a pure python file like all the rest of them, and I've looked through it and it doesn't seem different from any of the others โthey're all just snippets of code
are you doing version control integration?
Not purposefully, but I may have turned it on for this project at one point โ now that you mention it, I'm sure that's it
seems so obvious now ๐ฌ thanks for the help amigo
yeah i'm not sure that's what it is? but ik pycharm colors my files green and stuff after i initialize them for VCS and other things ^_^ np :D
i'd be p. surprised if that wasnt it at this point, not to worry
VSCode: text editor or IDE?
so the ability to compile and run code out of the box isn't beyond a text editor's abilities for you?
the debugger is included
@stiff sedge I'd call it a "very advanced" text editor
I can't bring myself to call it anything other than an IDE
the approach that it takes is nice tho
it doesn't seem attractive enough to me over JetBrains stuff
I love vscode
It's just light enough, nice and clean
and I find pycharm just does.... too much
I don't need all of it.
I feel like VSCode fills a gap that i don't desire
I either want somethign super simple like Vim for stupid simple stuff, Notepad++ for a bit of color, or IntelliJ for something feature rich
super simple
vim
i think they mean simple projects, not interface.
that being said, i feel like thats a disservice to all you can do with vim with the plugins out there
"somethign super simple like Vim" both.
u right. i misread sorry about that
When i'm using vim it's in a deployment server where I can't install anything special
and I'm not very strong with vim
I just use it for simple text changing when I'm working on xml config files in server
ah, I see. My skills are limited to save and exit too ๐
apart from all that editing magic you can do with vim you can also get it up to a level where it can compete with the features of vscode so its definitely not super simple if you get plugins for it
another fi needed?
(hint: you can enable bash syntax highlighting in Discord when you start your code block with ```bash )
And I'd recommend indenting your nested loops etc like you would in Python
@lost rock I was trying to do that to make it more readable but it didn't work.
@lost rock im still figuring out the correct nesting
@lost rock i accidentally closed the error. but it was something about unexpected syntax/index at done done done
but yeah, as Turtle pointed out, if you go with else if you need get another nesting level with that inner if, requiring you to close that block with fi. To keep it on the same level, use elif instead
it is not, one moment...
well, you compare two strings (or variables) like if [[ "$my_var" == "something" ]] ; then ...
but neither --meas nor wm-gm.30.pct.mgh are variables, so something is missing there in your logic, apart from the wrong syntax
but also the variable $feat is passed -- i don't know how to sort it out so that it works
you still need to wrap it in [[ ]]
that is the syntax for conditionals in bash
see help test and help [[
And you should almost always put your variables in double quotes "$feat"
hmm, hmm still not sure how to say that if the feat is running either of the wm-gm argument, then do something
argument parsing is not that simple in Bash
well, you can easily get positional arguments (first word, second word, etc), but not options like --foo bar
hmm okay
Pycharm or visual studio code
Depends what you like, and what you're doing. Its not really fair to compare them as they are 2 completely different things
Pycharm is a full ide with all the tools youd most likely need for most stasks, vsc is a text editor
But can immitate an ide with enough addons
is there a way for PyCharm to always create a custom .gitignore file when I create a new git repo?
there's a plugin called Ignore you could try out
it adds some extra support for gitignore files, along with a simple file template method to add one, and on new projects it'll give you a suggestion
if you use PyCharm a lot, any other plugins you can recommend? I eat customization and plugins like candy
hmm
Ignore is this right?
Aside from the theme, I also have GitToolBox, CodeGlance and EnvFile
what extra features does it add?
there's one already
Must have been updated
let me make sure i'm not going crazy
Was not a thing in the past
There are two diff plugins for md
The one I'm talking about also has a paid version
One is made by jetbrains I believe
But it isn't selected for inclusion by default iirc
I'm unsure if it was enabled by default, but if you open new type it'll ask if you want to enable the plugin in the bottom right of the window
so probs enabled it then
Markdown Navigator and JetBrain's Markdown support cannot function together btw
is it possible to have files sent on the initial commit but then remove them from the vcs entirely so they dont get updated on a commit on pycharm?
yes
how?
just started using PyCharm so not sure if there is a button for that, but in git, you do:
after initial commit, add the files to the gitignore, then
git update-index --assume-unchanged <filename>
wow i just was running through the old messages and found out about loguru
@sand sequoia it's the same git, PyCharm just has a GUI for some common git functions
is there anymore recommended hacks i should be aware of?
by the way, in the event you want to update that file again, it's
git update-index --no-assume-unchanged <filename>
You shouldn't
why not?
It contains pycharm specific stuff that other don't need
nop
why not?
Also no, you include the requirements they can use to make their own
where do i put requirements?
If you are just using pip, the convention is to pip freeze > requirements.txt
The other person can them do pip install -r requirements.txt to install the dependencies
okay ill do that, thanks for the help!
what do i do once i do pip freeze > requirements.txt?
git add requirements.txt
nvm the files were in the scripts folder
do i keep them there or put them in the main directory
okay
I really don't know where to put this so here I am. I want to create an api wrapper for some website, something something GraphQL. I thought this would be a good opportunity to learn about api wrappers since I learn by doing I guess. Are there some good resources to check out, or a simple explanation on how to go about creating an api wrapper? (I don't like the learn then do approach so if anyone has just starter resources that would be best)
Is there an addon for jetbrains products that allows me to gitignore files through the editor?
there is an ignore plugin
that should add support for .gitignore files, ignoring in the commit wizard and a few context menu things etc
Nice, seems to work
hi anyone here using atom ?
or have used Quokka in atom ?
I'm trying to to use it but it seems like Quokka is not working
pycharm professoinal isn't recognizing pymongo library, even though in the project settings it lists it as an installed module, any ideas? The only things similar I've found online are because people were using the wrong interpreter or their file was named pymongo.py or something.
it does recognize it in both the provided python console, and if i start the python interpreter in the provided terminal as well
just not in the file, or if i try to run hte file
does your run config use the right interpreter?
uhhh let me check
Based on that console screenshot it looks like it is using a venv in "rpg-assist"
i'm not positive if that was it or not bc i had closed it and it's working now? but i dug through the config and i think it's very likely. so i at least know what to check if i run into it again. Thank you!
You're welcome
has anyone used the atom live server here ?


