Coder Social home page Coder Social logo

python-wiki's Introduction

python-wiki

Basics

Start-Methode
if __name__ == '__main__':
    main()
Dateinamen auslesen
fileWithExt = os.path.basename(f)
fileWithoutExt = os.path.splitext(fileWithExt)[0]
fileExt = os.path.splitext(fileWithExt)[1]
Ordner-Elemente auslesen
os.listdir(folderPath)
Pfad auf Ordner prüfen
os.path.isdir(objectpath)
Pfade zusammenfügen
os.path.join(path1, fileWithExt)
Löscht überflüssige Leerzeilen
fileContent = "".join([s for s in fileContent.splitlines(True) if s.strip("\r\n")])
fileContent = os.linesep.join([s for s in fileContent.splitlines() if s])
Listeneinträge getrennt mit Zeilenumbruch in String speichern
mySting = '\n'.join(listOfFiles)
Datei zeilenweise auslesen und in Liste speichern
with open(donetaskspath, encoding='utf8') as f:
        listOfDoneTasks = f.read().splitlines()
Anzahl Elemente in Liste
countElements = len(listOfFiles)
Element einer Liste hinzufügen
result.append(objectpath)
Differenz aus zwei Listen auslesen
todo = list(set(listOfTasks) - set(listOfDoneTasks))
DateTime in String speichern
dateTime = datetime.datetime.now().strftime("%Y-%m-%d_%H.%M")
Funktion erstellen
def myFunction(para):
    ...
    return result
if / if not Beispiel
if var:
    ...
if not var:
    ...
For-Schleife mit vorgegebenen Range
for i in range(10):
    ...
Error-Handling
try:
    ...
except Exception as e:
    print("Error: " + e)

Sonstiges

PIP mit Proxy
pip3 --proxy=http://163.241.128.141:80 install ...
All Deps from Package
download [package] -d /tmp --no-binary :all: -v

python-wiki's People

Contributors

superdanyo avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.