Re: Question about asyncio doc example

2014-07-23 Thread Yaşar Arabacı
asyncio.sleep() returns you a Future. When you yield from a future, your coroutine blocks, until the Future completes. In the meantime, event loop continutes to execute other things that are waiting to be executed. The Future returned from asyncio.sleep gets completed after specified seconds. 2014

Review my asyncio code

2014-07-22 Thread Yaşar Arabacı
Hi, I am trying to learn how to utilize aysncio module. In order to do that, I wrote a class that checks http status codes for all the pages on a given domain (unless there is no internal link pointing to it of course). Since it is too long to paste here, I uploaded it to my github repo, you can

Re: asyncip application hangs

2014-07-21 Thread Yaşar Arabacı
2014-07-22 1:19 GMT+03:00 Yaşar Arabacı : > This program is supposed to give me status codes for web pages that > are found on my sitemap.xml file. But program hangs as Tasks wait for > getting something out of the Queue. I think it has something to do > with how I am using asyncio.

asyncip application hangs

2014-07-21 Thread Yaşar Arabacı
I am trying to grasp how asyncio works today. Based on the examples that I found on the docs, I write a simple program like this; import asyncio import urllib.request import urllib.parse @asyncio.coroutine def print_status_code(url_q): while True: url = yield from url_q.get()

Fwd: Event loop documentation error

2014-07-21 Thread Yaşar Arabacı
-- Forwarded message -- From: Yaşar Arabacı Date: 2014-07-21 21:54 GMT+03:00 Subject: Re: Event loop documentation error To: Chris Angelico 2014-07-21 21:45 GMT+03:00 Chris Angelico : > SIGINT is a Unix signal. There is an equivalent for Windows, but it > wouldn&#x

Event loop documentation error

2014-07-21 Thread Yaşar Arabacı
I was reading https://docs.python.org/3/library/asyncio-eventloop.html#example-set-signal-handlers-for-sigint-and-sigterm and wanted to test the example, however, I am getting this error when I run the code; Traceback (most recent call last): File "C:/Users/gorki/Documents/Python Scripts/as-io.

Creating Windows Start Menu or Desktop shortcuts using setuptools bdist_winst installer

2014-07-19 Thread Yaşar Arabacı
This is a cross-post from stackoverflow: http://stackoverflow.com/q/24841130/886669 I am not sure about cross-posting policies of python-list. I am sorry if this is discouraged. Here is my problem; I want to create a start menu or Desktop shortcut for my Python windows installer package. I am tr

Re: Pip doesn't install my scripts

2014-07-19 Thread Yaşar Arabacı
ld be separated with dashes. 2014-07-19 12:44 GMT+03:00 Chris “Kwpolska” Warrick : > On Sat, Jul 19, 2014 at 9:19 AM, Yaşar Arabacı wrote: >> Hi, >> >> I am trying to package my file, but I am having problems with >> installing my Scripts. Here is my package: >> h

Pip doesn't install my scripts

2014-07-19 Thread Yaşar Arabacı
Hi, I am trying to package my file, but I am having problems with installing my Scripts. Here is my package: https://github.com/yasar11732/tklsystem Here is my package's PyPi page: https://pypi.python.org/pypi/TkLsystem The problem I face is that, when I run `python setup.py install` from my dev

L-system equations drawing tool

2014-07-17 Thread Yaşar Arabacı
Hi, I wrote a small program to draw L-system equations using tkinter. You can find it on https://github.com/yasar11732/tklsystem It is still under development, but seems to be working nice so far. I could only try it on windows, but it should work on Linux too. You will need Python 3.x to run it

Re: Several Topics - Nov. 19, 2013

2013-11-19 Thread Yaşar Arabacı
2013/11/19 glen herrmannsfeldt : > More recently, there are JIT systems which generate the intermediate > code, but then at the appropriate time (Just In Time) compile that to > machine code and execute it. This is common for Java, and more recently > for languages like Matlab. Is there a particul

Re: Self-defence

2013-11-17 Thread Yaşar Arabacı
2013/11/17 Georg Brandl : > Let the barrage of posts continue for a few more days; if he doesn't get > replies he will get fed up eventually. My thoughts exactly. -- http://ysar.net/ -- https://mail.python.org/mailman/listinfo/python-list

How to np.vectorize __call__ method

