Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Stas Kaino
    @StasKaino_twitter
    maybe you can just show me on my code why this is not working?
    ale rimoldi
    @aoloe
    you're missing a space after Column
    i've put your sub() in my code and i also got the wrong result.
    i was looking for the difference and found it after Column... i hope it was the only difference
    Stas Kaino
    @StasKaino_twitter
    do you think I need this at the beginning?
    <br/>\n\n</p>
    you mean we need use: re.sub(r'<a class="anchor-column noCont" name="column_\d{4}"> </a><p><b>\d{2} \w{3} \d{4} : Column \d{4}</b></p><p>', '', content) ?
    Stas Kaino
    @StasKaino_twitter
    ok.. space did work, but I still wonder if we need <br/>\n\n</p>
    ale rimoldi
    @aoloe
    you don't need that. but if you remove them, you'll have a couple of new lines in the string... which is not very nice.
    Stas Kaino
    @StasKaino_twitter
    I think it is better not to touch this as it corresponds to previous tags
    Stas Kaino
    @StasKaino_twitter
    Ale do you know a way I can make the output on the console to show every item list on the new line?
    Stas Kaino
    @StasKaino_twitter
    I figured out both how to search console and why we used <br/>\n\n</p>. I thought it might ruin some previous tags but it actually works
    still missing is how to output list in console line be line...
    ale rimoldi
    @aoloe
    as far as i can tell, i've balanced the tags in my sub()...
    and i have no idea why you want to output the list in the console, but, of course, you can do that with a print().
    and eventually remove the publications array
    Stas Kaino
    @StasKaino_twitter
    I mean something else. there should be a way how to force print(publications) or effectively print(resultList) to show every new element on the new line in console?
    also do you know how to fix this: i dont know how to send it here - there is no attachment functionality I guess - I have send on email
    ale rimoldi
    @aoloe
    you can print(list)... but you'll get the full list each time.
    Stas Kaino
    @StasKaino_twitter
    really simple question but how do I close csv-output i
    I see about priniting. thanks you
    ale rimoldi
    @aoloe
    if you want to print each row, just store it in variable before adding to the full list.
    and print inbetween.
    Stas Kaino
    @StasKaino_twitter
    OK.
    ale rimoldi
    @aoloe
    the csv file is closed when the script is over.
    Stas Kaino
    @StasKaino_twitter
    unfortunately not in my case
    csv_output = csv.writer(open('xxx.csv', 'w', newline=''))
    csv_output.writerows(publications)
    when the script is over the file is open somewhere in the back
    and I cant deleted if I go to the folder where it is storing
    since it is "opened by Python"
    ale rimoldi
    @aoloe
    euh...
    Stas Kaino
    @StasKaino_twitter
    I thought of adding this: csv_output.close() but it is not an object with close functionality
    I guess I first need to somehow close and then add in the script that it closes it self
    ale rimoldi
    @aoloe
    the you should store the opened file in a variable before passing it to the csv module:
    Stas Kaino
    @StasKaino_twitter
    yeah i see the point
    Stas Kaino
    @StasKaino_twitter
    cleared that
    new thing

    ipdb> elem('a')
    [<a href="160211-0002.htm">Next Section</a>]

    this is from debugger. question is how can I call elem so that it gives me back only href contents (i.e.160211-0002.htm)?

    Stas Kaino
    @StasKaino_twitter
    do i need to sue again recursive equations?
    Stas Kaino
    @StasKaino_twitter
        if elem.text == "Next Section":         
            getUrl = elem('a').get['href']
    I am trying to extract the href from the elem but no luck so far
    ale rimoldi
    @aoloe
    no idea, but googling "beautifulsoup a href" (got through the autocomplete...) i got https://stackoverflow.com/questions/5815747/beautifulsoup-getting-href
    Stas Kaino
    @StasKaino_twitter
    dear Ale, I just replied with thanks. Todays email is the most important - I repeated it again just now. Much appreciated your comment. Thanks
    Stas Kaino
    @StasKaino_twitter
    Dear Ale. that question sorted.... thanks
    Stas Kaino
    @StasKaino_twitter
    Hello Ale, are you here? can I ask a question?
    ale rimoldi
    @aoloe
    @StasKaino_twitter i was not around, but you're welcome to join us tonight @ liip and ask questions : - )
    Stas Kaino
    @StasKaino_twitter
    ok
    thanks
    Stas Kaino
    @StasKaino_twitter
    Hello All
    Ale - I am back...
    I send you an email just now. Please look at it of possible. The question was how can you apply finite state machine approach to my problem. Thanks!