On Wednesday, 11 November 2020 at 12:22:24 UTC+1, Chris Angelico wrote:
> On Wed, Nov 11, 2020 at 10:06 PM j c wrote:
> >
> > Hello all,
> >
> > I don't know if this suggestion is missing some point, or it's part of
> > something already propos
"Alex Willmer" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> When reporting file sizes to the user, it's nice to print '16.1 MB',
> rather than '16123270 B'. This is the behaviour the command 'df -h'
> implements. There's no python function that I could find to perform this
> format
"Mark Line" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hello!
>
>
> I've also managed to connect to my access database, and just print out a
> field in a table, but I cant find anywhere on the web that will help me to
> import data? Any help would be great?!
>
>
Another meth
Para Windows:
import win32api
handle = win32api.OpenProcess(1, False, pid_del_proceso)
win32api.TerminateProcess(handle, -1)
win32api.CloseHandle(handle)
"Yves Glodt" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Andres de la Cuadra wrote:
> > Hola, me llamo Andres de la cuadra,
"Peter Hansen" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Fredrik Lundh wrote:
> > Daniel Crespo wrote:
> >>os.spawnl(os.P_NOWAIT, "c:/windows/notepad.exe")
> >>>1944
> >>
> >>I don't get the correct PID.
> >>
> >>When I do os.spawnl(os.P_NOWAIT, "c:/windows/notepad.exe")
>
Talking Panda LLC is looking for a programmer to take over building
applications for the iPod.
Required skills below.
Please email me personally.
[EMAIL PROTECTED]
- Expertise in text parsing and formatting. Specifically,
developing parsers to extract meaningful information from freeform
text, XM
Lee Harr wrote:
I found that the socket solutions only work if your
DNS entries are correct ... which in my case was not
true. So I came up with this:
That is indeed correct, and even if the DNS entries are correct at times
it does not give the full list of IPs by gethostbyname or gethostbyaddr.
Suppose I have a list of dictionaries and each dict has a common keyname
with a (sortable) value in it.
How can I shuffle their position in the list in such way that they
become sorted.
Maybe I am doing it wrongly and you would say: why don't you get
yourself a (slimmed-down) implementation of
Jp Calderone wrote:
On Thu, 06 Jan 2005 15:31:22 +0100, J Berends <[EMAIL PROTECTED]> wrote:
Suppose I have a list of dictionaries and each dict has a common keyname
with a (sortable) value in it.
How can I shuffle their position in the list in such way that they
become sorted.
In
Jp Calderone wrote:
On Thu, 06 Jan 2005 14:35:16 +0100, J Berends <[EMAIL PROTECTED]> wrote:
From several approached I came up with the following code:
def getipaddr(hostname='default'):
"""Given a hostname, perform a standard (forward) lookup and return
"frost" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
>
> I am trying to login a website that using PHP and javascript. This is
> what happend if you browse that website using IE, after you login, you
> can go anywhere without enter your name and password again, as long as
> you
Looking for Java/COM interoperability tools? Thousands of companies
world-wide are using J-Integra for COM for interoperability between
Java and Microsoft COM applications. J-Integra for COM is a pure Java
implementation of the DCOM protocol, making it several times faster
than Web Services.
J
> from win32com.client import Dispatch
> from time import sleep
>
> ie = Dispatch('InternetExplorer.Application')
> ie.Visible = 1
> ie.Navigate("http://ispds-sepsr.prv:7500/cs/welcome.jsp";)
>
> while ie.ReadyState != 4:
> sleep(1)
>
> doc = ie.Document
>
> while doc.readyState != "complete":
Hello,
I've just installed (accepted all installation defaults) Python 2.4 (final)
on my Microsoft Windows XP (home edition - service pack 2) computer, and I
am experiencing the following behavior regarding Tix:
>>> import sys
>>> sys.version
'2.4 (#60, Nov 30 2004, 11:49:19) [MSC v.1310 32 bit
The Python modules documentation indicates crypt is only available on Unix
platforms.
<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi folks!
>
> Can't compile my file due to some problems with crypt module.
> My platform is WinXP:
> First I launch my Python Shell,
> Than I open th
Ok, that indeed did work. Thanks for your help.
"Michael Auerswald" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Ok, problem solved, more or less. What happens is that Tcl isnt looking
> for the Tix DLL along the python path nor is it looking along the
> os.environ path, but
Assuming you're just trying to get rid of the message each time the program
runs, the following suppresses it:
import warnings
warnings.filterwarnings('ignore', category=FutureWarning)
HTH,
--
http://mail.python.org/mailman/listinfo/python-list
Peter Hansen wrote:
Bearish wrote:
I get 'Address already in use' errors when using sockets.
Generally one can fix this using:
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
where "sock" is the server socket in question. Do
this prior to attempting to bind to the port.
-Peter
I agree
"Roger Upole" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Something like this should be close:
>
> import win32com.client, pythoncom
> ie=win32com.client.Dispatch('internetexplorer.application')
> ie.Visible=1
> ie.Navigate('somepagewithjavascript.html')
> id=ie.Document.Script._
I am learning Python and wish to develop GUI applications to run on Windows.
I have installed the Visual Studio integrated shell (Ver. 12.0.21005.1 REL) IDE
and the Python 3.3 interpreter. I have gone through some of the 3.3 tutorial
available at http://docs.python.org/3.3/tutorial/.
The tutoria
Good evening, I am a complete noob at Python. I am attempting to create a
key and update its value. The code below is what I have come up with after
reading everything I can get my hands on.
When I run the this code I get an error that says the 'int' can't be called.
I appreciate your h
Cython and number it is...
they definitely rule!
But of course I am also interfacing my python code (with all the
structuring and UI and object orientation) with some sse and fortran.
if u can get a grip of programming fortran/sse, they work too
On 12/7/14, Mark Lawrence wrote:
> On 07/12/2014
Hi ppl,
I'm trying to figure out the whole virtualenv story.
Right now I'm using it to creating an environment for our upcoming debian
upgrade to squeeze.
I'm doing some tests in our current distrib (python 2.5).
I have come to realize that a lot of packages in the version I'm interested
in are n
i am doing my masters currently and im stuck up with my final project. As i
was interested in learning a new language i opted to do my final project in
python. im currently working on building an unit tester for multithreaded
code. Due to various reasons i got stuck with my project. basically my la
I'm having trouble with the BOM that is now prepended to codecs files.
The files have to be read by java servlets which expect a clean file
without any BOM.
Is there a way to stop the BOM being written?
It is seriously messing up my work as the servlets do not expect it to
be there. I could d
then edited. The files use a
whole variety of languages from Sanskrit to Cyrillic and more obscure
ones too.
I'll probably have to remove it in the servlet as we have standardised
on utf-8. This was done some years ago when utf-16 was rare (apart from
Macs).
J
--
https://mail.python.org/mailman/listinfo/python-list
inly there:
<86> %R 10C0203z-621
%A François-Xavier Le_Bourdonnec
000 206 255 373 % R 1 0 C 0 2 0 3 z -
J
--
https://mail.python.org/mailman/listinfo/python-list
process of updating this to Python as it is getting
too difficult to maintain.
J
--
https://mail.python.org/mailman/listinfo/python-list
So it is just a random sequence of "junk".
It will be a matter of finding the real start of the record (in this
case a %) and throwing the "junk" away. I was misled by the note in the
codecs class that BOMs were being prepended. Should have looked more
carefully.
Mea culpa.
--
https://mail.
Sent from my Windows Phone From: python-list-requ...@python.org
Sent: 05-08-2014 15:37
To: python-list@python.org
Subject: Python-list Digest, Vol 131, Issue 6
Send Python-list mailing list submissions to
python-list@python.org
To subscribe or unsubscribe via the World Wide Web, visit
loop"*
*python_dot_loop1(f,times,N)*
*print "nested loop using itertools.product()"*
*python_dot_loop2(f,times,N)*
*def python_dot_loop1(f,times,N):*
*for t in range(times):*
* t1=time.time()*
* for i in range(N):*
* for j in range(N):*
*
Dear Peter
Yes the f[t] or f[:,:,:] might give a marginal increase, but then i need
to do further operations using the indices, in which case this wouldnt help
Dear Wojciech
np.flat() works if u dont care about the indices and only the matrix/array
values matter.
but if the matters, flatten
loops and not to
distract us to the operation done inside the loop.
right?
On Wed, Aug 6, 2014 at 6:09 PM, Peter Otten <__pete...@web.de> wrote:
> Gayathri J wrote:
>
> > Dear Peter
> >
> > Yes the f[t] or f[:,:,:] might give a marginal increase,
>
> The spe
I have been using Anaconda's (Continnum) conda installation for system
installation (python 2.7) and for python 3
conda lets us maintain diferent environments with different python and
different combinations of other packages like numpy etc...
sure not to disappoint!
On 10/12/14, Albert-Jan Ros
I am having some issues compiling an exe myself but most of that stems from the
version of python I am using. That being said, try using GUI2EXE
http://code.google.com/p/gui2exe this program makes the setup file go a lot
easier, also it will tie in a few different tools like py2exe which is wha
I have a question:
When should syslog.closelog() be called? I have a daemon that spends
most of its time asleep and quiet, but writes messages to the mail log
when active. Should I open the log at the start and keep it open until
the program closes? This seems much simpler than issuing three
c
I'm doing QA testing of a WebApp. First step before crawling the links is to
enter the two texts mentioned.
Do I extract the login page using:
import sys, os, urllib, urlparse
Then figure out the HTTP string and then feed that into a HTTP Post ?
Or do I use Forms, CGI or Pamie ??
Whats the
><[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>It seems to me that there is no way to create a new instance of Internet
>Explorer (if there are already some IE windows opened).
>Does anyone know a possible solution? Or a workaround (without using
>startfile, maybe?) that will force I
"M.E.Farmer" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I played around with it.
>
> import pythoncom
> from win32com.client import Dispatch
>
###
<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Thanks for the response again. The solution is pretty close but not yet
> complete
> This is what I observed.
> a) I tried to use the delay mechanism as suggested below
> ie.
> ie.Navigate('www.google.com')
> while ie.ReadyState !- 4
>
"Roger Upole" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> There does appear to be some sort of conflict between the two event
> hooks. I wasn't seeing it before since IE was getting google from my
> browser cache and it was coming up almost instantaneously. As soon
> as I switch
> >>The Great 'Sateesh' uttered these words on 5/23/2005 7:14 AM:
> >>>Is it possible to access Lotus notes using Python? Can anyone provide
me
> >>>some pointers?
This might help you get started once you've installed the win32 modules.
http://tinyurl.com/a9ocy
--
http://mail.python.org/mail
"Elliot Temple" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> How do I make Python press a button on a webpage? I looked at
> urllib, but I only see how to open a URL with that. I searched
> google but no luck.
>
> For example, google has a button how would i make a script to
"Esben Pedersen" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> How do i know which methods the ie object has? dir(ie) doesn't show
> Navigate.
For ie object:
http://msdn.microsoft.com/workshop/browser/webbrowser/reference/ifaces/IWebBrowser2/IWebBrowser2.asp
For document object:
h
"Chris Curvey" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I need to create a set of IE instances that have different sets of
> session cookies. I thought that using the win32com.DispatchEx function
> would do this, but it doesn't seem to. In other words
>
> ie1 = win32com.Dispa
'll hunt around and see if I can find a solution
which I'll post back.
J
--
http://mail.python.org/mailman/listinfo/python-list
from the Start menu. (Of course, that doesn't
> > mean that I can launch them programmatically, but I'm hoping that
> > someone can give me a definitive answer.)
> >
"J Correia" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Right, I ha
>Chris Curvey" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> thanks for all the help. I'll give the ShellExecute() approach a try
> in the morning.
>
> The short version of what I'm trying to do is
>
> Have my website login to a 3rd party website on behalf of my customer,
> fil
> <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> > Resurrecting an old thread..
> > It seems that this solution does not return events on objects within
> > frames in webpages eg . if you go to www.andersondirect.com - the page
> > is composed of three frames called as topFrame main
<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Sorry about that I had an instance of ie running in the background that
> was version 0 didn't see the problem tell this morining when my
> computer started to not work. it should be hwnds[1] should be
> hwnds[0]. I woud enumerate the
<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Doh! I didn't think to look in the demo directory. Silly me.
>
http://www.win32com.de/index.php?option=com_content&task=view&id=163&Itemid=189
--
http://mail.python.org/mailman/listinfo/python-list
James Stroud wrote:
> Hello All,
>
> I'm using numpy to calculate determinants of matrices that look like
> this (13x13):
>
> [[ 0. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1.]
[snip]
> But I have a feeling I'm exceeding the capacity of floats here. Does
> anyone have an idea for how to
On 7/6/07, Ed Jensen <[EMAIL PROTECTED]> wrote:
Alex Martelli <[EMAIL PROTECTED]> wrote:
> Calling all vi/vim users (and we'll heartily appreciate the support of
> TextMate fans, BBEdit ones, etc, etc) -- we're at risk being defined out
> of existence, since we're neither happy with Emacs nor wa
[EMAIL PROTECTED] wrote:
> I'm trying to do some integral calculation. I have searched the web, but
> haven't found any useful information. Will somebody point me to the
> right resources on the web for this job ?
>
> Thanks a lot.
>
> ps. Can numpy be used for this job?*
> *
It can be done wi
you can use the dictionary returned by the built in function vars, along
the lines of
>>> vars()["foo"] = lambda x: 3*x
>>> foo(2)
6
but polluting your name space with data counts as bad style and will
probably bite you at some point -- you probably are better of putting
closures in a dictio
olive wrote:
>>> [snip]
>
> But few people are used to Plain Text Markup (excepted in some
> scientific area maybe) and it is error prone.
>
It looks very much like Gummi's authors and target audience actually are
part of the few people you are talking about: i.e. console-happy folks
that ar
On 8/28/07, Lamonte Harris <[EMAIL PROTECTED]> wrote:
>
> From a python starter, I don't like the word noob because it sounds very
> unprofessional.
>
Touche`...haha
I second the motion for "Dive Into Python." It's an excellent book, and you
really can't beat the price (free online as Shawn has
Silly question, but are you importing random somewhere in that file?
It works on both my XP machine and my Linux machine (both from CLI) after
importing random...though it runs through this:
while count <= i:
i + 1 times...(You initialize count to 0, then loop over it until it hits
i+1 (at which
Willa Ford Angelina Joli Paris Hilton
www.alphasearch.GR--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
> Just to clarify what I'm after:
>
> If you plot (-3)^n where n is a set of negative real numbers between 0
> and -20 for example, then you get a discontinuos line due to the
> problem mentioned above with fractional exponents.
>
> ..
>
It looks like you crash-landed
Hello Everyone,
I'm new to python. I have worked through some tutorials and played around
with the language a little bit but I'm stuck.
I want to know how I can make python run a program. More specifically, I
want to get python to work with SOX to record a sound through the
microphone, save the
t3 = [7,8,9]
>>> for a,b,c in zip(list1,list2,list3):
...print a, b, c
...
1 4 7
2 5 8
3 6 9
hth
j.
--
http://mail.python.org/mailman/listinfo/python-list
e too (on netbsd at least).
So, that's a bash problem - not that it helps I guess :-) but bash docs
may have some more info about this issue.
j.
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
> Hi, I work for an IT company in Phoenix, AZ and am trying to find an
> experienced python developer in the area. Can anyone help?
Hi,
There's a Python job board at http://www.python.org/community/jobs/
The first link on the page documents how to get your ad
tea break), surely that
can't hurt.
Anyway, I do not see how to suggest a new mailing list on
http://www.python.org/community/lists/ - does anyone know?
cheers,
J.
--
http://mail.python.org/mailman/listinfo/python-list
ly achieved by not reading c.l.p.
>
> If it succeeds, you may easily get the same amount of traffic as you have now
> here.
>
I hope you're wrong :-)
How about that: anyone that care for such a mailing list please drop me
a line privately. I'll report how many people do.
Cheers,
J
--
http://mail.python.org/mailman/listinfo/python-list
Diez B. Roggisch wrote:
> Achim Domma wrote:
> [snip]
>>
>> Is there an alternative to wx+pyOpenGL?
>
> The usual suspects - mainly Qt, possibly Tk (not sure if there is a
> python-available version of open gl canvasses for Tk)
>
> Diez
togl is a Tk/OpenGL widget that can be used with python as
Méta-MCI (MVP) wrote:
>> no idea how it works with windows.
>
> On XP: fine.
> On Vista: very difficult...
Hello Captain Obvious :-)
--
http://mail.python.org/mailman/listinfo/python-list
Keflavich wrote:
> [snip]
>
> I feel fairly certain, however, that floats are exactly what I want
> for my purposes: I need moderately high precision and I'm not
> concerned about the least-significant-bit errors except when they
> violate function domains. I guess the overriding lesson is that e
Hello,
I saw this statement in Core Python Programming book,
All arguments of function calls are made by reference, meaning that
any changes to these parameters within the function
affect the original objects in the calling function.
Does this mean there is not pass-values calling to a function
On Jan 16, 2008 1:45 PM, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote:
> On Wed, 16 Jan 2008 11:09:09 +0800, "J. Peng" <[EMAIL PROTECTED]>
>
> alist = []
> anint = 2
> astr = "Touch me"
>
> dummy(alist, anint, astr)
>
> "
On Jan 16, 2008 2:30 PM, Steven D'Aprano
<[EMAIL PROTECTED]> wrote:
> On Wed, 16 Jan 2008 13:59:03 +0800, J. Peng wrote:
>
> > Hi,
> >
> > How to modify the array passed to the function? I tried something like
> > this:
> >
> >>>
On Jan 16, 2008 3:03 PM, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote:
> On Wed, 16 Jan 2008 13:59:03 +0800, "J. Peng" <[EMAIL PROTECTED]>
> declaimed the following in comp.lang.python:
>
>
> > How to modify the array passed to the function? I tried somethi
I just thought python's way of assigning value to a variable is really
different to other language like C,perl. :)
Below two ways (python and perl) are called "pass by reference", but
they get different results.
Yes I'm reading 'Core python programming', I know what happened, but
just a little con
May I ask, python's pass-by-reference is passing the object's
reference to functions, but perl, or C's pass-by-reference is passing
the variable itself's reference to functions. So althought they're all
called pass-by-reference,but will get different results.Is it?
On
On Jan 17, 2008 2:03 PM, Christian Heimes <[EMAIL PROTECTED]> wrote:
> George Sakkis wrote:
> > Python's parameter passing is like passing a pointer in C/C++.
> [snip]
>
> It's not (I repeat NOT) like passing a pointer in C. Please read
> http://effbot.org/zone/call-by-object.htm
>
Yes I agree. No
On Jan 17, 2008 1:54 PM, Mel <[EMAIL PROTECTED]> wrote:
>
> test(a) (along with def test(x)) takes the object named 'a' in the
> current namespace and binds it with the name 'x' in function test's
> local namespace. So, inside test, the name 'x' starts by referring to
>the list that contains [
On Jan 17, 2008 2:55 PM, Hrvoje Niksic <[EMAIL PROTECTED]> wrote:
>
> @$ref = (4, 5, 6) intentionally assigns to the same list pointed to by
> the reference. That would be spelled as x[:] = [4, 5, 6] in Python.
> What Python does in your example is assign the same as Perl's $ref =
> [4, 5, 6]. So
what's the difference between an array and a list in python?
I see list has all features of array in C or perl.
so please tell me.thanks.
--
http://mail.python.org/mailman/listinfo/python-list
hello,
why this happened on my python?
>>> a=3.9
>>> a
3.8999
I wanted 3.9 but got 3.89
How to avoid it? thanks.
this is my python version:
>>> sys.version
'2.3.4 (#1, Feb 6 2006, 10:38:46) \n[GCC 3.4.5 20051201 (Red Hat 3.4.5-2)]'
--
http://mail.python.org/mailma
thanks all!
On Jan 18, 2008 3:49 PM, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote:
> On Fri, 18 Jan 2008 13:55:17 +0800, "J. Peng" <[EMAIL PROTECTED]>
> declaimed the following in comp.lang.python:
>
> >
> > why this happened on my python?
> &g
> On Jan 18, 3:23 am, "J. Peng" <[EMAIL PROTECTED]> wrote:
>
>> what's the difference between an array and a list in python?
>> I see list has all features of array in C or perl.
>> so please tell me.thanks.
>>
>
> If you are n
Python's variable is dynamic type,is it?
But why this can't work?
>>> 3 + 'a'
Traceback (most recent call last):
File "", line 1, in ?
TypeError: unsupported operand type(s) for +: 'int' and 'str'
So I see the number 3 can't be converted to string type automacially.
--
http://mail.python.org/ma
J. Peng 写道:
> Please see the code below,what's the scope for object "name"?
> I thought it should be located in the while block, but it seems not
> really,it can be accessed out of while (the db[name] statement).Thanks
> in advance.
>
>
sorry the before code
Please see the code below,what's the scope for object "name"?
I thought it should be located in the while block, but it seems not
really,it can be accessed out of while (the db[name] statement).Thanks
in advance.
db = {}
def newuser():
prompt = 'login desired: '
while 1:
name = raw_input(prompt)
J. Peng 写道:
>k = (i.split())[3]
>y = (i.split())[1]
btw, why can't I write the above two into one statement?
(k,y) = (i.split())[3,1]
--
http://mail.python.org/mailman/listinfo/python-list
Dennis Lee Bieber 写道:
> The scope of "name" is the entire function; lacking a "global name"
> statement, AND being on the left side of an assignment, it is a function
> local name.
Thank you. Does python have so-called 'block scope' object?
or if you can,please show me the doc for python's o
I tried to write it below,it can work,:)
v= """preference 10 host mx1.domain.com
preference 30 host anotherhost.domain.com
preference 20 host mx2.domain.com"""
x=v.split("\n")
li =[]
for i in x:
k = (i.split())[3]
y = (i.split())[1]
li.append((y,k))
li.sort()
print li
the output is:
Steven D'Aprano 写道:
> On Mon, 21 Jan 2008 16:23:50 +0800, J. Peng wrote:
>
>> J. Peng 写道:
>>
>>>k = (i.split())[3]
>>>y = (i.split())[1]
>> btw, why can't I write the above two into one statement?
>>
>> (k,y) = (i.split()
first I know this is the correct method to read and print a file:
fd = open("/etc/sysctl.conf")
done=0
while not done:
line = fd.readline()
if line == '':
done = 1
else:
print line,
fd.close()
I dont like that flag of "done",then I tried to re-write it as:
fd = open
Thank you. That gave so much solutions.
And thanks all.
Steven D'Aprano 写道:
> On Tue, 22 Jan 2008 11:00:53 +0800, J. Peng wrote:
>
>> first I know this is the correct method to read and print a file:
>>
>> fd = open("/etc/sysctl.conf")
>> done=0
Gabriel Genellina 写道:
> En Tue, 22 Jan 2008 02:03:10 -0200, Paul Rubin
> <"http://phr.cx"@NOSPAM.invalid> escribió:
>
>> "J. Peng" <[EMAIL PROTECTED]> writes:
>>> print line,
>> Do you really want all the lines crunched toge
def safe_float(object):
try:
retval = float(object)
except (ValueError, TypeError), oops:
retval = str(oops)
return retval
x=safe_float([1,2,3,4])
print x
The code above works well.But what's the instance of "oops"? where is it
coming from? I'm totally confused on it.thanks.
--
ht
Bruno Desthuilliers 写道:
> J. Peng a écrit :
>> def safe_float(object):
>> try:
>> retval = float(object)
>> except (ValueError, TypeError), oops:
>> retval = str(oops)
>> return retval
>
>> The code above works well.
>
> For whi
Hello,
Is there a site for python,which collects most kinds of python modules?
like CPAN for Perl.
Sometime I want to use a module,like the time/date modules,don't know
where I should search from.
Sorry if I have repeated this question on the list.
Thanks!
--
http://mail.python.org/mailman/listi
hello,
Which useragent lib supports javascript?
I know something about these libs: urllib,urllib2,cookielib,httplib
But I'm not sure which one of them can support javascript scripts.
Thanks!
--
http://mail.python.org/mailman/listinfo/python-list
js åé:
> AFAIK, nothing.
> How abount letting a browser do it?
> By using pamie [1] or selenium, you can drive a browser from python.
>
> [1] http://pamie.sourceforge.net/
>
> On Feb 2, 2008 11:07 AM, J. Peng <[EMAIL PROTECTED]> wrote:
>> hello,
>>
>
I think the metaclass stuff is a bit too black magic for a pretty
simple requirement.
Txs in any case for showing me the __init__ issue, I wasn't aware of
it.
Here's a workaround - not exactly elegant in terms of OO, with the
isInitialized flag, but it works.
>>> class RDFObject(object):
...
On Feb 8, 5:38 pm, Freek Dijkstra <[EMAIL PROTECTED]> wrote:
If you want to subclass, my initial example did not cover that. This
will, or at least, I don't have any problems with similar code:
... def __new__(cls,uri,*args,**kwds):
... try:
... return cls.cache[(cls,uri
I got coverage.py to work after somewhat of a difficult start...
Hint: if moving your code from Windows to Linux and if running
'coverage.py -r mymodule.py' causes SyntaxError/SyntaxException, the
'flip' utility is your friend to deal with removing those nasty \r\n
newlines that are preventing co
201 - 300 of 3022 matches
Mail list logo