#tools-and-devops
1 messages · Page 56 of 1
i see. but I really apprecieate you and this server, it has helped me so much
well thats why we are here
So grateful that u guys are
all we need from you is that you want to learn, and also behave nicely to others 😄
well now let's do some actual work now shall we
you do that 😄 good luck 😄
Hi
'File "c:\Users\39347\Desktop\SickBot\bot.py", line 1, in <module>
import discord
ModuleNotFoundError: No module named 'discord'
PS C:\Users\39347>'
'File "c:\Users\39347\Desktop\SickBot\bot.py", line 1, in <module>
import discord
ModuleNotFoundError: No module named 'discord'
PS C:\Users\39347>'
@heavy knot You need to install the module before you use it.
@blissful sluice Hi, long time no see. Is automatically packaging your python software after each commit be a part of continuous delivery? Have you done this with Jenkins?
yes
it might be CI, depending on what you mean by "packaging" rather than CD, but those two are blurred, we just call it CI/CD generally
and yes, with Jenkins, but since then I've switched to gitlab CI; but all CI software can do this
I had a software then I packaged it using setup.py, now publishing it on the website would be kind of a delivery pipeline with Jenkins?
ah yes, if you're going to actually upload it, then yes
you might not want to do it per commit, for something like publishing your pypi package, it makes more sense to do it on merge to a branch (usually the purpose of a main/master/prod branch) or on tag (i.e. tag commit as 1.0.0 to cause a build and release of version 1.0.0)
yes, so when there are certain number of sub versioning I can make a new version.
Can this be done with Jenkins?
yes
Do you know any resource?
nothing specific to this; but take a tutorial on Jenkins pipelines; your last (and maybe only) step is probably with Twine if pushing to Pypi
those groovy scripts are killing me
yeah, totally. that's why I moved away from Jenkins
You moved to Drone CI?
gitlab
it's simpler?
waay simpler
the whole deploy to pypi is something lke this:
stages:
- build
build:
stage: build
image: <name of my pypi builder image>
variables:
PYPI_REPO: <url>
TWINE_PASSWORD: ***
TWINE_USERNAME: ***
script:
- export APP_VERSION=$CI_COMMIT_TAG
- python setup.py bdist_wheel
- python -m twine upload --repository-url $PYPI_REPO dist/*
only:
- tags
wow, okay let me c
my setup.py reads APP_VERSION for the package version so that I don't have to update it, it inherits it from the tag name
You don't need a dockerfile to do this?
actually I do, the <name of my pypi builder image> is a docker image prepared, but it's literally inheriting from python:3.8-slim-buster, and installs setuptools and twine
you can avoid a custom image by using python:3.8 image, and just stick pip install setuptools twine as another line of script
hmmm, I need to ponder over gitlab and jenkins
yep, the downside of gitlab is you would need to use their git repo
and that was the biggest hurdle for us. fortunately we identified that their git repo has so many other features that are useful to us that it made sense to switch from github/jenkins to gitlab
Jenkins is so much more famous than gitlab. That was the major reason I was learning it 😛
Seems like I messed up here
yeah, it's weird. that's why I started using Jenkins too, but I dunno, it just feels like while it's super powerful, it's been around for so long and there's been so many different changes and so many ways to write, there's a 50% chance any documentation or guide is no longer correct. Even though I've been using it for years, I still struggle daily to find documentation for the plugins, and deal with bugs and incompatibilities. I get that those who are experts at Jenkins know the ins and outs and can get around issues quickly, but in my opinion, software packages like that should not be this difficult and suck to use this much
Gitlab CI has been a complete breath of fresh air, every task I've needed to do and struggled to do on Jenkins, was a breeze to figure out in Gitlab. There's still some weird things that aren't perfect, but it's much nicer.
I'll say that Github Actions is also a valid choice, and Gitlab CI and Github Actions are both quite good. I think Gitlab CI is still better due to integrations, and has many features Github Actions doesn't have, but those who already use Github for repos and don't want to migrate to gitlab (it's a big commitment), can still successfully use Github Actions for small tasks
if your project is already on Github, and it's a simple act of packaging it for pushing to Pypi, then Github Actions would be perfect
it's already on GitHub let me try
It would be great if there was a resource for Jenkins because I was so prepared for this
but it seems like it's gonna take time
Thanks for the expert advise 😄
well...jenkins is fine, you'd either make sure twine was installed on the jenkins host/runner; or you'd just have jenkins run a docker image the same way gitlab was doing above
Idk if this is the right place to be asking questions about github but is there a script for it that would let me turn all my repositories to private?
I found one on stackoverflow but doesnt seem to work :/
how many do you have?
Is there a way to take a tab in VSC and open it in a new window?
@atomic granite Do you want to see files side by side or open it in a new instance of VSCode?
New instance
So I only know the keyboard shortcut for this, but do:
Ctrl + K
Release the keys then press:
O
@viral marlin If I do that on currently running code, do you think that it will keep running or will it stop?
I'm not sure, I think it'll open a new instance and not carry over the process to the new instance. I've never felt a need to open a new instance on running code before
Yeah that makes sense thanks. It works well.
how can I edit a single py file with pycharm as opposed to an entire project? if I open test.py which is on my desktop, I do get it open, but another main.py file seems to be created and the test.py file is put in its own folder
I just want to edit a py file individually, like how it works on IDLE
Nevermind I'll just use vs code
so my github lfs data quota is full, and most of the stuff on there i don't need anymore anyways, so how would i go about removing some of the files from lfs?
Is there any guide on setting up a good development flow? I see python repositories having things like docker, pipenv and stuff.
A guide to modern Python tooling with a focus on simplicity and minimalism.
I found this the other day @heavy knot
@sly sleet Thanks!
if i delete commits will changes made to the local repo be synced automatically to my remote repo (on github) by the client ?
github or git doesn't do anything automatically
@leaden tartan ok yes i've seen that, i'm using a client and trying to delete older commits from history which aren't related to the project
i prefer doing that through the CLI now
okay... so?
deleting commit history is consider a bit of no-no but yea, you can delete commits locally and push it back to github
assuming no protection is enabled, you should be fine
you can but its a bad idea to modify public history
because a force push will break other people's local history
are you using the same interpreter ?
wdym??
your second screenshot shows you installed the lib with the python interpreter in /Library/Frameworks/...
but are you sure your VSCode is using the same interpreter ? (you can have several installed)
hmm let me check that out
Hi, new to gitignore and I would really like to not share a client secret in a publically shared repo of mine - so I want to make sure I understood it right.
I have a file called client.json containing private information not to be shared. If I generate a .gitignore that contains the line
client.json
do I exclude it this way?
just keep in mind that .gitignore isnt retroactive
so you cant use it to ignore already added files
okay thanks
good to know it isnt retroactive, however I didnt commit so far so all good
Hello👋, I am looking for a solution to add notifications 📩 to my flask website. Can you lead me to an solution that you know is working? Thank you 🙏
what's the default ubuntu image with gitlabs CI ? I can't seem to find info on that
Anyone had issues getting the vsc linter to work
I tried to turn it on after not using it for a while
And it's not doing anything
Nevermind just installed flake8 and that ones working
Pylint didn't seem to want to work though for some reason
you have to save
it only lints on save
and they all should work but maybe you didnt have "x" linter installed (you never told us what one you were using before)
Na the issue was something else with pylint
It just straight up didn't work
Not to sure why
But flake8 is doing the job so meh
Weird
It was working at some point
Then I turned it off for a bit
So not to sure what happened
just install the flake8 plugins
They should be project installed
That way anyone who helps on your code also has the same dev dependencies and setup
no that's not how docker images work
you need to rebuild only when there is a change in the image you want to build
Im having problems with git. I have class in 5 min so I can answer questions for a while but I will put this out there. Git has been working on this project before. Just today I try to pull some code off of github and I get this error.
sers/name/Desktop/wolfy-bot/.git/refs/remotes/origin/Add-parsing-for-messages-(Ex-"say-werf"-will-callback-"werf").lock': Invalid a
rgument
From https://github.com/Icebluewolf/Wolfy-Discord-Bot
! [new branch] Add-parsing-for-messages-(Ex-"say-werf"-will-callback-"werf") -> origin/Add-parsing-for-messages-(Ex-"say-wer
f"-will-callback-"werf") (unable to update local ref)```
I fixed that and started getting
Can't Update
No tracked branch configured for branch master or the branch doesn't exist.
To make your branch track a remote branch call, for example,
git branch --set-upstream-to=origin/master master
But now I am back at the original. I have done many of the "fixes" that I found on stack overflow none of witch have worked.
Do ping me but do note it may take me a while to respond.
thats a weird branch name
BTW the branch (I didnt name it) is not a branch anymore. It was deleted via github.
Sorry, the branch is closed not deleted. Should I delete it?
if i'm sent a build dir with a library and tool in it, how can I add that to my environment?
sorry if this is the wrong channel for my question
@loud walrus Your branch name is incompatible with Windows. The lock file failed to be created because Windows' file system does not permit double quotes in file names
I don't know what a "closed" branch is
Do you mean the PR for it is closed? Cause that is not significant
If you don't need the branch then delete it
As for the second error, try running the command it suggested to set the upstream for master
Ok
Thanks!
Hi. Can anyone here help me with understanding why my seemingly identical pip installs into venvs are creating different entrypoint scripts? Full details in #help-pancakes. I was referred here
Documentation question. Is there any way to make a :term: in Python docs (reStructuredText) refer to a term but display some other text? I ran into an issue there because my language has noun cases. Even though the glossary defines the term 'текстовый файл', I need to refer to it as 'текстового файла' in the text.
Nevermind, found it in Polish docs -- I do
:term:`текстового файла <текстовый файл>`
if you ever design a language please don't put case in there
what is this and how do i remove it?
dose git checkout branch change what branch it pushes to?
and receive "project updates" from?
hello, I'm having issues with nuitka + pil package, where should I look for help?
say i am using pycharm in debug and my script throws an error. I still have access to the running program to input commands, but it will no longer run automatically without some sophisticated bypass. Is there a way to continue after an exception in pycharm?
I'm not sure if you can continue after an exception is raised, but you could set a breakpoint before that point and modify some values so it doesn't trigger
Docker hates me, I'm convinced
do share
So it perpetually is stuck starting. I've uninstalled and reinstalled it, same issue
What OS?
check the logs
Sorry, just got back from deliveries. I'll respond once I see if the fixes I attempted did any good
Ugh, yeah now it's working
Had to uninstall both Hyper-V and Docker and let Docker reinstall Hyper-V for me
So 2 or 3 restarts
Seems fine now
Still a bit of a headache, though
There's a lot of channels and it's not really clear where this question should goes so there it is; Anyone know an implementation of bittorrent protocol in python? 😮
Hi all,
in this article you can read how I implemented a telegram bot using #python and #githubactions.
I published the code in my #github repository that you can find in the article.
Feel free to contact me for any suggestions :)
https://dev.to/frascu/today-s-tee-bot-with-python-and-github-actions-13l3
ah yes #hashtags
Of course i googled.. The first is 10y old and without doc, the second got potential but is in it's first version and i already wrote to the coder. Would be better to build an app with resources more sure to stay and be maintained.
If you see an alternative to bittorrent though it could be worth it, for a better picture; https://github.com/cldtech/absistence
just a description
dd
Note sure if this question should go here or one of the elemental help channels.
Is there a key combination for VSC that let's you comment-out a block of highlighted text? I asked here before a while ago but I couldn't get it to work and now I've forgotten what it was.
ctrl + / for multiple #s
@sly sleet This is what I was looking for but it seems to do nothing for me.
Oh I was pressing the slash on my numpad instead of the one on the?. Thanks.
not sure where to fit it, does sb know about a website that allows creating "pictures" of initials? Like discord does when you create a new server
what's a good method/library to use if I wanted to run some commands on remote hosts in parallel?
Who here has tried both VSC and PyCharm?
If you have then what are some features that are in PyCharm which are not in VSC and if u do like PyCharm more than VSC May I ask why so ?
Please happen to ping me for an answer
Ik that it's personal preferance and I respect that but I want to the reason behind that preferance. So If u have used VSC as well as PyCharm I want to know from your prespective which one you prefer and why becuase I presonally have used only VSC so It's beyond my capability to compare those two.
personally i use visual studio code. you see, in pycharm, i was really annoyed that you couldn't run more than 1 python file that is in the same project. i'm sure there is a solution but im lazy. besides that pycharm is pretty nice. you have dark mode, just like in vsc. obviously the strings and all that are coloured differently. 2 more things, it's really annoying in vsc that when you define an input() you have to go in settings and then activate the setting that makes the code run in the terminal, you know, the same place where you type "pip install module_name" and personally, i don't like the terminal, and the other thing, 1 HUGE pro that vsc has is that you can have 999 files from 99 different languages in the same folder, in pycharm, if it was allLanguagesCharm, i wouldn't have been able to do that
In coclusion, each IDE has pros and cons, if you are lazy like me, stay with vsc, but if you are "ready" to fix the new project problem, i suggest you go with pycharm. @rich nymph
hmm
Thank You for the answer @heavy knot. I really appreciate it if anybody has any opinions on
VSC vs PyCharm please let me know.
how does docker handle filepaths in the code
since you make an image of the directory
what happens when you make an image and then run the container, do those references hold? or what's up
what do you mean? like how does it construct the file tree from your dockerfile? it's similar to a chroot
idk if this is the correct channel, I'm running 2 python bots on the same vps, they require different versions of the same package (discord.py), I have one python install,
is there a go-to way of handling this scenario? to be able to have different packages for different deployed scripts.
does visual studio code make use of mypy for code completion/suggestions?
Does anyone here use visual code to work with python?
Yes I do @long bridge I use vscode for Python
anyone know how docker handles paths
because im saving a file locally and refference it later
df = pd.DataFrame(query_resolution, columns=['upload_timestamp', 'terminal_number', 'was_this_a_pandemic_related_call',
'what_was_the_call', 'was_the_inquiry_resolved'])
df.to_excel('/Users/aslkdjhasd/PycharmProjects/ExpFlask/staffDashboard/output.xlsx', index=False)
return send_file('/Users/aksjdhkas/PycharmProjects/ExpFlask/staffDashboard/output.xlsx', attachment_filename="output1.xlsx", as_attachment=True)```
@sand thistle Th easiest way would be to save the file to your current working directory
Or use relative paths. That way, the paths would remain platform independent
The pause button in VSC doesn't seem to do anything for me.
Does anyone here use visual code to work with python?
@long bridge Yes.
@heavy knot You said that if the person is willing to downnload stuff they should go with PyCharm?
Why did u say that, like what was the reasoning behind that?
If you do happen to download all the stuff in pycharm what features will it have that vsc does not?
@rich nymph i didnt say you need to download anything, its just that you need to configure the interpreter or something, si you can have multiple files in a project, and if you want, you can run, not at the same time tho, ok, 1 more feature in pycharm, there is a stop button, a run button, and a rerun button, unlike vsc in which you tidiously either add a quit button to ur app, if you are making a gui, or a game or something either you press ctrl m ctrl n, for me its really annoying that i have to press those keybinds every single time i want to rerun, but pycharm just has a button for that, and a keybind
yes I also meant configure, just couldn't think of that word during that time.
hmm I presonally use the terminal so Idk buttons
of vsc
i see
#tools-and-devops message
pls happen to ping me for an answer cause I really am curious
I have question a little bit of the topic but my vs code is not opening when i click it it just loads for a bit and stops loading but nothing happens
has anyone here deployed a full stack python app via Docker? I want to deploy a flask server with postgres database, and im having trouble setting up.
i have a gitignore file, but it seem to not work as I want
i added sql.py but it isnt ignored
I just found out about outline thing of VSC it's pretty cool
Guys it's all in the screenshot, I fawked up and noted where I did. the numbers are message orders. please help me
@cloud elbow I'd do XKCD method of fixing
so copy out everything you need to keep, git reset --hard origin/main (This command is destructive) and put the files back and make sure .gitignore is properly setup
orrrr, is there an way to just reset everything to local branch?
you have bad commits in there right?
yep
you can google rewriting git commit history because it's harder then my method
did you push the large dataset to github?
ok I think I get what you are saying.
- copy to another folder what I have
-reset to remote main branch
-paste back what I have
-and commit
right?
did you push the large dataset to github?
@wooden ibex nope
yep
and obviously make sure gitignore is setup to ignore the CSV files so you don't make the mistake again
so between 3-4, insert 3.5, make sure .gitignore is properly setup to ignore the CSV file
got it thanks
https://www.atlassian.com/git/tutorials/saving-changes/gitignore <--- Good documentation on gitignore
Git ignore patterns are used to exclude certain files in your working directory from your Git history. They can be local, global, or shared with your team.
3.8
hmm
tensorflow's pypi only has wheels for mac and linux
and no source distro
let me check the unoffical wheels site
there's only 3.6 and 3.7 wheels 😦
hm
32 or 64 bit?
64
looking for some people i can learn python from
@heavy knot I got the same error on python3.9 . But it worked when I shifted back to python 3.8
Hi, on trying to deploy my django application to GCP App Engine (standard environment), the documentation told me to install Cloud SQL Proxy. But the command that they tell to run (cloud_sql_proxy.exe -instances="[YOUR_INSTANCE_CONNECTION_NAME]"=tcp:3306) gives me this error
2020/11/01 14:06:20 listen tcp 127.0.0.1:3306: bind: An attempt was made to access a socket in a way forbidden by its access permissions.
if I run only setup.py install then this is the path >>> dsm.__file__ '/usr/local/lib/python3.8/dist-packages/dsm-0.0.1-py3.8.egg/dsm/__init__.py' and if i first build and then install then this is the path ```>>> dsm.file
'/usr/local/lib/python3.8/dist-packages/dsm/init.py'
Hello, I built a state monitor using Flask! Flask State Github:https://github.com/yoobool/flask-state . Should i can get some improvement suggestions from anyone? Thanks~
hey guys, i built a package assistant using Python!!
would appreciate some suggestions or feedback!
Hi, trying VS code, i'm looking for the shortcut to switch from terminal console to editor (and vice versa)
too many shortcuts 🙂
Hi, I dont know if I'm in the right channel, please point me in the right direction if I'm out of bounds here :). I'm having troubles with pandas reading a csv file and running script on it. With Pandas I'm (1) exporting a csv of different stocks which I'm later (2) running a script on for each stock. The (2) script doesn't run unless I open up the csv in e.g. Libre, remove an empty column and then save the csv again. Then it miracously works for some reason. Anyone has an idea how I can troubleshoot this?
The charset stays the same.
Hmpf, ok, seems I solved it... Still weird though. If I pass the id as an Integer it passes through. Still weird that it works also if I re-saves the file.
Here is a first for me, git add . is not adding every file in my directory?
it's not a .gitignore problem
I guess I need to use git add all
huh, nvm, still slumped...
Hello everybody, can anyone tell me is
ASUS TUF Gaming A15 Laptop 15.6" FHD 144Hz Ryzen 7 4800H, GTX 1660Ti 6GB GDDR6 Graphics (16GB RAM/1TB HDD + 256GB NVMe SSD. Is it a future proof laptop atleast for 6-8 years for coding and web design and graphic design. N gaming for time pass (no important
git add -A
Hello everybody, can anyone tell me is
ASUS TUF Gaming A15 Laptop 15.6" FHD 144Hz Ryzen 7 4800H, GTX 1660Ti 6GB GDDR6 Graphics (16GB RAM/1TB HDD + 256GB NVMe SSD. Is it a future proof laptop atleast for 6-8 years for coding and web design and graphic design. N gaming for time pass (no important
@brisk stirrup yes
@sly sleet that didn't work for me
@vagrant crescent 👍👍👍
i have a question :
why does this code shows error?
init doest exist
the code works fine
hapanned a few times
have you saved your file at all after you installed it
@shell remnant I've found the default pylint to be not great with import errors. I usually switch the flake8 and it behaves much more reliably
have you saved your file at all after you installed it
@sly sleet how do u do that? i used cmd window and typed pip install pygame
what ide you use? @shell remnant
he uses vsc
Anyone know why this error occurs in VSC?
load user information using flask
mysql
and docker
i was told that i first need to load the csv into an instance folder
after which i could write a query to load from that instance folder
i guess i need to use a .env variable to change the filepath in the mysql ?query
Although I've been using PyCharm for years now, I'm actively looking for some new (i.e. unused by me) features in it which might enhance my workflow.
sharing one here, live templates seems fancy.
I guess this would go here? I'm writing a sneaker bot (code in picture) and im trying to add the shoe in question in the cart but it wont add it and if it does it doesnt work in the cart, also the checkout seems to not work
any ideas?
@onyx kindle We can't help with that on this server since that breaks ToS
can someone help me add postgresql to the path on Mac
Do you know how to set environment variables from a .env file with an ansible task?
hello
i'm trying to use .env variables in a docker-compose file for a postgres db, but when I run docker-compose build I get:
variables are set, and the .env file location is specified
you need to set the variables instead of just ${DB_USER}
what do most people here use for packaging
Packaging in what way?
help i am having an issue with mysql server
i tried to restart it and now it's not able to restart
mysql.service: Control process exited, code=exited status=1
mysql.service: Failed with result 'exit-code'.
Failed to start MySQL Community Server.
mysql.service: Service hold-off time over, scheduling restart.
mysql.service: Scheduled restart job, restart counter is at 5.
Stopped MySQL Community Server.
mysql.service: Start request repeated too quickly.
mysql.service: Failed with result 'exit-code'.
Failed to start MySQL Community Server.```
so i googled
and foudn this useful post
which suggested i do ```Check the permission of mysql data dir using below command. The ownership should be mysql:mysql and the directory permission should be 700
ls -ld /var/lib/mysql/```
when i run that command
this is the output
drwx------ 7 mysql mysql 4096 Nov 5 02:15 /var/lib/mysql/
i dont know how to interpret that value
this checks out mysql:mysql but this does not 700
anyone ?
@sand thistle https://chmodcommand.com/chmod-700/
Hey could someone help me add postgresql to path
PyCharm has feature to convert http api tests from curl to pycharm. Is there a way to do it the other way around?
Which is better in performance
zip(itertools.count,iter) or enumerate
a
Hey guys, is this the right channel for AWS questions?
close enough
Alrighty. So I was given credential as an IAM user to another user's console(? not sure about the terminology here).
And I was wondering how should I best manage my credentials.
Since I have aws user credential for my own accounts too.
i'd recommend a password manager, e.g. lastpass
the ~/.aws/ files support multiple entries, but I haven't tried adding multiple account-id/alias entries in it 😔
Hi,
I'm using docker image based on python:3.6-slim, where I build my project and ship it with a virtual environment (including python binaries). Now when I run the binaries from within the container it shows Python version 3.6.12 but after unpacking the project the version is the one of the target system. I read the version number by just running the binary. Which will show something like this Python 3.6.9 (default, Oct 8 2020, 12:12:24)
however, I use the same binaries (from the build artifact) everywhere
Does anyone know how that magic works?
And no they're not sym-links
I really expected to see 3.6.12 everywhere
Does anyone know why Allure is marking my Jenkins build as unstable even though there are no test failures? Trying to work out what's going on so i'm just running a test stub that asserts true and a few tests that are "deselected" (i'm using marks to select what tests are run), but the build still comes out the other end being marked as unstable (looking at the console output Allure is making is unstable)
Ok, found the problem.. I wasn't clearing out the previous results which meant that the old ones were being picked up. I'm now clearing up the work dir before starting build steps and this has resolved my issue 😄 just in case someone else is having a hard time with this..... 😄
Anyone familiar here with the indentation of yaml? I cant seem to get it right, with the errors i get from 'here' to 'here' its a script for Ansible. Someone in the mood to take a look?
@heavy knot So, you build in a container, but you don't ship the container itself? What do you actually ship when you say "with a virtual environment"?
I expect that if you ran "which python" where you're seeing the wrong python (likely the system default python is what you're seeing).
Don't know quite what to tell you next till some of that detail is explained.
@fast cargo Not cleaning up the work dir has bit me in the butt before. Glad you figured it outl.
@heavy knot There's probably an auto-formatter online that will help you. For instance http://www.yamllint.com/ I think will show you what's wrong and should give you a cleaner output back.
Validate and Verify your YAML documents, optimized for Ruby on Rails
@heavy knot i opened a new folder and opened a file with .py
ok
send the ss
what the heck ffs it's not like any ide
the file should be .py
not .pyproj
it didn't work that way
3.9.0
does it show?
yes
ok
with a blue line
so ur new to it?
not new to python technically i used pycharm
i mean u didnt install anything in it?
hmmmm
there is a list of extensions
the first one should be it
its downloaded
does it show linting, debugging etc.?
Use pycharm its easiest for beginners @alpine aspen
@vagrant crescent i used it a lot
it was minimalist and really performative
it is minimalist?
Minimalist for what?
but i crossed vsc since it's common n so
it's just simple u type ur code it works every time
Why it minimalist?
no caprisé like vsc
does it crash on an infinite loop?
it does your job with simple interface and usually no trouble
you can stop your code anytime so no
does it crash on an infinite loop?
@heavy knot
oh ok
Are you using python plugin in vscode?
i do
Show me
Hmm, have you try terminal to type
type what
dotnet run yes i did
if you're sayin' anything else idk
no solution huh
Create new file and name it .py
"fall.pyproj"?
fall is the name tho
and there is a pop-up that tells me to install linter pylint
idk what's that but when i do clicck install after 45 secs it gave an error too
What is .pyproj?
Your file name is pyproj
Idk try pycharm or try google
pycharm is cool
Yeah i use it
but i don't get why vsc is troublesome,
i used vsc for c#
of course there was issues too
but somehow it's workin' at least
it's good if u have a happy relationship with the bench
but i still don't get why people love this
Idk pycharm is better for python its my option
vsc is better than pycharm imo
much easier to use and less bloat
as long as you know that python files end in .py
And that the run button is in the upper right corner
Has anyone used an EC2 dedicated host vs non dedicated in AWS?
Wondering how they both differ from preformances
ABstraCti¤n{B¤x =>(bindObservable = n2sFiles{network, security, storage}) Unb¤x =>(bindObservable = i2rData{reliability, integrity, redundancy})}
@heavy knot There's probably an auto-formatter online that will help you. For instance http://www.yamllint.com/ I think will show you what's wrong and should give you a cleaner output back.
@tranquil creek Thanks thebouv for your advise .
Validate and Verify your YAML documents, optimized for Ruby on Rails
has anyone here worked with PRAW?
I am a bit confused about how to use an authorized reddit instance
so for example created an authorized reddit instance in order for it to access some reddit contents or comment in a specific subreddit (defined with <reddit.subreddit>) . Is there any way to make the bot acct join a community? What I meant is to invite it as the subreddit admin not some exploits.
The read-only instance does not have this type of problem which i think makes sense.
lemme explain (read the comments in the code block otherwise you won't know what I'm saying ) :
# reddit1 defined as a read-only reddit instance
subreddit = reddit.subreddit('redditdev')
print(subreddit.display_name) #Output: 'redditdev'
# and now reddit2 is defined as an authorized reddit instance
#trying to access a subreddit right here.
subreddit = reddit.subreddit('redditdev')
print(subreddit.display_name)
# when trying to access an attribute from that subreddit throws an auth error
does anyone know what I need to do to make contents of a subreddit accessible to an authorized reddit instance?
this is the category that best fits my topic imo, sorry if im asking at the wrong channel
ok so i am jus starting to learn docker and i created a Dockerfile
FROM nginx:latest
ADD . /usr/share/nginx/html #i have tried using COPY also
I have both the file in same folder
and a normal .html to serve to nginx image but i cant get past the default page
what i've done:
docker build -t test:latest .
to build the image and then run it on port 8080 using
docker run --name example -d -p 8080:80 test:latest
ping me if anyone replies
what is the actual problem @storm phoenix
you said what you're done but not what's happening
My static file is not being served
I get the default nginx welcome page only
@tacit garden
😦
Morning
Hey, I am trying to make an tool about Snapchat really. And I found this on GitHub https://github.com/niothiel/snapchat-python which looked kinda nice and helpful. Although when I run my softwares it says "no module named Snapchat". Even in the example.py software it says "No module named Snapchat". I have ofc tried "pip install Snapchat" and installed it. Although it's not working. And yes I have installed everything that the developer want me to install, someone help? 
You import it?
Yep, I have imported it
@storm phoenix try docker run --name example -d -p 8080:80 test:latest /bin/sh and cd'ing to the dir
do you see anything?
yes i executed the shell and there were my files their
changing my html file name to index.html worked for some reason
if you know why that worked do tell
@storm phoenix because nginx, apache, and other web servers need to be told what the directory index file is going to be or it assumes index.html
You probably could have explicitly called your whatever.html file but it isn't just going to serve it up by default, it wouldn't know to do that. Once you renamed it, it was like "here you go"
@heavy knot Do you have python installed?
Because to be sure you don't have pip you can try python -m pip install blahblahwhatever to see if pip can at least run as a module and is installed like that. Might just be that the pip command itself is available but maybe not in your PATH
Ah so my home page would have to be named index.HTML for it to work right @tranquil creek ?
@storm phoenix well, it does work right, you just didn't know
And your index can be whatever you want. For instance if you built a Flask app and dockerize it, you wouldn't be setting the system up to load index.html
It's going to vary on what you're doing. But if all you want to do is serve up that index.html file, you're good.
@heavy knot glad it worked
im using VSCode, anyone knows how to change the debug settings
i switched from powershell to git bash terminal
and when i debug the file it doesnt recognize the command anymore
did you figure it out @dense forum ?
not yet
any good learning resources/ideas on how to handle a development server or how that part of programming even works
doing a flask app
alright i have learned that i should probably create a separate instance for each stage
and i might need to have different branches on my git tree
and connect them to docker as needed
should i rebase
@storm phoenix well, it does work right, you just didn't know
And your index can be whatever you want. For instance if you built a Flask app and dockerize it, you wouldn't be setting the system up to load index.html
It's going to vary on what you're doing. But if all you want to do is serve up that index.html file, you're good.
Ah okay got it thanx for the help
what do you mean @sand thistle ?
One typical flow is to dev locally till stable, then deploy to a dev server. Once dev is complete, you can deploy to production.
Or develop locally and test in a docker container, then deploy the docker container to one or more places.
I suggest you look up gitflow and github flow to learn about branching strategies. There is also trunk based development.
You can also look into some simple ci/cd tools so that on check in of branches you can have builds created automatically.
It really all just depends on what you want to do.
But in each instance you'd need to create a separate server, which in my case would need its own docker container
So the idea is to copy the full stack on each server? Including the db?
And the docker container
There are LOT of intricacies to this I hope you understand, but yes, typically you'd also want a dev db and prod db, separate. And each container knows which one to talk to on deployment due to the environmental variables you have set up on each server.
So when your container is on dev server, or your local machine, you've set up a config in env that says which db connection info to use. Deploy to prod, it knows which db there too.
Again, this is a super shallow explanation and a lot of things will depend on .. well .. a lot of things. 🙂
your dev server and local dev for instance can even ship around a db in a container, but for production I (and many others) suggest not containerizing your prod db itself.
That's the beauty of docker based workflow is that you can ship your app anywhere and expect it to work (provided you give it all the info it needs like which db to connect to obviously). None of this "works locally, but not on the server" stuff.
Hello. I'm running pipenv so I have a virtual environment. When you run pipenv shell to create the virtual environment, it creates you a file called "Pipfile". Should I .gitignore it? because I haven't seen that file in any repository or something. Also, is it possible to change the name of it? At least the capitalization (same name but in all-mayus for e.g.)
me and my friend are trying to convert a python file to exe,tried using pyinstaller,autopytoexe,nuitka but the application crashes and yes i am using external libraries.
@heavy knot watch this https://www.youtube.com/watch?v=UZX5kH72Yx4 may help 🤷
@chilly flame tried it but its crashing after packing it
its showing failed to execute the script bro
I found that video but I don't really know what that's happening to you. Hope you find the solution
@chilly flame Pipfile (and a lock file version of I believe) are created by pipenv and yes you should keep it in your repo. Part of your installation instructions for your repo should be to use pipenv as well.
This is similar to package.json and package-lock.json
from npm
Alright. Thank you!
Hi ! I'm new to python discord (and more generally to discord), hopefully here is the right place to ask...
I'm starting to use spyder as development environment, and I couldn't find out how to have several independent projects.
I mean: is it possible to have a number of files that are parts of a given project, and then close all these files and open another project with its set of files?
Hi ! I'm new to python discord (and more generally to discord), hopefully here is the right place to ask...
@heavy knot Are you referring to opening up multiple instances of spyder?
@quasi mesa No, I want to be able to work on a given project, then close all the associated files and open another project - no need to have both running simultaneously.
It should be possible yes, just open up the project that you want to start working on
it should import all the files and what not
But how is a "project" defined?
@heavy knot Never worked with spyder, but this should help
https://docs.spyder-ide.org/current/projects.html
I can only find how to open a single .py file...
wait what
@heavy knot Never worked with spyder, but this should help
https://docs.spyder-ide.org/current/projects.html
@quasi mesa OK thanks, I will have a look (it may well be what I was looking for...)
open up sypder
in the file tab
there should be an option to open up a project
it should be open
Oh, now I see, there's even a "Projects" menu in the menu bar... I should have looked better before asking!
thanks for the link anyway, I will have a look 🙂
How does Github branch protection name pattern matching work?
We've tried everything we can think of to match multiple branches without luck
Having troubles with Python Pyglet. Can anyone help me? If not, where should I go for help?
Hello, I've a question concerning mypy. I've a A class provided by an external librairy, from which I inherit in my B class. A has an attribute foo which I would like to extend in my B class, but conserving compatibily with all A method, that's why I inherit from the type of the foo however I get an error from mypy:
Incompatible types in assignment (expression has type "List[D]", base class "A" defined the type as "List[C]")
MRE:
class A:
foo: List[C]
class B(A):
foo: List[D]
with D definition:
class D(C):
#...
Any idea how to get around this?
@twin hull List is invariant in this case, List[D] is not necessarily a subtype of List[C]
Sequence on the other hand, is covariant as it's immutable, making Sequence[D] a subtype of Sequence[C]
You can read more about it here:
https://mypy.readthedocs.io/en/latest/common_issues.html#variance
Thanks, but is Sequence[D] a subtype of List[C]? I can't change the C one since it's from an external package
Sequence is a supertype of List, you'd probably want to convert it to the latter first
Although I think it'd be weird for an external package to not accept any sequence type and then just converting it to a list internally if needed
@rich nymph for me, since I don't need vsc's ability to use multiple langs, pycharm is much more focused on python dev so I like it more
multiple langs?
and "pycharm is much more focused on python dev so I like it more" this isn't really that explanatory, like at least give me the features that it has which makes want to make u choose it over vsc
vsc has pretty much all the features pycharm has, just not out of the box
since they're very similar, I like pycharm more
ye, u just have to acutaly put in the work to get those features running
PyCharm's debugger is awesome
any way for me to do a
input()
is vsc WITHOUT IT TELLING ME TO OPEN THAT STUPID TERMINAL, because i don't like the terminal?
so like do a input() in the output tab in visual studio code
Hello, would someone be willing to help me out with running django + postgresql in docker. I am getting an issue when connecting to the database.
sure, what errors do you get?
This is part of it
And I can confirm it is running locally and accepting connections on there because of this.
ahh okay, what is the database URI that you are using?
all good!
in the settings.py of your django app, what do you have set for the DATABASES variable?
DATABASES = {
"default": {
"ENGINE": 'django.db.backends.postgresql',
"NAME": os.environ['SQL_DATABASE'],
"USER": os.environ['SQL_USER'],
"PASSWORD": os.environ['SQL_PASSWORD'],
"PORT": 5432,
}
}
ahh okay
so you need a HOST key in the default dictionary
it can be an environment variable as well
should be 127.0.0.1
the default is /var/run/postgresql i believe
Yeah, just re reading it. I read that totally wrong.
Lets see, rebuilding.
So question, how come if I build the db detached and then run the server locally like pipenv run start or something it connects with no issues?
@blazing condor That did not seem to work. Should it be 0.0.0.0 or 127.0.0.1 for host?
So question, how come if I build the db detached and then run the server locally like
pipenv run startor something it connects with no issues?
that's quite odd, unless you have postgres running on your system as well
what OS are you using?
Actually just confirmed yeah. If I turn the docker container with my db off it cannot run. If I turn it on it works. (running it detached that is with -d)
Windows 10
are you using WSL or just windows itself?
Windows itself
if just windows, odd things with docker and windows 10 then i guess
Ok, so how would I go about using sockets to ensure that the database is ready before I attempt to run migrations and running the server? I tried using the same code that we have for pydis but it did not seem to work.
could i see your code?
Of course
import socket
import time
import sys
from django.core.management.base import BaseCommand
from django.core.management import call_command
class Command(BaseCommand):
help = 'An alternative to runserver which will run migrate and collectstatic beforehand'
def handle(self, *args, **options):
# Attempt to connect to the database socket
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
attempts_left = 10
while attempts_left:
try:
# Ignore 'incomplete startup packet'
s.connect(('127.0.0.1', 5432))
s.shutdown(socket.SHUT_RDWR)
print("Database is ready.")
call_command("migrate")
call_command("collectstatic", interactive=False, clear=True)
call_command("runserver")
break
except socket.error:
attempts_left -= 1
print("Not ready yet, retrying.")
time.sleep(0.5)
else:
print("Database could not be found, exiting.")
sys.exit(1)
# Run web server through custom manager
ENTRYPOINT ["python", "manage.py"]
CMD ["start"]
This is how I am calling it in my docker
hmm alright, do you get any errors? or any output at all?
Well the except is catching it
ahh, so it just says Not ready yet, retrying. 10 times?
ohh okay, so when you run via docker-compose, it's a bit different
the host will need to be the name of your postgres container
which happens to be postgres
ok
So just change the host on databases
But the socket thing would still fail no?
you'll want to use the environment variable for the host and port there as well
so you don't need to change the values in two places
Yeah, not sure why I did not put those in the environment variables tbh.
i can understand the frustration you probably have right now 😄
Good evening
Yeah, I do not quit though which I guess is good. I have been at it since yesterday but had worse errors.
I am trying to implement continuous integration so this is why I am going with docker.
ahh yes, i remember all the initial headaches i had with all of that.. not fun at first i must admit
nowadays, i really can't create a project without docker or CI
it's really great
Do not get me wrong. I am loving docker so far. Just the database connection to the application through docker is really messing me up.
My initial struggle was getting the psycopg2 dependencies installed. Lots of trial an error.
I looked up how to do that a couple days ago
well the docker is running debian
Docker script isn't platform specific I imagine
ahh okay, that'll be much easier
docker volumes between windows and unix are quite different actually
are you using the postgres image, Snowball?
I am
version: '3.7'
services:
dms:
# image: /dms:latest
build:
context: .
dockerfile: dms.Dockerfile
container_name: dms
restart: always
ports:
- 8000:8000
env_file:
- .env
db:
image: postgres:12.0-alpine
restart: always
container_name: postgres
ports:
- 5432:5432
environment:
- POSTGRES_USER=dms
- POSTGRES_PASSWORD=admin123
- POSTGRES_DB=dms-db
volumes:
- postgres_data:/var/lib/postgresql/data/
volumes:
postgres_data:
That is my compose
it should be fairly straightforward then
@blazing condor It was, I just was not sure what the dependencies were...
a simple apt install fixed it. Just did not know what to install.
What is the difference?
alpine images are specifically for use within containers, but the big downside is there are typically compatibility issues that are difficult to debug
So just remove the alpine from it?
Oh ok, maybe if I had the other image it would of had the dependencies I needed pre installed lol
lol, maybe
that's also another disadvantage
alpine doesn't have some common dependencies pre-installed
welp, I will just leave it for now maybe
Now just need to figure out why the server is not running. Docker build worked.
any errors?
Before I forget to ask. How did you know that my host was set to postgres? Is it just the name of the container?
any errors?
@blazing condor None
yep, it's the name of the container
... wow
oh wait a minute
Should have guessed that
i've been mistaken lol
it should be db, according to your docker-compose file #tools-and-devops message
sorry, i usually use postgres instead, and i assumed you did the same
so what does container_name even do in there?
it's just the display name
Oooooh, I thought that would actually change the name of it.
the network that docker-compose creates for your stack will use db and dms for the host names of your containers
Ok
i would recommend to add this under dms in your docker-compose.yml
depends_on:
- db
that'll make sure your db starts before django
it does not however make sure that the db is fully initialized and ready to accept connections
Alright, because I think I am doing something wrong with that socket thing I have.
Lets see, rebuilding now.
Yeah...
Well, I think I know what I did wrong there. For some reason I thought it would be smart to put the call commands inside of the try except. If I get another error now I will show you
okay, i think it's good now. the database system is starting up is probably from the socket connect calls, which is fine
No errors, containers are running. But the server was not started
oh, it wasn't?
Nope
Also there were 7 of those but the script should only attempt 5 connections
1 every .5 sec
Nvm it attempts 10 connections
interesting
I think it might be with how I am calling the commands in that start command. Idk really.
Sometimes I feel worse when I am not getting errors....
can you delete the postgres_data folder?
and then restart your stack
might be because postgres did not shut down properly before
Oh yeah, so that is a total mystery to me. Volumes... read the docs and did not quite get it. Where will those be located?
should be in the same directory as your docker-compose.yml
I do not see it.
you'll probably did need administrator privileges to delete it
might be hidden on windows? not entirely sure
on linux, you do need to use sudo
Let me do some digging I guess
[
{
"CreatedAt": "2020-11-09T21:21:02Z",
"Driver": "local",
"Labels": {
"com.docker.compose.project": "divisionmanagementsystem",
"com.docker.compose.version": "1.27.4",
"com.docker.compose.volume": "postgres_data"
},
"Mountpoint": "/var/lib/docker/volumes/divisionmanagementsystem_postgres_data/_data",
"Name": "divisionmanagementsystem_postgres_data",
"Options": null,
"Scope": "local"
}
]
Found the information is. Now have to figure out how that maps on windows
could you do docker volume ls ?
and find the one that is named dms_postgres_data
or something like that
Alright
So I can see the volume exists but it says the mountpoint is in "/var/lib/docker/volumes/divisionmanagementsystem_postgres_data/_data"
Not sure what that corresponds to in windows though.
okay great, you should be able to do docker volume rm divisionmanagementsystem_postgres_data
Alright, all done. Now lets rebuild
Alright no errors. Still same issue though
Do you know the command to run the shell for the docker instance? So I can manually try to runserver
The project?
yeah
Not really, why?
ahh okay, i was just seeing if i could look at the files to try and see if i could spot any issues
@blazing condor Oh you can, I do not mind. I just don't have this stuff pushed to github
The project is public atm.
There are no trade secrets lol
Figured out the issue tho I THINK
hahahahah
I am just spit balling at this point lol
the ports you specified allows port 8000 from the container to be accessed at port 8000 on your host
lol
i really want to blame windows for this issue, but i don't really have any solid evidence to do so lol
it should work as far as i can tell
I think it is worse lol
hahahah
now you don't know what's wrong
@blazing condor Yeah... lol
Oh man
Well, I am just going to commit this like this for now so I can continue at home.
Let me commit and I can send you the git stuff
if you want
Of course now git wants to act up
what's the issue?
Hey all, has anyone here used WSL-2 for development? I'm thinking of trying it out after recently switching to windows as a dev environment (sorry if wrong channel)
i would very much recommend WSL2 if you have to use windows for development
as opposed to running everything from a vm?
what's the issue?
@blazing condor Honestly idk. PyCharm threw 4 errors then just did the push...
I like using virtualbox as a server practically on my windows box
@blazing condor https://github.com/mredwin1/DivisionManagementSystem
if you'd rather use a vm, that's fine as well
Feel free to critique all of it lol.
lol alright, i'll have a look after dinner
Cool thanks
@blazing condor I am a bit confused. I removed all the call commands so I could just run them manually but it seems that the start script is running again and again.
Any clues?
hmm
so maybe the django app could be crashing?
and then docker will infinitely try to restart the container since you have it set to restart: always
either that, or your start command is somehow calling itself
Yes it is crashing
Not sure what is causing it though
@blazing condor This is the error RuntimeError: Can not reuse socket after connection was closed.
requests.exceptions.HTTPError: 409 Client Error: Conflict for url: http+docker://localnpipe/v1.40/containers/7dab9b559eb63658a21e45fc83cf81d75147b1000789292e696c2dc721def6d7/attach?logs=0&stdout=1&stderr=1&stream=1 This one happened first actually
Lol
Welp, I feel like I am so close yet so far.
This reminds me of the first time I deployed a Django app.
That was a nightmare
hahahahah
So did you clone the repo?
yeah i did
Ok, try something
Run the database by itself using -d and run the server using pipenv run start
yeah, it works perfectly fine
i did that earlier and was like huh, okay
So it has to do something with the docker set up right?
that would be logical, but who knows lol
i've never had issues like these though, which is quite interesting
I have removed the -alpine from postgres, maybe it is a dependency issue?
🤞
And nope.
i also tried that already
yeaah, not very fruitful results
You are using windows as well? OR linux?
linux
So it is not os specific
i dual boot with windows, but i haven't used it in ages 😄
it doesn't seem like it, nope
Ah nice. I am not really sure what else to test...
Maybe removing all the images from the container except for dms?
i'm not really sure
i'll try again tomorrow since i have a bit of work i need to finish up tonight
Alright, just fyi that does not help. Thanks for trying
May you have better results with your work lol
hahah, thank you
Hi is the right channel for discussions related to selenium ?
from tab crashed
(Session info: headless chrome=86.0.4240.193)```
I am actually having this error while running a python program but i dont know where to start looking for issues
Anyone using pip-tools (pip-compile and pip-sync)?
My problem is pip-sync in a venv seems to try to uninstall globally installed packages
pip-sync [.venv]
Found existing installation: anki 2.1.26
Uninstalling anki-2.1.26:
ERROR: Exception:
My pip list:
python -m pip list
Package Version
click 7.1.2
pip 20.2.4
pip-tools 5.3.1
setuptools 49.2.1
six 1.15.0
How do u change the theme in vsc using settings.json?
Hey guys! Is there anyone who is familliar with Microsoft Edge (Chromium)'s CLI switches?
so should my test serv hooked up to the internet? like should it have a url
Do you need it to be accessible from outside of your LAN?
(you can get a local URL pointing at it)
im not sure
i basically develop locally on my computer
then push changes to git, which is connected to docker so an image gets built
then i pull that image to my server and run it there.
dont i need to test the docker interaction as well?
@finite fulcrum
it's a webapp
i took a snapshot of my droplet, and was going to make that my testing/staging platform, and i think i need to get an actual url to work with. Because I want to make sure everything is working from start to finish
i guess yeah, if im serious about testing I should have a manual tester check it out and to do that I'd need a url
I'm not very familiar with the devops, but that sounds like it should just ran be locally for everyone until deployment
so we are really decentralized
like its me on my laptop
hmm ok
idk ill think about it
I would feel comfortable testing to make sure that the docker container is deployed properly
sometimes I've had issues with env files not pointing correctly through the container
morning
6a6, why are you asking about Edge switches?
how do i deal with access denied while connecting sql and pycharm even tho i have entered the correct username and password
@wooden ibex I asked it in order to use the proper parameter in chromium-based browsers to open a new tab in the existing window
Like If your Edge's window is open -and also it's your default browser- and you click on to the discord link, it'll open a new tab in the existing window
I want to do that too lol
There is a --new-window parameter, but it opens a new window as expected lol
By the way, is there a way to insert an inline code block
Ah thanks @sly sleet !
hey could somebody help me. So every time I open vsc and try to code something in python I get this.
and when I try to install it
This is what I get
it just does the same thing every 10 seconds of me trying to actually code something
could somebody tell me how I can fix this?
hmmmm
How do i force a pullrequest with github actions?
I'm trying to automerge down our pipeline where it stops if it gets a merge conflict, and creates a PR for the developer to review.
This is what i have, but it stops at the Rc to develop Pr creations saying the head is even
https://paste.pythondiscord.com/ceyihuwika.sql
Can someone help me to make a code that pauses a spotify song with the voice? PLEASE 😦
Hey! What do you want to build?
@heavy knot Are you going to control it from the Spotify API or from desktop app?
@heavy knot Are you going to control it from the Spotify API or from desktop app?
@spice flicker Yes, the code make all
I guess it can't make all in the same time?
It'll be confusing, won't be?
Look I found an idea
@heavy knot For windows, if you press FN+F7 (on laptops it'll maybe differ) the audio stops regarding your current window or audio source
And you can write a basic script where when you say "Stop", it'll press to that button
I know it's not an elegant solution but else it'll be a bit complicated, but why not!
Do you speak spanish?
xd
Ah so you're experiencing some linguistic issues, aren't you lol
Para Windows, si presionas FN+F7 (en las computadoras portátiles puede ser diferente) el audio se detiene con respecto a tu ventana o fuente de audio actual
Y puedes escribir un guión básico en el que cuando digas "Detente", presionará ese botón
Sé que no es una solución elegante, pero si no, será un poco complicado, ¡pero por qué no!
@heavy knot
Can sb explain me why GPL is considered a restrictive licence? I thought the (basically) only restriction on GPL is that it has to stay open source and used it in the past for my personal github projects
@frozen anchor I believe the language is referring to the fact that GPL forces specific behaviors and licensing of your code (some reference GPL as a virus, as it forces dependent code to follow its license in some cases). You can't pull in a GPL library directly into your code and license your code as MIT. You can pull in a MIT license and GPL license your code. For a personal project, this is mostly irrelevant. Some folks get around this with shim's to isolate the GPL code out, which introduces specific architectures to protect your codebase from GPL.
can anyone help me deploy my bot to digital ocean ? i am using putty right now and i logged into my sever so what do i do next ping me pls
@heavy knot well, you should follow this first to configure the VPS if you don't know what you're doing (im assuming you're using the ubuntu 20.04 image) https://www.digitalocean.com/community/tutorials/initial-server-setup-with-ubuntu-20-04
as far as deploying the bot, that entirely depends on how you intend to deploy it. if you have put the bot into a docker container, then you just need to download docker -> pull your container from your docker hub repo -> create the container and then start it in the background.
another way to deploy the bot is to create a service that runs in the background at all times.
if you don't have any idea about how you want to deploy your bot, then i would suggest learning how to containerize your bot with docker because once you know how it works, it's really easy to get things up and running instead of managing service files
thank you
can someone help
from pyautogui import *
import pyautogui
import time
import keyboard
import random
import win32api, win32con
def click(x,y):
win32api.SetCursorPos((x,y))
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN,0,0)
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP,0,0)
time.sleep(2)
pyautogui.displayMousePosition(x, y)
time.sleep(2)```
exexcuted this code in sublime then it crashed the app
hello. I'm trying to start using types definitions in my code. I use vscode so I started by installing mypy extensions. I don't see it warning me about missing types definitions. These are my settings
"python.linting.enabled": true,
"python.linting.mypyEnabled": true,
"python.linting.mypyCategorySeverity.error": "Hint",
"python.linting.mypyArgs": [
"--strict",
"--python-executable ${workspaceFolder}"
]
}```
a code like this doesn't trigger any warn
```def list_objects(bucket, prefix):
o_list = s3_client.list_objects_v2(Bucket=bucket, Prefix=prefix)['Contents']
return o_list```
any idea what could I be missing?
Hey could somebody help me change the fonts in VSC
cause I can't seem to do it
i changed it workspace but nothing happened
Did you install that font?
What os are you on
mac
Your Mac comes with many built-in fonts, and you can download and install more from Apple and other sources. If you don't want a font to appear in your apps, you can disable or remove it.
https://github.com/tonsky/FiraCode this is the repo you would want to install from
Might have to add quotes around the font name as well
k
They provide a zip file which you're supposed to download
Is there a way to search for a specific name in vsc, across your entire workspace
yes across the entire folder
The search page (CTRL+SHIFT+F) does that unless I'm misunderstanding
thx
Is there a VSCode plugin that will show me a "flattened" view of a class' inherited structure? For example, if I have the structure
class Parent:
def my_parent_func(self):
print("my_parent_func")
class Child(Parent):
def my_child_func(self):
print("my_child_func")
I want to see this view of Child
class Child:
def my_parent_func(self):
print("my_parent_func")
def my_child_func(self):
print("my_child_func")
Optionallly, it would be nice for there to be some indication that the my_parent_func fuction came from Parent speficaly, to help with complex inheritance structures
Hi
hi, i’m not sure to post this so i hope here is ok, i’ve been trying to convert a .py file into a .exe file using pyinstaller but it comes up with an error when i try to run the .exe file saying “ModuleNotFound error”. i used pyautogui and time modules so i’m guessing it’s the pyautogui module that’s causing the problem. what can i do to fix this?
Hi, just spent 3 days on my first Python course and I am using PyCharm. I'm trying to load sms4 from pypi to send text messages, but I am getting an error. Can anyone help? The error is as follows: ImportError: cannot import name 'send' from partially initialized module 'sms4' (most likely due to a circular import) (C:\Users\William Miller\AppData\Local\Programs\Python\Python39\lib\site-packages\sms4__init__.py)
I figured it out, thanks
Not sure if this is the right channel so sorry in advance if it isnt, but im just wondering if there is a way to change the top text of a cmd window when running a python script? like can i customize what it says?
@ruby nebula
omg wtf ur smart af thanks man
whats the name of that website that you can dump you program too then share the link?
please ping me @rigid sorrel
!paste
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.
@rigid sorrel
thanks soo much big help
Is this the right place to talk about pytest?
REPOSITORY TAG IMAGE ID CREATED SIZE
<none> <none> edabf6488d1f 41 minutes ago 131MB
<none> <none> 6819de49684e 49 minutes ago 496MB
youtubereactapp latest 6077818703c5 54 minutes ago 1.25GB
node latest f1974cfde44f 2 days ago 935MB
docker/getting-started latest 67a3629d4d71 11 days ago 27.2MB
ubuntu 16.04 dfeff22e96ae 3 weeks ago 131MB
ubuntu latest d70eaf7277ea 3 weeks ago 72.9MB
PS C:\Users\starcat>
the lastest two images were built with
docker build . -t (imagename)
however they're not titled
any idea why?
can someone help me find out why my socket io is still attempting to run
even though I commented out all instances of it
With Triage permissions in github a repository would members be able to merge their own PRs?
We want to allow them to create forks, but not directly merge PRs (private repository)
so i have made a django project on pipenv environment pycharm, now i need to open a python terminal such that i can do django code with the same setup as the project
i found this video like that : https://youtu.be/aHC3uTkT9r8?list=PL-osiE80TeTtoQCKZ03TU5fNfx2UY6U4p , but i am not able to do ti
In this Python Django Tutorial, we will be creating database tables for our application using Django models. We will also see how we can use the Django ORM to query the database and filter through results. Let's get started...
The code for this series can be found at:
https:/...
i suppose am in the correct channel 
Hello people. Question about how to setup git in ec2.
The ec2 server will be shared by multiple people, I was wondering what are some ways to setup git accounts.
Would I just have my own rsa key and other dev will also have their own rsa key? What about in git config?
is there anyone here who is making a software application of any sort they plan on/ are distributing? i am making a 'dashboard - in particular, a quasi-SaaS means of distrubuting softwares i.e. subscription based' as a school proj and need to product shit ton of documentation, and interviewing a prospective client would b v useful, so if I can ask you a few questions, please dm me expeditiously! ❤️
#tools-and-devops can you help me at #help-cheese ? trying to run ocropy as a docker container however i'm getting some unexpected errors. thank you.
Hey @minor goblet I could help with that. I speak a little 🐋 .
What docker image did you build from?
It seems to me you're passing the -it args to the command - so you get an interactive shell session, and that seems to be working.
I have supplied a good amount of information in my post already. Since the image is not written well enough I am thinking I should install manually and amend the image as needed
https://hatebin.com/tujkyyestt
here is the image
Okay, yeah, sorry I missed the link in your post. Content of setup.py ?
researching. I'll circle back.
@minor goblet python-lxml is the python2.7 version, and python3-lxml is the python3 version. Which did you want? I'm betting that python-lxml might even be defunct now that 2.7 is EOL.
so if you want the python3 version, change that in your dockerfile and try again
Yeah just confirmed that here https://packages.ubuntu.com/xenial/python-lxml
That is for python2.7
Seconded. I rebuilt the image after removing the last two lines and updated that package
...
docker build -t ocropy .
...
Successfully built 808a247ba0b8
Successfully tagged ocropy:latest
$ docker run --rm -it ocropy:latest
root@1a11ec1b5ce3:/ocropy# ls
PACKAGES models
root@1a11ec1b5ce3:/ocropy# ls models/
en-default.pyrnn.gz fraktur.pyrnn.gz
hi
hey everyone,
here's a list of some of the problems I've been running into as I try to set up docker containers: https://hatebin.com/vvwhykfswy
if you could take a look at this hatebin where I separated 4 issues:```# ocropy installation failure
tesseract installation failure
another ocropy install failure message
docker-ocropy empty server error```you might be able to see what is going wrong and how I can react.
i'm really new to docker so next on my list is to try running the docker image commands one at a time and making amendments to the image file, then posting my results to the github repo at which i got it...
that could be my first act as a real developer!
how about that? anyway... for the time being i'm just drinking my morning cup of coffee so if you know either how to fix these errors or manually set up a docker container i'd love it so much.
thanks
Is there a way to get sidebar (not pop up) documentation in VS Code, similar to how it looks like in PyCharm?
I'm looking specifically for the sidebar, not the F12 shortcut
https://marketplace.visualstudio.com/items?itemName=bierner.docs-view < makes VSCode usable 😉
Hey could someone explain the user of kubernettes or SaltStack
the only thing I know about saltstack are its past crypto bugs
uhh, i think i saw some sort of terminal extension that allowed one to see a tree of their git branches
or something
So here, is there a shortcut to switch between styling.css and index.html
Visual Studio code is only showing one autocomplete suggestion at a time instead of the many that it used to. Anyone know how to fix this?
@atomic granite use kite
What is that?
an auto completion engine which uses machine learning
Is it like an IDE?
@rich nymph Do you recommend that I link my email?
it's suggestions are really good
@rich nymph What's sorts of suggestions does it give? Does it give them via email?
Yeah I know that. I'm asking: What do I get, if anything, if I link my email?
idk
i linked mine
until now i got 2 emails form kite
one asking for a feedback
and the other one was when i first installed it
ok ty
@atomic granite do u use sroucery with vsc?
@rich nymph I don't know what that is so no.
it's an exatension for python, it's really good. it gives good suggestions like
b = []
for i in range(400):
b.append(i)
they turn this into
b = [x for x in range(400)]
@rich nymph Do you know how to turn off pro suggestions for kite?
Well it suggests things that I can't press enter to autocomplete I guess.
This extension is quite nice. I'm still seeing only one suggestion at a time though.
This extension is quite nice. I'm still seeing only one suggestion at a time though.
@atomic granite kite?
Yes, the problem still persists after installing kite. I think that I might have accidentally changed how many suggestions show up somehow.
For example, when I type if, it used to show a few suggestions for templates like if, if/else, and if/elif/else.
mhm
