Jon Crump wrote:
> I'm still faced with the problem of the javascript months being 0
> indexed. I have to add 1 to group \2 in order to get my acurate
> date-string. Obviously I can't do
>
> print jdate.sub(r'"\1-\2+1-\3"', s)
>
> because the first argument to sub() is a string. How can I act on \2
On Fri, Jan 9, 2009 at 6:53 PM, phr34kc0der wrote:
> Hi everyone,
>
> I have a python question i would like to ask.
>
> Im trying to write a script to login to a website and mirror it. I need to
> submit a post request to /login.php which is fine, but how can i access
> other pages on the site.
S
Jon Crump wrote:
> Dear all,
>
> I've been around and around with this and can't seem to conceptualize it
> properly.
>
> I've got a javascript object in a text file that I'd like to treat as
> json so that I can import it into a python program via
> simplejson.loads(); however, it's not proper j
Dear all,
I've been around and around with this and can't seem to conceptualize it
properly.
I've got a javascript object in a text file that I'd like to treat as json
so that I can import it into a python program via simplejson.loads();
however, it's not proper json because it has new Date(
Hi everyone,
I have a python question i would like to ask.
Im trying to write a script to login to a website and mirror it. I need
to submit a post request to /login.php which is fine, but how can i
access other pages on the site.
For example
data = urllib.urlencode({"username" : "my
On Fri, Jan 9, 2009 at 10:41 AM, Vicent wrote:
> Hello. This is my first message to the list.
>
> In this article written in 2002
>
> http://www.ibm.com/developerworks/library/l-psyco.html
>
> they talk about Psyco as a module that makes it possible to accelerate
> Python.
>
> Is it still a state-
Hello. This is my first message to the list.
In this article written in 2002
http://www.ibm.com/developerworks/library/l-psyco.html
they talk about Psyco as a module that makes it possible to accelerate
Python.
Is it still a state-of-the-art module?
I found it here also: http://pypi.python.org
Hello Kent and All,
Errata: int() does work.
I think that in my test code a number such as '4.5' might have slipped in
and then int() protested.
eval() worked in all my attempts. So, thanks Daniel Sarmiento, your solution
is correct as is.
By the way, when I said 'cast' I really meant 'conver
>> A tuple of exceptions works, just like what we did above, and more,
>> i.e., (IndexError, ValueError, TypeError, KeyError...
>>
> Thank you, thank you, thank you! I'm sure it's been staring me in the face,
> but I never realized I could use a tuple of exception types - that's why I
> said it wa
Forgot a "detail"
> def possible_cube(val):
> try:
> return val ** 3
> except TypeError:
> return val
denis
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
Le Fri, 9 Jan 2009 08:10:27 -0800 (PST),
culpritNr1 a écrit :
>
> Hello Denis and All,
>
> Your solution does show elegance. To remind people, it's this one:
>
> lol = [[1,2,3],[4,5,6],[7,8,9]]
> new_lol = [[a,b**3,c] for [a,b,c] in lol]
> print lol
> print new_lol
> ==>
> [[1, 2, 3], [4, 5, 6
On Fri, Jan 9, 2009 at 11:23 AM, culpritNr1 wrote:
> That is EXACTLY what I was looking for.
>
> Actually, int() does not really work but this does:
>
> [ [line[0], eval(line[1]), eval(line[2])] + line[3:] for line in LoL]
That's strange. What happened when you tried int() ? What version of
Pytho
Eduardo Vieira wrote:
Hello, I'm new to this list, and am enjoying it. I just wonder what
"OP" stands for, as I have seen quite a few mentions in the python
lists
Original Poster - ie whoever it was who first raised
the question we're discussing now. In the case of this
thread, you're the OP.
Eduardo Vieira wrote:
Hello, I'm new to this list, and am enjoying it. I just wonder what
"OP" stands for, as I have seen quite a few mentions in the python
lists
Original Poster - ie whoever it was who first raised
the question we're discussing now. In the case of this
thread, you're the OP.
Thanks Daniel,
That is EXACTLY what I was looking for.
Actually, int() does not really work but this does:
[ [line[0], eval(line[1]), eval(line[2])] + line[3:] for line in LoL]
Again, thanks.
culpritNr1
Daniel Sarmiento-2 wrote:
>
> I am not an expert and don't know if this is considered
Hello Denis and All,
Your solution does show elegance. To remind people, it's this one:
lol = [[1,2,3],[4,5,6],[7,8,9]]
new_lol = [[a,b**3,c] for [a,b,c] in lol]
print lol
print new_lol
==>
[[1, 2, 3], [4, 5, 6], [7, 8, 9]]
[[1, 8, 3], [4, 125, 6], [7, 512, 9]]
Now, as I said in my original pos
Hello, I'm new to this list, and am enjoying it. I just wonder what
"OP" stands for, as I have seen quite a few mentions in the python
lists
Thanks
Edu
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
I am not an expert and don't know if this is considered 'elegant', but this
is what I would try
conv = [[j[0], int(j[1]), int(j[2])] + j[3:] for j in LoL]
> Hi Your,
>
> I work with genomic datasets as well and have recently only started
> working with python (so my advice is a bit naive)
>
>
Le Fri, 9 Jan 2009 06:20:26 -0800 (PST),
culpritNr1 a écrit :
>
> Hello Trias and all,
>
> Glad to see that somebody recognized the BED genomic annotation format.
> Being a relative newcomer to python, my question was if there was an ELEGANT
> way to do this casting, perhaps as a list comprehe
Hello Trias and all,
Glad to see that somebody recognized the BED genomic annotation format.
Your naive approach is probably the first thing that one could try. It is
sure to work. The problem is that your code becomes unnecessarily
long/cumbersome: every time I would have to use a particular el
On Fri, Jan 9, 2009 at 7:36 AM, Michael Bernhard Arp Sørensen
wrote:
> I can't use a graphical debugger because i mostly code python over ssh on
> remote servers in my company.
Winpdb opens a socket connection between the debugger and debuggee.
Perhaps it would run over an ssh tunnel...
Kent
__
Hi Your,
I work with genomic datasets as well and have recently only started working
with python (so my advice is a bit naive)
I would say although there may be different ways you can cast an integer or
float type into your list of lists you may actually no need to do so with your
starting f
Hi.
Thanks for the input. Your way of doing it is simpler and possible to use as
an alias in pdb.
I can't use a graphical debugger because i mostly code python over ssh on
remote servers in my company.
Thanks anyway. It was actually helpfull. :-)
/Michael
On Fri, Jan 9, 2009 at 12:38 PM, Kent
On Fri, Jan 9, 2009 at 3:27 AM, Michael Bernhard Arp Sørensen
wrote:
> Hi there.
>
> I've just started using the python debugger and I wonder how I could have
> lived without it earlier.
>
> I just wonder if there is a smarter way to show what all the variables
> contain in any given point in the
Hi there.
I've just started using the python debugger and I wonder how I could have
lived without it earlier.
I just wonder if there is a smarter way to show what all the variables
contain in any given point in the debugger. I'm using this approach:
import sys
f = sys._getframe()
p f.f_locals.it
25 matches
Mail list logo