Updated version of yaml file is not getting read The Next CEO of Stack OverflowHow do I check whether a file exists without exceptions?How to get the current time in PythonWhat is the difference between YAML and JSON? When to prefer one over the otherHow can I parse a YAML file in PythonHow do you do block comments in YAML?How do I list all files of a directory?How to read a file line-by-line into a list?In YAML, how do I break a string over multiple lines?Delete a file or folderWhy is reading lines from stdin much slower in C++ than Python?

Is it possible to use a NPN BJT as switch, from single power source?

Dominated convergence theorem - what sequence?

Math-accent symbol over parentheses enclosing accented symbol (amsmath)

How to invert MapIndexed on a ragged structure? How to construct a tree from rules?

Why doesn't UK go for the same deal Japan has with EU to resolve Brexit?

WOW air has ceased operation, can I get my tickets refunded?

When you upcast Blindness/Deafness, do all targets suffer the same effect?

Is it ever safe to open a suspicious HTML file (e.g. email attachment)?

What happened in Rome, when the western empire "fell"?

Where do students learn to solve polynomial equations these days?

Is micro rebar a better way to reinforce concrete than rebar?

Find non-case sensitive string in a mixed list of elements?

How to prove a simple equation?

Why didn't Khan get resurrected in the Genesis Explosion?

Why is information "lost" when it got into a black hole?

Method for adding error messages to a dictionary given a key

Bartok - Syncopation (1): Meaning of notes in between Grand Staff

Proper way to express "He disappeared them"

Is the D&D universe the same as the Forgotten Realms universe?

Help understanding this unsettling image of Titan, Epimetheus, and Saturn's rings?

A small doubt about the dominated convergence theorem

Can we say or write : "No, it'sn't"?

Why isn't the Mueller report being released completely and unredacted?

Where does this common spurious transmission come from? Is there a quality difference?



Updated version of yaml file is not getting read



The Next CEO of Stack OverflowHow do I check whether a file exists without exceptions?How to get the current time in PythonWhat is the difference between YAML and JSON? When to prefer one over the otherHow can I parse a YAML file in PythonHow do you do block comments in YAML?How do I list all files of a directory?How to read a file line-by-line into a list?In YAML, how do I break a string over multiple lines?Delete a file or folderWhy is reading lines from stdin much slower in C++ than Python?










0















I am reading a yaml file like so in Python3:



def get_file():
file_name = "file.yml"

properties_stream = open(file_name, 'r')
properties_file = yaml.safe_load(properties_stream)
properties_stream.close()
print(properties_file)
return properties_file


When I update file.yml by adding keys or deleting all the contents of the file, the "print(properties_file)" statement is still retaining the contents of the yaml file the first time I ran this code.



Any ideas why this might be happening?










share|improve this question

















  • 2





    Are you sure you are editing the file in the current directory (i.e. from where you start the program)? I recommend you either (temporarily) remove the file or use an absolute path to be 100% sure. Maybe you used the correct/recommended extension for YAML file that you are editing (that has been .yaml since 2006) and are loading a different file.

    – Anthon
    Mar 21 at 18:13












  • Thanks! This helped me resolve the issue.

    – jli24
    Mar 22 at 13:24















0















I am reading a yaml file like so in Python3:



def get_file():
file_name = "file.yml"

properties_stream = open(file_name, 'r')
properties_file = yaml.safe_load(properties_stream)
properties_stream.close()
print(properties_file)
return properties_file


When I update file.yml by adding keys or deleting all the contents of the file, the "print(properties_file)" statement is still retaining the contents of the yaml file the first time I ran this code.



Any ideas why this might be happening?










share|improve this question

















  • 2





    Are you sure you are editing the file in the current directory (i.e. from where you start the program)? I recommend you either (temporarily) remove the file or use an absolute path to be 100% sure. Maybe you used the correct/recommended extension for YAML file that you are editing (that has been .yaml since 2006) and are loading a different file.

    – Anthon
    Mar 21 at 18:13












  • Thanks! This helped me resolve the issue.

    – jli24
    Mar 22 at 13:24













0












0








0








I am reading a yaml file like so in Python3:



def get_file():
file_name = "file.yml"

properties_stream = open(file_name, 'r')
properties_file = yaml.safe_load(properties_stream)
properties_stream.close()
print(properties_file)
return properties_file


When I update file.yml by adding keys or deleting all the contents of the file, the "print(properties_file)" statement is still retaining the contents of the yaml file the first time I ran this code.



Any ideas why this might be happening?










share|improve this question














I am reading a yaml file like so in Python3:



def get_file():
file_name = "file.yml"

properties_stream = open(file_name, 'r')
properties_file = yaml.safe_load(properties_stream)
properties_stream.close()
print(properties_file)
return properties_file


When I update file.yml by adding keys or deleting all the contents of the file, the "print(properties_file)" statement is still retaining the contents of the yaml file the first time I ran this code.



Any ideas why this might be happening?







python python-3.x yaml pyyaml






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 21 at 18:02









jli24jli24

12




12







  • 2





    Are you sure you are editing the file in the current directory (i.e. from where you start the program)? I recommend you either (temporarily) remove the file or use an absolute path to be 100% sure. Maybe you used the correct/recommended extension for YAML file that you are editing (that has been .yaml since 2006) and are loading a different file.

    – Anthon
    Mar 21 at 18:13












  • Thanks! This helped me resolve the issue.

    – jli24
    Mar 22 at 13:24












  • 2





    Are you sure you are editing the file in the current directory (i.e. from where you start the program)? I recommend you either (temporarily) remove the file or use an absolute path to be 100% sure. Maybe you used the correct/recommended extension for YAML file that you are editing (that has been .yaml since 2006) and are loading a different file.

    – Anthon
    Mar 21 at 18:13












  • Thanks! This helped me resolve the issue.

    – jli24
    Mar 22 at 13:24







2




2





Are you sure you are editing the file in the current directory (i.e. from where you start the program)? I recommend you either (temporarily) remove the file or use an absolute path to be 100% sure. Maybe you used the correct/recommended extension for YAML file that you are editing (that has been .yaml since 2006) and are loading a different file.

– Anthon
Mar 21 at 18:13






Are you sure you are editing the file in the current directory (i.e. from where you start the program)? I recommend you either (temporarily) remove the file or use an absolute path to be 100% sure. Maybe you used the correct/recommended extension for YAML file that you are editing (that has been .yaml since 2006) and are loading a different file.

– Anthon
Mar 21 at 18:13














Thanks! This helped me resolve the issue.

– jli24
Mar 22 at 13:24





Thanks! This helped me resolve the issue.

– jli24
Mar 22 at 13:24












1 Answer
1






active

oldest

votes


















0














Anthon was correct. Turned out I had two folders with the same name in my project directory in a different subdirectory and it was reading from the wrong file.






share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55286620%2fupdated-version-of-yaml-file-is-not-getting-read%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    Anthon was correct. Turned out I had two folders with the same name in my project directory in a different subdirectory and it was reading from the wrong file.






    share|improve this answer



























      0














      Anthon was correct. Turned out I had two folders with the same name in my project directory in a different subdirectory and it was reading from the wrong file.






      share|improve this answer

























        0












        0








        0







        Anthon was correct. Turned out I had two folders with the same name in my project directory in a different subdirectory and it was reading from the wrong file.






        share|improve this answer













        Anthon was correct. Turned out I had two folders with the same name in my project directory in a different subdirectory and it was reading from the wrong file.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 22 at 13:24









        jli24jli24

        12




        12





























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55286620%2fupdated-version-of-yaml-file-is-not-getting-read%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

            SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

            은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현