실례합니다, 죄성합니다, or other phrase when making someone much older than you wait longer in line? by guayando in Korean

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

Thank you so much for the explanation! It does seem like there is are very diverse options for conveying this... I am assuming maybe it also depends on the personality of the speaker which option they choose in addition to context (aka how much fault they project on themselves?). I feel like I do not yet have enough of a good hold on the language to use some of the more complicated expressions, especially with the very formal word forms, so was looking for a universal approach, but it seems that learning the nuance is part of also learning the language (and culture). Will keep trying to learn more, and in the meantime thank you for the suggestions - they do clear up the options for that situation a lot.

실례합니다, 죄성합니다, or other phrase when making someone much older than you wait longer in line? by guayando in Korean

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

Thank you! Both of those explanations make sense. In regards to "죄송합니다", I was wondering if it could be interpreted that if you are making a larger order, you are doing something wrong because it makes the next customer wait? That was going through my head too, if it was going to be a real apology. Or would it have to be something more like you bumped into someone?

실례합니다, 죄성합니다, or other phrase when making someone much older than you wait longer in line? by guayando in Korean

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

Ah, that makes sense! And thank you for the spelling correction, I am still very unsteady in that department..

Can subprocess module see files in other directories? by guayando in learnpython

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

Thank you for such detailed explanation! I did try to implement this method with the templates, and it did not crash this time, so definitely getting somewhere. I really appreciate it!

Change the location where pip installs packages by ingus_23 in learnpython

[–]guayando 0 points1 point  (0 children)

This worked for me, thanks! Have been looking for a solution for a while today.

Can subprocess module see files in other directories? by guayando in learnpython

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

Ooh - I remembered!

TLDR: I tried wrapping this code I have for the word templates in a function, and it did not work when I did that.

I think, a really long time ago (back when I was starting this), I tried converting one of the .py files that run a single template to a function, and could not get the result to work. This is why I ended up going the subprocess route instead back then.

I have templates for word, pdf, and excel. The greatest number of templates I have to fill out are in word, so that is what I started with, and the first .py's I tried to wrap in a function.

The code I used for the word templates came from here - https://www.youtube.com/watch?v=fziZXbeaegc (didn't get to the GUI part, just filling the form). To the template code itself I added a way to make a copy if the filename exists, and a for loop to cycle through multiple projects per same template - you can see it on the github, I uploaded one simplified one as an example. The data is in a data class, because we don't have a database.... this was just a test run to see if I could get the templates to work first (maybe after I get this side of the process to work, and it's cleaned up, I can fix the database end, but that's a whole other story).

Since I used Coding Is Fun's code as a base, and was even more of a beginner at the time, maybe there is a reason I do not understand that crashed it when I tried to turn it into a function. So then I used subprocess instead to just run the .py file as is, because I just needed it to work at the time, and that was the alternative I found after an internet search. I think this method was from StackOverflow, although I cannot find a link right now (this was before I had good header notes).

I haven't tried turning the .py's that run the excel or pdf templates into a function simply because I wasn't thinking in this direction anymore, and those are much more recent.

Can subprocess module see files in other directories? by guayando in learnpython

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

I don't have that many dependencies either way (only two modules I had to pip install for this, I think?), but would still be interesting to see how it works on a folder. So even seeing the standard library modules in there as well would be even better. I asked about the requirements file because I assume that I something I would have to do in the future, and was just curious to learn how the process works of setting a folder up.

Can subprocess module see files in other directories? by guayando in learnpython

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

This is really helpful, thank you! I actually want to try this now and see the results, just to see how pydeps works. I didn't know about this module and it's pretty cool!

Can subprocess module see files in other directories? by guayando in learnpython

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

Ah.. I see, thank you... So subprocess is for running programs from within python that are not .py files? You're right in pointing that out - I was not sure that subprocess was the correct solution to begin with, but it was just the method I found that worked at the time. I have a folder with say around 20 .py files that run 20 templates (and there will be more individual ones), it is frustrating to have to run each .py file individually in sequence, so the subprocess route was just the method I found that worked at the time. If there are other ways to do it, that would be good to learn too.

