#tools-and-devops

1 messages Β· Page 59 of 1

zealous bison
#

i cant do that ofcπŸ‘

#

XD

mild lance
#

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

mild lance
#

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?

mild lance
#

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:

  1. What are all of the different images I see in docker desktop?
  2. How come postgres images are "just ran" rather than built?
mild lance
#
  1. How can my other different container access the 5432 port 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"}
eternal flicker
#

@mild lance

rich nymph
#
{
    "python.linting.enabled": true,
    "python.linting.flake8Enabled": false,
    "python.linting.pylintEnabled": true,
    "editor.fontFamily": "Fira Code",
    "editor.fontSize": 16
}
mild lance
sly sleet
#

did you restart vscode

rich nymph
#

yes

obtuse saddle
#

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).

rich nymph
#

How do I make it so that my application would automatically pull, and restart, when a merge happens in github?

rich nymph
#

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

rich nymph
#

nvm i got it

radiant jasper
#

Anyone have experience using python + ssis / visual studio

safe heart
#

Hey guys, I cant seem to install tensorflow

gloomy trellis
#

anyone here work with codeartifact and docker

pine fern
#

azure vs. gcp vs. aws

cold gate
#

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.

clever raven
#

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

warm pollen
#

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

clever raven
#

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)

solid frost
#

they each excel in various areas depending on your use case, i don't know enough to recommend one over the other

pine fern
#

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)

soft axle
#

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!

pliant meadow
#

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?

sand thistle
#

502 bad gateway

#

uh ohhh

heavy knot
#

I wanna learn python can anyone help me find a good ide for mobile plz

torn creek
heavy knot
#

Thank you

wooden ibex
#

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

pine fern
#

good to know about GCP too

unique kite
#

Hello all, anyone using VScode for python3 development?

night quest
sly sleet
night quest
#

VS Code is like "I can be smart with some plugins"

sly sleet
#

pycharm has a bunch of random features that I will never use

wooden ibex
#

Bunch of people use VScode

#

It’s second most popular behind py charm

calm mirage
#

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?

night quest
calm mirage
#

hmm?

night quest
# calm mirage hmm?

If you are creating some kind of APIs you should consider downloading something like Insomnia to easy test it

calm mirage
#

oh

heavy knot
#

can anyone who knows tkinter go to user-interfaces please

austere knoll
#

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.

arctic flicker
#

how could it be that my debug is on the blue line but my screen doesn't show "moving on" printed?

short peak
#

perhaps related to how output is set in your project? have you tried printing somewhere else in the project?

night quest
arctic flicker
night quest
fleet geyser
ripe pike
#

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

obtuse wyvern
#

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...

arctic flicker
#

@obtuse wyvern what happens when you try it?

#

is the object found?

civic walrus
#

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
obtuse wyvern
olive junco
#

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.

Anaconda

Anaconda's open-source Individual Edition is the easiest way to perform Python/R data science and machine learning on a single machine.

arctic flicker
#

@obtuse wyvern is the element actually found? does it return?

obtuse wyvern
#

let me check @arctic flicker

arctic flicker
#

don't be shy to show us your output

knotty wasp
#

hi guys im here

#

i need some help in pycharm

rain belfry
#

does anyone here know what the difference between github's repository secret and environment secret is?

small light
#

@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

rain belfry
small light
#

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

rain belfry
#

hmm

#

so its just like a namespace? giving Environment priority over Repository ?

small light
#

not sure about priority πŸ˜›

rain belfry
#

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?

small light
#

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

rain belfry
#

oki, thanks πŸ™‚

heavy knot
#

hello

#

can someone help me

#

pls

olive junco
#

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.

thorny helm
#

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

nocturne anvil
#

seems like a terminal issue

#

wonder if u can check whether u modified any settings

stable olive
#

pyttsx3

Its not working in my PC
I installed the packaged too
But its generating error

heavy knot
#

Can anyone help me?

#

