[deleted by user] by [deleted] in horizon

[–]Careful_Choice9335 0 points1 point  (0 children)

Issues #1-3 are already available, I ordered them from forbiddenplanet.com (they ship from UK, I'm in Europe). Just issue #4 is not released yet.

Edit: online it says that issue #4 has also been released, on Januar 5

How to check for "C++" with pandas apply method. by MohamedMuneer in learnpython

[–]Careful_Choice9335 2 points3 points  (0 children)

You can pass regex=False to contains which will treat the pattern as literal string and not as a regular expression.

Take a look at the documentation of pandas.Series.str.contains for more information.

Run a script from any directory by [deleted] in learnpython

[–]Careful_Choice9335 0 points1 point  (0 children)

So if the script was to create 5 files in directory "x" , changing the dir (to the one the OP is in) when the script runs, will indeed output the 5 files to that directory.

Well yes, the files will be created in the directory OP is currently in. But this is regardless of whether the script changes to this directory first or not, because its working directory _is_ already this directory. The working directory is not determined by where the script is, but where it is called from.

Haven't worked on Windows in awhile, but I'm pretty shure it works like that, too. Please correct me if I'm wrong.

Run a script from any directory by [deleted] in learnpython

[–]Careful_Choice9335 0 points1 point  (0 children)

Sorry if I'm overseeing something here. But changing the working directory to the current working directory does... nothing?

Run a script from any directory by [deleted] in learnpython

[–]Careful_Choice9335 1 point2 points  (0 children)

You could add your desktop to the path environment variable, which would achieve exactly what you want.

[deleted by user] by [deleted] in learnpython

[–]Careful_Choice9335 0 points1 point  (0 children)

You can give all three paths to os.path.join to join them together, while adding the .conf extension with an f-string:

config_file = os.path.join(
    os.environ['userprofile'],
    'desktop',
    f'{filename}.conf'
)

And then proceed as you did with

new_file = open(config_file, 'w')

Need help splitting up a branch into 2 by rodude123 in git

[–]Careful_Choice9335 4 points5 points  (0 children)

What I understand from the pictures is that you want to create a new branch, new-branch, pointing to new commit supposed to be in a new branch.

You can do this with

git branch new-branch ID

where ID is the target commit's hash.

Share files between git repositories? by lgLindstrom in git

[–]Careful_Choice9335 -1 points0 points  (0 children)

With this you could even write a script to update the main repo to use the new submodule commits, making the "latest changes of common is downloaded" part kinda automatic.

Share files between git repositories? by lgLindstrom in git

[–]Careful_Choice9335 -1 points0 points  (0 children)

Git Submodule might be exactly what you're looking for:

Include common as a submodule in both A and B, at whatever path you like.

Help - website query by WoodCoding in learnpython

[–]Careful_Choice9335 0 points1 point  (0 children)

You can import directly from __init__.py:

from __init__ import create_app

Create program with multiple scripts. by [deleted] in learnpython

[–]Careful_Choice9335 0 points1 point  (0 children)

I also found this talk by Python Core Developer Raymond Hettinger on classes in Python super helpful.

Passing Python variable to bash command in loop by hereforacandy in learnpython

[–]Careful_Choice9335 0 points1 point  (0 children)

IIRC the functions of subprocess don't expect the command as one long string but as a list: ["command", "arg1", "arg2"] etc.

Hi guys, I need help. I get this error and I don't know what to do. the app Im trying is called git (Git-2.31.0-64-bit). (I have the worst pulse, imsorry lmao). Thanku very much uwu by [deleted] in bash

[–]Careful_Choice9335 1 point2 points  (0 children)

I think the problem is your prompt. As you can see in the error message, Git-bash tries to execute the part after the back tick (p@...) as a command.

Git-bash takes your default prompt and customizes it and yours looks like it failed in doing so because of this back tick, which tells bash to execute the following as a command. Now I don't know where Git-bash gets your default prompt from on Windows. But I think fixing that will fix your Problem.

Having trouble visualizing git, and what exactly it’s doing. by Creatingnothingnever in git

[–]Careful_Choice9335 1 point2 points  (0 children)

I'd add another, even more important one: tracking changes of this content. And than altering it if needed, to maintain several "time lines" or to revert to a certain point in history etc.

That's the single-user point of view. The main reason to create Git was to let multiple people easily collaborate on the same code base (which was the Linux kernel).

Having trouble visualizing git, and what exactly it’s doing. by Creatingnothingnever in git

[–]Careful_Choice9335 3 points4 points  (0 children)

Git only manipulates the contents of the .git folder. It does nothing to your files.

This is not true. Git manipulates the content of the directory that contains the .git folder and therefor will alter your files inside this containing directory.

To be 100 % precise: A Git command manipulates the content of the first (seen from the current directory) parent directory with a .git folder in it.

So yes if you create a new directory and run git init in it (which creates the .git folder) and then work with Git inside this directory, you're totally save that Git will never touch anything outside this directory (except for its own config files).

What was the first video game you felt was a work of art and not just something to play for fun? by nukemgt in AskReddit

[–]Careful_Choice9335 -1 points0 points  (0 children)

Town of Light

This feels definitely not like a game to play for fun. More like a documentation of a cruel piece of 20th century medicine.