#tools-and-devops
1 messages Β· Page 32 of 1
https://atom.io/packages/atom-live-server
I'm trying to use that for my web development class
no i havent
I have img in the right format it' s not showing up on the live server
but it shows up when I click the index.html
my image is not showing up now even the index.html
any help would be appreciated
I have the image path correct
guys, does anyone know how to toggle between lastly executed code in PyCharm's Python console? I only know I can do that by pressing UP arrow key and it's very ineffective π
hi all. i have a question. in pycharm, what is the plugin called which shows all the pages at the right side, and with which i can scroll through code, visualizing the font very small, like in vscode?
uh. if youre talkinf about what i think you are, thats enabled by default
no, i mean, the whole source code is showed in a sidebar on the right at once, written in a font. the code ure currently looking at is framed in white. and u can click anywhere to instant scroll there
@long sphinx itβs called CodeGlance
For anyone who uses duckduckgo as their search engine, here are some Python-related shebangs you can use to avoid typing the same things over and over again:
!py = Python 3
!pythondev = Python Dev (Currently, 3.8)
!numpy = numpy
!scipy = Scipy
!pandas = Pandas
!bs4 = BeautifulSoup4
!sns = seaborn
!mpl = matplotlib
!tflow = Tensorflow
!keras = Keras
!dj = Django
!pyside2 = PySide2
!pep = pep
!pypi / !pip = PyPi
!sopy = StackOverflow Python
π¦ π
what sort of love does a yellow heart indicate
would have taken orange if there were one
helper love
i don't understand
is this a setting thing you put into the search engine?
or do you have to type the !py each time
@hardy cedar you have to type the bang each time
is it just site-specific search?
bangs let you search particular other sites alot !so for stack overflow or !g for google
I imagine that these python based ones are for adding words to your search
when you are searching for a solution it is helpful to include the language that you are using (along with frameworks or whatever tools)
these bangs will make it quicker
as a next step you can use ddg as your default search engine to enable them from the location bar
i gave it a go and it went directly to the py 3 search results on python.org
but the python doc site's search is not a ui i enjoy
@hardy cedar congratulations
thanks
!dj models
Hi, probably a newbie question. I'm trying to use a virtualenv when working in VSCode, but VSCode is being irritating and not allowing me to select the venv as a valid interpreter. the venv was created using the virtualenv tool, and the folder is within the project folder, which is the only folder added to the VSCode workplace.
The instructopns suggest that is all you need to do to get it working.
in your settings.json, add "python.pythonPath": "venv\\Scripts\\python.exe",
adjusting for your interpreter path
you might need to restart vscode to get it to work, I believe I did when running into that
I've done that bit... the restart. Wouldn't be much of a sysadmin if I didn't π
I mean after you put in the setting π
Did you do create python terminal or run python file in terminal?
If you select python: create terminal from the menu thingy it will activate the selected environment
I assume it will accept % style % wildcards in the settings.json?
IIRC it does not
there are a few variables available, though - https://code.visualstudio.com/docs/editor/variables-reference
As well as allowing environment variables through similar syntax
Hmm stand by.
ok, got it.
wasn't the settings.json that wasn't working.
I had the wrong folders in venv.
(the correct ones were in a sub folder... headesk
anyone here work with graphene?
I have been trying to use the docs to learn but frankly I can't work like that
if theres someone willing to take out some time to walk me through it it would be greatly appreaciated
What's your problem with the docs/ at which part do you get stuck? I just took a quick look at some of it and it seems quite self explanatory if you know Graph QL
Also "i can't work like that" won't really save you because some day you will want to do something nobody you knows did before and then you will have to learn from the docs
Could someone explain why my code gives me an error when I run it using Visual Studio code? It says the file doesn't exist but it clearly exists and my bot works perfectly fine on sublime text.
It's the link to the error VS code gives me when I run my "!gems" command
It's in the same folder
What's the path, please
C:\Users\user\Desktop\C++ And Python\Code\responses.json
Can you show your VS Code launch configuration?
How do I do that? I forgot to mention that I'm entirely new to VS code and all I did so far was install the code runner extension
I'll google it
There's no need to use that extension
Unless you somehow find it more convenient I guess
I thought it was needed to run python code
No, you can run it with native VS Code features too
Go to Debug at the top left then click Start Debugging
Or you can do Start without Debugging too
nope
Oh is FileNotFoundError further up?
yup
You can get launch config by clicking the cog near the top left in the debug panel
oh okay I was going to send a pic of a file called launch.json
Which one do you have selected?
The first one?
The current one will be shown in the drop down menu next to the cog
this
Python: Current File (Integrated Terminal) is what i have selected
I'll be right back I need to get a new battery for my mouse
Strange. I would expect that to work. I suppose you can try adding "cwd": "${workspaceFolder}" to the entry for Python: Current File (Integrated Terminal) in launch.json
I added that, I'll try to rerun the file
Nope, still doesn't make a difference as far as i can see..
I wonder what the current working directory is then
In Python can you somewhere do import os then print(os.getcwd())
o.o
So it's not finding the json file cause it's searching for it in system32 lol
Though, setting the cwd in the json file should have fixed it
Can you show how you edited the launch.json?
Just wanna make sure it was done correctly
okay
{
"name": "Python: Current File (Integrated Terminal)",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"cwd": "${workspaceFolder}"
}
I wonder if this launch.json is even being used
If you change the name of the config, do you see the name change in the dropdown too?
should i just rename it to something random
doesn't matter
you can just change 1 letter
just something that you can see the difference in
Okay when i changed the name and clicked the cog again it just created the file again with the same name
You were meant to change the name of "Python: Current File (Integrated Terminal)"
not the file name launch.json
Try using "cwd": "${fileDirname}", instead
Yes It Works!!!1
No error is produced and It outputs the correct thing
Thanks a lot π
Nice. Unfortunately it isn't the ideal solution
Are you running VS Code as admin or something?
nope
Did you open the workspace by opening the "Code" folder?
nope the folder that contains the code folder
I put all my code for all the different languages and projects i do in that
and I opened that
It should have been the "Code" folder as the folder you open determines what the current working directory is
(not anymore since we made it based on the current file)
the cwd basically acts as the root
Still, that doesnt explain why the cwd ended up as system32
Maybe sublime text was doing something...
Like i said, it was working perfectly fine on it
anyways... Thanks a lot for you help Mark! I really appreciate It 
You're welcome
guys, is this the right place to ask about git?
Yes
I have a friend I found here with whom we are trying to practise collaborating on a django project. We have just started and I was wondering how to make it work... If I make changes I am satisfied with do I create a separate branch named like some new feature and commit changes to this new branch?
Make a new branch, commit your changes there, when it's done merge the branch into master
okay and once it's done, I push it to the remote repository to be reviewed, what if I want to continue working on another feature in the meanwhile? Say, another app in the django project, do I create yet another branch for it?
Yeah, you can create another branch for it
alright and to switch to this second branch? Let's say I'm at "eshop" branch right now... if I do "git checkout master" it switches to master branch where these new changes weren't comitted so it moves me to the past?
Yes, basically
okay, that was what I didn't have clear. So checkout can be used in combination with hashes but also with branches where it looks for the last commit that was carried out within that branch? Is that corrent?
Yes
It's a bit odd that you know it can work with hashes but didn't know about branch names
Typically people learn those the other way around
π
I don't even remember the last I've had to check out to a specific hash
I'm a hobbyist so I use these things once in a while and it's very easy to forget
branches are new for me
didn't need them working alone
Yay I finally figured out how to create a local project and then push it to github π
Only took me about 1h 30min or so
Regarding code formatters
So I am pretty much set on using black as my goto code formatter but I recenttly started running into an issue where it auto formats long lists with len(elements) > 100 or more to each element in one line which is a little annoying. Is there a way to configure list formatting via black?
@violet belfry ah well!
I did end up finding the pytoml file config but it seems to be limited to accepting the very few cli params
https://github.com/ambv/black#command-line-options
Hey everyone
could someone please assist me with following issues on pycharm
virtual environment is namen venv while it should be named untitled
and pip showing different version
It looks like it is using the right venv. If you look at the path when you did python -m pip ..., it matches the path that PyCharm shows in the interpreter settings
The issue may be that pip is not the same as python -m pip
the latter seems to be correctly using the pip in the venv
what does python -m pip list give?
---------- -------
pip 19.0.3
setuptools 39.1.0
(venv) C:\Users\Animus\PycharmProjects\untitled>
that gives the right one
@tawny temple
sorry was away for lunch π
ok
@tawny temple one thing I have noticed is also this just now
usually venv was not seen like this
what os are you on @radiant linden
Windows
Its been a mess lately with py charm and python
I have uninstalled everything and still same issue
what's the issue you still have?
same as presented on pictures
I even removed all the variables from environment and added them again but no luck
so your project interpreter is not the same one sourced when running the script?
@radiant linden Is that pip list everything listed within the global interpreter?
I just uninstalled everything deleted from env path
and have just one python version
3.7
venv file suddenly appears in testing
if I install for example requests
pip install requests
both get requests
is there something wrong here?
python is located in
C:\Program Files\Python37
in the top right corner, do you see a bar that says something like your script name? basically to the left of the green triangle pointing right
yes
click Project interpreter, and choose the venv you want to use
where the hell is project interpreter?
4th row from the top
under the section Environment
my bad, it's Python Interpreter
after changing the interpreter did you close the terminal and open another one?
no
can you try that?
Tried and no change
@radiant linden try deleting and recreating the venv
pycharm is telling me these two is are shadowing a name from an outer scope, but the function below is the only outer scope there is. am i missing something?
even then the i shouldnt count as shadowing, right? afaik identifiers dont carry over into functions called inside another function.
is that the whole file? any imports with i, or *-imports?
there's the full file
no imports with i or * imports
huh, fixed it
turned out it was
for i in range(n_list.flat_length()):
print(n_list.nested_path(i))
under if __name__ == '__main__':
Yeah, that's part of the global scope
which is why I personally always try to only write
if __name__ == "__main__":
main()
and put the rest of the run logic in a separate main function.
np
what does git commit -a do?
I can find -a in the manual
I thought it included all changed files on commit
but that seems to not be the case
@brisk prism Can you post that in #303934982764625920 instead? It doesn't seem to be tools related, and you will probably get more views anyway.
Is there any spreadsheet modules that supports utf-8 and easy to use?
I'm planning to store some values that contains Japanese characters and \ns, but csv is too hard for me to make characters escape properly
If you're doing csv with python three you just have to open the file with utf-8 encoding and everything should be pretty much fine
@tawny temple sorry for late response I had two day break π
could this be an issue as well?
That looks ok. The top path should be taking priority
Is this a venv that pycharm automatically created?
yes
So why is it yellowish? What's the message it's giving you when you hover over the folder?
nothing
no message poping up
its just next to the venv
library root
thats it
Go to Project Interpreter in the settings
At the top right, next to the dropdown menu, click on the cog and then click Show All...
So try to delete that interpreter
Than click the + button to create a new one
And just select "virtualenv" from the left
Try deleting the venv folder in the directory
so it will create the same folder?
Yeah
same thing popped up
venv in the main project
and in local terminal
while it should be named
testing
I am having doubts that the name in parenthesis actually means anything has gone wrong
well a week a go it used
If you open a command prompt and cd into your project, then run venv/Scripts/activate.bat, what does the name in parenthesis show on your conole?
to be so that name in parenthesis was the same as the one marked in project interpreter
(venv) A:\Python3_7Projects\testing\venv\Scripts>
(venv)
Yeah see, it just uses the name of the venv folder
did this change with the new version
but that still doesnt explain the issue
why i need to call
python -m pip list
instead of just pip list
like it was previously
I don't know π¦
just pip by itself should still be working
does it not work correctly with this test project either?
no
and when i updated the pip through the project settings
it gave me error for a pslit second and than automatically jumped on 19.03 version
setup tools can not update at all
what about when you ran activate.bat in your cmd
was pip working correctly there?
Did you run pip though in the cmd after activating the environment?
not through PyCharm
You're misunderstanding
I'm just asking you to run the pip command
pip list or something
Run it in your command prompt after you activate the environment
is it showing the outdated pip version?
Doesn't look like you activated the environment...
yes and
now run pip list
uh
Environment is not acivated anymore
Did you open a new command prompt or something?
no
Make sure the env is active before you run pip list
so
- activate through activate.bat
and than go back to root an run there pip list
Yeah but you don't even need to cd into scripts
you can just specify the path to activate.bat while you're still in "testing"
venv/Scripts/activate.bat
that command should work
If not maybe put it in quotes
what about python -m pip list?
that one has 19.0.3
where pip and where python
What about python -m site
Everything looks good based on those commands
I just don't understand
So there's one more idea
Maybe PyCharm fucked up creating the venv
Yeah that's fine
That's your system's interpreter
Anyway, you can try creating the venv yourself and see if the pip version is different between pip list and python -m pip list. You can create a venv with python -m venv /path/to/new/venv
(don't do this with your current venv still activated)
ok
π
No
Well we don't know if it is PyCharm's fault yet
You're going to test that right now by creating a venv yourself rather than through PyCharm
And if it still doesn't work then I'm out of ideas. Re-install Python or something at that point
π
as well as both
π
do i need to create new venv in project folder or anywhere i want
Anywhere
ok done
You did it with the python -m venv command right?
And what does python -m pip list show?
same
Hurrah
π€
So it is PyCharm after all...
sucker
I have not a clue why though. Is PyCharm up to date and everything?
yes
You said you re-installed it recently right?
latest
So probably
I don't know what's wrong with it
Maybe you can take this issue to JetBrains or something
But for now you can just create the venv yourself
Then you can go to PyCharm through the menus I showed you before, where you create a new interpreter
and add existing
You're welcome
Can I use .gitignore to include files in the folder which I do not want to be uploaded to github? ( I have data files that I do not wish to spread)
I have also been trying to figure out how to set up venv in visual studio code but havent found out how exactly.
Yeah, like so: ```
data/*
!data/important_data.csv
That excludes everything in the folder but makes an exception for that csv file
Could I do ```
Nordea*/*
to include all folders with a certain starting name and all files in that folder?
Sure, but you can just write Nordea*/ then. Everything inside is included automatically
ah ok, ty
No, you need the /* after
hmm....? sure?
Well, you need it for the exclude to work
I guess it wouldnt hurt either way
I don't think I ever wrote it that way and it always worked.
You mean the excludes worked?
Not sure myself, I just learned it has to be done that way if one wishes to exclude
But for general ignoring purposes either would work
@restive tiger Regarding the venv in VS Code, there's probably some fancy UI way to do it but you can set this option in your workspace settings python.pythonPath
hmm, it might be special because there is a glob in the first part, not sure how to interpret the docs on that point...
I believe this is the relevant line Git doesnβt list excluded directories for performance reasons, so any patterns on contained files have no effect, no matter where they are defined.
@lost rock
So ignoring the dir just ignoring the dir, but adding /* is actually ignoring each file individually
https://stackoverflow.com/questions/8783093/gitignore-syntax-bin-vs-bin-vs-bin-vs-bin suggests there are some subtle but significant differences
This answer is how I understood it The tricky one, that I just spent an hour or so ripping my hair out over, is that bin/ and bin/** are not quite the same! Since the earlier ignores the directory as a whole, and the latter ignores each of the files within it, and git in nearly all cases doesn't care about directories, there is normally no difference. However, if you try to use ! to un-ignore a subpath, then you will find that git (ahem) ignores it if you ignored the parent directory! (again, rather than the directory contents)
Β―_(γ)_/Β―
on a unrelated note, I am suprised more people dont share their github in the note section of their discord profile
But notes are client side
note section??
The note is whatever you give to others
Oh lol
People can't set notes to show other users
yeah, you only see the notes you make yourself π
kinda like placing sticky-notes on other people's forehead to remember their names or birthday
gn π
@tawny temple hey its me again π
is that normal as well?
this type of setup
because it looks like that VENV which i create under textin/venv like we spoke yesterday
is similar to external libraries
@radiant linden Yeah, it's normal my PyCharm projects show that venv folder in there too.
@worthy sequoia why you use VSCode when there's Vim?
It's only better at being a an IDE
not at being a text editor (as most claim it to be)
as an IDE it is worse than most options
I find it to be a really bulky mid ground that is not needed
there are lighter text editors and better functioned IDE's
Text editors I'd use include vim, notepad++, programmer's notepad, and gedit
IDE's of choice would be JetBrains products
That's part of the issue that i had with VSCode
PyCharm and IDEA are both pretty intuitive to me
@worthy sequoia Only use Sublime cause it's just what I started out with. When I started out, VSCode and Atom were fairly young still. I have considered switching before.
Now they have gained far more traction and have ecosystems of extensions and whatnot
Any config/ext for indentation for VSCode? I got a lot of PEP8/E128 errors. Is there a prettyfy function ?
print((productname, brandid, speciesid, positioningid,
flavorid, url)
)```
(to achieve this)
Succeeded! Format document command
Slowly getting the hang of github, almost feels more complicated tho to use tools like Gitkraken.
Once you understand what the commands are actually doing, and the git workflow, any gui on top of that is just for convenience
I just upgraded to Python 3.7 from 2.7, as the reload function is gone how do i update my packages?
I am currently using vim and running Python of console btw, if that makes any difference
There's still a reload function, but it's been moved to the importlib module
@fickle prairie
I thought he meant how to upgrade modules with pip lol, been sitting googling and reading about a "pip install --upgrade" feature that doesnt exist apparently (or is broken)
@cold gate yeah, ive shouldve mentioned i am using it now, but its just so clonky importing it everytime... Is there any enviroment i should look into? How do you guys usually deal with these things?
How are you using this at the moment? You have a script that runs continuously and want to reload modules while it's running?
I am currently programming neural networks, so everytime i make an update to it i have to reload the nn, create a new class and retry, no running while reloading
Oh, interesting
I don't know if you have to set-up more for your analyses, but you can either run a start script and have python end with the interactive interpreter (-i flag in cmd) and have something like from importlib import reload in there so you can just use reload(module) from there on out. It may also be possible to add it to the start-up options in Python, but I don't know.
You can use the PYTHONSTARTUP environment variable for the latter
You can set a file that should be executed before opening the REPL and you can add your default options to that
Omg thats amazing thank you so much!
I've never used it, though, so I can't really help you with setting it up
Its fine, i've dealt with similar things before.
What would you guys reccomend for a console framework/template engine?
Not ones like arg management and stuff I am thinking more like asci based GUI, its hard to explain what im looking for.
I guess which is why I havent been able to find it on git or anything.
are you maybe looking for curses?
Wow dude thanks a bunch I feel like an ID-10T now.
np, hope it helps you out π
Hmm, though curses is a little more real time app then I am looking for. I am thinking more of a view system, if that makes sense? I am more trying to format console output, use view partials and so on. Think like a web template engine but for console output instead.
pretty sure you can use curses for this
Ahh ok then I will check into a little more. Thanks!!
why does pycharm sometimes warn that my iterator in for loops is unused but doesn't worn other times?
is it because you use the wrong variable name?
_ is meant to mean that you do not care about it
Is there anything wrong with this pipfile? ```py
[[source]]
url = "https://pypi.python.org/simple"
verify_ssl = true
name = "pypi"
[packages]
discord-py = {git = "https://github.com/Rapptz/discord.py.git", ref = "8123d4a", editable = true}
aiosqlite = ""
pyyaml = ""
[dev-packages]
"flake8" = ">=3.6"
"flake8-bugbear" = ""
"flake8-import-order" = ""
"flake8-tidy-imports" = ""
"flake8-todo" = ""
"flake8-string-format" = "*"
[requires]
python_version = "3.7"
[scripts]
start = "python -m adventureIO"
lint = "python -m flake8"```
I tried installing that (without --dev) and i just keeping getting this error ```
File "c:\program files\python37\lib\json\decoder.py", line 340, in decode
raise JSONDecodeError("Extra data", s, end)
json.decoder.JSONDecodeError: Extra data: line 1 column 8289 (char 8288)
During handling of the above exception, another exception occurred:
...
File "c:\program files\python37\lib\site-packages\pipenv\utils.py", line 678, in venv_resolve_deps
raise RuntimeError("There was a problem with locking.")
RuntimeError: There was a problem with locking.``` full https://paste.pydis.com/wedilovezu.py
I am currently running it with a fresh install of python 3.7.2, pipenv was just installed and up to date
And there are no other python / pips on my system
Can you run it in verbose mode?
Not sure unfortunately
It basically builds a command then executes it in subprocess or something
then reads the stdout
Was kind of hoping verbose would show what that command is
or what the output it
Ah it does actually show it
It's right before the error
it prints results in caps and the next line is the json that it tries to load
Ye idk whats wrong
i experienced it yesterday when i was trying to setup this bot on a friends pc
he got the same error and what not
I dunno, that JSON seems fine
I reinstalled python cause i kind of had too many dependencies on my global python, now i get it too
Any suggestions as to what i can try?
Try to narrow down the issue
Is it failing cause of d.py?
Or more generally when installing with -e from git?
or perhaps installing anything from git
lets see
[[source]]
url = "https://pypi.python.org/simple"
verify_ssl = true
name = "pypi"
[packages]
discord-py = {git = "https://github.com/Rapptz/discord.py.git", ref = "8123d4a", editable = true}
[requires]
python_version = "3.7"``` my pipfile atm
deleted the virtual env
and restarted everything
I pinned it to the latest commit on their repo
i guess i could try an older commit
let's just see what it does first
huh~ seems o be working now
Yeh
Aha issue is related to aiosqlite @tawny temple
π€
oh yeah didn't catch that in the verbose log
kinda hard to follow since it's resolving dependencies for multiple things at once
true
i can run verbose with only aiosqlite
that... worked?
Seems to be a conflict with the newest d.py and aiosqlite then
Yet the error doesn't seem to indicate that at all
json decode error...
just confusing
Yeh so i can lock with all packages alone
i can lock with d.py & pyyaml, and pyyaml & aiosqlite
but not with d.py and aiosqlite
but aiosqlite doesn't even have any dependencies
I have no idea
I went ahead and asked on the d.py server if theres any other recorded incident with this
Eh was just pointed to the permissionError
Which doesn't tell me much if I'm able to install each package separately imo
I don't think it's the permission error
That's just something that is ignored by pipenv
Well apparently the permissions thing is a know issue
However, I still think this is not related to dependency resolution failing.
It's just some cleanup of temporary files failing
eh
And for what it's worth locking fails for me too
Is it cause i installed python in C:\Programfiles in stead of roaming this time?
Was it working before with that exact pipfile?
yeah afaik
i uninstalled all pythons and stuff cause my vsc had issues running files directly
i got tired of having to type pipenv run start jus to see if an import in my cog worked
Maybe the dependencies in your old venv were outdated so it was working
cause * just locks to the latest
Well, it takes a good 2 minutes but I can get it to lock with just d.py and aiosqlite
how
Here's the pipfile modified https://paste.pythondiscord.com/aduqesekuk.py
The lock file that resulted from pipenv lock --dev https://paste.pythondiscord.com/ofibizirom.py
I mean mine looks just the same
except i have pyyaml uncommented
and a long commit ref
instead of the short one
I'll try again with pyyaml uncommented now
When I initially ran pipenv lock with the pipfile exactly as you sent it, it did fail
Ive modified it a bit, this is my last iteration ```py
[[source]]
url = "https://pypi.python.org/simple"
verify_ssl = true
name = "pypi"
[packages]
aiosqlite = ""
pyyaml = ""
discord-py = {git = "https://github.com/Rapptz/discord.py.git", ref = "d48a424f6f464044a59275d5e885b493a4a1aef7", editable = true}
[requires]
python_version = "3.7"```
Mmm, well my results didnt change
yeah it fails with pyyaml
what 
huh
you're right
ok so it locks with a git reference for pyyaml
I guess the pypi version isnt compatible with 3.7?
or some of the deps of d.py
neither pyyaml or aiosqlite have dependencies on any other packages
I don't see why they would fail
`Specifying the two dependencies that d.py has manually also works
(but without d.py itself)
i.e. toml [packages] aiohttp = ">=3.3.0,<3.6.0" websockets = ">=6.0,<7.0" aiosqlite = "*" pyyaml = "*"
Isn't the dev our very own kennethreitz?
Yeah but I don't know how much he still participates in day to day development of it
Plus I think they'd just prefer if you go through the normal communication channels
What are you guys using for application developement frameworks that arent webbased? Or should I just break down and use a web framework?
I use PySide2, which is the Python wrapper for Qt
@thin elm depends on your needs, do you need a graphical interface? Do you want to make a basic CLI tool? Rich terminal application?
@brittle isle Im thinking more a long the lines of CLI.
Though I am open to looking at many different stand alone frameworks.
@thin elm for CLI program you may
- use no framework at all
- use
click - use
cleo - and so on
yeah I was looking into click I havent heard of cleo ill check that out
click is great, cleo is a bit different, but they basically fulfill the same goal
Which do you think is better?
none, there is no such thing as "better" when it comes to chosing a language, a framework, a library...
try them and pick the one you prefer
I mean, thats debatable. For instance look at cakephp and codeigniter
both frameworks have solid debates why they are better then the other.
yeah, but all those debates are pointless
tools have advantages and counterparts, it is just a matter of personal preference in the end
Im not gonna degress... Ill rephrase to suite your thought proccess
which one do you use more often and why?
I usually use no framework for my CLI tools (they are pretty simple), already used click though, it was neat
Hello, I don't know where to ask it so I write it here (correct me if it's the wrong chat). I look for a good website with royalty free images
I think I found it here : https://www.shutterstock.com/ π
Pixabay might work too
Ok tanks π
Is there any way to rank, for a github repository with many forks, which branch of which fork has had the most lines changed?
@coarse rapids you could use git diff and a script
If you're fine with a non-pure git solution then look at GH's API
Hello! I have installed git and it wont let me add my orgin; and i tryed through atom, but the github page just shows black
@tawny temple
How are you doing it through atom?
And nothing shows up when you click it?
Nope @tawny temple
Sorry, that seems like too vague of an issue for me to help you with
Maybe you should report a bug to Atom or something
In the meantime you could learn how to use git using the command line
I believe we have some resources for git listed
!resources
The Resources page on our website contains a list of hand-selected goodies that we regularly recommend to both beginners and experts.
@tawny temple
admin@DESKTOP-7OAPJU8 MINGW64 ~/Desktop/toolr-master (master)
$ git remote -v
orgin https://github.com/Thatcooldevguy/toolr.git (fetch)
orgin https://github.com/Thatcooldevguy/toolr.git (push)
admin@DESKTOP-7OAPJU8 MINGW64 ~/Desktop/toolr-master (master)
$ git push
fatal: No configured push destination.
Either specify the URL from the command-line or configure a remote repository using
git remote add <name> <url>
and then push using the remote name
git push <name>
git push -u origin master maybe?
weird
Hello I got this error msg with pip (I use Pycharm with windows10 and Python3.7) :
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
python -m pip install --upgrade pip
Requirement already up-to-date: pip in venv\lib\site-packages (19.0.3)
May I need to rename or move the site-packages (19.0.3) directory elsewhere ?
@fickle swallow whats the original command you used to get the version notice
pip install pyinstaller
Trying to install pyinstaller
are you on windows?
yes windows 10
It says : pip 19.0.3 from [...]venv\lib\site-packages\pip (python 3.7)
are you running this from within a venv?
yes
and are you trying to install pyinstaller inside that venv?
but I don't knwo what it means :x
virtual environment
oh ok
it's a little contained python environment
has it's own python path, package installs, etc
yes I was trying to install pyinstaller within venv
then just use python -m pip install pyinstaller
it's recommended to use pip via the specific interpreter you're intending to use to avoid pip path issues
in this case you likely tried installing pyinstaller via a pip that was not matched with the interpreter you were using
ok, so I must type this in windows command mode ? (actually I'm in the pycharm console mode)
pycharm autoactivates the venv your project is using
you can use it there
if you go to windows console, you'll need to manually activate the project venv
ok ti works without warning, thanks π
@fickle swallow no probs. if you want to update your normal pip, you can check it outside of your venv
just open a normal windows console and type py -m pip --version to check if the system install specifically is out of date
???
did you redefine list?
oh, sorry, didnt notice there was a convo going on already. shouldve checked first.
nah, haven't done anything to it
import io
from base.nodes.codenode import CodeNode
from typing import Union
DumpStream = Union[io.StringIO, io.TextIOBase]
class CodeNodeWriter:
def __init__(self):
pass
def node_to_lines(self, node: CodeNode):
stack = [(node, 0, node.total())]
# depth = 0
while stack:
node, depth, iterator = stack[-1]
try:
item = next(iterator)
except StopIteration:
stack.pop()
continue
if isinstance(item, CodeNode):
stack.append(
(item, depth+node.child_depth_offset, item.total())
)
continue
yield depth, item
def dump(self, node: CodeNode, stream: DumpStream, indent=' ', base_depth=0):
for depth, line in self.node_to_lines(node):
stream.write(indent*(depth+base_depth))
stream.write(line)
stream.write('\n')
def dumps(self, node: CodeNode, indent=' ', base_depth=0):
string_io = io.StringIO()
self.dump(node, string_io, indent, base_depth)
return string_io.getvalue()
writer = CodeNodeWriter()
that's the full file
seems like some typing weirdness
are you typehinting stack anywhere that's not shown here
nah
no stub files and no docstrings either?
not that i know of anyway. https://github.com/0xf0f/codenode you can see the repo here if you like. it's a bit different to that snippet but largely the same.
nah, no docstrings. not quite sure what you mean by stub files
test something for me
def node_to_lines(self, node: CodeNode):
stack: list = [(node, 0, node.total())]
first this i guess
ok next do this
def node_to_lines(self, node: CodeNode):
stack = [(node, 0, node.total())]
print(type(stack))
just to verify it's correctly typing
<class 'list'> yep
yeah thought so
it's just the linter having a moment
should be gone anyway
have fun
ty!
Hey so in pycharm i have a run config setup and it works fine. but under the same working directory in that config and everything if i do py src/main.py it gives me module errors. How does pycharm run the file differently?
show your run config
what's the module errors that shows up?
it works fine in the run config
ModuleNotFoundError: No module named 'src'
src is the folder everything is in
and the cwd is the enclosing folder
it's because it's adding the roots to the available paths
so how do i fix it
I don't personally rely on pycharms path additions in order to make sure things work as expected outside of pycharm run environments.
you could try running it as a module maybe?
py -m src.main
nice, good to hear
I don't think the cwd was the same
if he used src.main and it works, it should be the same cwd
Yeah, never mind
all g, i thought maybe it was that first too so i was scratching the head a bit
It's cause it wasn't being ran as a module
I'm so used to it that I forget it works differently with imports
i'm kinda not a fan of pycharm adding src to pythonpath because of this
i understand it has it's usages for tests
but it probs shouldn't be default enabled
which python linter can check for variable name reuse?
That depends on the OS you're using
Consolas for Windows, Menlo for MacOS, DejaVu Sans Mono for some Linux apparently
A lot of people change the chosen font to their personal favourites though
I personally use Fira Code Retina for my code, for example, and Atom has a setting letting you choose your preference.
time go scroll through and find my favorite
Yeah I use one of either Operator Mono, Dank Mono, Overpass Mono, or IBM Plex Mono currently depending on which machine Iβm on (Linux renders fonts much worse than Mac OS) which text editor (they also render differently) and my mood
Last time I used atom I donβt think it did ligatures yet, but then again I donβt use atom anymore
First thing I do with any computer is replace the global monospace font because Iβm OCD
i need help with vscode
whats the problem with that
for debugging
not right now, but that doesnt help
its not that the variables dont show up, its the whole panel isnt there
and youre sure
Did you try focus on variables view?
that's the full pane
that pic is running (paused)
control + shift + p to get the command thingy for vscode
Then type variable in there
i had no idea where to even start
You can right click to select which onces you want to see.
was about to say so
right click where?
watch
on the words watch, variables etc.
just rightclick the bar and check variables
And at the top of the debug window
Do you guys mind if I ask an Excel question here? I don't want to bother the help channels and TPH is not really helping
I could do the trick easily with Python but the client wants an Excel file without VBA if possible π¦
one of the off-topic channels would be more suitable for that kind of question. #tools-and-devops is for tools around Python, like package managers (e.g. pip, pipenv), version control (e.g. git), and IDEs.
ty
I uhh need help fast
so I uhh
forgot
that I needed to transfer files
but the thing is
its remote right
on my raspberry pi I need to transfer this one file to my current laptop
through code of course
google drive seems like the best way to do it
but uhh
I need it like right now
so I can't like spend time learning and stuff
help
idk what to do
Do you have ssh access to the pi?
well its connected to git, and to the same internet
so like I can push and pull to it
If you push with your laptop you could pull with your pi
but what do I push
What do you want to transfer.
How are you accessing the pi?
what do you mean?
What are you using to control the pi.
a tiny monitor
but its a zero, and if I try to upload it manually from my pi, it fails
its also clunky
I want a way to upload it from my computer, as I have already set it up so I can send commands from my laptop to the pi and make it run stuff
dunno how and what that is (sorry I am newish)
yes please
the thing is I need this done in like 5 hrs so I hope you can get it working first and explain how it works right after
acutally more like 3
https://www.raspberrypi.org/documentation/remote-access/ssh/
Is the official guide for setting it up.
Need to access a Raspberry Pi, but donβt have a monitor spare? This section provides basic instructions for setting up remote access.
ok thanks
And this is a guide for how to send transfer files once you set it up
https://www.raspberrypi.org/documentation/remote-access/ssh/scp.md
Need to access a Raspberry Pi, but donβt have a monitor spare? This section provides basic instructions for setting up remote access.
hey @languid helm
I just enabled ssh on the pi
looking at this page:
https://www.raspberrypi.org/documentation/remote-access/ssh/windows.md
Need to access a Raspberry Pi, but donβt have a monitor spare? This section provides basic instructions for setting up remote access.
currently on put the pi's IP address
where can I find it
Type ifconfig on the pi
gotcha
thanksman
looking at the second link you sent me right now...
wait so
@languid helm
what now?
thats the file I am looking for
where is it?
Is it in your user or download folder?
nope
After looking around a bit it seems that on windows you would use a program call pscp, (putty scp)
it should come with a normal putty instal
Disconnect from putty, this is done from the windows command line
I see
control + D is the logout command
I uhh did it, and it gave me a help menu
PuTTY Secure Copy client
Release 0.71
Usage: pscp [options] [user@]host:source target
pscp [options] source [source...] [user@]host:target
pscp [options] -ls [user@]host:filespec
Options:
-V print version information and exit
-pgpfp print PGP key fingerprints and exit
-p preserve file attributes
-q quiet, don't show statistics
-r copy directories recursively
thats part of it
yes, so the command is now
pscp pi@ip:/path/to/file c:\path\to\destination\filename```
What did you input it like?
pscp pi@192.168.1.128/Desktop/profiles.json "C:\Users\henry\Desktop"
Does it need the quotes?
should I try without them?
C:\Users\henry\Desktop\profiles.json
You are missing a : after the ip
you didnt give me it in your thing
uhh
it says it the directory doesnt exists
but
it does
I checked spelling
~/Desktop
~ means the home of the user
Without that it will look at the filesystem root.
still says cant findit
Does it say which one it's not finding?
gives the whole path
With both paths?
nope just the first
unable to identify ~/Desktop/profiles.json: no such file or directory
pscp -ls pi@192.168.1.128:~
pscp -ls pi@192.168.1.128:/home/pi/Desktop
π
well I got it working
thanks man
but one more question
how do I run this command
but like
make a .py file do it for me
you can use os.system but I"m not sure if thats the best way
Do you have acces to your router? You should give your pi a static ip, so it will always be .128
ok
Sooo, when creating a new project in pycharm
should I change the executable since I'm using a different python version
You should choose the base interpreter that matches the version of python you want to use.
I know but what do I put for executable @prisma nexus
not the base interpreter part
for the executable should I put python.exe or pythonw.exe
oh i just saw that
the pipenv executable? I'm not sure. I'm on linux and mine doesn't give me that optoin
Hi, is there a way to have a lockfile based on requirements as with using npm? I would like to avoid having to change virtual env for each project manually.
@languid helm Ok, does that mean can avoid virtual env or it's just to lock versions?
lockfiles are just files that contain the version number of packages
@languid helm So is there a way to avoid switching virtual env manually?
There might be, I don't know, it hasn't come up for me yet. I just open the terminals side by side if I need more than 1 at a time
so I got pycharm
how do I install new themes and such?
in Atom I have the Neutron Dark theme
and I want it in PyCharm
Hey, does anyone know how to use autocomplete on vscode without having python installed ?
I use python on WSL π¬
@heavy knot One way to solve this would be using a general autocomplete extension.
They are pretty good, but not as good as the official python extension.
Otherwise, why not install python in WSL and windows?
I just did that 
π
yo guys, anyone here using visual code?
Yes
do you know how to customize an extension? I'd like to get help customizing Bracket Pair Colorizer v2, no idea how to do it :/
what kind of modification?
i'd like to use my own colors that i've been using a long time on visual studio entreprise with Viasfora, but yeah i don't know how to use my own colors, that's what the description says but idk what to do with this
That description isn't very helpful indeed.
@grizzled trail Are you on win or linux ?
@grizzled trail nvm, go to Preferences > Settings
and clic on this icon
it will change to a json windows
there you can put that settings that says on the extension
this is the format
{
"bracket-pair-colorizer-2.colors": [
"Gold",
"Orchid",
"LightSkyBlue"
],
}
there you can use your own colors