I need to rewrite a code

#

because it's not up to date

stark flare
#

Why am I getting an error?

nocturne anvil
#

did u forget to define it earlier

small light
#

Your code looks a bit strange....

rancid schoonerBOT
#

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.

stark flare
stark flare
compact valley
#

!warn 338657065645899778 please do not post or ask for help with exploit code here, as it violates rule 5

rancid schoonerBOT
#

:incoming_envelope: :ok_hand: applied warning to @stark flare.

barren iron
#

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!

small light
#

Export the data from the development and re-import to prod?

worldly marlin
#

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.

dusty maple
#

@worldly marlin If your package has a __main__.py module, you should be able to do that in a relatively straightforward manner

worldly marlin
#

ah, would an __init__.py do the same thing or does it have to be __main__.py

dusty maple
#

They're distinct

worldly marlin
#

kk, i'll test out adding the __main__.py thanks

worn forum
#

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

upper oyster
#

Are you using VS or VS Code?

#

@worn forum

worn forum
#

idk the dif

upper oyster
#

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

worn forum
#

i have just vs

upper oyster
#

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

worn forum
#

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

upper oyster
#

Which one do you have?

worn forum
#

VS

upper oyster
#

I'd recommend not to use VS for Python

worn forum
#

ok

#

what should i use

upper oyster
#

Especially if you are going from repl.it

#

Visual Studio Code

worn forum
#

ok

upper oyster
#

You'll find it much simpler to use

worn forum
#

okee

#

thank you

upper oyster
#

What made you install Visual Studio for Python in the first place?

barren iron
#

@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

final sky
#

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...

upper oyster
#

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

final sky
#

Probably, ughh...

upper oyster
#

What are your PC specs?

final sky
#

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
final sky
#

Probably insufficient RAM

upper oyster
#

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

final sky
#

Let me check if I still have this problem

upper oyster
#

That's with no chrome

final sky
#

It works now, huh

upper oyster
#

Lol

final sky
#

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

upper oyster
#

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

robust peak
#

can somebody help me set up esp32 with vscode im struggling

hidden lily
#

How can I go about using a virtual env with PyCharm from within a Docker container?

orchid raptor
#

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

heavy knot
real coral
#

devops?

remote olive
#

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
#

hi at which value is the chr() funktion out of rage?

#

pls help

remote olive
#

@thorny mauve go to AVAILABLE HELP CHANNELS

thorny mauve
#

oh sry im not native english speaker and i was to lazy to do all the channel names on the google translater

upper oyster
#

@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

thorny mauve
#

@remote olive lol where is this channel i can not find it :C

remote olive
#

@upper oyster I see, but what about the parts of my code that requires those data? is unit testing appropriate for those as well?

thorny mauve
#

ah thx

upper oyster
#

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

remote olive
#

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?

upper oyster
#

I'm not aware of any

#

What would you want a module to do?

remote olive
#

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

upper oyster
#

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

remote olive
#

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?

upper oyster
#

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

remote olive
#

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

upper oyster
#

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?

remote olive
#

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?

upper oyster
#

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

remote olive
#

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

upper oyster
#

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

remote olive
#

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

upper oyster
#

Right

remote olive
#

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

upper oyster
#

How long do you think it would take you to write a full regression test suite?

remote olive
#

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

upper oyster
#

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

remote olive
#

I don't follow, do you mean I write test scripts before writing the actual project scripts?

#

or did I misunderstood?

upper oyster
#

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

remote olive
#

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

upper oyster
#

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

remote olive
#

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

upper oyster
#

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

remote olive
#

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

upper oyster
#

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

remote olive
#

reading the article, I guess I understand more what you mean introducing more bugs into the code

upper oyster
#

Not saying you have to use Emacs of course

#

I wouldn't wish that on anybody :P

#

But you get what they mean :)

turbid hollow
#

Hi @ all

#

i'm using VS -Code

#

Is there a good way to Colorize the SourceCode like that for Python

