#tools-and-devops
1 messages · Page 45 of 1
@brittle tide
Don't know if this helps, but I recently found out you can run scripts in interactive mode from the cmd line. Just add the -i argument.
yeah thats what i was talking about but whenever i change the file i need to reload the prompt
Can someone help me with git? I have config.py in .gitignore, but when I try push to repo I get errors. When I try git pull I get conflicts (screen) then git creating for me file with other name, type, but the same content.
So, anyone ever had this happen with pycharm when adding an existing venv?
@tough stratus corrupted data
I had that happen when I had a venv of a Python version I had uninstalled IIRC
Is it possible to make it so you can use your computer normally while you operate a task with pyautogui like moving your mouse like do the same but virtually only in the application and use your mouse as you want
Does anyone have a good solution to sync projects between different computers?
github is good at that
Does anyone know the extension SQLite on vscode? and if so I have a problem with it, i don't know how to close a table in a dataset if anyone can help me would highly appreciate it
Hey guys. Can someone maybe tell me how I can fix this problem
Pycharm usually has 4 windows at the bottom: python console, terminal, todo and a window called "run" where you can see what your coude would look like
sadly after I updated its gone
dont know what to do
hi guys is there any channel for pillow ?
Hi i'm trying to figure out how to install "pip" but i can't, if you can help me and don't go tell me to go search on google because i can't find on google.
@random sage It's possible that you already have it -- have you tried python3 -m pip?
official docs are https://pip.pypa.io/en/stable/installing/
some commade make just a space of a line and that's it, is that normal?
@thorny shell
that is to say ?
I didn't understand that, either 😦
I think you typed four commands, and I can see the output from the first one, but I can't see what you typed.
try ```py
c:\users\whatever> python3 -m pip --version
pip 20.0.2 from /Users/xyzzy/Library/Python/3.8/lib/python/site-packages/pip (python 3.8)
if you see output like that, then you already have it
no i have juste a space of 1 ligne
python3 -m pip
and that produced a lot of output?
python3 -m pip
Usage:
/usr/local/opt/python@3.8/bin/python3.8 -m pip <command> [options]
Commands:
install Install packages.
download Download packages.
uninstall Uninstall packages.
freeze Output installed packages in requirements format.
list List installed packages.
show Show information about installed packages.
check Verify installed packages have compatible dependencies.
...
output ?
lines?
look my screen, he has line breaks
tu peux utiliser Google Traduction https://translate.google.com
Google's free service instantly translates words, phrases, and web pages between English and over 100 other languages.
@thorny shell you are french ?
tu peux utiliser Google Traduction https://translate.google.com
non, c'est pourquoi je vous suggère d'utiliser Google Translate !!
Je suppose que vous parlez français
i use google translate
Si tu as besoin d'aide pour traduire tu peux m'envoyer un MP, je suis français :) (if you need help to translate you can DM me, I'm French)
Je pense que vous avez déjà _pas_pip, et pouvez l'invoquer comme python3 -m pip.
"Baguette, croissant" ~ in French
It's like those French have a different word for everything. "Oeuf" means "egg".
hey guys, im getting into python and I just installed python off the microsoft store (i don't have admin) and vs code. how do i run my scripts with microsoft store python? I also don't have access to command promt
The ms store version is pretty much all broken, if you can avoid it that would be great, if not, you have to find the path to the interpreter and feed it to vsc
it's a "revision control system".@stark basalt
it lets you keep snapshots of your code over time, in case you mess up and want to go back to something older that worked
it also keeps multiple programmers, working on the same code at the same time, from stepping on each other's toes
it doesn't have anything to do with python specifically, although it's common to use both together
just like a web browser doesn't have anything to do with python specifically, although lots of people use both at the same time
After rebasing my testing branch to my master branch, i’m left with now two identical branches
What do I do with my old test branch?
Can i delete it?
ty! :D
Hello, i am new to python and was wondering if anyone could point me in the right direction, I've started to code a very small program but want to try and display the raw data each on a separate line, I'm also not sure if my if statements are optional, I don't need you to do the code for me just point me in a direction of learning please
this is the code,
https://pastebin.com/zf5ZmCJH
Hmmm, not sure if this is what you wanted, but maybe try putting it on a gui like tkinter or pygame?
@round escarp are you good with tkinter?
if so, can you help me over on #user-interfaces
are the if statements okay like that? i wasn't sure if i had to add else: or not
Lol, I'm not really good with tkinter honestly i just know it exists
@vapid sigil probably better to post the entire thing here or at least send message link to question in case #help-pear closes
ok
when i used this comand on cmd: python -m pip install 'python-language-server[all]'
and i downloaded this
https://github.com/palantir/python-language-server
where do i put it
i would wanna ask i normally use visual studio community
but today VS asked me about licanse key
sorry typo
ik it is not about python but i need help
if i look to the settings the VS would say You're using Enterprise 2019
i think you need to renew your lisence ever so often with VS community
i think you do that by signing in again
well i signed in program again
i know
i signed today with my two microsoft accounts but nothing changed
and it says enterprise even though i downloaded comminuty
if your VS say you are using Enterprise, you need to uninstall and reinstall
ok
are you using VS for something else?
you might want to backup your settings and such
i just made some python programs
only python?
that i still have
algorithm
then why Visual Studio?
why not Visual Studio Code?
its made for python development
idk my friend said you can use this
could we also pragram C# or C++ or Unity with VS Code?
i do not think so, vs code is a bit limited for other languages
it supports C# and C++
for deleting VS i gotta have upgrade it first ... xd
anyways thanks eivl it was really helpfull
Visual Studio is so large, it kinda supports almost all languages ever made, but it is primarily made for windows development.
VS Code is a text editor that excells with python development due to its ease of use and feature rich tools.
hmm ok
downloaded
where can i change langueage
sorry typo again
and how do i add python in it
anyways got it
Is this legal?
and is it free
and where can i open my account
@frosty hornet VS Code is free, no account needed, and for Python support there is https://aka.ms/pvsc-marketplace (you can also reach out at https://aka.ms/python-discord in the vscode channel if you need specific help)
How would someone clone a git branch from GitHub?
Or would the best way be to clone the repo and then checkout the branch?
You can specify the branch to checkout in the clone command
I think with the -b option.
sounds good 👍
One more thing @tawny temple . If I am cloning one of my own repo's. How would I add connect the clone on my pc with the GitHub repo?
That's called a remote
Git will automatically add one when you clone
Check git remote -v to see a list
You should see origin listed
You can use git remote add/remove too if needed, like if you had a fork and wanted to add the upstream as a remote.
@tawny temple What if it is a pre-existing GitHub repo that already has changes and such?
I need to install my repo to a different computer and then connect them back to the repo
Yeah it will add the remote when you clone
Alright, thanks for the help :D
is it possible to change the color of an specific word on a txt file using atom?
txt files don't have colors
for some reason WARNING changes color
Code editors can add "syntax highlighting" logic to files
there's usually a style associated with it, although I'm not that familiar with Atom
It's not a part of the text file, but rather of how the highlighter interprets the file and how it's configured to display it
It's like Python syntax highlighting: The colors are not part of the file, but how the editor/IDE displays the file
After today's Python extension update, VSCode is showing me import warnings for the following setup:
opened_folder/
my_app/
models/
points.py
core.py
The folders have __init__.py files too but I've omitted them here.
In core.py, I have the following import:
from models.points import Point```
It works fine when I run the code, but VSCode shows the following warning:
`unresolved import 'models.points'`
VSCode doesn't give warning if I do `from .models.points import Point`, but of course Python gives an error for that.
I tried to install the previous version of the Python extension, but I still got the warning. This warning didn't appear before today.
If anyone can tell me how to fix it, it'd be great.
I'm on a Mac, in case it helps.
I have started learning IDLE in python. Can someone please tell me what I am supposed to learn next?
@zenith sequoia
IDLE is a code-editor that comes with Python. It's features are VERY limited, so I'd recommend getting comfortable with an editor that has more real-world features such as Visual Studio Code, Atom, Sublime Text, or maybe even PyCharm.
As for tutorials, I'm a big fan of the "Python Crash Course" book. It'll take you from 0 all the way to visualizing data and building a web-app with Django.
im trying to get notepad++ to execute python scripts, cant seem to get further than it just opening python, i have tried searching for it but im still kinda confused
i need help with tipeeestream api
import requests
import urllib3
import selenium
apiKey = input('apiKey: ')
refreshToken = input('token: ')
provider = input("provider: ")
payload = {"provider": provider,"access_token": apiKey,"refresh_token": refreshToken, "origin":"login"}
r = requests.post("https://www.tipeeestream.com/login", data=payload)
ignore that selenium
i want to make a script which logs you in tipeeestream with just api key
I have an issue with VScode. It always worked good and now i am getting this (see picture)
I tried uninstalling it many times and change path also. Please help
i have this in bottom left
umm, idk
i'm struggling since this afternnon
was working since 6 months
no issues
and yesterday update
and now..
Hello, i am new to python and was wondering if anyone could put me through on how to create go about Html letter crypter
can anyone help me setup my pycharm with python 3.8.2?
pls
pls anybody
i dont know how to use pycharm
nor python by itself
and i want to learn
so that i can code and make a website too
pls
dont mak fun
pls
i really need help
to setup my pycharm
in 3.8.2
version
pls
!tempmute 284366407771095040 18H Mocking other members will not be tolerated
:incoming_envelope: :ok_hand: applied mute to @opaque perch until 2020-05-14 12:55 (17 hours and 59 minutes).
@jolly dock it would be easier for someone to help you if you actually asked a question
Can someone provide me with the .gitignore glob that would ignore .git folders and .gitignore files in subdirectories?
I'm working through a new project-based textbook and I want to have a repo that I can push to GitHub as I complete each chapter. However, I'd like each chapter-project to have its own repo in-case I need it.
Book_folder
.git
.gitignore
chapter_1
| .git
| .gitignore
chapter_2
| .git
| .gitignore```
My tree is gonna look something like that.
@grand sierra please open an issue at https://github.com/microsoft/vscode-python
👋
@jolly dock it would be easier for someone to help you if you actually asked a question
@violet belfry https://discordapp.com/channels/267624335836053506/463035462760792066/710200197635899465
@covert kindle if you have git clones isnide another clone, you should probably use git submodules
anyone here knows how I fix indentation for python on VSCode?
like that 'print' for example
I need to manually go and put a tab there
which is annoying asf
I already installed the 'python' plugin for VSCode
using autopep8
maybe some indents cant be automatically recognised, thus have to be manually fixed?
Have you restarted VSC after downloading the plug-in?
ReSharper is really the star, but none the less nice that they made the IDE
visual studio with resharper is probably as good as (probably slightly more developed than-) rider
How to start when building a command-line app with Python:
https://youtu.be/JwwlRkLKj7o
Learn to build a command-line app using scaffolding. Then create a repository for it, create a PyPi page, use versioning, create documentation, and finally run it as a random internet stranger would.
Notice: if it will be the first time when you do this, please spend at least...
does anyone have atom? i need help with it
i switched to a new PC
and i had to reinstall atom etc
and then i ran a hello world program to chekc but it said this
so i tried the link and ms store
apparently its bugged or smth
so i downloaded latest ver from py website
but it still says that
A new book I'm starting has me using Conda for virtual environments. However, it doesn't look appealing since from what I read Conda doesn't use pip, it uses its own channels. I only have experience with venv, but I've also heard about pipenv and virtualenv. I'm not an advanced user, but I would like to pick one that will let me grow into more feature that I might find useful down the road. Any recommendations between venv, pipenv, virtualenv, or Conda?
pipenv looks good, but seems pretty much dead* (no release in almost 2 years, but occasional commits)
I do like that venv creates the folder in the project itself. The folders presence reminds me that I have to activate the virtual environment.
Does anyone know a workaround for pyinstaller to use the local venv instead of the global enviorment to build executables?
(It happens even when pyinstaller is executed from "./venv/Scripts/pyinstaller.exe")
Thank you in advance!
Currently my External tool Config for PyInstaller looks like this. 
I'm setting up a remote environment on my work computer (Linux) that I can use from my laptop (Windows), which appears to be working, except that if I right-click on the tests directory of my project, I don't have the option to run all the tests.
In fact I get a message about not having a perl interpreter for this project.
@analog kettle Using which tool(s)?
Oh, with PyCharm. Forgot to say.
However now I'm having an entirely different issue.
What's that?
Error
Traceback (most recent call last):
File "/usr/local/lib/python3.7/unittest/case.py", line 59, in testPartExecutor
yield
File "/usr/local/lib/python3.7/unittest/case.py", line 628, in run
testMethod()
File "/usr/local/lib/python3.7/unittest/loader.py", line 34, in testFailure
raise self._exception
ImportError: Failed to import test module: test_model
Traceback (most recent call last):
File "/usr/local/lib/python3.7/unittest/loader.py", line 154, in loadTestsFromName
module = __import__(module_name)
File "/tmp/pycharm_project_950/medacy/tests/model/test_model.py", line 11, in <module>
from medacy.model.model import Model
File "/tmp/pycharm_project_950/medacy/model/model.py", line 9, in <module>
import joblib
File "......lib/python3.7/site-packages/joblib/__init__.py", line 113, in <module>
from .memory import Memory, MemorizedResult, register_store_backend
File ".......lib/python3.7/site-packages/joblib/memory.py", line 33, in <module>
from ._store_backends import StoreBackendBase, FileSystemStoreBackend
File "...../lib/python3.7/site-packages/joblib/_store_backends.py", line 17, in <module>
from . import numpy_pickle
File "...../lib/python3.7/site-packages/joblib/numpy_pickle.py", line 15, in <module>
from .compressor import lz4, LZ4_NOT_INSTALLED_ERROR
File "......../lib/python3.7/site-packages/joblib/compressor.py", line 24, in <module>
import lzma
File "/usr/local/lib/python3.7/lzma.py", line 27, in <module>
from _lzma import *
ModuleNotFoundError: No module named '_lzma'
I've been looking into it. It might be an issue with 3.7.
@analog kettle It seems that your python installation is incomplete (missing the _lzma.cpython-37m-x86_64-linux-gnu.so file which should be in the /usr/lib/python3.7/lib-dynload folder). Try reinstalling/updating it.
figures. I'll see if I can install 3.8
Can you check if you have the file?
Let's move to a help channel, which will be pretty ironic.
Hey i was wonderin if anyone here would be able to help i got a small probem with a theme in atom called "glass-syntax" witch allows you to set a background picture but in their example they are showing a transparent codeblock and i was wondering why im not getting the same result? is there a way for me to edit the theme or make my own?
This is their example
@analog kettle It seems that the error is caused when Python is compiled without all of the necessary libraries (missed the /usr/local/lib so assumed it was the apt installed Python rather than a pyenv version (I assume)). You'll have to recompile it to fix the error:
https://stackoverflow.com/a/57773679
https://github.com/pandas-dev/pandas/issues/27532#issuecomment-517259553 (if you are using pyenv)
Please @ me if you know i way i can do this
good diffing tools? Ive used beyond compare, but I would like something thats free
@heavy knot
By code block do you mean the main editor?
You can customize the color of it and set it to transparent. That should give you the effect you want.
Just noticed you're on atom. It still applies, you can make the change, just google it.
Yes, that's still customizable. What you specify in your settings file overrides what the syntax theme says.
Can't remember how to do it in Atom, but I know i've done it.
Do a search
why all of a sudden my python interpreter is all of a sudden invalid XD
How Can I Start Rich Presence In Pycharm ?
You need an extension
how to create your own repository in git
@warped topaz
Set up a git repository: git init creates a new repo, git clone copies an existing repo, git config configures your Git installation from the command line
one of the better tutorials for beginners
Hey @sage oriole!
It looks like you tried to attach file type(s) that we do not allow (.pdf). We currently allow the following file types: .3gp, .3g2, .avi, .bmp, .gif, .h264, .jpg, .jpeg, .m4v, .mkv, .mov, .mp4, .mpeg, .mpg, .png, .tiff, .wmv, .svg, .psd, .ai, .aep, .xcf, .mp3, .wav, .ogg.
Feel free to ask in #community-meta if you think this is a mistake.
Hi guys, anybody knows how to take a screenshot of an inactive window?
I tried some stackoverflow solutions but do not work with Python 3.8 :(
It does create the image but without content xD
I have a gaming laptop that's a bit heavy, and I'm considering the possibility of getting a smaller laptop for next school year, unless of course we don't have in-person lectures again
I've heard about people putting different versions of Linux on a chromebook, but I assume that machines designed for ChromeOS don't really have enough resources to run IDEs effectively?
oh if you're concerned about your privacy i suggest librem os
How can I configure Atom to run a shell?
Like input commands
Using the atom-runner
package
How do I get rid of this stupid line that keeps wrapping my text to the next line when I breach it in PyCharm
Go to your settings and search for "wrap" and you'll fine an option to turn it off
If you want the line itself gone, search for "margin" I think
Unfortunately I already have soft-wrap off
Seems to be this I found when I searched margin
Yes, that's it
Wrap on typing should be ticked off
And remove the "120" from the text box
Hello all,
I have a query regarding click. Will it be possible to provide an undefined number of values to an option via CLI?
I have gone through this link:- https://click.palletsprojects.com/en/7.x/arguments/#variadic-arguments and found that it could be possible via an argument, but for an option, as defined here https://click.palletsprojects.com/en/7.x/options/#multi-value-options, it seems we need to hardcode the exact number of input values beforehand.
I am actually adding a possibility of providing the files present in a directory using the regular expressions like *.md to one of the option --file-path, to a click project. As there can be any number of files present at a location. I would need to process all those files.
Let me know if it can be possible or if there is a workaround about it.
File "C:\ProgramData\Miniconda3\lib\site-packages\lxml\html\__init__.py", line 53, in <module>
from .. import etree
ImportError: DLL load failed: The specified module could not be found.
Having trouble running scrapy from VS Code; haven't tried other editors yet. I installed from miniconda and am using the correct interpreter as far as I can tell
Seems like something is wrong with lxml
Wells turns out I have to force reinstall the correct version on windows
And I have to do it through the conda command prompt
Hello everyone.
My task is to create a reporting tool. And I need a tool that converts from markdown to .docx and .pdf. Found a tool called pandoc, understands many formats. But this tool terribly converts, markup just floats, images often crawl beyond the borders of a document, etc.
Hi Guys,
Anyone facing issues with Kite causing high memory and cpu usage ?
Kite is eating 1G of RAM and burning hot CPU
I've heard about people putting different versions of Linux on a chromebook, but I assume that machines designed for ChromeOS don't really have enough resources to run IDEs effectively?
@analog kettle depends on the Chromebook. If you get Something like the high-end Chromebooks from Google themselves they can run VS Code (or so I've seen demos of)
@austere dome Thanks for your input. I'd prefer to have PyCharm, but my classes this coming year might be in a mix of languages, in which case I might as well get used to VSC.
Pycharm should handle some other languages fairly well if that's a concern
Pro basically has some of the other jetbrain ides integrated
I have Pro for at least another year, per the student package
but I'd be willing to pay for an annual subscription once they take that away.
IDEA has a bit more plugins, but that also includes python only being a plugin so I believe you don't get some of the pycharm pro features like profiling
I only write in Java when my classes require it, and unless my capstone project also requires Java, I think I'm safely done with Java going forward.
In which case I would have a little party where I uninstall IntelliJ.
Still have some other languages like Kotlin which it's suited for
But depending on what langauges exactly, pycharm can cover them
which sort of begs the question
why doesn't JetBrains just have one modular IDE?
I guess it's more profitable to offer several different ones?
Some feature like the aforementioned profiler may not be as easy to implement and distribute in that way
but that's pretty much a guess from me
Although that should just be invoking something like cprofile and then just visualizing it, so don't really know
Also, I'm just now learning that Kotlin was created by JetBrains. So that's cool, I guess
@analog kettle You can always get your student license renewed for another year as long as your student ID is not expired.
I think Jetbrains also has means of checking if you're an active student on top of whether or not you have an edu email.
They can but as long as you have a valid student ID that is not expired, they don't mind renewing student license for another year
Edu email is not a mandate
Either your institution should be listed in their database
or
you need to upload a valid student ID
i already deleted that plugin
but the error message still appears
any way to get rid of it?
just reinstalled it and its gone x
Anyone knows how to debug python in a docker container? I've tried this in my launch / tasks.json:
{
"name": "Docker: PyChan",
"type": "python",
"request": "attach",
"preLaunchTask": "docker-compose-start",
"pathMappings": [
{
"localRoot": "${workspaceFolder}/python/src/",
"remoteRoot": "/work/"
}
],
"port": 5678,
"host": "127.0.0.1"
}``````json
{
"label": "docker-compose-start",
"type": "shell",
"command": "docker-compose up --build -d",
"isBackground": true,
"problemMatcher": [
{
"pattern": [{ "regexp": ".", "file": 1, "location": 2, "message": 3 }],
"background": {
"activeOnStart": true,
"beginsPattern": "^(Building py-service)$",
"endsPattern": "^(Creating|Recreating|Starting) (py-container) ... (done)$"
}
}
]
}```
I can't seen to attach to it no matter what, anyone has a clue on how to do this with vscode?
@minor herald you have two options: either launch what you're connecting to in the container and connect to it externally, or use the Remote - Container extension to run VS Code from within the container (I strongly recommend the second/latter option)
@austere dome thank you, I actually have the 2nd one, but everytime I remote connect to the container, I'll have to setup python inside it as well, right?
Rebuilding often wipe it as well
Like in order to actually do debugging, don't I have to setup launch.json and setting.json again
@minor herald you don't need to do a remote connection in the second case; it's just like running any other Python app in that scenario. Since VS Code is running inside the container then it has access to everything inside of it. So at that point it's like running locally
That sounds great! I'll give it a try again, thank you
It works great, thank you again @austere dome
@minor herald welcome! And if you have any more VS Code questions please feel free to come over to the vscode channel on the microsoft-python server: https://aka.ms/python-discord-invite
Hey.
For more than a month now, my pycharm IDE has been buggy. During operation, friezes occur every 5 minutes. The whole system hangs. Because of this, it is impossible to work. How to deal with this? I have installed the ubuntu 18.04, 16 gigabytes of RAM.
I had to move to the VS Code IDE, but it doesn’t utterly exhaust me.
how do i commit to github from pycharm
it should detect git in your project dir and then you can access it through the vcs tab or the checkmark in the top right corner
@chilly gazelle Not sure how much I'll be able to help but did you try going back to 2019?
it should detect git in your project dir and then you can access it through the vcs tab or the checkmark in the top right corner
@finite fulcrum i tried clicking commit
but when i open github
nothing changes
do i have to select some options when commiting?
like?
I'm not sure if switching to version 2019 will help. Has anyone already had the same problems?
@finite fulcrum
@dull halo you have to push to remote for it to take effect there
how do i tho
ctrl shift k in pycharm if you have the project properly set up
Performance on pycharm is pretty flawless for me (although there are some other issues) and I haven't seen anyone here ask about it; but reverting to an earlier release could do something
great
I'm on windows myself can't help much beyond that if it's something specific to your os
now i can ctrl + shift + k
hey
what is the error you are getting @heavy knot? what editor/ide?
idk what you mean by what errors bc i sent them but im using vs code
I'm not sure why it would be trying to lint that path
lint?
to lint is to check software for programming errors automatically https://en.wikipedia.org/wiki/Lint_(software)
lint, or a linter, is a tool that analyzes source code to flag programming errors, bugs, stylistic errors, and suspicious constructs. The term originates from a Unix utility that examined C language source code.
if it maters my in app cmd is not working
I'm having some weird troubles with virtualenvwrapper. I'm using VSCode's integrated terminal, and Git Bash as the default shell (on Windows). Virtualenvwrapper used to work in VSCode's integrated terminal, but now it only works in Git Bash prompts outside of VSCode. I'm not sure what happened. Any clues?
ya for me nothin in terminal
@heavy knot this is out of my depth for sure, you can leave it here and you may get a response from some of the people behind the VSCode Python integrations or else you can join their Discord server at https://aka.ms/python-discord-invite
side question but what does it mean to be a discord partner ?
Dont get it but anyway thanks for the help
@heavy knot did you customize paths in your settings for where to look for Python files? Or did you open bulitins.pyi?
i dont even know what bulitins.pyi is
guys how do you add sublime text application to yur status
as in itll show playing sublime text
like how it is for eivl
@soft bridge I don't use it personally but I'd take a guess that you could use a package like this: https://packagecontrol.io/packages/Discord Rich Presence
hello
please Ive installed playsound but if I import and use it in a code it tells me theres no such module
Hi guys, I am getting a strange error when trying to use the decimals module.
from decimal import Decimal
print(Decimal('8.8') - Decimal('0.2'))```
I am using PyCharm 2020.1, Windows 10, Python 3.8 -- If I run the same code in Geany I get no errors and it runs as expected
The file you’re running is also called decimal.py
So python is trying to import the file you’re running, not the decimal library
@sharp sorrel
@quaint saffron I hope that was it, my file is named deci.py now but not sure if I originally had it as decimal.py. I started a new venv in PyCharm and it is working correctly now
thank you
In the image I believe it’s called decimal.py
I think that's where its trying to import modules from? Those aren't the directories with my python programs
Me either -- It's fixed now, I had actually installed VS code, had module import issues with that too and then came back to PyCharm, messed with the venv settings and now it's fine
Yea, not quite sure what caused the issue but it’s fixed now 🤷♀️
Geany always worked and I suspect its because it doesn't create virtual environments
Yeah, venvs do kinda mess things up when you don’t properly understand them
I could probably do some reading up on them
thanks for the help though, it always helps to get more eyes on the problem!
GUYS I NEED HELP QUICK who uses atom when i press ctrl+s everything is deleted and does't save
maybe you messed the keybinds
anyone here firm on gitlab actions/conditions - im error-blind on whats preventing the release upload for setuptools_scm to trigger a task
(also asked in the pypa channel on freenode)
Why do i get this error?
cIDT = cID.get()
@digital cove at first glance it looks like the code is not ready for the cID variable to be none, however it is, you either have to handle that case or ensure itdoesnt happen, but thats all i can guess from the error
cID is a Tkinter entry
the exception clearly indicates its None
This would probably be suited to a more general help channel, but if you pack it or something immediatelly then that returns None
!code
Discord has support for Markdown, which allows you to post code with full syntax highlighting. Please use these whenever you paste code, as this helps improve the legibility and makes it easier for us to help you.
To do this, use the following method:
```python
print('Hello world!')
```
Note:
• These are backticks, not quotes. Backticks can usually be found on the tilde key.
• You can also use py as the language instead of python
• The language must be on the first line next to the backticks with no space between them
This will result in the following:
print('Hello world!')
def multiply(a, b):
a * b
guys what is wrong with this code??
You don't do anything with the a*b value you calculate, but you'll probably want to hop into a general help channel (see #❓|how-to-get-help ) unless it's related to some of the tools you're using
Hello, i am a new. My english is not very good, because i speak french
Hey ya'll, I am using git, when merging a branch I have, i.e. branch-a to master, do I get to keep and see all the commits i did in branch-a?
Yes. The branch does not get deleted.
So even if I delete branch-a after merging, I keep the commit history?
Yes, of course
Branches are just aliases to commits
Even if you delete the branch, the history will exist somewhere
Since you merged the commits into master, the history will be in master
But if you deleted a branch without merging it, I think the commits stay for a while and eventually get automatically deleted
I see, thank you 🙂
Is it possible to have nested git repositories? Assuming it is possible - how terrible of an idea is it?
e.g I want a setup like this
main-repo/
frontend/
this is its own git repo
backend/
also its own git repo```
Not that experienced with git but I believe you can use submodules/subtree; or nothing's stopping you from tracking the .git although that does sounds like a horrible idea
yep, submodules it is. It's not a terrible idea, but last I checked (a couple of years ago) it was awkward with a bunch of sharp edges
try it though, it might be worthwhile.
There are some alternatives too iirc
The issue with submodules is that they are pinned to a specific commit
and that can be bad in some cases
https://git-scm.com/book/en/v2/Git-Tools-Submodules is semi-official documentation
Well, this book is the official book
@warm pollen I had the vague sense that that book wasn't updated as often as the man pages that are part of the git distribution. Am I wrong about that?
Well, I never had any issue with this book, it seems pretty up-to-date
There are almost never breaking changes with git anyway
Anybody know how to use pygithub? I don't like the documentation
I wanna know how to retrieve the text from a specific folder in a repository
Ping me plz if you're answering
@twilit stratus Hi, I think you need to use this. https://pygithub.readthedocs.io/en/latest/github_objects/Repository.html#github.Repository.Repository.get_contents
This isn't really the right channel for this. If you have more questions regarding this, I suggest you open a help channel. See #❓|how-to-get-help
should I place a new .py file (my dashboard) in a separate branch on github?
is that good best practices
depends 🙂
does the new file belong with the existing files?
you should make a branch if you expect to have two or more versions of your project at once
with some difference between them
but if you're just improving the project, there's no big need for a branch
well
the new file is the dashboard
the current file is the backend logic
im doing analytics
Sounds like a whole separate project really
?
i guess im clueless how to use git
so it shouldn't even be in the same repo?
im confused
Anyone dealt with Catchpoint api before?
Not sure if this is the right channel. Happy to delete it if not.
This appears to be correctly formatted JSON, but I've seen where "options" would have a colon (:). Does that matter?
[
{
"greeting": "WelcomeToSeattle.wav",
"Retries1": 3,
"name": "CityHallMain",
"Retries2": 3,
"description": "1 CitySeattle"
},
[
"options",
{
"id": "3xo1tGbXCbEmGeiNlpaZ",
"digit": 1
},
{
"id": "c7BKvyTBZyeSlgmF0HS4",
"digit": 2
}
]
]
as it stands now it's correct
if there were a colon after options, it'd be bogus, because options is in a list, not an object
granted that's a surprising way to lay out the data; it'd make sense for options to be an object key. But that's not how whoever wrote that, chose to do it
did you see what i wrote sir?
Well I wrote it and I'm trying to do it as best as possible. What do you recommend doing differently? I do see what you mean by making options and object key. It looks the way it does because I'm merging two arrays.
Ok I think what you said let me down some googling which yielded this which I think looks much better.
{
"name": "CityHallMain2",
"Input": 2,
"Match": 2,
"description": "1 800 ",
"greeting": "WelcomeToSeattle.wav2",
"options": [
{
"id": "3xo1tGbXCbEmGeiNlpaZ",
"digit": 1
},
{
"id": "c7BKvyTBZyeSlgmF0HS4",
"digit": 2
}
]
}
hi I have an nginx question.
i want to serve my flask app using my public ip address (of my local machine), and im using windows.
i currently setup an nginx server, and everything works fine using localhost. but when I try to visit my public IP, nothing's appearing
is it possible to do this? am I missing a firewall step? or should I have my own static ip or someshit?
is your router configured to route traffic to your server?
have you forwarded port 80 to your app?
Can you edit text files in a docker build process? We have a config file that needs a line replaced for a specific environment, do we just create a new config for this environment, or is it possible to do a find and replace during a build?
Hi, I'm currently trying to split apart a diff into several patches but one of my smaller patches has this error /mnt/D/github/tpp> git apply /mnt/D/patch patch fragment without header at line 122: @@ -1368,6 +1369,59 @@ class give_avatar_item_handler(Command): however I cannot see what could be missing as it's in the middle of a bit I copy-pasted from thge larger diff.
Hey @flint sphinx!
It looks like you tried to attach file type(s) that we do not allow (). We currently allow the following file types: .3gp, .3g2, .avi, .bmp, .gif, .h264, .jpg, .jpeg, .m4v, .mkv, .mov, .mp4, .mpeg, .mpg, .png, .tiff, .wmv, .svg, .psd, .ai, .aep, .xcf, .mp3, .wav, .ogg.
Feel free to ask in #community-meta if you think this is a mistake.
Pasting large amounts of code
If your code is too long to fit in a codeblock in discord, you can paste your code here:
https://paste.pydis.com/
After pasting your code, save it by clicking the floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.
I can't find a good guide to the git diff syntax or a checker that can tell me what's wrong, so I'm kinda stuck
I mean I could just go through the hastle of moving it manually but then I have to retest it and won't know how to fix this when it happens again
Can't say I'm familiar with manually editing patches either, sorry
Most I've done is edited commit messages in patches
@hushed orbit you can add a command in the dockerfile that replaces the line
This can be put in an if statement that is controlled by a build argument
You are missing the file name above the header at line 122 @flint sphinx
Is that what you're asking?
Not exactly, the docker file will always build the same environemtn
but we have many other ways of deploying / testing
so i need the docker file to edit a line in a .cs file to disable https
else ican set an env var and write logic in the cs file
So why is my suggestion not going to apply here?
I'm unsure what you mean by command, that's the part I'm actually asking about
And yeah you honestly should read an env var cause manually patching code sounds hacky and fragile
the patch I was splitting didn't have a filename there though as it was a second change to the file at line 110
So you can run a shell script within your dockerfile
This can be put in an if statement that is controlled by a build argument
(Can you make a conditional statement in a dockerfile)
I'm on.mobile so I can't really write any example
I've done something like this before
wait the whole patch fails too 
Oh, using an unix if?
OK it looks like I pulled out a part of that file already
iirc like RUN /bin/sh -c 'if [ build arg set ]; then replace line ; fi'
Ahh, that makes sense
@hushed orbit
IIRC you don't need the explicit /bin/bash if your image is properly configured
Ok deleting a blank line made it spit out a different error
now it's complaining it won't apply
I also don't recall if builds args are available as environment variables. If they aren't then you can set some env variable with the value of the arg using a simple ENV
Yes they are
OK that fixed when I tried it on the correct branch
is there any way to import pycharm keymap in vscode?
there is an extension, but it doesn't work that well
it seems python does not handle junctions well
Windows file junctions?
Hey, can anyone good with PyCharm help me? I have a problem with virtual environments and i am so confused.
just ask your question
someone here will probably be able to help
although it probably isn't me
So I made a project and I started using pipenv - but then i got a lot of problems so I though i could switch to use virtualenv. But as I make a new interpreter for the project in the settings - it does something for a bit and says new virtualenvs installed but I cant see any vens folder not when I open the terminal in Pycharm it has any virtual environment activated
I have a requirementes.txt which I want to install - but I only want them to install to the project
So basically I want to assign a new virtualenv for existing project (I used previously pipenv) and install the packages from requirements.txt - and if this is even possible in to do in PyCharm
I've got something I need to fix - and I'm really not sure how.
I have a docker container running PostgreSQL
and it's not currently using volumes or anything
I think I can get the data out and into a volume using just dockery stuff right?
if not, is the only solution to manually connect to the postgres instance and grab the data that way?
@true vapor "docker export" might help you, but it's probably easier to just connect and do database dump
alright thanks - I'll have a look at exporting, but probably just do a dump I guess
@scenic chasm
I haven’t used virtualenv since venv is now built into python depending on your version
I suggest using it https://docs.python.org/3/library/venv.html
All new projects I create start with: python -m venv .venv
Nice. Clean simple.
Just remember to activate it and then do your pip install.
source .venv/bin/activate
I bet PyCharm will see that just fine.
if not, is the only solution to manually connect to the postgres instance and grab the data that way?
@true vapor
You could commit your container, then run the new image with a volume.
https://docs.docker.com/engine/reference/commandline/commit/#commit-a-container-with-new-cmd-and-expose-instructions
That sounds like possibly the easiest solution
I don't understand volumes all that well - but I'm pretty sure my dockerfile that I'm using is already pretty borked - would that mean the export stuff is likely to break things? Or should it be fine?
With a named volume your container will store its data on the host.
Then you can kill the committed image/container and start a fresh Postgres container with a volume pointing to same named volume.
Theoretically. DBs are weird with docker. I wouldn’t do this for production.
Hm - I think the best solution is just going to be exporting the data, creating the container correctly in the first place, then getting the data into it as actual data
It's probably gonna save work in the long run. Thanks for the suggestion of commit though - that's something useful to know about
No prob
Im working with Audio files / streams, and need to merge(overlap) multiple streams into one.
So far I have managed to do this with both pydub and ffmpeg-python.
But I ran into some issues with slow performance with pydub, and ffmpeg-python is very bare bones.
I wantet to ask here if there is anyone with experience with audio processing in python and had some tips.
I see there are quite a large number of modules for this.
@full epoch I would check the pythonPath in the Python extension settings. look at both the User and Workspace paths.
you should look closely what VSCode im running
What does that matter?
im running the insiders edition
and?
and?
so some things are updated
ok, I'm pretty sure sommersoft advice is still valid and if not, you shouldn't be running the insiders edition
wut
i think Rabbit's point is: if you're expecting stable software, don't run un-stable builds.
I'm saying insider builds are for those who know the product and want to test it understanding they get limited support, if you are neither, you should no longer be beta and revert to stable
considering VSCode gets monthly releases, it's not like you get a ton of new features way before anyone else
i installed the insiders
without PATH cuz i hate restarting the shell
even more problems in User edition
you have borked your VSCode apparently
wdym
ahh s**T
do i really have to uninstall the insiders
i only did nothing but install it
not borking it
if you bork everything just by installing insiders, you shouldn't be running it
i installed the users edition after the insiders
i would imagine they use the same location to store application data (settings, config, etc).
I don't think they do
does that mean i borked the users edition?
k i will delete the insider
along with python
rip stable
btw im new to registry so i will keep away from the registry editor
🤞
ohhhh s**t
i didn't bork it
cwjafoDW
it was the disk space
awkward slience
Hi, I was wondering about the gitignore function of github when creating a new project. I thought gitignore notates the files to exclude, and not the language. And it also doesnt declare the language the gitignore is written in... What is the difference between gitignore:Python and gitignore: C for example?
It loads standard ignore file that excludes common files that language will put out but shouldn’t be committed
For python, it’s pycache files
GitHub publishes those files on GitHub somewhere.
okay, thanks
So without gitignore it would push - for example - my venv - which it doesnt if I have a gitignore.
# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
-from the gitignore
Yep
Also check out gitignore.io website. You can list severa things out like language or editor or platform. And it’ll build a good ignore file for you.
os.execv("/home/secret/Desktop/hack_bot.py", sys.argv)
OSError: [Errno 8] Exec format error
how to fix it
You need a hashbang because a Python file by itself isn't an executable, i.e. something like #!/usr/bin/env python in the first line of your script
with requests, when i request an api that gives me a link
how do i get that link into a variable
the api only returns a link
Example for defining a request’s output:
import requests
r = requests.get(url)
t = r.text```
or requests.get(url).text. there is no difference except how both look like and how many lines it takes
this is what i get from the api when put in browser
and when i try to print the api contents with exactly what you did i get an error
oh...
you dont need the () at the end
like with json
thats... the problem
ok
how to run python files in vsc
So basically what i want to do is make a python script that will change a value in a script (it will ask the user what to change it to) and then pack the file to a .exe , would really appreciate someone helping me 🙂
Anyone uses poetry here? I've just installed scikit-learn with poetry add but when I do import scikit-learn in a python session (run with poetry ofc) I get invalid syntax.
I've chexked the .toml file and the package is there, also with other packages I didn't have this problem. Any idea where that could come from and how to fix it?
@tribal tartan try import scikit_learn instead
dashes are the minus operator in python
not permitted in variable names
actually it looks like it might be import sklearn
so try that and you should be okay
import sklearn works, huge thanks !
this is often true, by the way, so make a mental note that pypi packages often have dashes but imports cannot
Why is it that the name used to import the package isn't the same as the package name tho?
so if the pypi package has a dash and replacing it with an underscore doesn't work, then look at the documentation for what to import
Oh
it's not the same because python doesn't know what to do with scikit-learn, that looks like you're trying to do scikit - learn as in subtraction
Ok, I didn't think to check the doc, thought the problem came from me
basically dashes are not allowed in imports, not allowed in variable names.
Yeah that's probably why it made an invalid syntax, while underscore gave me no module named ...
yeah exactly.
sorry I gave you the wrong one first, I've never used scikit-learn myself
How did you know what would be the name then :o
Ahh lmao
and there's a code example with an import statement :)
Anyway thanks for the help !
Question anyone have experience with q learning??
Hi apologies if this is the wrong place to ask. I'm trying to run a subprocess on a bash command for MinIO client
subprocess.run(['/users/bin/mc', 'ls'])
^Running this command just outputs the help doc message for 'mc'. It does not seem to register the 'ls' argument.
Anyone know how I can get it to work?
I'm trying to understand the role of ansible - and Wikipedia's reference to Ursula K Leguin isn't helping. Could anyone ELI5 it for me? Moved this question to OT
hi i coded a simple login and registration program
import stdiomask
print('++Login/register++')
# register
login = input("Put login: ")
password = input(stdiomask.getpass("Put password: "))
country = input("Put country: ")
phonenumber = input("Put phone numer: ")
adresemail = input("Put email adress: ")
if login == password:
print('Invaild login!')
else:
print('Good login!')
if country == phonenumber:
print('Invaild country!')
else:
print('Good country!')
if phonenumber == adresemail:
print('Invaild phone number!')
else:
print('Good phone number!')
if password == adresemail:
print('Invaild password!')
else:
print('Good password!')
print(login, password, phonenumber, country, adresemail)
# login
login2 = input('Put login: ')
password2 = input(stdiomask.getpass("Put password: "))
if login2 == login:
print('Good login!')
else:
print('Invaild login!')
if password2 == password:
print('Good password!')
else:
print('Invaild passwprd!')
print(login2, password2)
time.sleep(3)
In Pycharm, How can I switch to the testing area (Run area) to type an input values to test my codes, without having to use the mouse to click in that box down there?
alt+4 maybe
Wrong
Alt+4 works for me
This is what I get when I click Alt+f4: http://prntscr.com/sqkwij
Oh shit thanks my bad sorry
@scarlet stratus not really the channel for this 😃, feel free to republish your gist in #303934982764625920
ok sorry
no worries!
@heavy knot Which plugin are you using with Sublime?
Hi, I want to deploy an app where I am running Quart (an async flask module) and a discord bot in the same loop. My plan is to do it on heroku, what should I type on the procfile to have both running as planned?
here is my main file:
if __name__ == '__main__':
loop = asyncio.get_event_loop()
loop.create_task(client.start(os.getenv('DISCORD_TOKEN')))
app.run(loop=loop, port=3000)
@heavy knot Glad to hear that.
@maiden nova ^v^
@civic walrus a web server and a bot on the same async loop? That sounds needlessly complex; couldn't you make them separate programs that communicate via (e.g.) a database, or some sort of RPC?
@thorny shell I figured it nvm
I am running into a different problem though which is async related
Does anyone have any opinions on the best editor for OS X? I am just starting out and using Atom, just curious if anyone recommends anything as a better alternative
there are so many, and the choice is so personal
atom is probably OK
just tell it not to insert tabs
yeah there is a huge variety and features
people here seem to like IDEs a lot
pycharm seems decent
Visual Studio Code too
I don't use any of those 🙂
ive just been using atom and terminal
try 'em all
probably not much to be learned from us, unless we warn you away from something truly awful
like, don't use IDLE
well so far it seems to work out, just wanted to make sure there wasnt something that was going to blow my socks off
true that
Agreed. VS Code is definitely pretty dominant. Especially in the Python community funny enough. Listen to the end of pretty much any Talk Python podcast. 😄
The Python extension for VS Code is the #1 extension by number of downloads by almost a factor of 2x (or was).
Hi,Now i have situation like these,when im trying to open the file for the first time or open the file after when i closed it, when i open the PyCharm it gives screen like these.Can i skip these screen automatically in some way because i have just one interpreter.İf i can skip these screen with any way should i do it or is it better to pick interpreter version for everytime for situations like these.
Okay, this might be stupid question, but it's driving me nuts.
I just started learning programming and i'm using Visual Studio for my coding needs.
After sometime application changes behavior and if i click in middle of code it starts replacing letters instead of adding them.
It's a bit hard to explain
You have toggled a key on your keyboard, insert, most probably
Oh my god, so simple fix and i have been battling this thing for quite some time.
Funniest thing is that insert in my keyboard requires FN + Ö letter for this to happen and i have no clue how i managed to press it so many times.
Thank you!
Anytime!
I recently started learning docker and I have a question regarding different base images.
I can use an Ubuntu as a base and then install python or directly use the Python image, whats the actual difference in the OS ?
The python images have different base images depending on what you want
Basically, python images are built above the distro images
If you don't need python, you can directly go for the base image and add other tools you need, but if you need python, it is recommended to go for the official python image based on the distro you want, so everything is managed by the PSF and correctly setup
how do I know or configure the base image of the Python image
Container images are layered, you have the base distro image, the PSF adds python on top of that, and you put your app on top the two
The Python image is on the dockerhub
You can access it by using the right FROM clause at the top of you dockerfile
FROM python:3.8-slim will pull the 3.8 image based on debian slim I think
They are here https://hub.docker.com/_/python
Python is an interpreted, interactive, object-oriented, open-source programming language.
so i guess using the python image is a shortcut for using a distro as base and then installing python
Yup
right, thanks!
And they do additional steps to make sure that the image will properly work, for example https://github.com/docker-library/python/blob/590e76ff7ec5d04194c369a8fed3a5afd52d38ae/3.9-rc/buster/Dockerfile is the dockerfile for buster 3.9rc
wow thats complicated
Yup, that's why you don't really want to have to deal with that 😄
okay
Use Python images unless you have some really weird setup, however, you will see alot of blog articles recommending python:<version>-alpine, it's a trap
stick with python:<version> or python:<version>-slim
guys, what is a page fault? i dont understand it what happens when one occurs
in what context?
I know not to use alpine, but why is it so recommended?
because it's "smaller" in disk/compute in theory
in practice, getting it to work requires such compromises that almost in all cases, it's neither of those things
one of those, let's go for optimization in all costs even when it makes our life hell
I have a Django container that's got the static files stored in the container (bad practice, I know), the dumb thing is that it wasn't started with a volume - literally started with the simplest run command possible. Is there a way to attach a volume so that static files which were added at runtime aren't lost on a restart?
Charlie, like you need to add files?
why not rebuild the container?
But yes, new run command with volume specified should attach a volume
I have containers with static files. If it doesn’t change and not too big, volumes are too much trouble
I m writing the mux16 in hdl(frm nand2tetris)
Mux(a=a[0],b=b[0],sel=sel,out=a);
Now i will copy this line 16 times
I want a vim substitution command using regex that inserts the index in increasing order upto 15
Is there any way of implementing this?...would be really helpful
The problem is that the users uploaded photos and stuff at runtime (and they now live in the container). Surely just running a new run command won't fix that?
Yup, that's the best way to do that, ideally you want all the data that should remain between reboot to be separated form the container, in a volume or so
My understanding of what a volume is actually doing is probably wrong. But basically I have a bunch of static files in a container. If I kill that container, will the static files stay there?
stop not kill I guess
(my docker knowledge is very bad - I just type run and hope it works)
They probably would, but if you pull the container back to update it or so, the whole docker filesystem will be reset and you'd lost them
Basically, a volume is a binding container folder - host folder
So if you pull the container again, your files stay on the host filesystem
it should
pretty sure container will hold onto data it has
you could test it easily I'm sure
alright. So I stop the container, re run it with a volume, and I'm a bit safer? If so, this is a much simpler problem than I thought; for some reason I assumed it was harder than that
I'll test it first to make sure
problem is, if you mount the volume where files are, I don't think the files will be pulled into volume
I think they will be overwritten
You have a command to create the container, and you need to add the binding within your run command, you should use docker-compose for that :)
They'll stay on the docker filesystem and be shadowed yeah
You have to copy them from within the containers
like if you are storing files in your container in /app/files and then you put a mount point of /usr/dockercontainer1/files and mount them into /app/files, everything in /app/files will go poof
so I think the step is docker stop, docker export container, move the files you need into host file system, docker start mounting a volume where you moved the files
Alright - I'll try that, thanks for he help
some downtime required unfortunately
that's fine - this is an archery club website with like 50 total users
got it
Hi all. Quick Q: given a wheel for some package, is it possible to install just the dependencies but not the package itself? I know I can install just the package with pip install --no-deps, but I'm wondering if there's some incantation for doing the opposite...
Longer version if anyone wants context or can tell me a better approach: I've got an app I'm deploying with docker; right now my Dockerfile does a multistage build, where in the first stage I'm (among other things) building a wheel for my app (I happen to be using poetry for package management), and then in the second stage that wheel gets copied in and pip installed. My problem is that the app has a lot of dependencies (some of which are large, e.g. numpy, etc.) and I've realised that any time I change my app's code, the wheel changes, meaning that when I pip install the wheel in the second stage it reinstalls all the dependencies, pulling them from pypi again, etc. Obviously this is slow and results in bigger changes to my images than I'd like. So my thinking is that if I can install just the dependencies, and then just the package, that would separate that into two layers, the first of which could be cached nicely.
anyone here proficient with Biopython. https://biopython.org/
I figured out how to solve my problem: poetry export -f requirements.txt and then just pip install from that
@wooden ibex thank you for the link about python alpine docker image
Research alpine and python image. I believe there are some performance issues because of the different libc in alpine?
@ripe dew ^
I have multiple bad commits in a row under good commit in git and I already pushed everything.
How can I get rid of bad commits? There are no conflicts between them. I need to remove and the most recent good one
you don't remove commits
ok I cherry-picked recent commit to a different branch
that's fine
checkout the good commit
well, git revert is what you are looking for
yes, your old bad commits will show in history
but in many professional places, that's fine, it happens
I am making 2nd PR to for the repo and made a big commit on top of another PR branch so I had to force push cherry-picked latest commit
You can git reset them, but that's bad if you are working with a team, since it breaks the history
that's why I said to revert
since while you cna reset a private repo, it's not considered ok in any team setting (like a workplace)
class ServerData(JsonManager):
def __int__(self, ServerId):
super().__init__('./storage/ServerData.json')
self._Server_Id = str(ServerId)
'''
decorator
'''
def conditional_decorator(cls : function, condition):
def decorator(func):
if not condition:
# Return the function unchanged, not decorated.
return func
return cls(func)
return decorator
'''
Server Data
'''
def ServerInitialization(self):
return True
'''
User Data
'''
@conditional_decorator(True)
def UserMaster(self, user_id):
try:
user_id = int(user_id)
except ValueError:
raise Exception('Please chose a valid int')
if str(user_id) in [k for k in self.json_manager["user"]]:
return self.json_manager["user"][user_id]
else:
new = self.json_manager
new["user"][user_id] = {
"is_kick": False,
"is_ban": False,
"is_mute": False,
"is_admin": False,
"reason": None,
"time": None
}
self.json_manager = new
return self.json_manager
Why my decorator is wrong ? and how I make it fonctionnal ?
This isn't the right channel. See #❓|how-to-get-help
yep
so im using gitlab
ayup
and my project is pretty large
ayup
.git is nearly 100gb
and ive bypassed my gitlab limit. i cant push anymore
i know why this is happening
i have long txt files that ive been commiting
and they arent really desparate priority
for git commiting. but i didnt git ignore them in the begging, and now im paying the price for it
yeah, and of course just doing "git rm" on them won't help
i want to completly erase my repositorys history of these files existence from the commits
as if they never existed. and push the changes to gitlab. but also keep them on my local disk
ive found this thing https://rtyley.github.io/bfg-repo-cleaner/
A simpler, faster alternative to git-filter-branch for deleting big files and removing passwords from Git history.
which seems like its supposed to get the job done but im incompetent and dont know what im doing
I was about to recommend git-filter-branch, and that you read about it here https://git-scm.com/book/en/v2/Git-Tools-Rewriting-History
well, if you're incompetent you have three options:
- become competent
- find someone to help
- live with it
otoh, no matter what the tool, you ought to be able to try it out on a toy repo
im trying to do number 2
there's also http://www.catb.org/~esr/reposurgeon/README.html which I've also never used
alas I ain't your guy
atm im not concerned about erasing the big txts in question from my local disk as i have them backed up
(the logs are generated on a remote server and i just drag and drop them to my local disk anyway)
you should be concerned about screwing up the rest of your repository.
yes thats why im nervous
have you considered the nuclear option: just throw away the current repo, and start a fresh one with the current commit (without the big files)?
you lose all your history, but it's awfully easy 🙂
and the end goal is that these repository changes are pushed to gitlab so gitlab doesnt remember them either
assuming i get to the point of succesfully making the local repo changes
have you considered the nuclear option: just throw away the current repo, and start a fresh one with the current commit (without the big files)?
@thorny shell yes. thats the backup
you actually sound like you're in OK shape
you understand the basics -- i.e., it's safe to futz with your local repo
you just need to settle on a tool and try it out. If it's awful, restore from a (hopefully local!) backup, and try again
my local repo is 50 commits ahead of whats currently pushed to gitlab. ide probably kms if i lost that
get a reliable storage medium and back up there
obviously.
or maybe pay gitlab more money, push there, fix the repo, push, then stop paying gitlab
the .git is 80 gb
lotta options
I believe you
get a cheap USB drive and back up to that before you do anything else
usb drive? what is this the stone age?
ill just make a 2nd directory
hold on lemme do some math rq
i would need 66296 3.5 inch floppys to hold my git repo
off you go, then
just curios, assuming i can bfg nuke that out of my repos history, would it be possible to simply "push" the changes to gitlab, and have gitlab side of the repo erase that from its history too
doubt it
then how would i get gitlab to do it
I assume you're going to have to delete the gitlab repo, and create a new one
you should poke around in their docs; they might have some guidance for this sort of situation
You could probably wrap GAM tool using python
Guys does GitLab support collaborations?
how do you guys manage packages on an enterprise level? any infra / ops engineer have any advice? we're currently adopting python but have concerns around our users being able to install any packages they wish
reomowhiskey, you could run your own pip server
we just have 3rd party tool that scans applications for security issues including libraries with security issues
Guys does GitLab support collaborations?
what do you mean by "collaborations"
i think you can add collaborators to your repo, or create a team and add other people to the team
Oh can u? nice
@wooden ibex I was thinking more down the lines of using the google directory API rather than GAM
Agunigugu, ok, then see if Google Directory library available
yup, found something
GAM is written in python, you might be able to take that
I'm new to Python so I just want to get to know it by using some scenarios that I know
making api calls and manipulating data, works well for me 😄
Enjoy
coming from powershell and I'm trying to bridge the knowledge
yeah, thx 😄
have fun with G Suite, I'm certainly not
@wooden ibex thanks!
i see a few sites recommend bandit for security scanning. would you suggest this one to start with?
it sucks, I'd highly recommend not doing it
sure, ours is HP Fortify, can not recommend
probably won't go with hosting my own pip server
lol thanks. i'll check out a few
hey y'all, does sphinx napoleon's google docstring mode support describing the structure of a tuple? i'm trying to do something like this
(that obviously doesn't work or else I wouldn't be asking ahahah, but i hope that describes well enough what i'm trying to do)
that renders to this, which isn't terrible, but isn't fantastic either
and it obviously sticks out like a sore thumb on the page
I am building a dashboard, and I'm curious how I should be structuring my git tree
should I have the actual dashboard on one branch, and the logic for data parsing in it's own branch?
so it's totally cool to have 2 .py files on the same branch
uh
even if they do different things
it's totally cool to have thousands of directories and files on one branch
gotcha
I had pictured it like, different aspects of the project go on different branches
ooohhh no
you might make different repos if you intend to keep the code separate, like if each bit of code gets its own pypi package.
you can have more than one repo?
oh nvm I see what you mean
ahh oh no
warning: CRLF will be replaced by LF
what have I done
Separate repositories is a good idea
That warning is fine, git is just telling you it's replacing CRLF with LF when it commits, since CRLF is a Windows artifact
add the venv directory to a .gitignore file
You can configure Git to ignore files you don't want to check in to GitHub.
gotcha
well
my .py file is in the venv directory thoug
I guess I just move it out and add the venv folder
it's easier to use pipenv to manage your environment, then you don't need to worry about where the venv folder is
yeah i like pipenv
I forgot to use it and used pip instead on the last couple projects
I used it in the past
it's my go to usually. I had a nightmare incident while installing homebrew
it broke all my sym link
I used pipenv to help
how can I check what I already have committed, like what files
I don't need the log
in commit log
something like Git Lens or other graphical git applications will show you
so will GitHub if you check
so much to learn, such little time
I'm not sure if there's a simple command to show all checked in files like you're asking
I wouldn't be surprised if that exists, but I don't know of it.
You could do it by looking at the log but that may be tedious if you have lots of commits
As it only shows files for each commit, not all at once
Easiest way is just to go on GitHub or whatever and have a look
idk when I do git -log i only see the messages i log them under
git log --name-only
I guess it's not so bad, since you can specify the range to only show unpushed commits
Ah here's a way to do it. Man git has so many commands. I was trying to do it with log, but it's simpler with diff git diff origin/master..HEAD --name-only cause I don't have to worry about commit messages showing
git has about 1,000 commands 😐
Well, at least 950 of them are just internals
When using Anaconda, is it a good idea to put the src directory inside ~/anaconda3/env/[EnvironmentName]/ ?
*~/anaconda3/envs/
or the site-packages folder inside there?
What I am trying to see is what the best practice is to avoid having to change sys.path or the environment variable
Hey there, help with aws glue. Error "java.lang.IllegalStateException: User did not initialize spark context!", Am using my existing pyspark scripts. How can I initialize spark context
what kind of src directory? @heavy knot
generally no i wouldnt mess with the env directly like that
or with any anaconda internals
Hey guys, I think this is the correct channel but if not please let me know
So I am making an api with python and flask and I want to document it but I am not really sure how. I know about sphinx and I've read a few things about it but I am still not really sure how my comments should look like? So any links or pointers that could help?
PyInstaller isn't working for me... I've done all the steps necessary, installed python (to Path), and ran the command needed to build my executable. However it gives me this error in cmd/terminal...
and yes, I have installed PyInstaller
Spyros, look at FASTAPI
@wooden ibex I have heard of it before. So far I have barely started so I guess I could take a look. Is the advantage that it is actually faster (and docs) or is it more fine tuned for apis and it will actually make my life easier?
It's designed for REST APIs
like nothing else
So if your intention is building APIs, it's great
and it's pretty damn speedy
Okay cool, my intention is to build the api and have a different web app and desktop/phone apps that talks to it so yeah, I'll give it a try
Thanks for the recommendation
I use it at my company for Ops stuff
We also use it for our interview code challenges
Then I should certainly give it a look in case I want to work for your company haha
no
I use it to test people ability to read REST API
it's backend server I run on my laptop for them
Huh alright, it was a joke anyway but interesting
We do alot of API work at my division
so coding test is: "We have web API at http://127.0.0.1:8080 and you can read the docs at /docs please have your application hit API, Multiple 898 by 46565, greet you by name and get weather for KLAX"
I assume I can use SQLalchemy with it, right? I don't really mind writting my own sql but I'd rather use something like sqla to easily be able to use a different database
I don't use SQLAlchemy with it but I don't see why not
Okay thanks, I'll look into it more
FastAPI framework, high performance, easy to learn, fast to code, ready for production
You can easily adapt it to any database supported by SQLAlchemy, like:
Postgresql
..
SQLite
Sounds great to me haha
We use Azure at company so I use CosmosDB
What I am making will be self-hosted, so SQLite will be enough, but if I decide to host something public my self I want to be able to use PostgrSQL there just in case it gets big
I might have asked this before, but why do you think IntelliJ (the Java IDE from the makers of PyCharm) costs more than PyCharm?
Java tends to be used by established corporations who have money
thus, if their java developers want expensive IDE, they will pay for it, there also isn't alot of competition
It also has a more plugins which offer features that lean towards things like pycharm or their other ides/tools
If I have to code in Java I would potentially pay in blood for a good IDE that helps overcome some of the more tedious parts of Java.
Especially if I'm building something that needs to interface with weird COTS plugins that have limited support and restrictive implementation requirements
agreed, most of divisions at work code in Java, they all use either Eclipse or IntellJ and we happily pay for either
my group is one of rare ones that doesn't
@viral marlin I will not code in Java unless the IDE is handling the verbosity for me.
@wooden ibex does your division use Python, then?
I might have asked this before, but why do you think IntelliJ (the Java IDE from the makers of PyCharm) costs more than PyCharm?
@analog kettle
Intellij ultimate includes all features of all jetbrains ides. It can do everything pycharm can and more
No - IntelliJ ultimate lets you install the features of every single IDE that jetbrains makes
It can do Python, Go, PHP, JS, everything
Pycharm can only do Python and JS
If you have IJ ultimate properly configured, you don't need any other IDE (except maybe Visual Studio)
Hey guys. We are a mini team. We are using Gitlab. I would like to auto-label issues that hadn't been updated for a while. I'm not sure where to start. Any suggestions?
Is this guide enough? https://about.gitlab.com/blog/2016/08/19/applying-gitlab-labels-automatically/
looks like a trojan?
AV software is notorious false positive prone
if you are building EXEs, it's something that comes up alot
the actual exe bootloader is shared between the pyinstaller installs
or
