Mantıklı tek key kullanılmış olur;Ali vegas diyorki o count mantığı şöyle olucak diyelim event append ederken sadece count 10 girdik diyelim her eventden sonra count -= 1 olucak taki 0 olana kadar.
Linkleri görebilmek için Turkmmo Forumuna ÜYE olmanız gerekmektedir.
Eve gecince guncellerim kodlarıMantıklı tek key kullanılmış olur;
Linkleri görebilmek için Turkmmo Forumuna ÜYE olmanız gerekmektedir.
@ulubey4242 You don't need cur_count and max_count, just do a simple max_count and decrease it until it's 0, that's all, you did things more complicated than are, but i like that there are people who want to improve it and do updates.
Then i've some tips for you, i hope you'll get them.
Then i've some tips for you, i hope you'll get them.
- You used dictionary get method in function GetEvent, but you didn't returned it, so the function will return None.
- has_key is a old thing, in is definitely more pythonic and faster than has_key, also it was removed in Python 3., you can use simple if key in dict like we do in lists.
- The idea of the run count was to use it in parallel and for can be None as default argument. then the user have two options, using a function for X times and started to Y time and using a function for UNKNOWN times (from result of the event function until the return is 0) and started to Y times, what you did here have some conflicts and isn't a good idea, what's the scope of the returning function then, we should allow them to use one of the method.
- Also you used del event, which is wrong, you deleted it locally from generator, not global, so the event will still run unlimited you need to use the DeleteEvent function for delete it properly.
- You used a wrong method for loop, dictionaries aren't like list in loop, you have to use for event in self.eventDict.itervalues() for loop trough values of each dict, not for event in self.eventDict.
Son düzenleme:
@ulubey4242 You don't need cur_count and max_count, just do a simple max_count and decrease it until it's 0, that's all, you did things more complicated than are, but i like that there are people who want to improve it and do updates.
Then i've some tips for you, i hope you'll get them.
Btw, good idea about transform the list into dictionary, i leaved it like this because i wanted to make a compare functions too, if the admin call two times the same event < event, with differents settings but same name, i'd compare the events and merge them together with the same name (not replaced), that's why i leave a list, when i've some free time i'll post it, also if i'm the one which would do this from 0, i would change the full structure like event.cpp and do it in C++ combined with Python, i'll do it asap.
- You used dictionary get method in function GetEvent, but you didn't returned it, so the function will return None.
- has_key is a old thing, in is definitely more pythonic and faster than has_key, also it was removed in Python 3., you can use simple if key in dict like we do in lists.
- The idea of the run count was to use it in parallel and for can be None as default argument. then the user have two options, using a function for X times and started to Y time and using a function for UNKNOWN times (from result of the event function until the return is 0) and started to Y times, what you did here have some conflicts and isn't a good idea, what's the scope of the returning function then, we should allow them to use one of the method.
- Also you used del event, which is wrong, you deleted it locally from generator, not global, so the event will still run unlimitedm you need to use the DeleteEvent function for delete it properly.
Yes I already did as you said above,
- Out of sight, thanks for the warning, @is_null; GetEvent fonksiyonunu güncellersin bu şekilde
Linkleri görebilmek için Turkmmo Forumuna ÜYE olmanız gerekmektedir.
- Okey, I've edited it. @is_null; DeleteEvent fonksiyonunu güncellersin bu şekilde
Linkleri görebilmek için Turkmmo Forumuna ÜYE olmanız gerekmektedir.
- I'il arrange it like you said yes.
- DeleteEvent has the same function and control, Nothing but extension.
@DarkForce9 şuan bilgi patlamasının yaşandığı dönemdeyiz. Rank çıkmak için aşağıdakinin eline değil suratına bascaksın. Yukardanda destek alırken yukarıyıda aşağı çekiceksin.Şu forumda ne zaman insanlar gelip birbirini karalamak yerine yukarıda ki mesajda olduğu gibi bir şeyleri anlatıp daha iyi hale getirmeye çalışacak merak ediyorum. Paylaşım için teşekkürler.
Şu an konuyu görüntüleyenler (Toplam : 0, Üye: 0, Misafir: 0)
Benzer konular
- Cevaplar
- 8
- Görüntüleme
- 495
- Cevaplar
- 1
- Görüntüleme
- 8
- Cevaplar
- 1
- Görüntüleme
- 5
- Cevaplar
- 1
- Görüntüleme
- 20