upper oyster
#

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?

turbid hollow
#

I think it is easier to read

#

if for example Int(), float(), str() had another color

upper oyster
#

Not sure if you can customise it to that extent

turbid hollow
#

there is something like MagicPython

#

i install it but somehow it doesn't work for me

wooden ibex
# turbid hollow

It's working fine in my VSCode, make sure you have both Python/Pylance running

turbid hollow
#

How does it look

#

??

#

Would you send me a Screenshot

#

for comparrison

wooden ibex
#

Discord upload is broken

turbid hollow
#

Oh ok

#

i installed Pylance but nothing changed

wooden ibex
turbid hollow
#

do i neet to configure something?

stray pine
#

Anyone here familiar with scrapy

stray pine
turbid hollow
#

Highlighting the Syntax

turbid hollow
stray pine
#

Which editor are u using

turbid hollow
#

VsCode

stray pine
#

Sorry, not too sure

turbid hollow
#

Same Same πŸ˜„

#

What are you trying to do with scrapy?

stray pine
#

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

turbid hollow
#

interessting

turbid hollow
stray pine
#

lol

#

I was thinking the same

wooden ibex
#

Pretty sure it's been replaced

turbid hollow
#

with nothing

wooden ibex
#

Are you using Pylance?

turbid hollow
wooden ibex
#

Did it activate?

turbid hollow
#

before i get every time a Message to install it

wooden ibex
#

Go into Preferences

turbid hollow
#

mom

wooden ibex
#

It will require VSCode restart quite possibly

turbid hollow
wooden ibex
#

then not sure what to tell you

turbid hollow
#

i don't know

#

Story of my life πŸ˜†

turbid hollow
stray pine
#

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

wooden ibex
#

Create venv, VSCode will pick up on it

stray pine
#

I did

wooden ibex
#

I think it has to be named .env/.venv/env/venv

stray pine
#

I got to that

#

But how do I run it in vs terminal

wooden ibex
#

OS?

stray pine
#

Windows

wooden ibex
#

So sometimes default Powershell Windows it creates doesn't pick up on it

#

generally creating a new one will

stray pine
#

python3 file name.py in vs terminal uses main base

wooden ibex
#

is it activated?

stray pine
#

It is in cmd

#

But can’t get that in vs code

wooden ibex
#

That's Powershell, no clue about Cmd, I don't use it

stray pine
wooden ibex
#

it mostly activates automatically for me but if it doesn't, it's <env folder>/scripts/Activate.ps1

stray pine
#

Thanks for the help, not working for me

wooden ibex
#

Are you using Powershell

#

what does default terminal say?

stray pine
#

Nope

wooden ibex
#

PS will be PS

#

Cmdline will be <I'm ancient and shouldn't be looked at>

stray pine
#

I can get it to work in cmd and powershell

#

But I want it to work in vs code terminal

wooden ibex
#

Terminal by default uses Powershell so if it works in Powershell, it should work fine in terminal

stray pine
#

Anyways, getting late πŸ’€

#

Thanks though

turbid hollow
#

It was because of the theme

turbid hollow
#

Dark+

heavy knot
#

how do i add threads

#

to my tool

night quest
#

!d threading.Thread

rancid schoonerBOT
#
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)
heavy knot
night quest
# heavy knot ty

Your welcome! You can also use futures.concurrent.ThreadPoolExecutor

#

Pff

heavy knot
#

oh ok

night quest
#

Executor is fine class when you want to dispatch some async tasks

young drum
#

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

obtuse oak
#

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?

foggy marlin
#

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?

upper oyster
#

!resources

rancid schoonerBOT
#
Resources

The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.

whole night
#

what does it mean to replay a commit in git?

turbid hollow
#

Oh i had that too

#

this is about policy

stray pine
#

did you manage to fix it?

turbid hollow
#

yes it was not so hard

#

only a one liner in PowerShell

#

let me check

