Skip to main content
Code Review

Return to Question

Commonmark migration
Source Link

###Intro:

Intro:

###Code:

Code:

###Miscellaneous:

Miscellaneous:

###Intro:

###Code:

###Miscellaneous:

Intro:

Code:

Miscellaneous:

Tweeted twitter.com/StackCodeReview/status/814952593222942720
added 4 characters in body
Source Link
Grajdeanu Alex
  • 9.3k
  • 4
  • 32
  • 71

I've written a small piece of Python program which is looking afterfor a given sentence in multiple sub directories of a given path.

As you may already figured out, the reason for my program being so slow resides in search_sentence_in_file(base_path, sentence) where I need to open each file, read it line by line and look afterfor a specific sentence.

I know I could use a logging library instead of printing the results to see who matched what, but that wouldn't serve the purposes of the program. So I'm not looking for that (I'm building this to have a fast way of looking afterfor certain classes / methods / slots definitions in multiple .magik files in a fast manner. Opening a log file won't satisfy me).

For whoever is interested aboutin the Magik language, and as a bonus of taking your time to take a look at this question, here's a small introduction ofto Magik.

I've written a small piece of Python program which is looking after a given sentence in multiple sub directories of a given path.

As you may already figured out, the reason for my program being so slow resides in search_sentence_in_file(base_path, sentence) where I need to open each file, read it line by line and look after a specific sentence.

I know I could use a logging library instead of printing the results to see who matched what, but that wouldn't serve the purposes of the program. So I'm not looking for that (I'm building this to have a fast way of looking after certain classes / methods / slots definitions in multiple .magik files in a fast manner. Opening a log file won't satisfy me).

For whoever is interested about the language, and as a bonus of taking your time to look at this question, here's a small introduction of Magik.

I've written a small piece of Python program which is looking for a given sentence in multiple sub directories of a given path.

As you may already figured out, the reason for my program being so slow resides in search_sentence_in_file(base_path, sentence) where I need to open each file, read it line by line and look for a specific sentence.

I know I could use a logging library instead of printing the results to see who matched what, but that wouldn't serve the purposes of the program. So I'm not looking for that (I'm building this to have a fast way of looking for certain classes / methods / slots definitions in multiple .magik files in a fast manner. Opening a log file won't satisfy me).

For whoever is interested in the Magik language, and as a bonus of taking your time to take a look at this question, here's a small introduction to Magik.

added 54 characters in body
Source Link
Grajdeanu Alex
  • 9.3k
  • 4
  • 32
  • 71

I know I could use a logging library instead of printing the results to see who matched what, but that wouldn't serve the purposes of the program. So I'm not looking for that (I'm building this to have a fast way of looking after certain classes / methods / slots definitions in multiple .magik files in a fast manner. Opening a log file won't satisfy me).

I know I could use a logging library instead of printing the results to see who matched what, but that wouldn't serve the purposes of the program. So I'm not looking for that (I'm building this to have a fast way of looking after certain classes / methods / slots definitions in multiple .magik files).

I know I could use a logging library instead of printing the results to see who matched what, but that wouldn't serve the purposes of the program. So I'm not looking for that (I'm building this to have a fast way of looking after certain classes / methods / slots definitions in multiple .magik files in a fast manner. Opening a log file won't satisfy me).

Source Link
Grajdeanu Alex
  • 9.3k
  • 4
  • 32
  • 71
Loading
lang-py

AltStyle によって変換されたページ (->オリジナル) /