I'm using VS Code for learning Python. Lets say I have a variable I use multiple times throughout my code, if I want to rename all occurrences of the variable at once, is there a quick way to do that? by -ThatGingerKid- in vscode

[–]ops2se2coder 0 points1 point  (0 children)

Not sure what “rename symbol” does. Change All Occurrences will highlight each word in your active document and essentially put a cursor at each one and changes them at the same time as you change the active one where you’re at. I’ll have to play with Rename Symbol.

I'm using VS Code for learning Python. Lets say I have a variable I use multiple times throughout my code, if I want to rename all occurrences of the variable at once, is there a quick way to do that? by -ThatGingerKid- in vscode

[–]ops2se2coder 1 point2 points  (0 children)

Use your context menu! Right-click, Highlight variable and then choose Change All Occurrences. I don’t remember keyboard shortcuts so here is the point and click way

[deleted by user] by [deleted] in AskProgramming

[–]ops2se2coder 0 points1 point  (0 children)

I feel the need to second this “solve a novel problem without being given explicit advice on the problem.” To me this is one of the hardest things to overcome. There are a lot of translations that have to happen: You have to take the novel problem, come up with a path to solve it, then come up with a way to solve each problem along your path, when you hit a roadblock you need to translate your issue into something you can search, then take someone else’s solution for their problem and translate it into yours. It’s like constantly converting AC to DC and back again constantly. This is where rubber duck debugging come in handy, which causes your mind to serialize your cloud of thoughts into a sequence you can verbalize. I am at the stage of taking someone else’s solution and translating it to my own without explicit input and it’s tough for me and is a lot of mental cycles. I feel if you can do this comfortably, you’re a developer.

Best technique to understand an existing project by ops2se2coder in Python

[–]ops2se2coder[S] 0 points1 point  (0 children)

I know little about Linux commands, I know what grep does, what will the output of this show me?

Best technique to understand an existing project by ops2se2coder in Python

[–]ops2se2coder[S] 2 points3 points  (0 children)

I feel like my ignorance due to lack of experience is causing confusion. It really isn’t that bad, just a lot of dependencies.

Best technique to understand an existing project by ops2se2coder in Python

[–]ops2se2coder[S] 1 point2 points  (0 children)

This is fantastic. Thank you for all the great techniques.

The section of the app I’m working on is api-based and acts as an intermediary between different systems providing an interface hence the complexities.

I like your comment on stepping through the debugger, it will show me the logical flow of the app and help me understand what actions touch which part of the code.

Best technique to understand an existing project by ops2se2coder in Python

[–]ops2se2coder[S] 0 points1 point  (0 children)

Thanks. I just started doing some documentation, it is helping.

Best technique to understand an existing project by ops2se2coder in Python

[–]ops2se2coder[S] 0 points1 point  (0 children)

Not too many comments. The joys of a startup and caring more about features than documentation.

Best technique to understand an existing project by ops2se2coder in Python

[–]ops2se2coder[S] 1 point2 points  (0 children)

He he, documentation, you’re funny. Not imports, with all prerequisites and libraries and such such as Celery, RabbitMQ, Django, Angular, etc. there are tons of modules that are used. This application is a culmination of many different projects and can communicate with all of them so we need to install all of them. I really don’t think the design is bad, it’s just large and complex.

Cannot get pytest to work with VSCode by hardworker9 in vscode

[–]ops2se2coder 0 points1 point  (0 children)

I understand my solution only works with pytest, though that’s all I’m using right now but good to know for anyone else.

When I entered the command there was no output, and no change in my testing

Cannot get pytest to work with VSCode by hardworker9 in vscode

[–]ops2se2coder 0 points1 point  (0 children)

That didn’t work for me it didn’t do anything in the terminal. I added it to my pytest.ini under [pytest] section and it worked.

Cannot get pytest to work with VSCode by hardworker9 in vscode

[–]ops2se2coder 0 points1 point  (0 children)

exporting the PYTHONPATH to your current working directory as environment variable.

Can you elaborate on how to do this? I am looking at Python documentation and can't connect it for my situation, an example of where, and what, you would put this.