stray pine
turbid hollow
#

Set-ExecutionPolicy RemoteSigned

turbid hollow
stray pine
#

I've downloaded pylance, but I can't get it to work

turbid hollow
#

i tell you

#

one by one

#

let us check your executionpolicy first

stray pine
turbid hollow
#
  1. You need to Run PowerShell as Admin
#
  1. Set-ExecutionPolicy RemoteSigned
#
  1. 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

stray pine
#

Thanks, much appreciated

turbid hollow
#

Restart VsCode and run you script

#

does it work for you?

stray pine
#

ye

turbid hollow
#

if you type

#

Get-ExecutionPolicy

#

You can check it

#

and change the policy again if you need that

stray pine
#

How would you revert back to normal

turbid hollow
#

it should be restricted

stray pine
#

How did you change pylance

turbid hollow
#

restricted

#

which theme do you use?

stray pine
#

Markdown Editor dark

turbid hollow
#

turn it to dark+

stray pine
#

cool!

#

Nice

turbid hollow
#

there are also other Theme extentions you can check

stray pine
#

Ye seen that, thanks

turbid hollow
#

This is my Fav for now

stray pine
#

any particular reason?

turbid hollow
#

everyone has a different taste

stray pine
#

true say

turbid hollow
#

i like that the outkommented lines aren't screeming on you

#

i think it enjoyable to read

stray pine
#

btw I don't get the different colors

turbid hollow
#

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

mighty condor
#

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

tawny temple
#

How about specifing all services except the pgadmin service?

#

docker-compose logs service1 service2

mighty condor
#

I would do that if I ran with docker-compose up -d right? Right now I run in attached mode

tawny temple
#

Yeah

#

Your solution is more convenient

mighty condor
#

Ok cool to learn, thanks!

tawny temple
#

Though I probably wouldn't completely nuke the logs

merry stag
#

could you please anyone suggestion me profiling tool

vast nebula
#

Can someone tell me what it's saying to do?

lunar holly
#

@merry stag I really like pyinstrument

graceful patio
soft citrus
#

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

graceful patio
#

that's a problem with their computer

soft citrus
#

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

pulsar vector
#

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

merry stag
#

@lunar holly thank you

vast nebula
rancid schoonerBOT
#

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:

https://paste.pythondiscord.com

plush cobalt
#

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?

rich nymph
#

So if your fork is behind, how do up make it up-to date?

candid kayak
rich nymph
#

thank-you

obtuse cipher
#

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.

wooden ibex
#

Nope, there is too many variables to make a framework viable

tender plank
#

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?

sand thistle
#

uhhh

#

how do i undo a git push

tawny temple
#

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.

candid juniper
#

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?

worldly marlin
#

vscode

molten haven
#

I'd recommend IDLE if you're new to Python and software development in general.

sly sleet
#

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

candid juniper
#

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

upper oyster
candid juniper
#

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

heavy knot
#

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

upper oyster
#

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.

rapid estuary
#

where do i put the pipfile and pipfile.lock? in my project folder?
and should i rename the virtual env to my project name?

olive compass
#

What is the best way to protect the master/main branch in a github repository when starting an open source project?

eternal flicker
#

Don't know about the "best way", but Github has branch protection rules for each repo

robust wraith
#

@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.

olive compass
livid schooner
#

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

hearty basin
#

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

ancient flower
lean grove
ancient flower
#

somehelp guys !!!!!

spark falcon
#

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()
sly sleet
#

yeah, threads are tied to the process

spark falcon
#

ah

spark falcon
sly sleet
#

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

spark falcon
#

set the flag? like when im running the python file?

sly sleet
spark falcon
#

alr thx

spark falcon
#

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

brisk lake
#

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

graceful patio
#

what kind of special details

abstract jay
#

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

warm pollen
#

IDLE isn't an IDE

abstract jay
#

oh

#

well, it does syntax highlighting and in-context argument hinting

warm pollen
#

Yep, but that's about it

