#tools-and-devops
1 messages Β· Page 59 of 1
I think pycharm prefers that you use a different name in the walrus assignment
it doesn't like that you are reassigning the value mass directly after looping over it
In docker desktop I can see a bunch of images with grey text interfacer-bot, the tag I've been using for builds, but, besides that there are a bunch of randomly generated names. Does it create a new image on each build and am I intended to delete the old ones?
And in that case, what are the randomly generated names and what is the actual image name?
Also, somewhat unrelated, but what's "different" about postgresql images. It looks like they aren't built, but just run directly. It seems like only one can be available because I see the container referred to as postgres in docker compose
docker run --name some-postgres
ah okay, so they can be differentiated
So, now I'm just wondering the two things:
- What are all of the different images I see in docker desktop?
- How come postgres images are "just ran" rather than built?
- How can my other different container access the
5432port of my database container? (It's working fine, but I'm not sure why π )
Here's my docker-compose.yml:
version: "3.8"
services:
db:
image: postgres
restart: always
environment:
POSTGRES_PASSWORD: postgres
POSTGRESS_USER: postgres
POSTGRES_DB: interfacer
volumes:
- "./pgdata:/var/lib/postgresql/data"
ports:
- "5432:5432"
bot:
build:
context: .
dockerfile: Dockerfile
depends_on:
- db
I'm connecting to the database in the bot service with these creds:
credentials = {"user": "postgres", "password": "postgres",
"database": "interfacer", "host": "db", "port": "5432"}
- I have no idea since I do not use docker desktop
- Those images are basically pre-written Dockerfiles that you can directly use, rather than having to write your own.
- They're on the same network (https://docs.docker.com/config/containers/container-networking/) and therefore are allowed to communicate with one another through iptables rules (Docker handles this). Docker also uses iptables to prevent cross-network communication for example (https://docs.docker.com/network/iptables/).
@mild lance
{
"python.linting.enabled": true,
"python.linting.flake8Enabled": false,
"python.linting.pylintEnabled": true,
"editor.fontFamily": "Fira Code",
"editor.fontSize": 16
}
Thanks! Sorry for taking so long to respond, I was sleeping π€ :D
did you restart vscode
yes
Can anyone explain why when I launch Python script with env variables set in Anaconda env via conda env config vars set my_var=value in Pycharm, I can't retrieve them via os module? I want to set them on per-environment basis and I don't want to manually create and modify shell script files. I can set them up in run configuration, but it's annoying to do that for every entry point (including tests).
How do I make it so that my application would automatically pull, and restart, when a merge happens in github?
Hey guys even though for vsc my font is set to Fira Code, why isn't it changing it???
{
"python.linting.enabled": true,
"python.linting.flake8Enabled": false,
"python.linting.pylintEnabled": true,
"editor.fontFamily": "Fira Code",
"editor.fontSize": 16
}```
and this is my settings.json
nvm i got it
Anyone have experience using python + ssis / visual studio
Hey guys, I cant seem to install tensorflow
anyone here work with codeartifact and docker
For me, they're just all something to get used to. They're massive platforms and when you first start out, they all look like a jungle of different services that you have to find your way in (at least to me). I know @clever raven likes GCP the best of the three, if I remembered that correctly; I have no real opinion yet, but I'm trying to have an open mind, because I'll probably have to work with all three at some point due to the nature of my job.
eh, yeah.
AWS is the one I'm familiar with. GCP is the one I'd like to learn more about, because it just looks a bit less painful - but I'm sure there's a minefield of hidden complexity there too
Iβve heard some good things about GCP from sysadmins
AWS is also a good choice, or DO and Linode if you prefer independent providers
It is easy to get trapped in the AWS pricing methods though
AWS is a nightmare to work with, for many reasons. there's tons of surface complexity, but there's also a lot of hidden complexity. Stuff like, services not being supported in all regions, instance types not being available in all regions, extremely poor documentation, mismatches between different versions of awscli, or between the UI and the CLI tools...
every time you want to do something complicated (like migrate stuff to a new region), you just get hit by a tidal wave of invisible complexity.
and every single error message is cryptic as fuck
but it's very powerful
a tip for europeans - don't use eu-west-1, it's super slow compared to more recent regions (like eu-north-1)
they each excel in various areas depending on your use case, i don't know enough to recommend one over the other
this is all good stuff to keep in mind
its funny that you mention different regions bc my classmate is a cloud engineer and sometimes has to work with clients that are european (we are stateside)/has to open instances in those regions and he says you can get in big legal trouble due to the GDPR (since in the states theyre used to doing whatever)
I'm using PyCharm, and a recurring issue I've encountered is that the output console seems to update once every half second. Is there any way to change that? Thanks in advance!
Hi, I need a bit of help with something that I wasn't sure where to ask, and figured this channel could be suitable: I want to test the limits of my laptop, but not interested in going full advanced computing stuff, I want to get an idea of how my laptop fares, in a determined task in a somewhat standard use. In other words, I have a code, that not only requires a lot of memory to process data, but at the same time I need extra memory to save data from that algorithm. Now I want to study the trade-off of how much I can compute, and how much data I can save, and I can't stream data to a file while the algorithm runs, everything will be stored in python's kernel (I'm not sure that's the correct use of the word kernel tbh). Is there a tool that will help me? Something like a monitor of ram used against available ram?
I wanna learn python can anyone help me find a good ide for mobile plz
pydroid 3 is a good one for mobile
Thank you
There is not, that's the problem
if you are needs are simple, it's great, if they are complex (like security requirements or anything else), it's painful experience
at work, it's been really frustrating laying over 3rd party stuff to make up for Google lack of features, my work just decided that going Kubernetes was "CLOUD!" and called it done so we can't use a ton of serverless stuff
also, I'm finding their Python libraries for various serverless stuff to be hit or miss, like Firestore in Python is really really weird
good to know about GCP too
Hello all, anyone using VScode for python3 development?
Why not PyCharm?
why not vscode?
PyCharm is like a smart guy out of the box
VS Code is like "I can be smart with some plugins"
pycharm has a bunch of random features that I will never use
hi, this is probably my first message on this channel,
I would like to ask you what tools do you use for programming?
I use my text editor (i.e vscode) and git.
anything else I could use to improve productivity and workflow?
All depends what are you creating
hmm?
If you are creating some kind of APIs you should consider downloading something like Insomnia to easy test it
oh
can anyone who knows tkinter go to user-interfaces please
Hi, I reallly dont know what I did but I am geting errors like this. I didnt had someting like this before thats why I really dont know how to fix it.
how could it be that my debug is on the blue line but my screen doesn't show "moving on" printed?
perhaps related to how output is set in your project? have you tried printing somewhere else in the project?
Are you sure? Which IDE are you using?
it's pycharm. I've moved on from that, but these mysterious, minor issues keep popping
Are you sure that are you watching on console output? In PyCharm there are Frames and Console tabs
I use docker and docker-compose - very helpful, if you want to run api, db, frontend, email, nginx etc
has anyone used aws sagemaker and can help me with some (unfortunately) very basic stuff?
i'm trying to import a custom class in the intro script of my SKLearn object, but it keeps saying that the class isn't defined. i've tried putting the model definition in model_fn, i've tried importing it from a separate file, i had it originally as a global definition in the file. nothing works, and i have no idea why since model_fn should be able to see all these definitions
I've basically tried almost everything that I can think of, but can someone possibly help me?
What I am aiming for...
place_order = browser.find_element_by_class_name("persistent-footer-continue width-full button--primary")
place_order.click()
^ I would like to do something like this but I've constantly tried it and I have not gotten it to work. If anyone could give me any advice that would be amazing.
Ping me whenever I need to take a break...
Hello, I am trying to deploy a flask app using uWSGI and I am getting the following error:
2021/01/28 18:04:45 [crit] 24267#24267: *1 connect() to unix:/root/server/server.sock failed (13: Permission denied) while connecting to upstream, client: 5.54.200.131, server: pyropreme.com, request: "GET / HTTP/1.1", upstream: "uwsgi://unix:/root/server/server.sock:", host: "pyropreme.com"
This is my server.ini
[uwsgi]
module = wsgi:app
master = true
processes = 5
socket = server.sock
chmod-socket = 660
vacuum = true
die-on-term = true
No it just loops and ignores and crashes
I apologize if this is in the wrong help section. I am new to programming. I have two issues that I can't seem to fix independently. It's very frustrating. The core problem is, I want to use Scrapy but I can't get scrapy to download successfully with the latest python, pycharm, and Windows OS.
Through googling I have discovered that Windows users just need to have miniconda/anaconda to use Scrapy, and pip itself will throw many errors otherwise.
So, I'm on Windows trying to install miniconda or anaconda. I can't get either.
I have tried to download miniconda from docs.conda.io on two different days. Every time I click on the corresponding Python+Windows download link, it states "Connecting..." then the error, "This site can't be reached. repo.ananconda.com took too long to respond."
Alternatively, I have visited https://www.anaconda.com/download/#windows and tried to download the full Anaconda. I get the same error here as well.
My internet is working fine on all other websites and my popup blocker is disabled. Any idea why I can't download either of these? Any advice is welcome. Thank you for taking the time to read this.
@obtuse wyvern is the element actually found? does it return?
let me check @arctic flicker
don't be shy to show us your output
does anyone here know what the difference between github's repository secret and environment secret is?
@rain belfry I can only imagine repository secret being bound to the fact that you have commited the code to a repository. While environment secret is a secret that is local to your environment, eg the pc ur developing on. but when testing / building you are using the repository secret
both of them are on the github repository page, which can then be used in the github actions for example. so they are unrelated to my pc
ah.. you are talking about github! dooo
yea so.. an environmental is literally that,e.g production environment / testing / build environment and dev environment
so you have a set of variables for each of those stages. E.g dev always uses sqlite for database.
but maybe a specific repository needs to special care for an environment, you just specify that in repository secret
not sure about priority π
I do know that Environment has priority over Repository
but what I don't understand is,
If I want to add lets say a certain token to be used by Github Actions to push code somewhere, should I put that in Environment or Repository secrets?
let's say that you have a central server for authentication, for dev ti's always id.dev.server.local - that go into environment secret. ALll repository shares this.
just add it to repository π
unless u plan on using multiple environments and complicated stuff
oki, thanks π
Bump: My question about Anaconda/Miniconda is now up and off the page. If anyone is willing to help me with advice, I would greatly appreciate that. Thank you.
hey, did i do something stupid and turn something off accidentally?
i can no longer follow stack traces and quickly jump to lines in code when ctrl clicking in the terminal
in vscode
now when i hold ctrl over terminal text it just highlights small parts of it and if i click it, it puts them into the top input box that pops up for some shortcuts
always saying "no results found", but i don't even know what it's doing exactly, it's not searching for it in the document or anything, seems to be something else
like, this pops up
seems like a terminal issue
wonder if u can check whether u modified any settings
pyttsx3
Its not working in my PC
I installed the packaged too
But its generating error
did u forget to define it earlier
Your code looks a bit strange....
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.
I tried it to test my own system :)
yes it may be thanks
!warn 338657065645899778 please do not post or ask for help with exploit code here, as it violates rule 5
:incoming_envelope: :ok_hand: applied warning to @stark flare.
I have two SQL docker containers, one development, one is production, on different servers
What's the best way to move the development data to the production server? I
I'm thinking exporting the data (it's not much, under 5000 entries) and putting it into the dockerfile, or exposing the production database, with a third database for fallback if something goes wrong
I'm hoping someone can suggest a better solution, or improve on one of mine. Please tag me if you think of anything. Cheers!
Export the data from the development and re-import to prod?
Anyone know of a guide that will let me know how to setup my pypi package to be globally available after pip install? For example I did pip install twine, then I was just able to do python -m twine.
I'd like to do that with my own package.
@worldly marlin If your package has a __main__.py module, you should be able to do that in a relatively straightforward manner
ah, would an __init__.py do the same thing or does it have to be __main__.py
They're distinct
kk, i'll test out adding the __main__.py thanks
hi im working on a bot rn and ive been using repl.it but just got VS
im so confused on how to use it
i want to make a bot that replies to every message with a π emoji and makes a copy of chat
idk the dif
Well you should be able to tell which one you have from the name of the thing you installed :)
But anyway
Visual Studio is a full fat IDE
Visual Studio Code is more of a lightweight text editor
i have just vs
Ok, while you can do Python programming in full-fat Visual Studio, I know basically know one who does
The most common choices are PyCharm if you want an IDE, or Visual Studio Code if you want a text editor
i have it i just am havig troubl wit things like windows for errors or shells or terminal and idk how to change the appearance so the numbers are on the side of each line
Which one do you have?
VS
I'd recommend not to use VS for Python
ok
You'll find it much simpler to use
What made you install Visual Studio for Python in the first place?
@small light yes. Ideally something that would work through the equivalent of GitHub actions to K8s
I don't actually use these programs, but I use equivalent versions I've coded myself
Anyone knows any good IDE for Python? PyCharm is taking seconds just to validate stuffs and it didn't even catch simple things like undeclared attributes...
PyCharm usually catches that stuff. It's possible your PC is too slow for it though.
Use VS Code instead
Not technically an IDE but still
Probably, ughh...
What are your PC specs?
But it didn't catch something like this:
class A:
def __init__(self):
self._do_thing()
def _do_thing(self):
pass
class B(A):
def _do_thing(self):
self._some_attr = 10
def another_thing(self):
self._some_atts = 11 # <--- didn't catch undefined attribute
self._some_attr = 12 # <--- didn't autocomplete the attribute
I would expect PyCharm to run on something like that, but that would be the minimum requirement really
If you are running PyCharm and Chrome and a bunch of other stuff, you really want 16GB
And I'm pretty sure PyCharm would catch those issues. Let me boot up my PC real quick
so there's issue 1
And that's issue 2
I've literally just turned on my PC and it's already using 7GB out of 16GB
Let me check if I still have this problem
That's with no chrome
It works now, huh
Lol
Probably it was the cache or insufficient RAM
I had to copy, paste, and modify the same code over and over again. But I need to change the method definition like in the example I gave.
It was broken most of the time
Sounds like your PC is struggling to use PyCharm
Do note that if you see PyCharm "indexing" or "generating skeletons" then you might not get this analysis show up, or as quickly
can somebody help me set up esp32 with vscode im struggling
How can I go about using a virtual env with PyCharm from within a Docker container?
Hello i'm deploying my app on EC2, Route 53 to connect to my domain, ACM & Load Balancers.
I get an error everytime i try to make an API call. the error is cert_common_name_invalid
Hi, I build the tool lifecockpit.com. Can somebody help test it?
devops?
so this is my first time working, like professionally, on a project. The project is growing and everytime I add a feature, I just test if the feature is working properly and ship the project to my client. The problem is - sometimes, when I add a feature, some previous code generates errors, and because the project is quite big, I dont test every thing in the project (literally just the code I added and ship), I found out about unit testing and currently using it, the problem is, I don't think unittesting is what I'm looking for since as I'm testing it, it gathers data from external environment. Can anyone direct me which way to go from here on?
@thorny mauve go to AVAILABLE HELP CHANNELS
oh sry im not native english speaker and i was to lazy to do all the channel names on the google translater
@remote olive it would be good if you could isolate the parts of your codebase that call out to get data from external environments
That way, you could unit test the parts that don't connect
And just do, say, in memory processing of the data
@remote olive lol where is this channel i can not find it :C
@upper oyster I see, but what about the parts of my code that requires those data? is unit testing appropriate for those as well?
#help-lemon @thorny mauve
ah thx
Depends how much you've managed to isolate the parts that connect to the external environment
If you think a function needs testing and it does connect externally, and it can't easily be isolated any further, you can look into using mocks
unittest.mock
You can replace any function or class with a Mock() item during testing
It's useful to have and to use, but don't go crazy with it, especially for unit testing
If you are doing an integration test, then obviously mocking is fine
is there any, module perhaps?, for doing integration testing?
just like unittest for unit testing?
or you just manually write some test script for it?
am not exactly sure, I guess I have to look more into automated testing, rn my client is complaining cuz of the silly errors, looks like I know where to go now, thanks a lot man
No worries :)
Yeah, automated tests are so important
I could never have the confidence to make any changes to my work codebase without them
By not testing, you've built up quite a bit of tech debt
I see, I just realized that there's also that part in software engineering, are you using any frameworks or tools in doing automated testing of your projects?
So, unit testing is automated testing
Using tools like unittest you build up an automated test suite
And then you can run it every time you make a change to your project
And it's automatically testing all your code for regression, as well as the new stuff
yea that's exactly what I'm looking for, but my problem is, like, say I have a class named MyClass and I have two methods like method1 and method2, and I have to test both methods, I have to instantiate MyClass twice
something I find uncomfortable so I thought it wasn't unittesting am looking for
So what if you have to create the class twice?
Like, how long does the class take to instantiate
Is your concern performance or code reuse?
code reuse in the testing suite perhaps, say you have this class:```
class MyCar:
def start():
pass
def stop():
pass
how should I test both methods?
I would have no problem with creating two test methods that instantiated the class twice
Now, unittest has a concept of a setUp method
That runs before each test method in a class
So you can have something like this
class TestMyCar(unittest.TestCase):
def setUp(self):
self.car = MyCar()
def test_mycar_start(self):
self.car.start() ...
def test_mycar_stop(self):
self.car.stop() ...
However, you don't really need to write it like that. Code reuse isn't really achieving much here, and is making the code slightly more difficult to read (nothing crazy though)
Tests don't have to be DRY like code, and you can redefine the class multiple times even if there's a little bit of repetition
ahh I see, now I get a better look at how things get done here. Man that's very very helpful, thanks a ton. my only problem now is if I should look back and make a proper test suite for the whole project, lel hahaha, I should have known about this from the start, but anyway this is almost life changing, thanks a ton man
So, here's the thing
To prevent yourself from regression issues, yes, you will need to create a full test suite
And so, by skipping the tests, you've gotten yourself into what's called "tech debt"
It would have been quicker to write tests as you went along
At least, quicker in the long term
But for short term speed, now you have to slow down, and you have to slow down more than if you had just written tests as you went along
Cos you have to write tests for code written a while back
I guess I haven't noticed about this before cuz the project was not that big, but now, I spend a whole lot of time doing manual testing on almost every corner of the project
Right
majority of my time now is really just spent on testing before shipping to client, it's a good thing I followed my curiosity to here
How long do you think it would take you to write a full regression test suite?
am not sure, I was thingking of trying to rewrite majority of the codebase from scratch cuz it got quite messy, I looked into this as well, like how to systematically do things, but am considering rewriting majority of the codebase from scratch, and I suppose the test suite along with it
Oh no, don't rewrite without tests
Especially if it's already too big for you to handle
Write the tests first, and then refactor
Like, if you have to rewrite from scratch, you could introduce all kinds of bugs that aren't present in the current system
You need tests to protect you from introducing regression errors
I don't follow, do you mean I write test scripts before writing the actual project scripts?
or did I misunderstood?
I'm saying that, if you completely rewrite your code from scratch, you could introduce errors not present in the original system
Here's an article you should probably read first
From the founder of Stack Overflow. It's a bit dated but it's still relevant IMO
man I really need this, I started coding as a hobby, I never imagined I would find some occupation in this industry so I really never tried to understand the system of software engineering
Right
This article was actually quoted by Guido himself when talking about the Py2 to Py3 migration
In the migration, they upgraded the codebase, they didn't rewrite it completely
I think I noticed on a few of my side projects before as well, some that I rewrote from scratch again, it never really went bigger than the original one cuz I guess I got quite bored tryin to rewrite the whole thing
Lol, well that's a different issue lol
When you are being paid for it, that will motivate you instead
But your problem will be more around, can you ensure you won't introduce regression when you rewrite?
And how very different will the rewrite be anyway?
Presumably you'll use the same language. Will your new system be significantly architecturally different?
If not, then for sure there's no reason to rewrite
I suppose I better not, I mean, I tried to make the code as stable as possible, by stable, I mean try it's best not to brick and be able to properly report properly if something was not handled well, my only problem is, there's some (if not a lot) of inconsistencies, like first I used snake case, then moved to camel case, then some internal philosophies now change and conflict overtime, prolly cuz I found something better.
but I think I should just do my best to go through those one by one, and making unit tests in each area in the process
Right - that kind of stuff you can fix really easily without a rewrite
As the Stack Overflow owner said, you can fix that in 5 minutes with a macro in Emacs
reading the article, I guess I understand more what you mean introducing more bugs into the code
Not saying you have to use Emacs of course
I wouldn't wish that on anybody :P
But you get what they mean :)
Hi @ all
i'm using VS -Code
Is there a good way to Colorize the SourceCode like that for Python
You mean syntax highlighting?
You should get that from installing the Python extension
You don't need anything more than that
Unless you want to customise the colours as well?
exactly
I think it is easier to read
if for example Int(), float(), str() had another color
Not sure if you can customise it to that extent
there is something like MagicPython
i install it but somehow it doesn't work for me
It's working fine in my VSCode, make sure you have both Python/Pylance running
Discord upload is broken
Anyone here familiar with scrapy
What u trying to do?
Highlighting the Syntax
like that
Which editor are u using
VsCode
Sorry, not too sure
Attention VSCode users: MagicPython is used as the default Python highlighter in Visual Studio Code. Don't install it unless you want or need the cutting edge version of it. You will likely see no difference because you're already using MagicPython.
Create a penetration testing tool
interessting
Ummm..... No it's not
I read that but it doesn't look like the Image
Pretty sure it's been replaced
with nothing
Are you using Pylance?
Did it activate?
before i get every time a Message to install it
mom
It will require VSCode restart quite possibly
then not sure what to tell you
But tank you for trying
How do run my code in a python venv in vs code
U canβt have venv/Scripts/activate in vs code terminal
Why is that
Create venv, VSCode will pick up on it
I did
OS?
Windows
So sometimes default Powershell Windows it creates doesn't pick up on it
generally creating a new one will
That's Powershell, no clue about Cmd, I don't use it
How do you get that in vscode
it mostly activates automatically for me but if it doesn't, it's <env folder>/scripts/Activate.ps1
Thanks for the help, not working for me
Nope
Terminal by default uses Powershell so if it works in Powershell, it should work fine in terminal
Hey Rabbit i figured it out.
It was because of the theme
Dark+
Using threading.Thread for example?
!d threading.Thread
class threading.Thread(group=None, target=None, name=None, args=(), kwargs={}, *, daemon=None)```
This constructor should always be called with keyword arguments. Arguments are:
*group* should be `None`; reserved for future extension when a `ThreadGroup` class is implemented.
*target* is the callable object to be invoked by the [`run()`](#threading.Thread.run "threading.Thread.run") method. Defaults to `None`, meaning nothing is called.
*name* is the thread name. By default, a unique name is constructed of the form βThread-*N*β where *N* is a small decimal number.
*args* is the argument tuple for the target invocation. Defaults to `()`.
*kwargs* is a dictionary of keyword arguments for the target invocation. Defaults to `{}`.
If not `None`, *daemon* explicitly sets whether the thread is daemonic. If `None` (the default), the daemonic property is inherited from the current thread.
If the subclass overrides the constructor, it must make sure to invoke the base class constructor (`Thread.__init__()`) before doing anything else to the thread.... [read more](https://docs.python.org/3/library/threading.html#threading.Thread)
ty
Your welcome! You can also use futures.concurrent.ThreadPoolExecutor
Pff
oh ok
Executor is fine class when you want to dispatch some async tasks
Hello, i still cant find a good vim vundle plugin for python syntax highlighting, maybe someone can dm me and help, beacause i also have problems installing plugins. thanks for help
Hey Guyz, I am facing a problem in Google Developer Console that I am unable to create my billing account as my transaction keeps getting error even after the successful OTP submission..thus I am not able to get API credentials.Has anyone gone through the same problem before?
Hi everyone. I m new and i just started coding python. Can someone tell me or give some tips where i should start and the direction i should go?
!resources
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
what does it mean to replay a commit in git?
did you manage to fix it?
How do you change the theme?
Set-ExecutionPolicy RemoteSigned
wich theme?
I've downloaded pylance, but I can't get it to work
you ran that line in powershell?
- You need to Run PowerShell as Admin
- Set-ExecutionPolicy RemoteSigned
- J or A
That's it
There are 2 posibility's unrestricted or RemoteSigned i would recommend RemoteSigned as long as it works for you
Thanks, much appreciated
ye
if you type
Get-ExecutionPolicy
You can check it
and change the policy again if you need that
How would you revert back to normal
it should be restricted
How did you change pylance
Markdown Editor dark
turn it to dark+
there are also other Theme extentions you can check
Ye seen that, thanks
This is my Fav for now
any particular reason?
everyone has a different taste
true say
i like that the outkommented lines aren't screeming on you
i think it enjoyable to read
any idea?
I'm not familiar with Scrapy. At first a thought it would be a good idea to learn Python better. But i decided to make a DeepDive into Python without any package
Except of virtualenv
How do I disable logging for a specific docker container? I have a docker-compose.yml with a pgadmin image there, among others. I want to see output from all other containers, but pgadmin one is cluttering my view. Seems the spam is coming from flask pgadmin frontend, but I'm not sure.
At this point, I'm thinking I can redirect standard output to null on the pgadmin container, but not sure how to do that with environment variable (or if possible)
Welp after an hour of looking, I found it right after posting here. What you need is:
logging:
driver: "none"
for the container you want to disable logging in
How about specifing all services except the pgadmin service?
docker-compose logs service1 service2
I would do that if I ran with docker-compose up -d right? Right now I run in attached mode
Ok cool to learn, thanks!
Though I probably wouldn't completely nuke the logs
could you please anyone suggestion me profiling tool
@merry stag I really like pyinstrument
which part are you struggling with
is there a way to get pip to create less small files?
like i think there are tens of thousands if not a hundred thousand or more files in my virtual environment site packages
I know someone who has trouble installing my program because it installs so many small files while creating the venv that the whole system freezes
that's a problem with their computer
right, but I was wondering if there is some way to get pip to use zip files instead
I thought python could interpret zip files of python files as a module, and I thought that was more or less what an egg was, but I'm probably wrong
I'm going to cross post this from #networks and delete my message there, since this is actually a better place.
Not sure if this is offtopic, but i don't know where else to ask. I'm trying to use NGINX to serve a static site (it uses a Flask API, so technically python related). It was working fine, but when I restarted, it stopped using CSS and JS.
It returns 404. This is my config for the site (default): https://pastebin.com/K3vhSijn This is the nginx.conf: https://pastebin.com/V0rLFDEv
@lunar holly thank you
How to tell create react app to add the path assets accordingly?
Hey @heavy knot!
Uh-oh! It looks like your message got zapped by our spam filter. We currently don't allow .txt attachments, so here are some tips to help you travel safely:
β’ If you attempted to send a message longer than 2000 characters, try shortening your message to fit within the character limit or use a pasting service (see below)
β’ If you tried to show someone your code, you can use codeblocks
(run !code-blocks in #bot-commands for more information) or use a pasting service like:
I'm trying to get Paramiko to run on a windows 2016 I only have a ppk. Found out it needs a pub key. Attempted puttygen loaded and saved public but it left a file with no extension.
I've even tried giving it a .pub sadly attempting connections fails.
Any advice?
So if your fork is behind, how do up make it up-to date?
https://gist.github.com/Chaser324/ce0505fbed06b947d962#keeping-your-fork-up-to-date pretty decent explanation of the fork-pull workflow
thank-you
I've been searching for an automation framework in Python - something to let me write and schedule small tasks like copying information from an email to an API, uploading a file to somewhere, accepting information to a webhook, etc., etc., and handle the scheduling and storage (and ideally secrets/credentials) for those tasks for me.
I've actually written my own framework for this but it's not very good and I imagine someone else must have already written this.
Things like Ansible and Nornir seem to be more about managing devices than performing data-oriented tasks.
I have a feeling that this thing must exist and I just don't know the words to use to find it.
Nope, there is too many variables to make a framework viable
Question... So I lost some data on github right, my local folder got messed up cause of bad onedrive sync and hDD went down, so not all files synced and some other drama... so I had to re-initialize the repo... However, now whenever I make a push, I have to go to the site and create a pull request and merge it... but that's alot more than I was doing before...
It's still my account so why doesn't it sync back up like how it was before... and if possible, how can I get it to?
By using git reset and force pushing
Another way is to use an interactive rebase and drop the commits, then force push
That's git push -f. It rewrites history. If you want to avoid that, use git revert. All that does is create a new commit that undoes the changes.
For any Mac people here. What editor or IDE do you use? Seems PyCharm is loved by most but don't know if I should stick to something like sublime text (my normal editor) while learning or just jump in and learn with PyCharm?
vscode
I'd recommend IDLE if you're new to Python and software development in general.
they already use sublime
idle would be a big step down
tbh if you're experienced with sublime you can just stick with it
maybe install some python-specific extensions
thanks all!
Am new to python but not programming in general having some C and C++ experience
Just getting my head around the tools commonly use like pyenv, virtualenv etc
If you are new to Python I'd stick with pip and venv to begin with
yeah seems venv is the best option for a beginner π
dunno if its just because im new but god the python tools world is kinda messy with so many tools that do mostly the same thing lol
Hi could somebody help me ?
I'm trying to make something like "Hacker Typer" VScode addon in python.
but I don't know how to print letter from string when I press random key
Yeah it can be quite daunting with all the different tools
Those don't even include pipenv, conda, poetry and others
But, in that article, you can ignore a bunch of them
pyvenv is basically dead
venv is just a subset of virtualenv that is in Python 3 standard library
And pyenv seems to be just to manage different Python versions more than anything else.
where do i put the pipfile and pipfile.lock? in my project folder?
and should i rename the virtual env to my project name?
What is the best way to protect the master/main branch in a github repository when starting an open source project?
Don't know about the "best way", but Github has branch protection rules for each repo
@olive compass just don't invite collaborators. From my view, there is a lack of user management, but it's like python, flat and built on trust.
Got it, thanks
True, yeah I won't invite collaborators for now.
i'm using resilio sync to sync files between my pc and my pi, but it won't allow me to move files on the pi's end. what can i do against this?
it actually won't let me edit the files on the pi at all
I'm designing an application that runs in the background and have a 3rd party application interface with is. This is all done locally. What would be the best way to do this for a windows environment?
I'm thinking a FastAPI with uvicron service in the background and the 3rd party application interfaces with it through APIs
Would that be something doable? It has to launch together with the other program. Can
Can someone help me with this please i downloaded from org itself
somehelp guys !!!!!
if i have a python thread running and I can't kill the thing by crtl+c in the terminal, are the threads terminated if i close the terminal?
say like if I started th thread with this
x = threading.Thread(target=thread_func, args=(str(i),))
x.start()
yeah, threads are tied to the process
ah
i see isee, but why can't i crtl+c when threads are running in the process? i always have to close the terminal
if you have running threads, python will wait until all of them stop before exiting the process
just set a flag when a sysinterrupt occurs in main thread and check that in your bg threads
set the flag? like when im running the python file?
something like this https://stackoverflow.com/questions/323972/is-there-any-way-to-kill-a-thread
alr thx
so exiting the program close the threads right?
so what if i create a while loop listening for keyboard interrupt, if so, then exit the program, but i tried that, it doesnt work
Its been a long day today
And right now at the end of it, black decided to start adding special characters to my reqs.txt
How do i stop this
what kind of special details
I'm thinking IDEs fall under tools-and-devops here ...
I'm just trying out idle while I await some way to support PyCharm on this linux host
so far, idle seems to fall pretty far short vs. pycharm
IDLE isn't an IDE
Yep, but that's about it
and it has a basic debugger. WHat is it lacking
It is lacking a lot of more advanced features
well, anyway, I found idle's features fall quite short of Pycharm's
the variable explorer in pycharm is miles ahead
pycharm has line numbering and visible breakpoint dots
pycharm shows a link to the source line at each error
Our apt repository is down just now, so I haven't been able to try eric as another possible IDE
some feature chart on WP suggests eric might be more capable, but I have not tried it yet
The big thing idle has going for it just this moment is 'dpkg -l idle' says ''ii''
so ... not idle, I'm gonna say
the eric website screen shots look more promising than idle, at least
IDLE is just a simple Python text editor that is included with Python to fulfil its "batteries included" philosophy
You can code in it, but it's a "gets the job done" kind of deal
whenever i would commit something, black would append οΏ½ this character to my requirements.txt file
But its strength is that it's nice for beginners. It doesn't have the myriad of options that PyCharm has and so doesn't overwhelm
i didnt change any of the settings, been committing code with no issue until last night
i would get errors with decoding my requirements on heroku, but i couldnt commit any code without that happening, so i just uninstalled it at the end
how do I access redis that is running localhost in docker?
http://localhost:<port>?
nope that's not how that works I think. because I tried
do you expose the port?
if you try to access it from the docker network, yes, otherwise not
are you sure, it is, actually running?
did you check with docker ps?
I know I'm late, but you are asking for help how you connect and you denying @fleet geyser answer? "That is not how it works"
Yes , that is how it works.
You said that the container is running LOCALLY THAT IS localhost: 127.0.0.1
I'll give you an example: (written from my head using Linux shell)
# spawn the container
$ docker run -d -p 6379:6379 bitnami/redis:latest
# you should see a running container.
$ docker ps
# testing the connection using netact by sending ping to redis you should see `pong` in the shell
$ echo -e '*1\r\n$4\r\nPING\r\n' | nc localhost 6379
PONG
"compiled by my head"
thanks for the answer though, and yes I am still denying the barba's answer
Are you still having issues though?
this solved it
π
but you know, I tried everything, localhost and 0.0.0.0
wait, were you trying to connect to the redis container from another container? In that case you have to use the container name
yes, and I guess my question was not correct at the beginning. oops. bed england
Whelp, no wonder why you were having issues π
@cloud elbow anywaay, localhost = local to the machine. When you are running containers, you can think of each container as separate machine, but your computer as a whole has access to all the containers as localhost, but the containers them self can only access stuff in other containers using their IP / hostname.
thank you. lesson learned
ok so just one question: i used pyinstaller to convert some small test file into a .exe file, and it grew in size, by a lot. before, it was 613 bytes, and after, it was 6.54MB? is this normal?
well it includes the entire python programming language @opal tapir
ahh, it has to store that information if someone doesnt have python installed?
well yeah it relies on the person not having python installed
it's a bit like sending a zip file with python and your program
Hello, i have a problem with visual studio code and python, it says i need to select python interpreter... These are the options:
And when i press it to select:
bottom right
Can anyone help me pls?
run as admin?
Could you expand the error message?
I think this has to do with modifying the PYTHONPATH rather than the location of an interpreter
Did u run as admin?
I don't think it's related to that
What's that?
Could you open your user settings file? It should be a JSON-based file.
There may be an error in there
This is what it says when o [ress the link in the error message
Where is it? in what file?
Is it in python files?
And if it is where are those?
Probably it's your_user_folder\AppData\Code\User\settings.json
The error you get is saying that something goes wrong with trying to set a value in that user settings file, probably because there's an error in there of some sort
There could be some other reasons for why this happens though
I'll search for the files
Another option would be your workspace settings file
It could have a missing curly brace, comma, or another JSON-related mistake in there
No, it's in a different location, but maybe we can do it in a different way. Let me open up VSCode myself to try something. I'm not super familiar with it; I just use it on the side from time to time.
Do you have a workspace open in VSCode?
If you haven't saved a workspace, then it's probably not that, but that's another json file
Just so you know, when i type python code there, it works, but no normally pressing F5
Only when i press the file itself
What do you see when you do:
- ctrl+shift+p
- type "configure language specific settings" and hit enter
select python
I went to python there
This is a comma right: ,
yes, the same as at the end of the other lines
"html": "cd $dir && start chrome $fileName"
"javascript": "node" ,
What happens here is that JSON wants a , as a separator between the different key->value pairs
there is a comma
When i press the arrow and type:
print("test")
Where is it supposed to show me the output?
This is what it shows me when i try it
Oh if you can't it is ok you already helped me alot
Sorry for the burden
It claims that it can't find Python as a command on your PC
It probably means that it's trying to use the python command, but you did not add Python to PATH during the installation
It's something you'd have to manually select
Are you on Windows? @hexed ermine
I would imagine you have to figure your interpreter in VSCode directly and specify the directory to your python installation, however if you're on Windows you could do:
(1) Windows Key + Type "Edit System Environment Variables"
(2) Click "Environment Variables"
(3) Look at the lower section entitled "System Variables"
(4) Click on "Path"
(5) Click on "Edit"
(6) Click "New"
(7) Copy the full path of your python folder: e.g. C:\Users\NIR\AppData\Local\Programs\Python\Python37 or wherever it will be
(8) Click "OK" "OK" "OK"
(9) Re-open VSCode and see if that works.
Otherwise, you will have to search "Setting interpreter VSCode" or something along those lines.
I also don't use VScode so I could very well be slightly off here.
You have two spaces between system and environment, not sure ir it would do anything
Is it to hard to check it in some search? Are your system is in EN lang?
Try to start typing env...
I have localized version so I need to type in my language
They helped me already, thanks
π
I mean there is anoter problem but it is linked to discord.py
Guys I need help with heroku CI. Currently for some reason my test cases aren't passing. Heroku is unable to access my postgres db currently I am getting this error in Heroku CI
/app/.heroku/python/lib/python3.6/site-packages/django/db/backends/postgresql/base.py:270: RuntimeWarning: Normally Django will use a connection to the 'postgres' database to avoid running initialization queries against the production database when it's not needed (for example, when running tests). Django was unable to create a connection to the 'postgres' database and will use the first PostgreSQL database instead.
RuntimeWarning
Got an error creating the test database: permission denied to create database
-----> test command python manage.py test failed with exit status 2
i am newbie and i am having a hard time making this private little site which my teacher gave me to do it
does anyone know the command which counts the lines
under the PREFERRED QUALIFICATIONS
@heavy knot are you using html?
I can help you
i just need a command which counts the lines in my private site
it is shown on the picture under the preffered qualiffications
Waittt, will u use python for counting
no
Ohk, full html
yes yes
Welp, π€ u want to count the num of lines in the list of preferred qualifications
Right
This may help
thank you
should i put the mobile version of an app in a different git repo than the desktop app or multiple folders in the same repo?
Some unicode letters aren't rendering properly in the integrated terminal of VSCode
How can I fix that?
so like this is what it is supposed to be
but it's showing this on VSCode
I don't mind the colors
how do I get the letters?
ξ
this is one
I am using oh-my-bash with the Agnoster theme
please ping me if you reply
Has anyone faced an issue named "driver failed programming external connectivity on endpoint" when running docker-compose up
?
It has something to do with iptables
I noticed that people tend to separate them
For example, telegram does this.
Already solved a problem. In case you are interested, run iptables -t filter -F and iptables -t filter -X
This will clear all iptables chains. And don't forget to restart a docker service
@pastel topaz you need to install powerline symbols
Is it some extension? or what? how do I do it?
wait I think I understood what you mean
one second
Nope it isn't working
@sly sleet how would we do it?
https://github.com/powerline/fonts install a font from here
then you can set terminal.integrated.fontFamily to a powerline patched font
okie thanks!
It's working!
I have different repos for desktop/server/mobile apps
It's easy to merge repos but you need some work to split them out
recommendations for vs code plugins for beginners? I have the extension pack which is pretty helpful.
Hi, every time I push a branch from master to prod, GitHub tells me that there was a push to prod and if I want to merge prod into master - which would result in 0 changes. Any idea how to "untrack" pushes to prod? Only a mild inconvenience, but still
Hmm maybe adding a branch protection rule will prevent that
Branch protection but itβs unusual to have prod branch, generally master/main are prod branch
well, I have prod, master and dev as branches but I guess I could cut the prod branch, it just overcomplicates things
Just saying, that workflow is unusual and Github is making wrong assumptions
Hi, Everyone. I have a question regarding flask and AWS Lambda. I'm seeing a lot of tutorials on running Flask on AWS Lambda. I don't understand the point of it. If I can just have an API Gateway and Lambda linked up then why would I even need an entire web backend written in a single Lambda? Can't I just make separate Lambdas for each functionality? Wouldn't that shrink and make my codebase more manageable?
Can anyone describe the use cases for this please.
having some trouble...
first time making a python package
i have it on test.pypi, and but when i install it with pip, it says it installs, but then fails
install_requires=[
'beautifulsoup4',
'pandas',
'requests',
'lxml',
'Munch'
],
``` this is correct tho?
nvm
hey, does anyone know of some sort of a viewer for big xml files? vscode doesn't seem to handle deeply nested tags and doesn't let me collapse them anymore at a certain point
intellij just gave up when it tried to load the file with syntax highlighting
it's like 50mb
Hey there. Anyone who could help me to deploy discord.py applications over Heroku ? It seems my worker also start a web-runner, that I don't need to :(
does anyone know a program to help me not get ddosed or how ever you spell it?
Hide your server behind Cloudflare for example?
no like a program or something so i can plug my laptop into my xbox
so i dont get ddosed
I don't know any open source software that prevents from DDoS attacks
oh alright
You should also note that even if you have any there still exists a limit for your hardware
What are you asking for? Python is programming language so it makes everything like any other programming languages 
like in simple terms, what can you do with python whats the purpose of it?
im new to it
You can create HTTP server, game or any other desktop app
I am helping with a project, github/tda-api. tda-api depends on pyreadline and pyreadline requires that your OS is configured to use a utf-8 character set that supports multi-byte characters. Pyreadline will fail to build its binaries if you attempt to on an improperly configured OS.
Unforntunately, Ubuntu's official docker image is a minimal install and that image doesn't come with a multibyte characterset installed. Instead it comes configured to use something called C.UTF-8. Which I believe stands for Computer.UTF-8, and it only supports single byte characters.
Anyway... my question is this... is it possible to setup your requirements file or setup.py or something like that (I am VERY inexperienced messing with this stuff), so that when someone runs pip3 install tda-api en_us.utf-8 gets installed and configured, but only for the current environment? Is this even an advisable thing to try and do?
As far as I can tell, some of the source in pyreadline uses umlauts in some of the comments and that is causing the issue. For example:
Contributors to this release:
- JΓΆrgen Stenarson, maintainer
possible a reverse proxy in front of your network? There are a lot of steps to reducing the risk of DDoS attack, I'd research a little bit about preventing DDoS attacks and best practice.
i am getting this error if i try to run my phyton document which i converted to a .exe
why
i am running this on a virtual machine to test it
its very unlikely for you to get ddosed on your home computer anyways
unless you're running a webserver or something on your home network, which is a bad idea in the first place
Hey, i dont know here this belongs exactly, but i was wondering if sombody know of a way or an already existing code which can switch wifi signal (different ssids) based on time of pc
why tho @twin knoll
I'm having an issue that appeared suddenly today in Intell-J.
While debugging a flask application, I'm not able to trigger certain breakpoints found inside route methods ( but was able a day or so ago )
Anyone have this issue before? The issue does not happen in vscode
hi@all i'm a python learner and i don't know how to manage multiple projects with different python versions & dependencies
I bought the M1 Macbook Pro recently. Unfortunately VSCode is not fully compatible with the current version of Mac OS that supports the new chip. I seemed to have issues installing pip extensions too, but that may have just been VSCode. Do you have any IDE or Text Editor recommendations?
Hi Guys. Not sure if this is the right sub but I have a blackfire profile here of the cv2.Tracker running on continuous frames. Is this a memory leak? Or is that standard operation? I'm investigating a memory leak in my mother application and it has lead me to this module:
@flat marlin https://atom.io/
Hi! I am new to Deep Learning, is it possible to integrate an AI chatbot with a Learning Management System from scratch? If yes, how do I start?
@real hedge Thank you!
Insider Build is native ARM64
I wouldnβt get invested in Atom. Itβs Got shaky future since both VScode and Atom are Microsoft. Itβs open source so itβs not going to disappear but I could see development slowing.
hello, I'm having some problems with GIT and stuff. Basically, I wanna push to an existing github branch on my repo (not the main branch or the default branch). I have basically tried everything I can find on the internet and none of them work and I got a lot of errors and stuff.
does anyone know what commands I should use? like the flags I should use for git remote add or git push, or at least the way you do it
Have you tried --set-upstream flag for git push command? https://git-scm.com/docs/git-push#Documentation/git-push.txt---set-upstream
Oh but what if the branch already have some contents in it, like this is not a initial push
Would it work?
If you type git push without setting remote git should generate some advice with ready-to-copy command to push with setting upstream in one command
There is no matter whether your branch is brand-new or has some commits already
Oh Um ok thx, but do I not need to do git remote add and stuff if I use that? How do I specify the repo?
I assumed that you have already cloned your repo and has set at least one remote..
Can you describe your situation?
Alr so basically I have this repo where I downloaded it and then I made some changes, I wanna push it to the side branch and then make a PR to merge it to the main one (which is irrelevant from this question since it can be done afterwards). And then, basically idk how to specify the branch to the side one instead of the main one, I tried all I could find
Yo ima have to be back in few minutes
But I brb
So...
$ git clone ...
...
$ git checkout -b test
Switched to a new branch 'test'
$ git add ...
... # add changes
$ git push
fatal: The current branch test has no upstream branch.
To push the current branch and set the remote as upstream, use
git push --set-upstream origin test
$ git push --set-upstream origin test
... # success
After all you are going to have your changes on test remote branch.
Yo thanks, I mean Iβll try that
Your welcome
oh um @night quest sorry for da ping but unfrotnuately i gave me this error src refspec new-commits does not match any and I couldnt find information online that helps with this issue
so basically new-commits is the branch i wanna push to and it does exist
oh wait nvm
one sec
If branch exists on remote then you have two options:
- Use
git fetchto get remote changes. - DANGEROUS Use
git push --forceto force overwrite remote changes. (it removes remote branch and replaces it with local changes!)
Right, use git pull
so basically i ran this command
$ git push --set-upstream origin2132 new-commits
and it gave me this
Everything up-to-date Branch 'new-commits' set up to track remote branch 'new-commits' from 'origin2132'.
As far as I understand it means that your changes have been already pushed - "Everything up-to-date"
yea, but its not, idk
How about?
$ git push --set-upstream origin2132 another-one-branch
so this it everything i ran
git init &&
git add . &&
git remote add origin2132 https://link-to-my-repo.git &&
git push --set-upstream origin2132 new-commits
yea dat what i did
Where is git commit? π
No matter but before git push (between add and push)
Is it working?
Try git push originxyz new-commits
https://stackoverflow.com/a/28969139
From GitHub help, I have tested it and it works.
$ echo "# test-repo" >> README.md
$ git init
$ git add README.md
$ git commit -m "first commit"
$ git branch -M master
$ git remote add origin git@github.com:githubuser/test-repo.git
$ git push -u origin master
oh so add the -u tag?
If it's not working in your case check your git configuration (both client and server)
oh man
ok yea i will
hopefully this works
like i think everything i need is to specfiy the branch to "new-commits", and i have no idea how
i think it never was set to it
brub you wanna know what happened?
it deleted all my files on my local folder
oh my ||fucing|| god!
dude im like so close to dying
how do i recover them?
like dude
it deleted everything
bruh
im like
omfg!!!!
stoopid git
what did i do?
like all i did is git checkout new-commits and then it deleted everything in my folder
oh thank god i still have my things on the main branch
i had to clone them again
dude but what the heck was that? why did it delete my folders and files?
alr u know what? im just gonna use github desktop
git bad
like idk, everytime i use it, theres gotta be an issue
github desktop, i only need to do fetch and then push
ez
hehe
bet
I haven't told you to just paste those commands... You can use man or something to check what those commands/flags do.
Anyway, it's really hard to help when I don't know at least nothing about your environment and what do you want to achieve.
Ye I understand
But idk
@warm pollen
I saw some instructions to push a Linux OS into a Container and i'm wondering why to use Docker instead of an so called traditional VM.
Linux OS inside Docker container? I am not following latest releases but as far as I know there is no possibility to put whole OS inside container because it is a "lightweight" virtual machine
Ubuntu is a Debian-based Linux operating system based on free software.
Hm? I know this image
I don't know what those links proof
Lightweight: Containers share the machineβs OS system kernel and therefore do not require an OS per application, driving higher server efficiencies and reducing server and licensing costs
Like I said, containers are not full-packed VMs
i don't want to proof something. I'm confused
Check link above
I read this. but isn't it a guest OS if i push a linux distro inside
For example - if your Docker image uses some kernel-specific methods (like GPU drivers) you need to install them in the host OS
This is not whole distro but just tools like package manager and so on
If you want to have lightweight virtual machine with different kernel you have User-Mode Linux
@night quest
Korrekt me if i'm wrong. If i Develop something inside a Docker Container there is no need for building a Python venv because the Docker Container is isolated.
right?
Yep!
Is it easy to handle for a Beginner?
Right!
You need to learn how to create images using Dockerfiles
It's not hard to learn but you need to understand some concepts (like what is an image or a layer)
Later you can build more complex structures using Docker Compose
@night quest
So you have BareMetal > ServerOS > Docker Engine (Deamon)> DockerContainer (Images)
As far as I know you are correct
HM hope it is worth to spend time
If memory is increasing but the garbage collection objects aren't increasing, what does that mean?
That your objects didn't be collected by GC?
Idk, I guess
Ah. So thats a possibilty?
Would you know of a way how to handle this increasing memory then?
yo hello @night quest so I took a look into my .git/config file, basically I wanna push the origin000 to the dev branch but it keeps giving me this src refspec dev does not match any
Here's my config file, do u see anything wrong?
what do heads and refs mean?
idk
looks fine to me
btw how i push it is that git push origin000 dev
Can I have a sqlite database on ibm cloud?
Their database service is called db2 https://cloud.ibm.com/catalog/services/db2
But I don't think sqlite is provided, since sqlite is generally not used in production environments.
Generally, if you wanted to use sqlite, you would just create the db on whatever system would use the database.
Thanks I'll check it out
you would just create the db on whatever system would use the database.
Sorry, I didn't understand that.
I'll try to switch to postgress, but is there a big difference between that and sqlite?.
It depends. If you are using an ORM like SQLAlchemy or Django's ORM, then there's hardly any difference.
If you're doing something a little lower level, like writing SQL statements by hand, there may be some slight syntax changes you need to make between dialects.
Because sqlite databases are just a simple file, you would typically just create the database on whatever server would otherwise access the database. In other words, there's usually not much point in having a machine dedicated to running sqlite.
Ok, Thanks 
You can try to manually call GC as far as I know, what do then?
||if "Invalid" in send.text:
with open ("invalids.txt", "a+") as inv:
inv.write(str(line) + '\n')
print("\033[1:32:40[+]" + str(line) + '\n' )
elif "Spotify" in send.text:
with open('valids.txt','a+') as val:
val.write(str(line) + '\n')
print("\033[1:31:40[-]" + str(line) + '\n')
else:
print("[/] BirΕeyler Ters Gitti!")
except Exception as e:
print(e)
||
^
IndentationError: unindent does not match any outer indentation level```
im getting this error idk why
Just remove two spaces before except. Indentation in Python defines logic so you must take care about that.
now it says invalid syntax
File "/storage/emulated/0/Download/spotify checker deneme.py", line 42
except Exception as e:
^
SyntaxError: invalid syntax
$
Where is your try? Please, read some introduce into Python language because you should learn basics
Thank you for your input. I'll try this before atom.
I've read that installing the Insider version of VSCode via Homebrew eliminates the problems I'm having
hello guys, all I wanna do is a simple "push to a remote branch and then merge it to the main branch". But it turns out to be really difficulty for me as I couldn't find resources online that instructs me about it, I have tried various types of commands and they all ended up failing, does anyone have an idea of what i can do?
i tried
git init
git add .
git commit -m "changes"
git remote add origin https://url-to-the-repo.git
git checkout -b branch
git push -u origin branch
and then after that, to merge the <branch> to <main>, but the last line of the commands in the above code block gives me this error
! [rejected] branch -> branch (non-fast-forward)
error: failed to push some refs to 'https://url-to-repo.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
I tried git pull or git pull --rebase (just tried everything) and then none works so idk
just really frustrated with git and i got this project that's due in just few days and im stuck on this stoobei stuff
nahh i was jk
dont take it too seriously
Does anyone use LOC (lines of code) as a measure measurement KPI for devops?
for complexity measurement?
Hi, I need to use Jinja2 to copy values, the main aim is to automate a testing process, I've never worked with template libraries, can I ask about Jinja in this text channel?
@rough ice #web-development ?
Maybe you need to push force this
Sometimes when I need to rebase something, this message appears to me even not having anything new on the branch to pull. When I push force, it works with no problem
Terrible KPI
Why?
People can increase LOC because of measurement
No, then you one line messes
LOC measures complexity. The less code there is the less there is to maintain, the better the porject. (minus cutting tests because lol tests are code.)
it's more of an approximate measure then an indicator of anything concrete i imagine
doesn't tell you much except maybe a couple of basic thresholds a la small/intermediate/huge
I think what your commands did is create a new local branch that was not based off the remote. If you just want to push local changes to a remote branch, do this
git init
git remote add origin https://url-to-the-repo.git
git fetch origin
git switch master
git add .
git commit -m "changes"
git push -u origin
If you want to work with separate branches then you'll need to use git merge to merge changes from one branch into another before pushing.
No, sometimes it's better to write little more code so it's easy to read. For example, at my company, we frown heavily on Lambdas because number of times we had to break Lambdas out because of requirement changes. So even if it's python def add(x, y): return x + y We would do that because never know when requirement comes to return 100 if it's greater then 100
LOC calculations just lead to stuffing a bunch of stuff on one line
its better to use cyclomatic complexity or something better
I agree. Type hinting for example is amazing.
The issue I've run into on many dev teams/companies is rampant product development. Devs have a limit on how much code they can operationally maintain
Product abandonment is functionally lost WIP
For example, @wooden ibex, how many LOC do you manage professionally and on the side?
14 million?
1000?
If there is a vulnerability how confident are you that you'd be aware enough to catch it?
yes, thats what cyclomatic complexity measures
except in a way that isn't easily cheesed by one liners
Oh cool. I didn't know about that
What tool do you use to measure cyc. In your projects @sly sleet ?
Does anyone know why vs code might be not recognizing virtual environments and python interpreters?
also why it started to execute text from a website as commands in the terminal on its own?
I have python installed and in path but when I press Ctrl+Shift+P and choose 'Python: Select Interpreter' nothing shows up
Sure. It does depend if your question is in the right channel
ALot and not as much
Zero
but that's the case for most teams
yo thx, i eventually did solve my problem, i just didnt know how it works, now i do lol
yo thx
hoping someone can help me with an issue on git/github
my github branch is ahead technically with changes
but i actually want to keep what I have local
but it's asking me to git pull before I push
but i dont want the content of the current github branch
just the local
@sand thistle how did the GitHub branch get ahead of your local branch?
Are you sharing it with other people? If not, I'm curious to know how it happened
The safest thing is to git pull and then apply your local changes on top. That would align the two repos again
But I'm curious to know how it got that way in the first place
its shared
Ok then you need to pull first
You can't push if you are behind the GitHub version
When you pull then you should be able to resolve any conflicts between the pull and your latest commits
You should rebase only if you know exactly what you are doing lol
So, you should never rebase any commits that you already pushed
But, if all the commits are local only to your machine, then yes, you can rebase
Do git pull --rebase if the local commits are in the same branch and you just want to replay them on top of the GitHub commits
Or git rebase if you are rebasing local commits from another branch
well
i did a git pull rebase
and this is not the desired result, it combined both files
i just want my local commit
to be the head
i dont understand why its so hard
Yeah a git pull will do this