2013-11-14 Thread Yaşar Arabacı
I am cross-posting from: http://stackoverflow.com/q/19990863/886669 I am following, [quant-econ](http://quant-econ.net/numpy.html) tutorial. I am trying the exercise where I am supposed to implement a [Empirical Cumulative Probability Funcion](http://en.wikipedia.org/wiki/Empirical_distribution_fu

Count each unique element in list of lists

2013-11-08 Thread Yaşar Arabacı
Hi, I have a function that returns something like this; [[[1, 5, 9], [2, 6, 7], [3, 4, 8]], [[1, 6, 8], [2, 4, 9], [3, 5, 7]]] It is a list of list of lists. Each uppermost list is called a result. I want to write a code that shows that each elem in sublists of result on appears once in whole su

Debugging decorator

2013-11-03 Thread Yaşar Arabacı
I don't think it would be much problem. I can do that when I have spare time. Yasar. > Oh, I just noticed that the person using 2to3 wasn't the OP. My > apologies, my language was aimed at the decorator's primary developer. > Yasar, are you prepared to take on Python 3 support fully? If it's as >

tuple __repr__ non-ascii characters

2013-10-31 Thread Yaşar Arabacı
Hi, while this: a = "yaşar" print a prints "yaşar" this: a = ("yaşar",) print a prints ('ya\xfear',) At first I tried decoding repr(a) with different encodings, but later I realised there is actually 4 charaters \, x, f and e in return value of repr. Therefore, I wrote this: def byte_repla

Re: Cookie fucking problem

2013-10-26 Thread Yaşar Arabacı
I didn't follow the thread, I am sorry if this is duplicate, but don't catch all Exceptions, catch only the ones you expect, so that you can identify unexpected errors: cookie = cookies.SimpleCookie( os.environ['HTTP_COOKIE'] ) try: cookieID = cookie['name'].value except KeyErr

Debugging decorator

2013-10-25 Thread Yaşar Arabacı
Hi people, I wrote this decorator: https://gist.github.com/yasar11732/7163528 When this code executes: @debugging def myfunc(a, b, c, d = 48): a = 129 return a + b print myfunc(12,15,17) This is printed: function myfunc called a 12 c 17 b 15 d 4

Re: Python package statistics

2013-10-18 Thread Yaşar Arabacı
Hi Terry, Thanks for pointing it out.matplotlib's hist function wasn't broken after all :) I published non-parametric statistics here: http://ysar.net/python/python-package-statistics-additions.html 2013/10/18 Terry Reedy : > On 10/18/2013 8:41 AM, Yaşar Arabacı wrote: >> &g

Python package statistics

2013-10-18 Thread Yaşar Arabacı
Hi people, I collected some data on PyPI and published some statistics about packages on PyPI. I think you might find it an interesting read: http://ysar.net/python/python-package-statistics.html -- http://ysar.net/ -- https://mail.python.org/mailman/listinfo/python-list

Re: .format vs. %

2011-12-31 Thread Yaşar Arabacı
You mean like this? === a = "I like {name}" a.format(name="myself") 'I like myself' Sat, 31 Dec 2011 20:44:08 +0200 tarihinde davidfx şöyle yazmış: Thanks for your response. I know the following code is not going to be correct but I w

Re: .format vs. %

2011-12-31 Thread Yaşar Arabacı
What exactly do you mean by putting .format into a variable? You mean like this: "{name} is very {adj} {gender}".format(name="sandy",adj="diligent",gender="female") Sat, 31 Dec 2011 20:19:34 +0200 tarihinde davidfx şöyle yazmış: Hello everyone, I just have a quick question about .form

Re: help - obtaining the type of the object using tp_name

2011-12-25 Thread Yaşar Arabacı
I am not sure if I understood your question correctly, but I would advice checking this: http://docs.python.org/c-api/object.html#PyObject_Type Sun, 25 Dec 2011 13:28:55 +0200 tarihinde Mrinalini Kulkarni şöyle yazmış: Hello, I have embedded python into a vc++ app. I need to obtain typ

Re: help - obtaining the type of the object using tp_name

2011-12-25 Thread Yaşar Arabacı
And by the way, I would advice asking these kinds of questions in #python-dev IRC channel (Freenode). I believe you can get much better help about your problems regarding C-api there. 2011/12/25 Mrinalini Kulkarni > Hello, > > I have embedded python into a vc++ app. I need to obtain type of the

Re: Get named module's file location