abstract jay
#

and it has a basic debugger. WHat is it lacking

warm pollen
#

It is lacking a lot of more advanced features

abstract jay
#

well, anyway, I found idle's features fall quite short of Pycharm's

#

the variable explorer in pycharm is miles ahead

warm pollen
#

Like jump to definition, type checking and such

#

Yep

abstract jay
#

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

upper oyster
#

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

brisk lake
upper oyster
#

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

brisk lake
#

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

cloud elbow
#

how do I access redis that is running localhost in docker?

fleet geyser
cloud elbow
#

nope that's not how that works I think. because I tried

fleet geyser
#

do you expose the port?

cloud elbow
#

of course

#

I should've used container_name as host

#

I guess

fleet geyser
#

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?

small light
# cloud elbow nope that's not how that works I think. because I tried

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
cloud elbow
#

"compiled by my head"

thanks for the answer though, and yes I am still denying the barba's answer

small light
#

Are you still having issues though?

cloud elbow
small light
#

πŸ‘

cloud elbow
#

but you know, I tried everything, localhost and 0.0.0.0

small light
#

wait, were you trying to connect to the redis container from another container? In that case you have to use the container name

cloud elbow
#

yes, and I guess my question was not correct at the beginning. oops. bed england

small light
#

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.

opal tapir
#

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?

graceful patio
#

well it includes the entire python programming language @opal tapir

opal tapir
#

ahh, it has to store that information if someone doesnt have python installed?

graceful patio
#

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

hexed ermine
#

Hello, i have a problem with visual studio code and python, it says i need to select python interpreter... These are the options:

#

bottom right

#

Can anyone help me pls?

winter isle
#

run as admin?

cold gate
#

Could you expand the error message?

#

I think this has to do with modifying the PYTHONPATH rather than the location of an interpreter

hexed ermine
#

Me?

winter isle
#

Did u run as admin?

cold gate
#

I don't think it's related to that

hexed ermine
cold gate
#

Could you open your user settings file? It should be a JSON-based file.

#

There may be an error in there

hexed ermine
hexed ermine
#

Is it in python files?

#

And if it is where are those?

cold gate
#

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

hexed ermine
#

I'll search for the files

cold gate
#

Another option would be your workspace settings file

#

It could have a missing curly brace, comma, or another JSON-related mistake in there

hexed ermine
#

I can't find the files

cold gate
#

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.

hexed ermine
#

Ok, thank you

cold gate
#

Do you have a workspace open in VSCode?

hexed ermine
#

What's that?

#

And how do i do that?

cold gate
#

If you haven't saved a workspace, then it's probably not that, but that's another json file

hexed ermine
#

Just so you know, when i type python code there, it works, but no normally pressing F5

#

Only when i press the file itself

cold gate
#

What do you see when you do:

  • ctrl+shift+p
  • type "configure language specific settings" and hit enter
hexed ermine
cold gate
#

select python

hexed ermine
cold gate
#

ah

#

there's an error

#

add a comma at the end of line 3

hexed ermine
#

This is a comma right: ,

cold gate
#

yes, the same as at the end of the other lines

hexed ermine
#

"html": "cd $dir && start chrome $fileName"
"javascript": "node" ,

cold gate
#

What happens here is that JSON wants a , as a separator between the different key->value pairs

hexed ermine
#

there is a comma

cold gate
#

Not after "html": "cd $dir && start chrome $fileName"

#

That's line 3

hexed ermine
#

yes i see it

#

Should i save it and try again?

cold gate
#

yeah, it will probably work now

#

unless there's another mistake somewhere

hexed ermine
#

Oh it worksss

#

You are the best

#

But one second

cold gate
#

sure

#

I do have to get back to work soon

hexed ermine
#

When i press the arrow and type:
print("test")
Where is it supposed to show me the output?

hexed ermine
#

Sorry for the burden

cold gate
#

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

hexed ermine
#

How?

#

