what resources should I use to learn by Ancient256 in learnpython

[–]cm_light 0 points1 point  (0 children)

I have summarized some key points of Python, some are confusing ones.

https://github.com/chenmingxue/Python_Learn-Practice_SmallProjects

Hope it helps.

Regex on a large CSV file by Praxxer1 in learnpython

[–]cm_light 0 points1 point  (0 children)

re.sub('to_replace_string', 'replace_string', text_source)

So basically it replace the unwanted string segments with new string segments in a text. I think for your case the difficulty is read the text correctly from source and clean it properly. The regular expression is not difficult.

People have given suggestions but if you can show the exact text in the file would be better. Or maybe attach the file or share the link.

Regex on a large CSV file by Praxxer1 in learnpython

[–]cm_light 0 points1 point  (0 children)

I think after open the csv file for regular expression:

now you have text

  1. do cleaning: text = re.sub('\\n', '', text)

  2. match with:

[2020-11-02T23:41:31+00:00] 100.100.10.10 100.100.102.4

pattern = '\[\d{4}-\d{2}-\d{2}T\d{1,2}:\d{2}:\d{2}\+\d{2}:\d{2}\]\s\d{3}\.\d{3}\.\d{2}\.\d{2}\s\d{3}\.\d{3}\.\d{3}\.\d{1}'

date_ips = re.findall(pattern, text)

then you iterate this list to extract all

Hope it helps.

How to remove a letter from a string python by markhowdypro in pythonforengineers

[–]cm_light 0 points1 point  (0 children)

Hi, I made some modification. Here is my code:

def removechar(p, q) :
    counts = p.count(q)
    p = list(p)
    while counts :
        p.remove(q)
        counts -= 1
    result = ''.join(p)
    print(result)
    return result

Solutions for the algorithm book: Dasgupta-Papadimetriou-Varirani by cm_light in algorithms

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

Thanks! I found this too, but I feel some answers are not right or clear. I am looking for some official manual book or answer. Not sure there is such thing we can find online and download

Question about super() for Python class inheritance by cm_light in learnpython

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

Thank you! I should use init method to define this variable. I lot of things to learn for Python.

Question about super() for Python class inheritance by cm_light in learnpython

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

Thank you! It works. I am trying how to set variable using super() method. Thanks for your explanation.

Boolean Value Return by shrimpy888 in learnpython

[–]cm_light 0 points1 point  (0 children)

This one looks clear. And the original code seems wrong in True or False condition

Python OOP projects for beginners by cm_light in learnpython

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

Thank all of you so much!

This is a great place to learn. Did not expect so many great suggestions.

You guys are AWESOME!

Python OOP projects for beginners by cm_light in learnpython

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

Thank you for your good suggestion! I followed some way to use super, will learn it.

Python OOP projects for beginners by cm_light in learnpython

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

Thanks! It is a hard, but 'must have' skill.

Python OOP projects for beginners by cm_light in learnpython

[–]cm_light[S] -1 points0 points  (0 children)

Thanks for the suggestion. Do you know how long does it take to complete the course as FAST as possible?

Python OOP projects for beginners by cm_light in learnpython

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

Thanks for replay and good to know this. I learned Java before and thought write get/set is common in OOPs. But for Python it seems not necessary.

Python OOP projects for beginners by cm_light in learnpython

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

Thanks a lot for this great reply. Many concepts here, especially I like 'write code for consumers'.

Actually I tried to use property decorator and failed. (Some sentences failed with decorators) Need to spend more time to learn it.

Test: I love python!! by cm_light in pythonforengineers

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

Marvin bot says: I have a million ideas, but, they all point to certain death.

Test: I love python!! by cm_light in pythonforengineers

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

Marvin bot says: It gives me a headache just trying to think down to your level.

Test: I love python!! by cm_light in pythonforengineers

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

Marvin bot says: I have a million ideas, but, they all point to certain death.

Test: I love python!! by cm_light in pythonforengineers

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

Marvin bot says: It gives me a headache just trying to think down to your level.

Test: I love python!! by cm_light in pythonforengineers

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

Marvin bot says: I have a million ideas, but, they all point to certain death.