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
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
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
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
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
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
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"
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
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
>
[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
[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
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
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
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
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
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
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
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
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
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
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,
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
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
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
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
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
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
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
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
[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
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
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
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
33 matches
Mail list logo