Do you know?

flat star
#

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.

hexed ermine
#

Ok @flat star

#

There is nothing

warm pollen
#

You have two spaces between system and environment, not sure ir it would do anything

hexed ermine
#

Still won't work

#

@flat star Are you sure this is ok?

#

Anyone?

night quest
#

Try to start typing env...

#

I have localized version so I need to type in my language

hexed ermine
#

They helped me already, thanks

night quest
#

πŸ‘

hexed ermine
#

I mean there is anoter problem but it is linked to discord.py

mortal swallow
forest phoenix
#

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

heavy knot
#

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

elfin rivet
#

@heavy knot are you using html?

elfin rivet
#

I can help you

heavy knot
#

i just need a command which counts the lines in my private site

#

it is shown on the picture under the preffered qualiffications

elfin rivet
#

Waittt, will u use python for counting

heavy knot
#

no

elfin rivet
#

Ohk, full html

heavy knot
#

this part

elfin rivet
#

Are you done with bold heading

#

And lists

heavy knot
#

yes yes

elfin rivet
#

Welp, πŸ€” u want to count the num of lines in the list of preferred qualifications

#

Right

elfin rivet
#

This may help

heavy knot
#

thank you

spring stump
#

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?

pastel topaz
#

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

#

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

severe cradle
#

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

severe cradle
#

For example, telegram does this.

severe cradle
#

This will clear all iptables chains. And don't forget to restart a docker service

sly sleet
#

@pastel topaz you need to install powerline symbols

pastel topaz
#

wait I think I understood what you mean

#

one second

#

Nope it isn't working

#

@sly sleet how would we do it?

sly sleet
#

then you can set terminal.integrated.fontFamily to a powerline patched font

pastel topaz
#

okie thanks!

pastel topaz
#

It's working!

night quest
#

It's easy to merge repos but you need some work to split them out

proper shadow
#

recommendations for vs code plugins for beginners? I have the extension pack which is pretty helpful.

frozen anchor
#

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

warm pollen
#

Hmm maybe adding a branch protection rule will prevent that

wooden ibex
frozen anchor
wooden ibex
rancid mulch
#

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.

lucid tangle
#

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?
lucid tangle
#

nvm

thorny helm
#

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

