#tools-and-devops
1 messages · Page 57 of 1
#Term Freuency - TF-IDF
from sklearn.feature_extraction.text import TfidfVectorizer
tfidf_vectorizer = TfidfVectorizer(max_df=0.90, min_df=2, max_features=1000, stop_words='english')
tfidf = tfidf_vectorizer.fit_transform(tweet_dataset['text'])
#Count Most Frequent Words
Counter = Counter(corpus)
most_occur = Counter.most_common(10)
print(most_occur)
what channel is it then? Pretty confusing for a new user tbh. TY for the help
Hey guys
I'm having issues with git merging
my colleagues work with a development branch, I work on my own
I just want to delete all new files on my own branch and replace it with the development branch
I've tried git pulling their branch and merging, but that literally just messed up files with >>>> HEAD as lines in it.
I do 'git checkout development' to get in the development branch , I git pull
I do 'git checkout trilinear-jakob' to get in my branch, then I mess up, what should be my next step?
if I git merge, it says it is already up to date, which is weird.
I tried using git reset --hard
but that just gives other errors
Hey could someone explain the user of kubernettes or SaltStack
Can we integrate smtplib and getpass in pycharm?
What's the syntax for a http git remote with a PAT token in it?
I've tried just about all i can think of with these variables
https://${{env.PATOWNER}}:${{secrets.GITHUBACTIONREPOKEY}}@github.com/${{ github.repository }}.git```
How can I get more than one completion suggestion to show up in VSC? It used to show more than one but now it shows 0.
Ok so i have a bigggg text file from one of my projects that was checking usernames on a website im working on, and i was having it output the resualts into a text file just like this:
example username Is not taken
example username is taken
example username Is not taken
example username is taken
example username is taken
example username Is not taken
example username is taken
Is there a way using python or something that i can remove all the lines that have taken usernames and just have all the non taken usernames in my text file? Thanks!
That helped thanks!
btw when i installed python the install pip was checked
hey guys, I don't know almost nothing about python, and sorry for the stupid question. I read is a script language, but how complex can I make a "script"? can I make a .exe independent software for windows in python for example? for people to use without having python installed... I read some articles and watched some videos, but these things are not clear for me. thanks
python is not just a scripting language
you can make large programs with it
and yes to your 2nd q
pyinstaller, etc
@barren sigil This sounds a lot like advertisement
!warn 752083731988086821 Advertisement is against our rules, which you agreed to follow when joining. Don't let it happen again
:incoming_envelope: :ok_hand: applied warning to @barren sigil.
I currently have WSL enabled on Windows, and I wanted to know if you guys, whenever create a virtualenv, do you do it via cmd/powershell or wsl terminal?
Basically, do you keep your virtualenvs in the linux subsystem or on windows?
I treat WSL as a virtual env - like VirtualBox for example - so I keep all files in subsystem
But it could be wrong
i am trying to make a voice recognition python code
so i am trying to install pyaudio
but whenever i try to install it it shows an error
Can you paste an error here?
I treat WSL as a virtual env - like VirtualBox for example - so I keep all files in subsystem
But it could be wrong
@night quest do you even store your git projects in the subsystem?
Yep, but I am just a lazy developer, not devops 😦
Currently, I have WSL only for docker containers (I guess its better than hyper V)
Another reason, I would love to use a unix shell in windows (wsl does provide that but no exactly)
As far as I know WSL in second version uses Hyper V under the hood - or some similar methods
But it's kindly offtopic
is there a unix shell available for windows which integrates well with pycharm/other IDEs
Anyway - I think that it's nothing wrong to store code inside WSL
I might consider that
Windows is being just mad at me, lol
it wants me to install microsoft visual c++ now for virtualenvs
Maybe you should check VS Code because there is plugin (or it's builtin) for integration with WSL
Give me a second to find a right video
i got it into vscode tho
Okay - here you have example how it works https://docs.microsoft.com/pl-pl/windows/wsl/about#what-is-wsl-2
It's node application but I think that Python runs quite similar
right
Another case that you should store everything inside WSL is that Windows can make a mess with chmod, chown and so on
oh
But maybe someone is more experienced with that topic
windows is kinda new to me, I have been a linux user for about 1-2 years
I think I will store my code in WSL
alright, thanks man!
Your welcome!
Anyone who use Spyder know if there is a way to clean up the console, so it doesn't show the directories and other information, just the clean python output?
Like the shell in this editor: https://www.programiz.com/python-programming/online-compiler/
No no run count, no file path, no python version, no directory, just the output
Alternatively, are there any editors that work like the programiz one, but just with a save button? That's literally all I need.
how do you guys handle ticketing
are there any free tools that can handle this issue
I use this and github issues -- the two of them combined solve most of my problems
does anyone know if there is a way to prevent a check from running twice on a pull request like this?
it is doing this since it is ran on [ push, pull_request ] in github actions.
Only check once. Preferably during pull request.
hello guys, I'm new to docker and docker-compose, and I'd like some help, I don't know if what I'm doing makes complete sense, but here I go.
I have 2 apps running on the same server, each app is containerized with docker. The first app is an API, and the second is a discord bot (but that's besides the point).
I'm using postgres as a DB engine for both apps, and rather than having multiple postgres containers, I've made a single pg container for my databases. That's created with docker compose, so that I start pgadmin on the same network easily.
Now I want my apps to connect to that specific container (so I need to change each app's docker-compose.yml). I read through the docs a little and it seems that I need to use networks to achieve that (I'm not sure, I'm a total Docker noob). The question is, how do I do that ?
Hi I am having an issue with docker
I have posted more info here:
https://stackoverflow.com/questions/64904750/dockerized-flask-app-is-not-accessible-in-localhost
Ping me
h
here this is the problem i m facing in vs code after downloadin pythion extension
@heavy knot
@rancid shore Do you get that when you try to install the extension?
it is working now
thanks qwerty
but i have one ,ore doubt
we can talk about that in general chat
who can commit to a repository?
HELP !
i just tried to convert my app to exe file using pyinstaller
but i got this problem
as you can see, the file type is unknown or idk '-'
Can I have a setup where I have one pc hosting my bot and I can wirelessly make changes without actually going physically to my pc and changing it? I want to have one pc in my basement hosting my bot 24/7 and I can just push to GitHub with new code and the bot will update
Can I have a setup where I have one pc hosting my bot and I can wirelessly make changes without actually going physically to my pc and changing it? I want to have one pc in my basement hosting my bot 24/7 and I can just push to GitHub with new code and the bot will update
@hushed verge Maybe the easiest way to accomplish this in a local network is using Jupiter Notebooks?
@olive sparrow can you link me?
does anyone know how to turn off docker buildkit in windows?
@olive sparrow can you link me?
@hushed verge https://jupyter.org/install
How would I set it?
If you get the jupyter notebook installed on the machine running your bot, it'll install a web server to execute python in it. That would be the jupyter notebook server.
so from the other computer or cellphone you can connect to that web server in your local network, go to your python file, and edit it
or you could configure an ssh server
depending on the machine you are using to run your bot, one thing would be easier than the other
what OS do you have installed there?
@hushed verge ?
I have Windows 10 running on both
ok, then jupyter notebook would be a simple solution
or, you could configure an SSH server instead, but I've never done that in windows10
@olive sparrow Jupiter seems to be online but I can't run my file
the basic python launcher @olive sparrow
I understood that you only were looking for a method to edit your python file from another machine in your local network...
You should be able to do that with jupyter
Yeah but when I edit it will the code because if I want to role out an update the server is going to not have a monitor so I will need to update it via another pc
Is there a way to convert a UTF-16 character like this: b'\xac ' to a html entity?
@olive sparrow Can Jupiter do that?
@unkempt peak first use .decode() on the bytestring then use html.escape
Hey guys is there any way to host django apps with mysqlite db in gitlab?
I don't think GitLab offers that kind of service
anyone know why its throwing this error? go get github.com/Nhoya/gOSINT/cmd/gosint ..\go\src\gopkg.in\ns3777k\go-shodan.v2\shodan\shodan.go:15:2: code in directory C:\Users\\go\src\github.com\moul\http2curl expects import "moul.io/http2curl"
i am on windows btw
Twice now I’ve tried committing changes to a new branch, and both times it fucked up my code.
It has something to do with stashed code. But I’m not intentionally stashing anything.
What makes GitHub GUI decide it’s going to consider a change “stashed?”
If I’m wanting to snapshot my code, as is, would I want to “bring changes” every time ?
I'm looking for a very simple solution to be able to get some stats and run basic tests on a bunch of remote hosts. So far I'm using pytest w/ paramiko and I just run simple commands to get the output and pass/fail the test. One prob I have with this is that each of my 20+ tests establish a second ssh login, otherwise it seems to work. Curious if there are any other tools or libs you guys use? This is for UNIX only.
How do I get a traceback for a non-main thread from a hanged process?
yes
sorry for the late reply
After some research I found that Parsec is a much more useful tool and is really easy to use
superb, if that solves your problem, that's the good one!
Hey can we use getpass in pycharm cuz my programme can’t proceed to the line with a getpass func
@heavy knot what's your codr
!code
Here's how to format Python code on Discord:
```py
print('Hello world!')
```
These are backticks, not quotes. Check this out if you can't find the backtick key.
@heavy knot
generally text is better
Because you can't copy paste from a screenshot and some people can't view images
import smtplib
import getpass
def sign_in():
smtp_object = smtplib.SMTP('smtp.gmail.com', 587)
while True:
tries = 0
useremail = input("Enter your email: ")
password = getpass.getpass("Enter your password: ")
try:
smtp_object.login(useremail, password)
except:
# This will check for any exception and then execute this print statement
if tries < 6:
print("Wrong E-Mail or Password. Please enter credentials again.")
tries += 1
else:
print(
'Hmmmmm, I see that you tried one too many times. Please deactivate firewalls to permit Python to log '
'into your account and try again.')
else:
print("Logged in successfully")
break
did you call the function?
user prompt prints?
no
uh I don't see any func call in your code
it's in another script
here
import time
from Utility.Startup import start_app
from Utility.Sign_in import sign_in
Program startup
start_app()
time.sleep(3)
sign_in()
hm what's start_app?
Hey so how can u run stuff of a file, in a shell in vsc.
Ik that u can do that in pycharm but how do u do it in vsc.
what are the big differences between pycharm and vs?
lot, pycharm is way better than VS
how
if I'm gonna be coding in python and c#, should I use pycharm and vs, or should I just code python in vs?
or maybe even vs and vsc?
@slender relic you can run both python and c# programs in vs code simple download .Net core and python compiler. install the recommended extensions for both c# & python.
Finally install a code runner plugin and you're good to go.
i dont want to code c# in vsc though
Then i think pycharm & vs would be good.
ok thanks
Anytime
happen to ping me for an answer thx
@sly sleet i haven't tried pycharm so i wouldn't know
oh wait vs
i am using vsc
i misread this oops
oh that's aight
but uh yeah vsc python has a keyboard shortcut to run in shell
idk what it is because i changed it
cause what i am currently doing is that i am importing the file in shell and then doing the sutf there which is a lot of work
does it have to be within the repl?
because you can click the green run button at top right to run normally
it has to be in a repl to check certain stuff
i won't run it in repl
just to check certain stuff
hmm
the closest you can get is run selection/line in python terminal
I'm getting this error
@rich nymph
I've tried that as well but still i'm getting this
@sly sleet ye i got it thx.
oh yeah that feature
i was just looking at it
to see if it could solve your problem
@trim granite the same error?
did you install python3 from apt
just check
@sly sleet o gotcha
Python is not installed in my machine
@sly sleet it worked thanks
anyone ever experience https://hastebin.com/onuguhuyop.rb
Not sure if this goes here but i'm trying to create "something"
The thing is, it won't work.
from configparser import ConfigParser
import robloxpy
config = ConfigParser()
config.read("config.ini")
cookie = config["Main"]["Cookie"]
cookie_check = robloxpy.CheckCookie(cookie)
print(cookie_check)
It uses RobloxPY (https://pypi.org/project/robloxpy/)
For some reason it doesn't work
Hello I need help with an autosave feature in my text game If anyone would like to help me please message me thank you
In pyproject.toml I have something like this:
[tool.poetry]
packages = [
{include = "main_package"},
{include = "extra/package"}
]
[tool.poetry.extras]
extra = ["package-required-by-extra-package"]
How do I make poetry only build extra/package package if extra option is specified?
I'm setting up a PyCharm project that lives in a subdirectory of a larger git repo
but I want it to use the same .git folder as the whole project
my pycharm mypy just suddenly stopped working, which I mean is great cause I went from ~60 errors to none..
anyone know what caused it/how to fix?
I want to get some perspective on how bad it would be to build a django based frontend for a devops tool. The tool is similar to ansible and manages servers for hosting. Right now I login via SSH to perform any actions but I need some way to let others login.
Sounds dangerous.
Are there no other tools that exist that you can leverage instead of rolling your own and missing out on all the bug fixes / security fixes that other free, open source tools would have already figured out for you?
reinstalling it seemed to get back around half of them, but as soon as I ran a second inspection, they all disappeared
@heavy knot wrong channel, see #❓|how-to-get-help
also, you need to define what "doesn't work" means
@heavy knot #❓|how-to-get-help
What do people prefer for Python, vsc or Pycharm?
I have used vsc for Javascript so I am wondering if I should just continue on vsc or install Pycharm as well
I use vscode for small scripts, non github projects or those which involve a lot of frontend (html, css and js), like django projects.
pycharm, on the other hand, I use it for git projects, just to get the nice interface for version control and also the pycharm allows you to run individual tests from the editor which vscode does not provide
if you are running on a potato machine, pycharm can be really slow and you might want to stick to vscode
vscode git interface is nice
there is a test extension for that
Anyone tried getting pycharms linter to work with automaticly generated init methods?
Everything appears as unexpected arguments, though the code runs fine
Just wondering if there's a way to fix it
without you know, manually defining the _init_ method for each Model instance
How are the __init__ methods generated exactly?
def gen__init__(columns: List[Column]):
def __init__(self, **kwargs):
missing = []
for col in columns:
try:
val = kwargs[col.name]
except KeyError:
if col.default is None and not col.nullable:
missing.append(col)
continue
val = col.default
setattr(self, col.name, val)
if missing:
raise TypeError("__init__() missing {0} required positional arguments: {1}".format(
len(missing), format_missing(missing)
))
__init__.__annotations__ = {
c.name: c.column_type.python for c in columns
}
return __init__
This is the function that makes it
Here is the class it's used in ```py
class ModelMeta(type):
def new(mcs, name: str, parents, data: dict, **kwargs):
columns = []
data["__tablename__"] = tablename = kwargs.get("table_name", name.lower())
for key, value in data.items():
if isinstance(value, Column):
if value.name is None:
value.name = key
if value.index:
value.index_name = "%s_%s_idx" % (tablename, value.name)
columns.append(value)
data["columns"] = columns
data["__init__"] = gen__init__(columns=columns)
return super().__new__(mcs, name, parents, data)
@muted cobalt afaik, PyCharm only ever does static analysis of your code and doesn't check for anything at runtime
The best approach that you can do here is to create interface stubs for your code, for instance https://www.jetbrains.com/help/pycharm/stubs.html#create-stub-external
Those stubs are also read by other tools like flake8 or mypy so you'd benefit from that as well
This seems like alot of work for external contributors to go through 😅
I'm not even sure how this would work myself
Yeah, that's a fair consideration
Hello. I've made a github action to automatically generate a sphinx documentation into another branch of my repository. However when I am pushing into my repo, it's not triggering, does someone know what I could've been missing?
Here's the action in question: https://github.com/Cerberus1746/generic_lexer/blob/master/.github/workflows/generate-sphinx.yml
Hi there, I want to configure my pycharm run & debug with docker environment. Anyone have any idea how to do this ?
hi
What do you mean? Do you want to start Python exec in Docker container rather than as native application?
No i want to debug django application running on docker container with pycharm.
How about configuring remote interpreter? https://www.jetbrains.com/help/pycharm/using-docker-as-a-remote-interpreter.html
Well i configure remote pipenv environment running on docker in pycharm using Dockerfile but i'm not able to configure Debugging.
does anyone use SKLEARN here?
i haven't made a branch in >14 days. i want to make a new branch, based on my local repo as-is
does it matter which one i pick?
@stark cave if by "local repo as-is" you mean "the current state of the files on my local disk", then I think you want the second option. "The currently checked out branch" is what you have on disk right now.
Thanks man 🤩
@stark cave that you means you have changes on your local disk that haven't been committed - if you want those changes to be part of your new branch, choose the second option
hey
m kinda new to visual studio code, can anyone just tell me the setup, i mean before running the code, we need to install the extension and do some stuff, but i am not clear about that, so if somebody could help
@heavy knot just search python extension in vsc,
now u riun the code
this is what it is coming, which is perhaps not the output
how are u runnning the file?
by that green run option over ther
try running the file through the terminal
also could u send the entire screenshot of u runnign the file
are u on windows?
yep
also @heavy knot u revelaed your token change that
so in terminal just type the name of the file, and it should run
so did it work?
@rich nymph
u are running it through a jaascript thing
just trash all of those, using the trash button. Start a new terminal and type the name of the file it will run
yeah but if i select this one, its not running either
u are doing it wrong
so first trash all of the open terminals.
And then press CTR + ` ANd then type the name of your file
no
in terminal
just open up the terminal and type the name of the file,
but this will only work if you are in a workspace, meaning if you have a folder open
oh
this is what if i am opening a folder and then running it
@rich nymph
i didnt expected that window, ever happened to you?
and what happened
and when i run the file
are u running the file from the terminal?
this new chrome window appeared
yes
@rich nymph can you send me a screenshot while running the file, maybe i can relate with it
ok
thanks for this
np
Anyone tried getting pycharms linter to work with automatically generated _init_ methods?
Everything appears as unexpected arguments, though the code runs fine
I see that it works fine for models created with SQLALchemy, but I'm not sure how they managed to get it to work
Hlo
i am a biggner and i have a dout that what are github
plz some one anwer me
answer me
i am confused
what are github and what are there uses for a devloper
?
Hey hey, easy
GItHub in a nutshell is service to share code
You can share your project, collaborate with other people and so on
You can store your code in GitHub
i am using pycharm comunity edition interpreter and its just best, but the problem is that it takes much more RAM and i have a laptop with 4GB RAM . so , is there any soloution for that?
Oh, I think that I cannot help but maybe this page is going to be helpful https://www.jetbrains.com/help/pycharm/tuning-the-ide.html#default-dirs
tnx
Abhinav not easily. All of Jetbrains products are RAM 🐷 and they just expect you to have hardware to run them.
use vscode /s
So I'm having a terrible time with PyCharm - it keeps running in normal mode when debugging, and for no apparent reason

Hello, folks! Ansible question here.
I have multiple machines a,b,c that are accessible via public network each of those machines has access to internal network (lan). A, b, c have separate Lans and on each of those Lans there is a machine with ip 10.0.0.1 that i want to access. How can I do that?
My end goal is to run ansible playboy once that does this.
- creates a file on a, b, c then log into 10.0.0.1 on each of their Lans and create a different file there.
I have some issues with vs code and venv after I reinstalled windows, I am sure it worked much smoother before. I had to add a command line argument for powershell so the venv get activated at all and I have to open a new terminal for the activation to take effect, pretty sure I didnt had to do any of this before.
i use
and
and
and
and 
why does "discord" get that underline, whilst not giving an error?
why are you printing discord?
I have a turtle pc too. I use anaconda ,notepad ++ and sublime
Has anyone had issues with Sphinx in VSCode? I specified all the paths in the settings and I enabled the autodoc extension. It works, but VSCode is saying:
(INFO/1) No directive entry for "automodule" in module "docutils.parsers.rst.languages.en".
on this code:
.. automodule:: lib
:members:
@heavy knot what message appears when hovering over it
Hey folks.
My local instance of Code OSS recently stopped listing the python interpreters available on my machine in the Ctrl + Shift + P > Select Interpreter Menu.
Anyone experience this before? The status bar has also stopped showing the selected interpreter 🤔
git stash is what I would do if I want to save some changes in progress that aren't ready to commit yet, yes?
@analog kettle yes
git stash pop to retrieve them off of the pop stack
i think you can also git stash list
check the doc for how to use git stash, i'm unsure of it at the moment
I also have a bit of an odd git question.
On some of my local repo copies, everything works fine
on one of them, attempting to git fetch fails
b.com```
the other git repos are hosted on github
so i have no idea what the problem is
bump
that error looks like a connection issue
it's not able to connect to github
I keep having issues now when trying to open ipynb files in vscode
it worked yesterday but now i get this error
Unable to open 'file.ipynb': Using the Jupyter notebook editor requires the stable version of VS code and the CustomEditor experiment to be enabled..```
actually i did more research into it and i found a gh issue opened 5 days ago about it and a pr that was just merged 8 hours ago lol
seems to have been a result of a vscode update
since the pr was just merged there will probably be a bug fix update fixing it soon
@muted cobalt I don't really know a lot about this, but https://youtrack.jetbrains.com/issue/PY-38400 seems to suggest that the bug is fixed in v2020.1. Other threads like this with similar errors also say they've been fixed in never versions, so try updating pycharm? sorry I don't have a lot of helpful info here 😅
Was looking at a docker-compose.yml and found this in the volumes section. What does the :Z at the end mean?
you have to pip install it
it doesnt give me an error and i've already installed it
is your python interpreter set in the bottom left?
i think so
do i need 2?
@bitter vigil
show the full vscode terminal when you press run
im trying to use nuitka. the whole works 'fine' until I try to use the resulting .exe and there is a lib missing at runtime. is anyone familiar with nuitka. I don't have a whole lot of experience with python in general
thats not the terminal you are on the output tab
Hey guys. I have a git submodule that I made some changes to. I can I push the changes of the submodule to its remote repository?
I think I messed something up by pushing to the parent repo before the submodules.
I'm able to push with git push origin HEAD:master
but, that doesnt seem right
Does anyone have a preferred style/system for documenting fields, required/optional, choices, etc for JSON/YAML format files?
YAML supports comments natively
For JSON, maybe look into example JSON file with comment field?
Hmm
I have a schema defined in Marshmallow and was hoping there might be an easy way to generate some human-readable documentation of the schema
Am open to switching to another mainstream schema library such as pydantic if the support is better
does anyone know if it's possible to get vscode to recognize typing.ForwardRef ? I'd like code completion without actually importing the module due to circular dependencies
You can just use typing.TYPE_CHECKING and most language servers/linters should recognize it for you
I use it with from __future__ import annotations as well so I can write the types without making them forward references for recursive type hints
ok cool ill try that out, thanks
Is there a linter / code formatter that does something like this:
Notice how the is_3, float(), and mean() are lined up
accuracy_3s = is_3(valid_3_tens).float() .mean()
accuracy_7s = (1 - is_3(valid_7_tens).float()).mean()
Hi ... does anony one here know how to setup virtual env for M1 MacBooks ?
@wispy heath this is the python discord
many people are able to answer your questions
if you actually ask them
when you create a virtualenv where does it actually go (ie what folder, macOS) ?
If you create it through venv or virtualenv it gets created at the directory the you specify it to
You did, it's test_env1 of your current working directory when you ran that command
lol got it
It's not a connection issue imo because every other repo worked fine. I moved the version I had and checked it out fresh, and everything suddenly works
karakterer = { "Steffen": 1, "Frank": 6, "Tobias": 4, "Finn": 3, "Jakob": 2, "Jens": 5, "Olivia": 2, "Mathias": 6, "Bo": 4, "Kent": 1, "Ronny": 1, "Kentare": 1, "Finnkjetil": 1, "Tore": 1, "Tormod": 1 }
Now I want to add a surname: Like Steffen Frogh
And people can do siether: Steffen, Frogh or Steffen Frogh
And it will still print the number
I'm trying to setup a GitHub Actions workflow to make an installer of my Python app.
I've go the .yml file set up but I'm having some difficulties understanding how correctly trigger it.
I'm working with a master branch and a dev branch: me and the other programmer that are working on the project each create new branches from the dev one for every feature we work on and we then merge those into it when done. We can't push to master directly, Pull Request from dev is the only way to commit changes to it.
Ideally I would like to run the Action on push to master (which I know how to achieve) but only if the merge is tagged. The second part is the one which is confusing me: is it possible to tag the merge commit from a PR?
oh okay well glad you figured it out then
I have a docker container that is not including the port on a redirect uri (django). Is there some setting i might be missing that would include the port?
After a few weeks of crippling pain working with pipenv, does someone have experience with other tools for dependency management? Poetry seems interesting
how does flake8 determine the order of imports
how can you run a python file in atom, i have installed the script that is runs the code, but it isnt works
This is just a screenshot of everything
Hello can someone give me a quick help?
how can i get this link to the answer to my request?
hey how can i install kivy in py 3.9 version
I didn't actually figure it out, lol. I just did the local git repo version of reinstalling the OS
you might want to check the service's TOS, but if you mean get an http response, you might be looking to use something like requests
using pip. pip install kivy will probably do it.
@rough marlin it did't work
Not sure if this is the right place, but im making a simple bot for a offline/singleplayer game and im trying to find a bit of code to find a pixel within a certain region on the screen. Im using pyautogui library. Could someone direct me to some good knowledge there 🙂
command to remove this container?
f831b244a1531878be0f8e230e81fb2e6e858a262aa055d9107069189a2b82a3
docker rm
You can prune too: docker container prune
newbie here
is there any good text editor like pycharm but for browser?
pls ping while answering
The Tools page on our website contains a couple of the most popular tools for programming in Python.
Youll notice "repl-it" on it
ohh thanks:)
@heavy knot omg thanks so much my bot is online now, it wasnt working withother softwares this one works
:D
Any reccomendations for a free IDE for web development with django that runs well on linux?
Hi
Looking for a way to receive a message on my phone when a block of code executes is there a tool for that?
is there a command I can place at the end of my scripts that when I run them in vsc, and the script finishes, it will auto stop the console and script from running? Like basically I run my script, at the end of the script is like a 30 second timer, and when that timer finishes, it will stop the script from running (system monitor) and it will close the console in vsc so that I don't have to keep opening my system monitor to close the many python events running that never seem to close after I hit the red square to stop the script, and the trashcan Icon on the terminal to close it?
if you have windows 10, and you use the phone companion app that comes with it. My Phone or whatever it's called, maybe there is a way you can get your script to connect through that, and send yourself a text message? set the output to your phone number, use that app to send a text message, input your number, and tada? idk lol maybe?
:x: According to my records, this user already has a mute infraction. See infraction #22022.
:incoming_envelope: :ok_hand: applied mute to @shy cipher until 2020-11-29 16:02 (9 minutes and 59 seconds) (reason: burst rule: sent 8 messages in 10s).
help, i have python 3.9 but i need an older version for tensorflow, so i downloaded anaconda to set up a virtual environment with 3.7 to open in jupyter notebook, but despite it listing the environment i created as a kernel and me choosing it, the python_version() returns 3.9 and it seems like it's using the default kernel for some reason
importing tensorflow returns a modulenotfound error, meanwhile in anaconda in the environment i created it lists tensorflow as installed
does anyone know what's happening?
Anyone use vim?
@grizzled pine you dont understand do you u windows using microsoft edge worshipping programmer that GOD TALKS YOU HAVE NO CHOICE
Can anyone help me out in #help-lemon
@heavy knot you need to add <python_installation_folder>/Scripts to PATH
@heavy knot you can send text messages by emailing special email addresses which depend on your provider
@summer oak use vim
How can I host my own PyPI as a mirror of original one with my packages?
@sly sleet do you know what that is called?
what for? you also can create pypi from iso
I want to use pip install notation to download some private packages that I have on git
Currenty I am using git submodules but it's not clean solution
have you useed setup tools? or maybe create just setup py
i think that deploy and maintenance a pypi will be much more work
I have setup.py in my packages 🙂 But currently I am installing them by iterating in deps/ directory like cd deps/foo/; pyton setup.py install; cd ../bar/; python3 setup.py install
I prefer to list packages in requirements.txt and do all the magic behind pip install -r requirements.txt
I cannot publish my packages to official PyPI because of company requirements but installing every module manually, writing instructions and so on is to much effort for me
I want to find solution such as simple Docker container with my own PyPI server and cronjobs to recreate packages daily from git repos
Alternatively git hooks are nice options too to rebuild packages in PyPI
ummm , maybe add another repo but just for your packages
i donk use git hook so i cannt tel
Have you looked at nexus?
That's your own pypi
And you probably push from a fit hook, might be easier to setup in a release pipeline
What should I write in search? For nexus I have Nexus Mods for games 😦
The world's only repository manager with FREE support for popular formats.
I have tried devpi but it's too complicated to just add new packages for me
I will try it, thank you!
I never had to set it up, but my employer uses it a lot
Okay, thanks again
Don't even know about this option lol
idk if that works with private repos though
you can try it
and you can add those to reqs.txt too
I will check it out, thanks!
that being said, those gateways still work but being cracked down on by providers
so I wouldn't rely on them for anything critical
I have a couple of printers setup at work on the same print server, when one printer goes down, we can just change the port of the faulty printer (in print management) to another one and the printing job continues. I'm looking to change port not add or delete, which libraries or modules should I start exploring to find the answer?
PrintManagement
Anyone know how to specify a particular python interpreter when creating a virtualenv using virtualenv ?
When using: virtualenv --python=/usr/bin/python3 ./venv_app
i get the following error:
bad interpreter: /Library/Developer/CommandLineTools/usr/bin/python3: no such file or directory
but im not even trying to point to that folder
it was working on Friday and then I installed Xcode and it stopped working.
Is it just me or does this block of code seem wrong according to ecs.client.waiter docs? Says maxAttemps is set to 100 and error is returned after 100 failed checks, MaxAttempt=200 seems counter intuitive or am i missing something?
https://boto3.amazonaws.com/v1/documentation/api/1.9.42/reference/services/ecs.html#ECS.Waiter.TasksStopped
# If we don't wait, we return here.
# This will skip the waiter
if not self.wait:
return True
waiter = self.client.get_waiter("tasks_stopped")
# Wait for task completion
waiter.wait(
cluster=cluster,
tasks=[
task_arn
],
# NB: max timeout is 600 seconds
WaiterConfig=dict(
Delay=10,
MaxAttempts=200,
),
)```
What would be the best way to setup an authentication system for my python bot?
Is it possible to run exe files from auto-py-to-exe on other windows 10 computers?
:incoming_envelope: :ok_hand: applied mute to @stoic galleon until 2020-11-30 09:43 (9 minutes and 59 seconds) (reason: burst rule: sent 8 messages in 10s).
Anybody on dooms-emacs ?
Write a function all(lst) that models a limited version of the behaviour of the built-in function. You may
use the built-in function bool().
Input: a sequence (list) of objects lst.
Output: a boolean, True if all objects in lst have a truth value of True; otherwise False.
too many indices for array: array is 0-dimensional, but 1 were indexed
predicted is a list, i need it to be an array to process it
!rule 5
5. Do not provide or request help on projects that may break laws, breach terms of services, be considered malicious or inappropriate. Do not help with ongoing exams. Do not provide or request solutions for graded assignments, although general guidance is okay.
@clear mountain
i made this search open but when i run this it will show only 1 result but in db there were multiple values currospodence to searched value
because ur doing fetchone()
do fetchall()
and iterate through the values
@compact violet
Hey, just looking for general advice... I have an application that's going to run on a Raspberry Pi with PiCore, that needs to log some of the data it records as 'lifetime' statistics. I'm using PiCore because power could be cut at any time, unpredictably, but there's a small chance that would corrupt the statistics log file if it happens while it's being written... I need to make that a 0% chance.
What do you guys think of this strategy; setup a rotating series of log files, after writing to each file check and store the hash and datetime in a 2nd file, and then when I need to retrieve these data after reset pick the most recent log with a valid hash?
Sqlite is ACID compliant
So it’s pretty rock solid, if it can’t save your data, likely nothing else can.
ACID compliant TIL. Thanks, I'll check it out!
@foggy yacht I'll do that but not works
Hello!
A very simple question about github
I have my account and I make a lot of commits into private repositories
Thing is, the green boxes don't show to the public when it's about a private repository
But I saw people that could show how many commits they did to a private repository publicly
Anyone knows how to do that?
Thank you very much beforehand :)
For example, look at this profile: https://github.com/sumneko
I click on 16 October, and it shows that
It clearly counts the private repositories contributions
On the other hand, you got my account and think I did nothing throughout half of the year :(
Check settings next time 🐊
Thank you very much!! Just did sight read that page quickly and didnt find it xD
It's why I am using CTRL+F always when I need to find something 😂
I almost always do that LOL, except this time - god damn it!
Stupid git question, but never thought of it:
if I use /* in my top level .gitignore, will that also ignore the .git/ folder and screw up my repo?
I'm trying to change my gitignores in my repos to be whitelists rather than blacklists, as in previously I'd specifically ignore certainly files and folders, whereas now I'm trying to ignore everything from the start and specifically whitelist the relevant files/folders
logically my brain tells my that git should ignore the .git folder anyway
..otherwise each commit will produce a change that needs to be recommited
ad infinitum
@eager owl
$ cd (mktemp -d)
$ git init
Initialized empty Git repository in /tmp/tmp.vTpg7KZbbk/.git/
$ echo "*" > .gitignore
$ git add .gitignore
$ git commit -m "Initial commit"
[master (root-commit) 2fbbb63] Initial commit
1 file changed, 1 insertion(+)
create mode 100644 .gitignore
$ touch test
$ git status
On branch master
nothing to commit, working tree clean
$ git add -f test
$ git status
On branch master
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
nowy plik: test
It's that simple
If you don't know how it works just test it
It seems that .git directory has nothing to .gitignore becuse you don't put .git directory as git object
But ignoring everything by default looks oddly
ok great cheers
Do any Windows users know of a terminal more reliable than gitbash? I'm thinking of switching over to powershell because gitbash sometimes behaves unpredictably. Like it won't use packages in my virtual environment when I execute Python code or will forget what ls is when I deactivate an environment.
How about WSL?
I'll have to see what that is
I used Windows for a year and I had to use a different per purpose. gitbash for git. powershell for docker commands and WSL for kubernetes commands
it was really painful to try to use all of them in a single one
yeah, that's what I'm running into @short peak
I'm going to dual boot my next computer
not sure if WSL2 improves that. I used version 1
and the Windows partition will just be Steam, basically
oh I decided to go ubuntu and void suffering
WSL2 allows for Docker
is it available for everyone already or still needs to be something insider?
As far as I know it's available till previous update
But I cannot use it 😂
WSL2 requires some options that crashes VirtualBox
If you are VMWare user it shouldn't be a problem
@analog kettle powershell is superior shell. Period
why
Because it’s object oriented, has standard for commands and easy to extend
It’s also got modules for just about everything at this point
Plus you get access to .Net standard libraries if you must
Only thing that comes close is python and it’s easier to use for command line operations then Python since arguments are native
perhaps has a better design but it's common that simple tasks to do in bash are way longer and complex in Powershell
Maybe but I find that’s mostly false
Doesn’t change you should be scripting and not using command line a ton so bash being “simple” is not a great argument to continue to use less capable shell
if I wanted to "script" instead of "automate" commands I'd use Python
Or do both with same shell
yeah, not sure. Mixing technologies is not a big issue for me I guess
Not to mention Powershell has a ton of built in commands for common scripting asks
Invoke-RestMethod vs request.post()
Import-CSV
yeah, it has a lot of functionality. Perhaps it needs a better documentation oriented to bash users. Like, how to do this "common in bash" in Powershell. I can't recall all the scenarios but I remember that every time I needed something I had to search a lot
I mean it already aliases most of common bash commands
Problem I find with just bash -> Powershell is bash is all string based and Powershell is not
It’s like trying to drag someone from Basic to Python by writing some guide, sorry new language with more power, it’s hard to hide all that power without massive crippling.
I see your point
so why do you think Powershell hasn't been adopted by default in app/systems? or at least I haven't noticed it
I try to do both versions but it's common that you only find .sh files in apps and that you need to install Powershell in Linux systems. Has any distribution adopted it as default or is that even possible?
yeah, I use it. It's also in brew for mac
Yep, but if it was made a default shell, it would break so much
@wooden ibex Thanks for the advice about sqlite yesterday btw! Just tested my rolling database and it works flawlessly.
I was totally going to reinvent the wheel >.>
@wooden ibex tbh idt powershell is a bad language
its just way too verbose
shells aren't designed for actual programming
and instead for interactive use
idt powershell will ever become a default shell
because its way too different from posixy shells
Also, Windows is trying to integrate more into WSL, Their latest Development on the Windows Terminal tries to integrate any shell (Inc. CloudShell).
https://github.com/microsoft/terminal
Should I use Mu or go straight to PyCharm? Where does VS code come in I read that? it is not as good on as Pycharm for python which is it?
Hi guys, ive been trying to install VS code Via the Linux app installer, But i seem to get an error!
Alright, I own a Lenovo C330, and I think it runs 32 bit, but I'm not 100% sure, so I went on the official Visual Studio code website, and I installed the latest .deb (Debian) version of VS Code, I open my file folder, right-click on the file, and it only lasts a good one and half-second before I get an error message stating there has been an error and I am unable to install VS Code.
I already have it on my Windows PC, I just think having on my laptop for on the go would be nice.
Please ping me If you have a response, Thanks
hello
i need help to use twitter api
i am new her and i don't know wich channel i supposed to post this
What is the problem?
i am a newbi in python. i want to scrap my number of follower
(i allready have the api)
Do you have API key?
yes
I didn't used Twitter API but as fas as I see you can create twitter.Api according to this link https://python-twitter.readthedocs.io/en/latest/twitter.html#module-twitter.api
Then use api.getUser
User model has following and followers_count - https://python-twitter.readthedocs.io/en/latest/_modules/twitter/models.html#User
ok. thank u. i will read those
I don't have API key to check it on my own
no probelm. to my first python app, i wanna make a social network wallboard
just to discover this language
hello , sorry for disturbing u guys i have a question ? Did you know something that can navigate into webpages like click or acting like if it was watching a video but without really opening a webbrower
i mean as a background process
Hey
you guys know that sort of shortcut in vs code where you type ! in an html template
and then you type tab or enter
and you get a base template
It for some reason doesn't work for me anymore. How do i enable it?
something like code completion
does anyone knows a library/package for visualizing recursive function?
Selenium can run Google chrome in headless mode so that might be what you need. As rabbit said, its somewhat difficult to use. Look into Helium which is built on top of selenium.
ERROR: Could not find a version that satisfies the requirement json
ERROR: No matching distribution found for json
need help to fix this
how do i start with python on vscode
def cake():
if False:
print("hey")
x = u
z = NonExistant("hey")
how come PyCharm linter dies and can't report Unresolved reference error if I do this?
False is actually __debug__
I mean in practise the code below the if will run, but the Unresolved reference error is not reported 
hello
i am trying to use instagramy tool (https://github.com/yogeshwaran01/instagramy/tree/master/instagramy), when i try to use it i have an error:
File "rs_i.py", line 6, in <module>
user = InstagramUser('github')
File "/home/louis/.local/lib/python3.8/site-packages/instagramy/InstagramUser.py", line 32, in init
if check_username(username):
File "/home/louis/.local/lib/python3.8/site-packages/instagramy/InstagramChecks.py", line 26, in check_username
token = response.cookies["csrftoken"]
File "/usr/lib/python3/dist-packages/requests/cookies.py", line 328, in getitem
return self._find_no_duplicates(name)
File "/usr/lib/python3/dist-packages/requests/cookies.py", line 399, in _find_no_duplicates
raise KeyError('name=%r, domain=%r, path=%r' % (name, domain, path))
KeyError: "name='csrftoken', domain=None, path=None"
is anybody have an idea ?
Anyone have a Docker django, channels, redis, postgres configuration available?
guys anyone here is good at developing augmented reality app??
has anyone used PyUpdater? what kind of host should i use for storing the update files? i know nothing about web stuff
Hi, i dont know too much about python and when I try to change my archive from .py to .exe with PyInstaller it give me an error. Can i send to any one the archive and you change it to .exe pls? Thanks
hi anyone knows bs4 and selenium?
I can't extract data from one website, bs4 doesn't prettify whole document, I cannot get certain divs, they are sent to website via JS need help
hello. A bit beside the focus on this channel, but anyone familiar with kubernetes? I have a service that needs to run at host network level, but I want an ingress for it. How would I do that?
anyone??
Has someone some experience with pyre-check? What are the pros and cons over mypy?
how to auto format python code with neovim?
Has someone delved into the rabbit hole of dependency management, packaging and cross platform python installations and came back alive to tell the tale? I'm at my wits end at work trying to figure out a bullet proof way - that's quick, easy and out of the way - to have all our python code running on multiple machines.
So far I've looked into and used: setup.py, pip with a private pypi, pipenv, poetry, twine, dephell... Also homebrew vs pyenv and what to install with pip at what point to which version. Tried custom mingw, cygwin and git bash on windows. The platforms I use are windows and macos. Also scoop, choco and something else on windows.
venv, virtualenvwrapper...
In my case, on macos, the safest bet (iirc) was to install pyenv with homebrew, install python3 with pyenv and then work only-and-exclusively with virtualized envs - usually with pipenv.
However, pipenv gets tiresome when you're shuffling around in and out of folders and don't want to install stuff systemwide. Then someone goes and does a pip install this-and-that and it gets forgotten for a month or more. It just so happens, that what they pip-installed conflicts with some new projects dependencies inside a pipenv venv, and the developer flips over the table. Fast forward to a discussion about "npm never has these issues"
I can't argue - it looks tempting to have npm install -g in the readme vs my longwinding step-by-step instructions..
Any long arching articles (not just how to use pipenv etc, but rather how to make all of this work) or such material to study would be appreciated. Also any experiences or questions that might provoke that typical "oh yeah, why am I doing it that way.. true.."
I've used - with vim and nvim - dein installer -> deoplete and deoplete-jedi. For these you probably have to install (check readmes etc.) python packages pynvim and jedi
Any guide to make python wheels for a armv7l linux?
im having trouble getting mypy to recognize the type hints in a package when it's installed and imported elsewhere. I found this:
https://www.python.org/dev/peps/pep-0561/
This PEP does not support distributing typing information as part of module-only distributions. The code should be refactored into a package-based distribution and indicate that the package supports typing as described above.
can someone clarify here: does this mean that it won't work if my package is just
foo.py
test_foo.py
... # other files like setup.py etc
py.typed
and that I have to reorganize it into
src/foo/foo.py
src/foo/__init__.py
tests/test_foo.py
py.typed
?
this is auto completion right? i want to use black formatting for example
leg
I did not think of that. However, my use case involves the actual development environment rather than external testing environments. Most of the tools deal with the state or use build tools of the machine. In other words that would be like using 'git' via a dockered container.
Docker would work for platform agnostic cases, but not for those that are cross platform in the sense that they have to adapt to the platform they run on. For example docker would work in parsing some json, but invoking a compilation using proprietory sdks would be a bit of a hurdle to configure - if it works at all. Also invoking GUI programs would also have a steep configuration curve.
Some of the tools are ones I'd rather keep private to our team. This would require setting up a private repo for docker. I guess that's doable, but I need to validate if docker works in enough cases.
True, for autocompletion . I misread your question, sry
Probably not the answer you're looking for, but I've found it easier to comply to that directory structure when possible. There's so many corner cases that I can't be bothered.
In addition I use poetry. With that I can get the structure out of the box with poetry new <project name> and refer locally from one project to another using the pyproject.toml file as other_project= {path = '../other_project'}
At least with that you could validate if the typing comes theough / works the way you intended, when they're setup into that dir structure
What's the state of WSL now? I prefer having Windows for a home system, but I'm likely to work with Unix-specific packages in the future.
Right now I'm dual booting, but having two systems is annoying, so maybe it's possible to switch to one system.
Is that setup viable and problem-free?
- Dev and work environment is inside WSL, including python interpreter and package manager (anaconda)
- I can access source code and data files from windows (for example, I may want to attach a file to the e-mail from Windows or save downloaded file directly into data folder
- Pycharm installation is inside windows, but works with package manager inside WSL
yes I use src and poetry too, but this isn't actually my project, I'm just trying to contribute to someone else's, so I'd like to just add the type hints and make as few changes as possible. i don't see why such a simple change should necessitate changing the entire project structure and build process but seemingly it does.
which is really annoying
-
works as long as you do the dev work only inside the wsl and don't require any GUIs
-
might work until windows locks some file. Not a blocker but annoying.
-
probably will result in pain. wsl and windows environments are in that sense separate, that for example python has to be installed to wsl and win separately.
Also one of the caveats of wsl is that file permission handling from within wsl leaves a lot to hope for. Win has additional perms settings that you can't - or at least couldn't a while back - configure reliably from the linux side.
So far my only positive experiences with running linux and windows in tandem are running linux in a virtualbox vm. File sharing can still result in file locksby windows, but yeah - that's what windows does
Thanks! Soooo.... Dualboot it is
I wanted to use Pycharm on the windows side, because, as you said, GUIs don't really work with WSL and I'm not leet enough to code in vim.
Linux works pretty nicely inside a virtualbox. It feels icky, I know, but you have access to typical dev workflows. If you're doing some specifc work that won't fit the vm flow, then sure - it's out of the question.
And I've used pycharm etc inside the vm - all the graphical stuff. Usually I opt for xubuntu because I think xfce is lighter than whatever comes with default ubuntu.
with wsl it pretty much boils down to vim imo.
There is a x11 port for windows. I used that to bridge the gap between wsl and windows. The startup of programs is painfully slow and there is quite some configuration to be done to make it work.
It still doesn't provide wsl to pycharm for what I know, and would probably take you into a deep rabbit hole to make it work, if it's possible
Well, deep rabbit holes is precisely what i want to avoid :)
I'm learning to use python to interface with various specific data processing programs, which are mostly supposed to run on linux servers, and even if they have GUI, they often have CLI interface. While I don't have much experience, everything looks like it will run on VM without major problems.
However, I'm more used to GUIs for writing scripts, debugging, resolving merge conflicts, ect.
Luckily, i didn't have issues with Linux Mint on the desktop aside from various annoyances stemming from incompatible file systems for my windows and linux install.
Googled a bit, and apparently GUI on WSL is in the works (WSLG), but zero idea how good would it be and when it would be released
Sure, what’s up @dark folio ?
im trying to package a kivy app with buildozer but i get WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
my guess: install openssl and reinstall python. Not sure what's going on there, but sounds like your installation of python is somehow borked.
coincidenttaly bumped on something about certain kivy versions not working with certain python versions. Sometimes python versions have changed breaking stuff as they've moved packages to different places. I don't think that's the case, but maybe check that just in case too
👋 Hey there! If anyone would be willing to help me with PyCharm in #help-apple, it would be greatly appreciated.
@obtuse saddle vscode has a extension that lets you run the gui on the windows side and connect it to a server in wsl; does pycharm have anything similar?
interesting. There's a remote interpreter option in pycharm professional. https://www.jetbrains.com/help/pycharm/using-wsl-as-a-remote-interpreter.html
well wasn't that a necessary unrolling.. /s
Anyone know where I might find an expert on snekbox? I have an issue... Seems like if I send the server two requests at approximately the same time one or both gets an out-of-memory error (return code 137).
I'm trying install Python on VS Code but i meet this error "CommandNotFoundException"
@heavy knot what command are you running in terminal?
@muted notch pip install -U pylint --user
@heavy knot try just a normal pip install pylint
@muted notch Fatal error in launcher: Unable to create process using
@heavy knot i'm assuming you've tried re-installing python or tried some commands from here?
https://stackoverflow.com/questions/37220055/pip-fatal-error-in-launcher-unable-to-create-process-using
I installed python 3.5.1 via ampps and it's working. However, when i try to use pip, i get the following message:
Fatal error in launcher: Unable to create process using '"'
I already reinstalled...
That's not working 😕 @muted notch
i have a bunch of submodules in a directory
how do i convert them to normal directories
where they each have their own history
a la git clone
and i cant delete them because some of them have untracked changes
@heavy knot I'd try re-installing your python from the site and seeing if it works
@muted notch Not working
@heavy knot does this work? python -m pip install --upgrade pip
Not working, i try re-install VS Code and Python
@heavy knot if you type python does that work? are you able to get into python?
LOL glad to hear it worked out 😆
🤣
https://github.com/dephraiim/termd
A small project I made to render Markdown files in the terminal. You can read any .md file and also it supports md files hosted online.
Hi. You can share your Python content in off-topic channels, in #python-discussion or in an appropriate topical channel, but we don't allow advertising of projects not directly related to Python.
https://pypi.org/project/towncrier just found out about this tool. seems very useful, but quite different from the usual NEWS.txt type of workflow. does anyone have any first-hand experiences with it that they can share?
I am looking to use Sphinx autodoc to generate some human readable docs from my docstrings. I'm confused as to what I need to put in my index.rst to get it to just document everything it can automatically
I found a medium article but it seems to be implying I need to add a directive for every module. That seems excessive?
@smoky compass You can write the autodoc directives manually but you can also run sphinx-apidoc on your package and it should generate the appropriate directives for you. Depending on how you want to format your docs you might want to edit some things.
Yup, thanks I just discovered that. Right now this is my first play with Sphinx and I’m just trying to generate simplistic docs for every class/function
I’m not thrilled by the theme, it’s OK, but it doesn’t seem to put any space between definitions, which when the docstring is one simple line makes it a little “wall of text”
Any recommendations for good info on getting the most out of it much appreciated
I personally use the theme that ReadTheDocs uses (sphinx_rtd_theme); provides just enough spacing for each section/subsection w/o fiddling with the vanilla styling
Interesting. I might give that a go. I’m not a huge fan of blue though (although it is my companies colour so 🤷♂️ )
I need to work out how to include non-auto generated files to the docs too. Like I want the top level to have overviews of the project, some detailed help on common tasks etc, then a link to the apidoc part somewhere
I need help installing and using a sound tracker called ODAS.
I just need someone to thought check me on what I am doing wrong....
I have it installed, but I cant figure out where to put the client/server IPs in the config.
How do I add a custom library to IronPython in visual studio
New Anchor Podcast Episode. Python Basics: IDEs and Text Editors | Episode 7. Let me know what you think. https://anchor.fm/thirdeyecyborg/episodes/Python-Basics-IDEs-and-Text-Editors--Episode-7-eniusv
I will be talking about the core foundations of Python segmented throughout different episodes of this Podcast. In this episode I will be going over the best IDEs and Text Editors in Python. I also plan to go into other programming languages and software development technologies in future episodes.
Check out my website here, I have a newsletter ...
I have this issue with PyCharm where it thinks everything I import is invalid, does anyone know how to fix this? Thanks in advance!
(Code runs fine)
Where can I learn to turn a python file into an exe?
google for pyinstaller @ionic condor
it says not found when i type my .py file
Hello
Do you need an application .exe? Or you need to run your script with double click?
I believe application, so that I can send the file to another person where they don't need to install python on their pc
Oh then pyinstaller is your option. It is hard if you have many dependent libraries.
Will use again Jupyter Notebook in my Python codes. What should I use? Anaconda, browser (conda), or Google Colabs
I will use Jupyter mainly for my ML learning. What are you using?
This is a more deployment oriented question, please bear with me. I am using a FLASK API + Next JS fronted. The application is very backend heavy.
Operations : An excel file with 100k records is matched with another one with 100k records using an algorithm.
Worst case - 10 users simultaneously send a request to the server to perform this operation. What kind of EC2 instance should I get?
Hey @analog cobalt, we don't allow advertising here
:+1:
nope its a new project that i created
im going to try using / while creating a new file as someone suggested in general
Ahh, so there's a little bit more work to do here
I'm not experienced enough with the git plug-in to help though, I'm afraid
its fine i used / after typing in my folder name and it worked. thanks a lot for your help though :D
can I get a some help on handling a failure using retry in this Step Functions section?
https://docs.aws.amazon.com/step-functions/latest/dg/concepts-error-handling.html
What i'm trying to understand is how this snippet works:
"ErrorEquals": ["States.TaskFailed"],```
If I have a Lambda that returns a Exception message from a API call, how can I have that bubble up to step functions to handle the retry scenario? I _don't_ want to retry for all errors in the Lambda, only a specific Exception message that occurs
Does anyone here use GitLab CI/CD? I am trying to understand, if it is possible, how to deploy our python package onto our server using it. Basically the "deployment" just involves installing the package into a venv on a Linux VM at a specific path. If anyone has any experience/thoughts please ping me
Why is PyCharm autocompletion broken when I use Conda?
Does the pause button in VSC actually work for any of you guys?
hi guys got any tool can help to auto buy the things ??
like in lazada , amazon
kindly like can help to buy in the limited time
Yep.
@leaden turtle This channel is for discussing development tools and so on. Besides, pretty sure amazon doesn't allow for automation. We won't be helping you with it.
ok
is there a pep8 but for git?
I would like to get .exe file based on mine .py file. how to do that using pyinstaller
I have a bit of a Frenkenstein data preprocessing script, one part is written in pandas, another bit in pyspark. Now, when feeding it a large source file my laptop clearly shows its limits (hangs at [Stage 0:> (0 + 0) / 1] indefinitely). What would be my best shot at running this on aws?
Is EMR my only option here?
I'm thoroughly confused. Why would PyCharm tell me that the files are being uploaded when they very clearly are not?
The only explanation I can think of is that the server I'm trying to upload is swallowing them without doing anything.
I'm also having trouble with PyCharm, it's not recognising my modules correctly and it's so annoying
It works fine with the default interpreter, just not in the venv
@soft axle where does it say your venv is?
also, why are your imports in a try block?
Do File > Settings > Project: [project_name] > Python Interpreter
if you don't see discord in the list of packages, there's your problem.
(Ping to reply or I won't see it)
I'm catching the exception ModuleNotFoundError so that the script can auto-install missing dependencies
do you really need that?
It's all here.
Because it might lead to confusing behavior later if you get a ModuleNotFoundError that isn't solved by the way that you handle it.
I see, is it a bad idea to just keep the clean error message using this method?
@soft axle I wouldn't recommend that either. Python was going to give you an error message that tells you you didn't have it installed without any added work on your part.
(And exit the program, for that matter)
Also, since this swallows the ModuleNotFoundError that you would have gotten, you don't get to know which module wasn't installed
whereas the actual error would have told you
I guess what you could do is
except ModuleNotFoundError as e:
raise ModuleNotFoundError('Look at the requirements.txt file') from e
that way they get both error messages. But looking at the requirements file if you're missing something should go without saying 
Ok, thanks foor your help! This works perfectly.
Unfortunately, PyCharm is still screaming about invalid imports, which are definitely valid...
:P
no problem. raise Exception(...) from e is a great pattern for wrapping more specific error messages around default ones. But it should still be used sparingly so you don't clutter up all your code.
I wouldn't bother with those two comments--the general Python style is that stdlib imports are grouped first.
Here's what I'd do: delete your virtual environment and start over.
I end up doing it a lot because I hate figuring out where I messed up with environment stuff.
So, is that as simple as just deleting the venv folder contents and letting PyCharm handle the rest?
deleting the venv folder is part of it, but then you have to go to the interpreter settings and pick a new interpreter.
if you don't pick a new interpreter, PyCharm will just say "fuck, where'd the interpreter go?" when you try to run something.
I'm mad at pycharm right now so that's why I'm using bad words 
Yep, it's now asking me to select an existing one or make a new one.
Is it a good idea to make a new virtual interpreter for each project, or can that quickly get very cluttered?
@analog kettle
@soft axle I have a separate one for each project
you can tell pycharm that certain environments are for specific projects only and then it won't even list them in other projects
Ok, I see. Does Pycharm do that automatically when adding an interpreter for a project or do you have to do it manually?
Also, I assume that the option I want is "Virtualenv Environment"?
I think it's a check-box when you make a new venv
yeah, don't check "make available to all projects"
Ok, thanks! Sorry for all the questions, I'm still quite new to Pycharm :P
No problem, we're here to help. PyCharm can be tough to figure out but on a good day it's like writing code in a five-star hotel.
@analog kettle Unfortunately, the re-install of the interpreter didn't help. It gave me the popup asking me to "install dependencies" which it correctly itentified as discord.py, munch, python-dotenv then gave me confirmation that it successfully installed, but it still lints them wrong
@soft axle I'm about to have a meeting with my advisor but hopefully someone else will come along. This is the right channel, and you can also use the dynamic help system (see #❓|how-to-get-help)
Ah, no problem. Thanks for all your help!
Hey this might sound weird but is there anyway i can put variables in server.properties (its a minecraft file that has a lot of false true or (name) I am trying to make a gui of it using pysimplegui but can't find a way to create the variables.
Idk if this belongs here bnut how woulod i set a np array with no deffiended shape
Any linux/docker people know why I keep getting this DBUS error?
It still seems to work fine, I can interact with the chrome instance and everything, but I have this error on windows wsl2, mac and linux. I'm using https://github.com/yukinying/chrome-headless-browser-docker
seems as if dbus isn't working in the docker container, but I'm not sure why I haven't seen any solutions online
perhaps the container can't see the host socket
I'm not sure why it even would need to, especially since I don't need to communicate back with the main host
Maybe chrome needs it for some reason
but it seems to work fine with the error running
I've come across a weird bug and I'm like 90% sure it's just vsc (it's not happening anywhere else, I'm downloading another editor to confirm this), but my indents keep deleting themselves
hello
for example I'm working on a new feature (alternate universe)
as I'm working on, I went back on master and fixed something.
then I'm back to my feature branch. how do I also apply that fix in master branch to my current feature branch
Git merge master
ok, but will my feature changes be kept?
heyo guys, i'm using Visual Studio Code, I have Discord library installed, python 3.8 installed and i have an error using "import" but the import is working : / Can VSC have a false error ?
Here is the error and the context :
I have the error ``Unable to import functions'`. The file where the error is contains :
from functions import create_character
I have a tree looking like the screen below. I'm using a function in character_function.py, file in the folder functions.
I have py from .character_function import create_character
Yes. It's a merging of the branches not a replacement
please 
hi, does anyone know how i can disable the current line number highlighting in VSCode? 114 would be white as well instead of orange
this is version 1.52, i looked for it but can't find anything related to disabling highlighting of line number specifically
@shadow drum That sounds more like a project structuring project more than a VSCode problem now that I see it
idk the import is working well
On runtime?
like, i can use the function but vsc tell me i can't
yes
so
can i send my code ?
import json
import os
import discord
from discord.ext import commands
from functions import create_character
class CogCHARACTER(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.command()
async def character(self, ctx, arg=None):
with open('pvp_character\\character.json', 'r') as file:
data = json.load(file)
print("Debug 1")
if arg is None:
print("debug2")
if str(ctx.message.author.id) in data:
reset_message = await ctx.send("You already have a character, do you want to reset it ?")
await reset_message.add_reaction("✅")
await reset_message.add_reaction("❌")
def checkreaction(reaction, user):
return user == ctx.message.author and reset_message.id == reaction.message.id and (str(reaction.emoji) == "✅" or str(reaction.emoji) == "❌")
try:
reaction, user = await self.bot.wait_for("reaction_add", timeout = 30, check = checkreaction)
if reaction.emoji == "✅":
await create_character(self, ctx)
else:
await ctx.send("You cancelled")
await ctx.message.delete()
await reset_message.delete()
so it"s discord.py
when i check the checkmark emoji it's running the function
and it's working very well
This goes a bit out of scope for this channel already, I suggest taking a help channel or going to #discord-bots
but my problem isn't really discord.py i think
i thought it was my text editor
isn't it ?
It is VSC, although what your code does wouldn't really be related to the current problem at hand
"workbench.colorCustomizations": {
"editorLineNumber.activeForeground": "#fff"
},
does the job
If I have a git remote like this:
main -> dev
|
\/
main
How should I get the changes from main to dev. Would I just git rebase main dev?
git merge main with dev checked out
thanks, that's what i ended up going for
Click commands are not working when ran in docker
https://cdn.discordapp.com/attachments/597175122222252038/787469881477300244/unknown.png
what should i use
i use repl atm
but i want an app that specificely uses python
not sure which onbe
would heklp if someone replied
@errant cipher There are quite a few on our tools page, its just personal prefrence really
!tools
The Tools page on our website contains a couple of the most popular tools for programming in Python.
I personally use Visual Studio Code
thank you for getting back ot me there legit a text channel for everything
happy to help
anyone know how I can make my git repo smaller?
I am storing a large csv but everytime I make a small change to the csv file the get rep size doubles
Don’t use git for large file storage
It was designed for smaller code text files
There is git lfs but hosting for it is expensive
Hey guys. I have data from solar installations which are stored on an FTP server. Data are sent every day at 3 a.m (csv files). I then have to analyze the data to see if the solar power plants are working properly. What kind of tools should I use to monitor the data (visualize, alerts and emails) ? Can I do it with only Grafana ?
is it possible to remove these warnings from the variables in 'Pylance'?
everything works fine, but the 'Pylance' says that the variables have not been defined.
you can bring the mode down from strict or disable it in settings
unless you need strict typehinting ofc
then just define the types
Does anyone here use Celery and periodic tasks? If so do you have a good/accepted method for registering new tasks with the beat_schedule which doesn't involve using Django?
so if my build process doesn't use docker, but builds a docker image at the end, I don't need to do this?
Not sure if this is the right place to ask... trying to get some OpenStreetMaps modules for a project, pip install OSMPythonTools fails with ERROR: Could not build wheels for ujson which use PEP517 and cannot be installed directly. Novice here but I do know that wheels are needed to compile on different OS/cpu architecture/etc and tried pip install ujson --no-use-pep517, ujson==1.35, --no-binary... no dice. Anyone know my alternatives? How can I get a module when pip doesn't have the right wheels?
Considering dropping docker as our code works perfect on all machines tested, except when ran as a docker container.
https://stackoverflow.com/questions/65299676/async-python-error-while-running-api-in-docker-asyncpg-exceptions-base-interfac
Mention me or reply on the thread
Any help would be appreciated
Anyone else having issues with pip? xmlrpc.client.Fault: <Fault -32500: 'RuntimeError: This API has been temporarily disabled due to unmanageable load and will be deprecated in the near future. Please use the Simple or JSON API instead.'>
Any idea on how to configure Atom to use Python 3 instead of python 2?
hello, so i encountered this issue where when i called a file outside of the folder, that called file throws import error (the error file is importing another file), but when i instead, just run the error file and not from the file outside of the folder, the import error disappears
here's my folder structure for brief
(file)main.py
(folder)app--
|--(file)app.py
|--(file)views.py
|--(file)__init__.py
so app.py import views.py and perform some tasks, when i call app.py, everything works fine, but when i call app.py from main.py, it throws an import error at the place where app.py imports views.py
anyone know how I can delete a gitlab repo history? The large files is taking up all my storage
I have a repo here (https://gitlab.com/tuangeek/cryptocurrency-historical-data) but I was tracking the /data dir, but it was taking up 9.5 GB. I deleted it but my repo is still 9.5 GB
hi.
how can change the path on VSCode? so I can import from a different folder
can't seem to find this on google...
I was able to do it with "sys.path.append()". but it causes VSCode to not recognize the module.
how can it be that this is such a rare use case. does nobody ever import from a parent folder?
I am following along in the Django for Professionals book and I am stuck at the first chapter where you create a django project and app
using pipenv and then Dockerizing it
when running docker build . i get the following error
=> ERROR [4/5] RUN pip install pipenv && pipenv install --system
I ignored that, made a docker-compose.yml file
and ran docker-compose build
and got this error
ERROR: Service 'web' failed to build : The command '/bin/sh -c pip install pipenv && pipenv install --system' returned a non-zero code: 2```
This is my Dockerfile:
FROM python:3.8
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
WORKDIR /code
COPY Pipfile Pipfile.lock /code/
RUN pip install pipenv && pipenv install --system
COPY . /code/```
This is my docker-compose.yml file:
version: '3.8'
services:
web:
build: .
command: python /code/manage.py runserver 0.0.0.0:8000
volumes:
- .:/code
ports:
- 8000:8000```
hard to tell with that error message. try running the docker image with -it and running the command within the image
or include the results of the docker build command when i tried to run the line RUN pip install pipenv && pipenv install --system
when you did docker-compose up build it output data right?
what does the logs say
returned a non-zero code: 2 is not enough information to even guess what the problem is
its over 2000 chars so that's why i didn't include it
usally only the ending part matters
it should said "error: " somewhere right before it failed
Pastebin.pl is a website where you can store code/text online for a set period of time and share to anybody on earth
weird. it looks like pip failed to install pipenv
well you can go inside the image and try running the command yourself
do docker images to get a list of the images you have
the failed images should be <none> with the latest timestamp
get the hash of that image. then run docker run -it --rm <hash> /bin/bash
that command will let you essentially exec into the image and then you can run pip install pipenv
my only guess is that you lost internet connection when you tried to build the container
oh
it says pipenv is already installed
It gave me a warning about my pip version
so i upgraded it
how do i get out of this line root@59c4cf95575e:/code#
yea. i think your internet failed you the first build
socket.timeout: The read operation timed out
so it tried to download pipenv when you first built it. but it timeout while downloading
np man. now you know some simple commands to debug docker build errors
Hello,
I want to check if my application imports particular library.
For example: i want to detect if my code contains this import statement import my_library .
how can i check that? is there any option in flake8 ?
iirc flake8 doesn't do anything close to that, but usually module checking is done with a mix of try/catching a ImportError as well as checking if the .__version__ is the version you need for your code
are noob question allowed here?
Yes, of course.
i need to create a command line tool for a simple todo list.
i don't know where to start?
It'd be best to claim a help channel and then elaborate on your task. Try to break the problem down into smaller, more concrete steps. If you can't then, someone may be able to help you break it down. See #❓|how-to-get-help
okay, thank you
django.db.utils.OperationalError: could not translate host name "db" to address: Name or service not known```
That is the error I get when running docker-compose exec web python manage.py migrate
my docker-compose.yml contains:```docker
version: '3.8'
services:
web:
build: .
command: python /code/manage.py runserver 0.0.0.0:8000
volumes:
- .:/code
ports:
- 8000:8000
depends_on:
- db
db:
image: postgres:11
This Is what I put for DATABASE in settings.py:```python
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'postgres',
'USER': 'postgres',
'PASSWORD': 'postgres',
'HOST': 'db',
'PORT': 5432
}
}
I have tried running docker-compose up -d --build and then docker-compose exec web python manage.py migrate
But that doesn't work.
Is there a way to install ffmpeg with pip? It would be cool to automatically have always the right version, whether on windows or linux.
unzip Pysbs-2020.2.2-py2.py3-none-win_amd64.whl -d
'unzip' is not recognized as an internal or external command,
operable program or batch file.
What kinds of install zip on python 3.9?
There's no existing package I know of that does this. It is possible to build such package, but I don't see the point. Pip was designed for Python packages; FFmpeg has nothing to do with Python. There are other more generic package managers that can install it. Your Linux distro probably has one (apt, pacman, etc.). macOS has Homebrew. Windows has scoop and chocolatey.
ffmpeg-python is just a wrapper around FFmpeg. It expects you to already have the FFmpeg binaries installed locally by some other means.
anyone have experience packaging (freezing) pypy apps? need a solution other than docker
What do you want to create?
basically a ready-to-run executable with my app, all python dependencies, and the pypy interpreter/runtime. support for linux and macOS is a requirement as well
There is something like py2app but I never used it before
yeah I've looked into it, couldn't get it to work with pypy :/ but if it worked that would be the solution I think