2011-12-23 Thread Yaşar Arabacı
>>> import imp >>> imp.find_module("os") (, '/usr/lib/python2.7/os.py', ('.py', 'U', 1)) >>> 2011/12/23 Gnarlodious > Given a module's name, how do I get the file path without importing it? > Searched all over, can't find any such info. > > Is it possible to ask if a named module exists before a

Recommend blogs for me to follow

2011-12-22 Thread Yaşar Arabacı
Hi, I am looking for some recommendations about blogs that I may like to follow. I am interested in Python (that goes without saying), django and server side web development in general, linux tools, and git scm. I am looking for blogs which shares short examples of codes, and hints about various t

Bug in multiprocessing.reduction?

2011-12-17 Thread Yaşar Arabacı
You can see my all code below, theoritically that code should work I guess. But I keep getting this error: [SUBWARNING/MainProcess] thread for sharing handles raised exception : --- Traceback (most recent call last): File "

Re: file processing question

2011-10-12 Thread Yaşar Arabacı
And also, I higly recommend against using lists named list. That means overwriting builtin list object. 2011/10/12 Andreas Perstinger > On 2011-10-12 13:15, selahattin ay wrote: > >> >> hi all, I wrote these codes but the program must write the prints to a >> text file... >> code = [100, 200, 3

Re: Python library for generating SQL queries [selects, alters, inserts and commits]

2011-10-11 Thread Yaşar Arabacı
Are you looking for something like this? http://www.sqlalchemy.org/ 2011/10/11 Alec Taylor > Good afternoon, > > I'm looking for a Python library for generating SQL queries [selects, > alters, inserts and commits]. > > I can write them by hand, but thought it would be more useful writing > them

Re: creating a code with two list

2011-10-11 Thread Yaşar Arabacı
And also, I should recommend you to use Turkish speaking mail groups in here: python-programci...@googlegroups.com since your English is a little hard to comprehend. There are less people there, but, still would be more helpful for you. 11 Ekim 2011 17:11 tarihinde Yaşar Arabacı yazdı

Fwd: creating a code with two list

2011-10-11 Thread Yaşar Arabacı
your_final_list = [[str(i) + str(k) for i in range(len(liste))] for k in range(len(code))] -- http://yasar.serveblog.net/ -- http://yasar.serveblog.net/ -- http://mail.python.org/mailman/listinfo/python-list

Re: [NUMPY] "ValueError: total size of new array must be unchanged" just on Windows

2011-10-09 Thread Yaşar Arabacı
I don't know about your problem, but did you compare numpy versions in windows and other platforms? You may have newer/older version in Windows. Otherwise, it looks like a platform spesific bug to me. 2011/10/9 Paolo Zaffino > Hello, > I wrote a function that works on a numpy matrix and it works

Working with spreadsheet files

2011-10-08 Thread Yaşar Arabacı
Hi, Does anyone know a good tutorial about working with Spreadsheet files (e.g. excel files) with Python. I have found xlutils, but there doesn't seem to be any documentation or tutorial about it that I could find. So, any suggestions? -- http://yasar.serveblog.net/ -- http://mail.python.org/ma

Adding new keywords to Python interpreter

2011-10-02 Thread Yaşar Arabacı
Hi people, Nowadays, I am trying to explore python source. I added a new keyword, essentially doing same thing as 'continue' keyword to the interpreter, mostly by following instructions in PEP 306. If anyone interested here is the video about how I did it: http://www.youtube.com/watch?v=Ww7BeIdUb

Need help with file encoding-decoding

2011-09-23 Thread Yaşar Arabacı
Hi, I'am trying to write a mass html downloader, and it processes files after it downloaded them. I have problems with encodings, and decodings. Sometimes I get UnicodeDecodeErrors, or I get half-pages in after processing part. Or more generally, some things don't feel right. Can you check my appr

Re: httplib's HEAD request, and https protocol

2011-09-22 Thread Yaşar Arabacı
Ok, nevermind. Appereantly there is such a thing as HTTPSConnection. I thought httplib auto-handled https connections.. 22 Eylül 2011 13:43 tarihinde Yaşar Arabacı yazdı: > Hi, > > I wrote a function to get thorugh redirections and find a final page for a > given web-page. B

httplib's HEAD request, and https protocol

2011-09-22 Thread Yaşar Arabacı
Hi, I wrote a function to get thorugh redirections and find a final page for a given web-page. But following function gives maximum recursion error for any https pages I tried. Do you know what might be the problem here? def getHeadResponse(url,response_cache = {}): try: return respon

HTMLParser and non-ascii html pages

2011-09-20 Thread Yaşar Arabacı
Hi, I am using a simple sublclass of HTMLParser like this: class LinkCollector(HTMLParser): def reset(self): self.links = [] HTMLParser.reset(self) def handle_starttag(self,tag,attr): if tag in ("a","link"): key = "href" elif tag in ("img","sc

Modifiying __getattribute__ of an instance

2011-09-17 Thread Yaşar Arabacı
I am trying to modify __getattribute__() method for an instance, as you may already know,__getattirbute__ is read-only attribute in Python. What I have in mind is, create a new object like this: def create_new_instace(old_instance): class temp(old_instance.__class__): def __init__(self

Fwd: why ps/fname of a python interpreter changes across platforms?

2011-09-16 Thread Yaşar Arabacı
-- Yönlendirilmiş ileti -- Kimden: Yaşar Arabacı Tarih: 16 Eylül 2011 14:33 Konu: Re: why ps/fname of a python interpreter changes across platforms? Kime: Steven D'Aprano For example, in arch linux, I had 3 different interpreters named python, python26 and python27 because

Re: Turkic I and re

2011-09-15 Thread Yaşar Arabacı
Hi, I am a Turkish self-taught python user. Personally, I don't think I am in a position to discuss a issue in this scale. But in my opinion, I think pardus* developers should be invited to join to this discussion. As they are using python heavily on most of their projects** I think they would hav

Invoking profile from command line prevent my sys.path modification

2011-09-01 Thread Yaşar Arabacı
Hi, I am new to profile module, so I am sorry if this is an absolute beginner question. In order to my code to run, I need to add a directory to sys.path. When I invole python -m profile myfile.py, my code won't work, saying that the thing that is supposed to be in path, isn't. Code works fine wit

Re: Subclassing str object

2011-08-31 Thread Yaşar Arabacı
27;s instance, instead of unicode's 31 Ağustos 2011 20:11 tarihinde Ian Kelly yazdı: > 2011/8/31 Yaşar Arabacı : > > I made a class like this (I shortened it just to show the point), what do > > you think about it, do you think it is the python way of subclassing str > (or

Re: Subclassing str object

2011-08-31 Thread Yaşar Arabacı
uk + u"ler") return kelime(self._sozcuk + u"lar") 31 Ağustos 2011 14:43 tarihinde Yaşar Arabacı yazdı: > Hİ, > > I originally posted my question to here: > http://stackoverflow.com/q/7255655/886669 Could you people please look at > it and enlighten me a little bit? I

Subclassing str object

2011-08-31 Thread Yaşar Arabacı
Hİ, I originally posted my question to here: http://stackoverflow.com/q/7255655/886669 Could you people please look at it and enlighten me a little bit? I would appreciate an answer either from here or at stackoverflow. Thanks in advance. -- http://yasar.serveblog.net/ -- http://mail.python.org

Fwd: Processing a large string

2011-08-28 Thread Yaşar Arabacı
-- Yönlendirilmiş ileti -- Kimden: Yaşar Arabacı Tarih: 28 Ağustos 2011 22:51 Konu: Re: Processing a large string Kime: Paul Rudin Are you getting Overflow error or memory error? If you don't know what those means: Overflow error occurs when your lists gets bigger

A question about class as an iterator

2011-08-28 Thread Yaşar Arabacı
Hi, I got confused about classes as an iterator. I saw something like this: class foo(): __iter__(self): return self next(self): return something But then I saw a __next__ method on some code. So what is the deal, which one should I use and what is the difference? -- ht

Fwd: is there any principle when writing python function

2011-08-23 Thread Yaşar Arabacı
I accidentally sent below mail only to roy. Resending to groups. -- Yönlendirilmiş ileti -- Kimden: Yaşar Arabacı Tarih: 23 Ağustos 2011 16:19 Konu: Re: is there any principle when writing python function Kime: Roy Smith I don't see myself a good python programmer or any

Optimizing Text Similarity Algorithm

2011-08-22 Thread Yaşar Arabacı
Hi, I originally posted this question on stackoverflow, you can find it here: http://stackoverflow.com/q/7133350/886669 I just want people check what I am doing and express their opinion about the thing I am doing is acceptable, or are there some expects of it that could change. -- http://mail.p