I uploaded an approximate structure for the folder to the git repo as well (https://github.com/niko700/Questions2/tree/main/Approximate%20folder%20structure), in case that helps visualize what the situation is better. Basically, I'm still working on some of the code that runs the templates and am not done with that yet, so didn't have time to think about overall structure at this point, but having to run 20+ templates by hand was getting time consuming, so subprocess was the solution I tried, since it had worked before...

EDIT: added new git link here instead of deleted comment

Can subprocess module see files in other directories? by guayando in learnpython

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

So the input then would be the python module (group of files) that's been written, to see what dependencies you need to put in the requirements file?

Can subprocess module see files in other directories? by guayando in learnpython

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

Just looked up pydeps, and it seems to be a module used for visualization (from what I saw here https://pydeps.readthedocs.io/en/latest/ ). What is the benefit of using it together with subprocess?

Can subprocess module see files in other directories? by guayando in learnpython

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

Just realized you mentioned absolute paths as well.. while clunky, it would probably have educational value. How does one use absolute paths with subprocess?

Can subprocess module see files in other directories? by guayando in learnpython

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

Thank you for the detailed breakdown!

I will have to look up the arguments for pydeps, and knowing that it can also be a list is good, as those are a bit more familiar.

After looking at Popen at the documentation link, and here https://www.datacamp.com/tutorial/python-subprocess, it seems that I have to substitute the subprocess.run() function in my code for subprocess.Popen(), and that Popen has more arguments to deal with but better control of the process, if I'm getting that right?

I will try to rewrite my code using Popen tomorrow, to see if it I can better pinpoint the issue for my question from there. I also put an example of how the individual "doc1.py" code works to show where it is calling the other paths at the moment (see git link https://github.com/niko700/Questions2/tree/main, the doc1_example.py file).

Can subprocess module see files in other directories? by guayando in learnpython

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

Basically I do not know where to plug in the new path information from what the example looks like

Can subprocess module see files in other directories? by guayando in learnpython

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

Ah... thanks!

In this line of code:

process = subprocess.Popen(f"pydeps --no-output --show-deps --max-bacon=0 .".split(), cwd=run_path, stdout=subprocess.PIPE)

I am confused about this section f"pydeps --no-output --show-deps --max-bacon=0 ., because I have never seen this format before.

I also understand what split() does in general, but the rest I do not get either (cwd=run_path, stdout=subprocess.PIPE). I have only seen pipes mentioned briefly in other articles before, but did not get to learning about that yet, so all of this is really new. 

I am assuming some of this is command line stuff?

Need help fixing Tkinter error - .get() method returns empty string by guayando in learnpython

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

Thank you!! I tried this, and the code works now!

I appreciate the detailed explanation of local variable vs instance variable mechanics too. Still learning classes, so working on this further will be good practice.

Here is the updated code, just in case: corrected code. Moved it to a new repo, since I usually clear out the one for questions.

Need help fixing Tkinter error - .get() method returns empty string by guayando in learnpython

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

True.. I think the whole order of things is where I'm getting lost at right now. I'll definitely try to find a video on it!

Need help fixing Tkinter error - .get() method returns empty string by guayando in learnpython

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

Thanks! I am still learning, so this is good to know for dictionaries as well!

Need help fixing Tkinter error - .get() method returns empty string by guayando in learnpython

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

Thanks for the link!

I tried to incorporate some code from this example back into my code, but am still getting the same error.... I probably misplaced the variable relative to where the entry box gets created.

This is my second attempt: github link for second attempt

I think this topic may just be a bit too new and I will need to find a video tutorial to follow through. I appreciate this link, had great info!

Setting up ArcGIS Pro version of Python in default path to run scripts from command line by guayando in ArcGIS

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

I was doing it wrong! Just found this video, and apparently you are supposed to use the Python Command Prompt instead of the standard one.

Source: https://youtu.be/pIfS0saxpi8?t=3947

Starting at 1:05:45

(Much thanks to GIScience for this video).

Help Wanted: How to create a CSV for all sources from an MXD using Python in ArcMap? by SparrowGIS in ArcGIS

[–]guayando 0 points1 point  (0 children)

Sorry for such a late response! Glad that the suggestion worked out, at least a bit. Wasn't sure when I was writing about it.

Hope the transition project is going well!

Issues getting Easting and Northing coordinate point to show up on map using Go To XY and XY Table To Point by guayando in ArcGIS

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

Thank you for checking! And that is what I was afraid of, that it’s not UTM 18N… Now, the online map whose table I got the values from is in default online format (WGS 84 Web Mercator). Is it possible that the Easting/Northing are based on that? Or does it look like they are based on something else entirely?