Re: Simple - looking for a way to do an element exists check..

2008-02-23 Thread Boris Ozegovic
TeroV wrote: > It isn't list comprehension, it is generator expression > http://en.wikipedia.org/wiki/Python_syntax_and_semantics#Generator_expressions Nice. :) -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple - looking for a way to do an element exists check..

2008-02-23 Thread Boris Ozegovic
Paul Rubin wrote: > if any(x[0]==element[0] for x in a): How come this list comprehension isn't in [] brackets? -- http://mail.python.org/mailman/listinfo/python-list

Re: Pydev, Eclipse

2008-02-22 Thread Boris Ozegovic
Preston Landers wrote: > Shift-Tab does it for me. It can also dedent whole blocks if you have > them selected. Excellent. Thank you. -- http://mail.python.org/mailman/listinfo/python-list

Pydev, Eclipse

2008-02-22 Thread Boris Ozegovic
Hi Suppose I have three blocks: if 1: if 2: if 3: # here I want my cursor go back to second block (if 2:) What is the standard shortcut for this? ctrl+arrow keys aren't, arrow keys alone aren't either. -- http://mail.python.org/mailman/listinfo/python-li

Re: localhost, ?!

2007-08-28 Thread Boris Ozegovic
Bjoern Schliessmann wrote: > Definitely a problem with the web server (503 means "service > unavailable"). I did try on two servers, Apache and simple python server. There was identically error on both servers. >> Anybody have slightest clue wthat is going on? :-/ > > Try using wireshark or

Re: localhost, ?!

2007-08-28 Thread Boris Ozegovic
Fabio Z Tessitore wrote: > I think to have http://localhost working you need a web server (like > apache). maybe you have it at your home. I do have Apache. You can see that urllib, older module, works correctly. -- http://mail.python.org/mailman/listinfo/python-list

localhost, ?!

2007-08-28 Thread Boris Ozegovic
Three machines, one at my home, other two at my job, in every machine there is Win XP SP2 and Python 2.5 At home: urllib2.urlopen("http://localhost";), everything is ok At job: urllib2.urlopen("http://localhost";) raise BadStatusLine(line), after half a minute. urllib2.urlopen("http://127.0.0.1"

Re: I Need help from all the group participants

2007-08-21 Thread Boris Ozegovic
Aaron wrote: [...] > Good luck. Thanks a lot for your help. -- Ne dajte da nas lažljivac Bandić truje: http://cnn.blog.hr/arhiva-2007-06.html#1622776372 -- http://mail.python.org/mailman/listinfo/python-list

Re: I Need help from all the group participants

2007-08-20 Thread Boris Ozegovic
Jason wrote: > I wonder what John's pulse is? Display John's pulse. I need to know > John's pulse. How many beats per minute is John's heart going? > What's John's pulse rate? How fast is John's heart rate? How fast is > John's blood pumping? What is the rate of John's heart? What is the >

Re: I Need help from all the group participants

2007-08-20 Thread Boris Ozegovic
[EMAIL PROTECTED] wrote: > I would be happy to help but I don't have a clear understand of what > the poster needs. Suppose you want to find out what is someone's pulse/heart rate, you can ask question in many ways, syntaxically, but with same semantic. One way to find out someone's pulse is to

Re: I Need help from all the group participants

2007-08-20 Thread Boris Ozegovic
[EMAIL PROTECTED] wrote: > The only sentence that comes to mind is: > > "I hope I never find myself in a hospital that uses your system." You are not funny. The system isn't for hospitals, it is for university purposes. -- Ne dajte da nas lažljivac Bandić truje: http://cnn.blog.hr/arhiva-2007

I Need help from all the group participants

2007-08-20 Thread Boris Ozegovic
Hi, I am working on some system, and the communication will take place through the chatterbot which will be written in AIML (interpreter is written in Python). English is not my mother tongue, so I need huge favor: if all of you can write two sentences, so that I could have greater pattern base

cookielib

2007-08-10 Thread Boris Ozegovic
Hi I have HTTP client which accepts cookies. If client allready has cookie, but that cookie has expired, server sends him new cookie, and in response object Set-Cookie: header everything is fine, but if I reload request, client sends expired cookie, and not the new one. In cookiejar there is onl

Re: httplib module

2007-07-08 Thread Boris Ozegovic
Steve Holden wrote: >>> Why do I get double new lines when geting data from server? Example: > How? It's customary to include details when you've solved your own > problem in case someone else gets the same issue. Ok. In do_GET I had this two lines: for line in file: print line As you c

Re: httplib module

2007-07-07 Thread Boris Ozegovic
Boris Ozegovic wrote: > Why do I get double new lines when geting data from server? Example: Fixed. -- Ne dajte da nas lažljivac Bandić truje: http://cnn.blog.hr/arhiva-2007-06.html#1622776372 -- http://mail.python.org/mailman/listinfo/python-list

httplib module

2007-07-07 Thread Boris Ozegovic
Why do I get double new lines when geting data from server? Example: I have a following file: --start- Ovo je testni primjerak --end--- And the code is: conn = httplib.HTTPConnection("localhost:8000") conn.request("GET", "/folder/index.html") response = conn.g

AIML, Python, Java

2007-07-04 Thread Boris Ozegovic
Hi I have a chatterbot written in AIML. I am using PyAIML, and HTTP server as a mediator between user and PyAIML. Server calls PyAIML, and sends the result string to the sensor network which is written in Java; and in the end, server returns value from Java method. Can I somehow call Java metho

Python data visualization

2007-04-11 Thread Boris Ozegovic
Hi I don't know if someone is familiar with Java JUNG, framework for data visualization (http://jung.sourceforge.net/), I am interested is there anything lik JUNG for Python? -- Greatest shits: http://www.net.hr/vijesti/page/2007/03/30/0030006.html -- http://mail.python.org/mailman/listinfo/p

Re: Module trouble [newbie]

2007-02-23 Thread Boris Ozegovic
Diez B. Roggisch wrote: > I use it sometimes myself, to avoid otherwise circular imports. Circular imports are the reason why I have module issues. Last question: if I put modules in some package and then try to import one I get "AttributeError: 'module' object has no attribute 'a' Code is: a

Re: Module trouble [newbie]

2007-02-23 Thread Boris Ozegovic
Diez B. Roggisch wrote: > Are you sure the above is what you really used for your test? Because your > output features a single 100, which the above lacks a print-statement for. Yeah, I cancelled the message, but synchronization allready happened. :) Problem was in some other place. One more q

