Upload
, а уже в нём вызывать метод upload
, передавая ему url адреса для загрузки и прочие параметры.var test = new Test;
function Test2() {}
Test2.prototype.method1 = function(first_argument) {
// Вызов
test.method1();
};
function Test() {
this.field1 = 'field1';
this.field2 = 'field2';
}
Test.method1 = function(first_argument) {
// do something...
};
The callback will be called as close as possible to the time specified.
https://nodejs.org/docs/v0.6.1/api/timers.html
А если скажем на середине задержки сервер залагает на минут 20, но к окончанию промежутка разлагает выполнится ли скрипт ровно в назначенное время или задержка увеличится на ~20 минут?
import string
from collections import Counter
punctuation_map = dict((ord(char), None) for char in string.punctuation)
prepositions = ['в', 'без', 'до', 'из', 'к', 'на', 'по', 'о', 'от', 'перед', 'при', 'через', 'с', 'у', 'за', 'над', 'об', 'под', 'про', 'для']
text = open('WarAndPeace_rus.txt').read()
clean_data = text.translate(punctuation_map) #Убираем знаки пунктуации
words = Counter([word.strip().lower() for word in clean_data.split() if word not in prepositions]) #Приводим все слова к нижнему регистру и убираем предлоги
with open('words.txt', 'w') as fh:
fh.write('\n'.join([w[0] for w in words.most_common(1000)]))