spring kindle
#

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 :(

strong mica
#

does anyone know a program to help me not get ddosed or how ever you spell it?

night quest
strong mica
#

no like a program or something so i can plug my laptop into my xbox

#

so i dont get ddosed

night quest
#

I don't know any open source software that prevents from DDoS attacks

strong mica
#

oh alright

night quest
#

You should also note that even if you have any there still exists a limit for your hardware

strong mica
#

oh alright thanks

#

what does python do?

night quest
strong mica
#

like in simple terms, what can you do with python whats the purpose of it?

#

im new to it

night quest
lunar holly
#

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
rich gorge
# strong mica so i dont get ddosed

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.

silk steeple
#

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

sly sleet
#

unless you're running a webserver or something on your home network, which is a bad idea in the first place

twin knoll
#

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

sly sleet
#

why tho @twin knoll

real hedge
#

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

turbid hollow
#

hi@all i'm a python learner and i don't know how to manage multiple projects with different python versions & dependencies

flat marlin
#

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?

hearty basin
#

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:

real hedge
flint barn
#

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?

flat marlin
#

@real hedge Thank you!

wooden ibex
# flat marlin <@!341582409168453642> Thank you!

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.

spark falcon
#

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

spark falcon
#

Would it work?

night quest
#

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

night quest
spark falcon
night quest
spark falcon
#

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

night quest
#

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.

spark falcon
night quest
spark falcon
#

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

night quest
#

If branch exists on remote then you have two options:

  1. Use git fetch to get remote changes.
  2. DANGEROUS Use git push --force to force overwrite remote changes. (it removes remote branch and replaces it with local changes!)
spark falcon
#

oh i see

#

lemme try the first one

#

wait isn't it "pull"?

night quest
spark falcon
#

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'.

night quest
spark falcon
#

yea, but its not, idk

night quest
#

How about?

$ git push --set-upstream origin2132 another-one-branch
spark falcon
#

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
spark falcon
#

oh crap

#

i forgot

#

so do i do it before remtoe add origin?

night quest
spark falcon
#

kk

#

oh wait

#

still

#

idk man

night quest
spark falcon
#

no doesnt work πŸ₯²

#

it keeps giving me this "Everything up-to-date"

#

but its not

night quest
spark falcon
#

ok thx

#

oh yea i tried that

#

still doesnt work

#

i have no idea

#

lol

night quest
# spark falcon lol

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
spark falcon
#

oh so add the -u tag?

night quest
#

If it's not working in your case check your git configuration (both client and server)

spark falcon
#

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

night quest
turbid hollow
#

hi@all

#

is anyone familiar with Docker

#

??

warm pollen
#

Sure, what’s up @turbid hollow ?

#

You can ask right away, no need to ask to ask

turbid hollow
#

@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.

night quest
turbid hollow
night quest
turbid hollow
#

this is also a good one

night quest
#

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

turbid hollow
night quest
turbid hollow
#

I read this. but isn't it a guest OS if i push a linux distro inside

night quest
#

For example - if your Docker image uses some kernel-specific methods (like GPU drivers) you need to install them in the host OS

night quest
#

If you want to have lightweight virtual machine with different kernel you have User-Mode Linux

turbid hollow
#

@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?

warm pollen
#

Yep!

turbid hollow
night quest
night quest
#

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

turbid hollow
#

@night quest
So you have BareMetal > ServerOS > Docker Engine (Deamon)> DockerContainer (Images)

night quest
turbid hollow
#

HM hope it is worth to spend time

hearty basin
#

If memory is increasing but the garbage collection objects aren't increasing, what does that mean?

night quest
#

Idk, I guess

hearty basin
#

Would you know of a way how to handle this increasing memory then?

spark falcon
#

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

vocal quiver
#

Can I have a sqlite database on ibm cloud?

open spear
#

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.

vocal quiver
#

I'll try to switch to postgress, but is there a big difference between that and sqlite?.

open spear
open spear
vocal quiver
#

Ok, Thanks lemon_pleased

night quest
leaden ruin
#

||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
night quest
leaden ruin
night quest
flat marlin
spark falcon
#

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

fast pivot
#

Does anyone use LOC (lines of code) as a measure measurement KPI for devops?

#

for complexity measurement?

rough ice
#

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?

fast pivot
fading rivet
#

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

fast pivot
wooden ibex
fast pivot
#

XD

#

backwards my dude

#

you want LOC to go down

wooden ibex
#

No, then you one line messes

fast pivot
#

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.)

lone linden
#

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

tawny temple
# spark falcon hello guys, all I wanna do is a simple "push to a remote branch and then merge i...

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.

wooden ibex
sly sleet
#

LOC calculations just lead to stuffing a bunch of stuff on one line

#

its better to use cyclomatic complexity or something better

fast pivot
fast pivot
#

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?

sly sleet
#

yes, thats what cyclomatic complexity measures

#

except in a way that isn't easily cheesed by one liners

fast pivot
#

What tool do you use to measure cyc. In your projects @sly sleet ?

runic pond
#

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?

runic pond
fast pivot
#

Sure. It does depend if your question is in the right channel

wooden ibex
#

but that's the case for most teams

spark falcon
spark falcon
sand thistle
#

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

upper oyster
#

@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

sand thistle
#

uhh well we branched to refactor some code

#

and something went wrong a long the way

upper oyster
#

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

sand thistle
#

right but if there are a lot of differences

#

cant i rebase

upper oyster
#

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

sand thistle
#

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

upper oyster
sand thistle
#

thats not my object

#

i tried resetting the head to the commit on the test branch, before these issues came about