Module trouble [newbie]

2007-02-23 Thread Boris Ozegovic
Can somebody explaint this to me: I have module a.py A = 100 import b print "A printing" print "B is %s" % b.B and module b.py B = 2000 import a print "B printing" print "A is %s" % a.A I thought that output would be: B printing A is 100 A printing B is 2000 Because import b would execute b.py,

Django, one more newbie question

2007-02-09 Thread Boris Ozegovic
Umm, can somebody tell me which language is this one: {% if latest_poll_list %} {% for poll in latest_poll_list %} {{ poll.question }} {% endfor %} {% else %} No polls are available. {% endif %} Whole tutorial is on this page: http://www.djangoproject.com/documentati

Re: Functions, parameters

2007-02-08 Thread Boris Ozegovic
Paul Rubin wrote: > Since split is applied to argname, it retrieves 'question' and 'startswith'. Exactly. :) And, 'questions' and 'startswith' are two string, and not references at Poll.question, or more precisely, instanceOfPoll.question. I suppose this is what I was looking for: __getattri

Re: Functions, parameters

2007-02-08 Thread Boris Ozegovic
Bruno Desthuilliers wrote: > Why don't you just read the source code ? Django is free software, you > know !-) Yes, I know. :) > What about something like: > def filter(self, **kw): >for argname, value in kw.items(): > fieldname, op = argname.split('__', 1) Yes, this is what conf

Functions, parameters

2007-02-08 Thread Boris Ozegovic
Hi, I'am still learning Python and while reading Django tutorial couldn't understand this part: class Poll(models.Model): question = models.CharField(maxlength=200) pub_date = models.DateTimeField('date published') # Django provides a rich database lookup API that's entirely driv

Re: Module problem

2007-02-06 Thread Boris Ozegovic
Matimus wrote: > Do you have more than one version of Python installed? Is > win32clipboard installed for both versions? It could be that the Yup, that was the problem. Thanx! -- "A mi smo stranci u vlastitoj zemlji zbog ljudskog sljama, lipa nasa silovana" -- http://mail.python.org/mailman/l

Module problem

2007-02-06 Thread Boris Ozegovic
Hi I am writing some simple script, and when I start my script from command line (python Imenik.py), everything works perfectly. If I double clik the same script in my desktop I get the following error: "No module name import win32clipboard" -- "A mi smo stranci u vlastitoj zemlji zbog ljudsko

Re: Jython

2007-02-03 Thread Boris Ozegovic
you can do even this: import sys for line in sys.stdin: print line, python FileReader.py < bobo.tx 'import site' failed; use -v for traceback boris ozegovic vedran ozegovic -- "A mi smo stranci u vlastitoj zemlji zbog ljudskog sljama, lipa nasa silovana" -- http://mail.python.org/mailman/listinfo/python-list

Re: Jython

2007-02-03 Thread Boris Ozegovic
Boris Ozegovic wrote: > [EMAIL PROTECTED] wrote: > >> Files aren't lists and thus don't have the functions for iteration. > > They do have iterator: > > C:\Documents and Settings\Silovana Vjeverica\Desktop>python FileReader.py > 'import site&#

Re: Jython

2007-02-03 Thread Boris Ozegovic
[EMAIL PROTECTED] wrote: > Files aren't lists and thus don't have the functions for iteration. They do have iterator: C:\Documents and Settings\Silovana Vjeverica\Desktop>python FileReader.py 'import site' failed; use -v for traceback boris ozegovic vedran ozegovi

Jython

2007-02-03 Thread Boris Ozegovic
Hi Why this doesn't work: def go(): for line in open("bobo.txt", "r"): print line go() python FileReader.py: everything ok jython FileReader.py: Traceback (innermost last): File "FileReader.py", line 6 File "FileReader.py", line 3 AttributeError: __getitem__ -- "A

Re: Sorting a list

2007-02-01 Thread Boris Ozegovic
John Salerno wrote: > Hi everyone. If I have a list of tuples, and each tuple is in the form: > > (year, text) as in ('1995', 'This is a citation.') > > How can I sort the list so that they are in chronological order L.sort() -- "kad imaš 7 godina glup si ko kurac, sve je predobro: autići i b

Re: Best way to document Python code...

2007-01-22 Thread Boris Ozegovic
Adonis Vargas wrote: > Then Python will generate a quick help interface for your module. I Hi Does Python has API just like in Java, for example http://java.sun.com/j2se/1.5.0/docs/api/allclasses-noframe.html ctrl-f and than click on class you are searching for, and finally you get clean list o