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.

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

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

Fwd: Event loop documentation error

2014-07-21 Thread Yaşar Arabacı
-- Forwarded message -- From: Yaşar Arabacı yasar11...@gmail.com Date: 2014-07-21 21:54 GMT+03:00 Subject: Re: Event loop documentation error To: Chris Angelico ros...@gmail.com 2014-07-21 21:45 GMT+03:00 Chris Angelico ros...@gmail.com: SIGINT is a Unix signal

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()

Re: asyncip application hangs

2014-07-21 Thread Yaşar Arabacı
2014-07-22 1:19 GMT+03:00 Yaşar Arabacı yasar11...@gmail.com: 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

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

Re: Pip doesn't install my scripts

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

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

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

Re: Several Topics - Nov. 19, 2013

2013-11-19 Thread Yaşar Arabacı
2013/11/19 glen herrmannsfeldt g...@ugcs.caltech.edu: 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.

Re: Self-defence

2013-11-17 Thread Yaşar Arabacı
2013/11/17 Georg Brandl g.bra...@gmx.net: 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

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

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

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

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

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: 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 tjre...@udel.edu: On 10/18/2013 8:41 AM, Yaşar Arabacı wrote: Hi people

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 dgeorge2...@gmail.com şöyle yazmış: Hello everyone, I just have a quick

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 dgeorge2...@gmail.com şöyle yazmış: Thanks for your response. I know the following code is not going to be

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 mrinal...@edss.co.in Hello, I have embedded python into a vc++ app. I need to

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 mrinal...@edss.co.in şöyle yazmış: Hello, I have embedded python into a vc++ app.

Re: Get named module's file location

2011-12-23 Thread Yaşar Arabacı
import imp imp.find_module(os) (open file '/usr/lib/python2.7/os.py', mode 'U' at 0xb6c4c700, '/usr/lib/python2.7/os.py', ('.py', 'U', 1)) 2011/12/23 Gnarlodious gnarlodi...@gmail.com Given a module's name, how do I get the file path without importing it? Searched all over, can't find any

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

[issue13625] multiprocessing.reduction gives OSError: [Errno 9] in 2.7.2

2011-12-18 Thread Yaşar Arabacı
New submission from Yaşar Arabacı yasar11...@gmail.com: Even though same code works fine under Python 2.7(r27:82500, Aug 07 2010, 16:54:59) and Python 2.6.6 (r266:84292, Jun 12 2011, 20:37:17), I get following error using multiprocessing.reduction module no matter what I try. Complete code

[issue13625] multiprocessing.reduction gives OSError: [Errno 9] in 2.7.2

2011-12-18 Thread Yaşar Arabacı
Yaşar Arabacı yasar11...@gmail.com added the comment: I forgot to mention that I use Python 2.7.2 (default, Nov 21 2011, 17:24:32) [GCC 4.6.2] on linux2 Linux yasar-laptop 3.1.4-1-ARCH #1 SMP PREEMPT Tue Nov 29 09:08:04 UTC 2011 i686 Intel(R) Pentium(R) M processor 1.86GHz GenuineIntel GNU

[issue13625] multiprocessing.reduction gives OSError: [Errno 9] in 2.7.2

2011-12-18 Thread Yaşar Arabacı
Yaşar Arabacı yasar11...@gmail.com added the comment: I would love to test which patch introduced the problem, but I am not sure how should I do that. (Get the python source, change it and recompile?). I am also adding output of strace here. -- Added file: http://bugs.python.org

[issue13625] multiprocessing.reduction gives OSError: [Errno 9] in 2.7.2

2011-12-18 Thread Yaşar Arabacı
Changes by Yaşar Arabacı yasar11...@gmail.com: Added file: http://bugs.python.org/file24019/output-2.6.txt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13625

[issue13625] multiprocessing.reduction gives OSError: [Errno 9] in 2.7.2

2011-12-18 Thread Yaşar Arabacı
Changes by Yaşar Arabacı yasar11...@gmail.com: Added file: http://bugs.python.org/file24020/output-3.2.2.txt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13625

[issue13625] multiprocessing.reduction gives OSError: [Errno 9] in 2.7.2

2011-12-18 Thread Yaşar Arabacı
Yaşar Arabacı yasar11...@gmail.com added the comment: Ok, I figured how to test for those patches. I just tested my code against those versions, and suprisingly I didn't get any errors. I am adding output of three different versions now. Each filename corresponds to regarded version

[issue13625] multiprocessing.reduction gives OSError: [Errno 9] in 2.7.2

2011-12-18 Thread Yaşar Arabacı
Changes by Yaşar Arabacı yasar11...@gmail.com: Added file: http://bugs.python.org/file24026/d4d9a3e71897-output.txt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13625

[issue13625] multiprocessing.reduction gives OSError: [Errno 9] in 2.7.2

2011-12-18 Thread Yaşar Arabacı
Changes by Yaşar Arabacı yasar11...@gmail.com: Added file: http://bugs.python.org/file24027/9f4d72da69a8-output.txt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13625

[issue13625] multiprocessing.reduction gives OSError: [Errno 9] in 2.7.2

2011-12-18 Thread Yaşar Arabacı
Yaşar Arabacı yasar11...@gmail.com added the comment: Appereantly my distribution's build used this http://www.python.org/ftp/python/2.7.2/Python-2.7.2.tar.xz, and that version was bugged. But I tried building this http://www.python.org/ftp/python/2.7/Python-2.7.tar.bz2 and that build worked

[issue13625] multiprocessing.reduction gives OSError: [Errno 9] in 2.7.2

2011-12-18 Thread Yaşar Arabacı
Yaşar Arabacı yasar11...@gmail.com added the comment: Current 2.7 branch is ok. This bug report can be closed. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13625

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 andreas.perstin...@gmx.net 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...

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: 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ı yasar11

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 alec.tayl...@gmail.com 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

Working with spreadsheet files

2011-10-09 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/ --

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 zaffin...@gmail.com Hello, I wrote a function that works on a numpy

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:

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

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

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ı yasar11...@gmail.com yazdı: Hi, I wrote a function to get thorugh redirections and find a final page for a given web-page

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,script):

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

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ı yasar11...@gmail.com Tarih: 16 Eylül 2011 14:33 Konu: Re: why ps/fname of a python interpreter changes across platforms? Kime: Steven D'Aprano steve+comp.lang.pyt...@pearwood.info For example, in arch linux, I had 3 different

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

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

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/ --

Re: Subclassing str object

2011-08-31 Thread Yaşar Arabacı
kelime(self._sozcuk + ular) 31 Ağustos 2011 14:43 tarihinde Yaşar Arabacı yasar11...@gmail.com 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 would appreciate an answer either

Re: Subclassing str object

2011-08-31 Thread Yaşar Arabacı
of unicode's 31 Ağustos 2011 20:11 tarihinde Ian Kelly ian.g.ke...@gmail.com yazdı: 2011/8/31 Yaşar Arabacı yasar11...@gmail.com: 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 unicode

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? --

Fwd: Processing a large string

2011-08-28 Thread Yaşar Arabacı
-- Yönlendirilmiş ileti -- Kimden: Yaşar Arabacı yasar11...@gmail.com Tarih: 28 Ağustos 2011 22:51 Konu: Re: Processing a large string Kime: Paul Rudin paul.nos...@rudin.co.uk Are you getting Overflow error or memory error? If you don't know what those means: Overflow error

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ı yasar11...@gmail.com Tarih: 23 Ağustos 2011 16:19 Konu: Re: is there any principle when writing python function Kime: Roy Smith r...@panix.com I don't see myself

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. --