W dniu 2012-09-28 16:42, Alister pisze:
On Fri, 28 Sep 2012 10:39:32 -0400, Neal Becker wrote:
I know this should be a fairly basic question, but I'm drawing a blank.
I have code that looks like:
for s0 in xrange (n_syms):
for s1 in xrange (n_syms):
for s2 in xrange (
year as a "magic number", some of you
may think that I am repeating the Y2K problem. Hey, if my application
is still being used in the year 9998 I am not being paid nearly
enough...
--
Wojtek :-)
--
http://mail.python.org/mailman/listinfo/python-list
user comes across a site which uses it)
The IT community has enough trouble getting a few ISPs to upgrade their
DNS software. How are you going to get millions of general users to
upgrade?
Web stats show that people are still using IE 5...
--
Wojtek :-)
--
http://mail.python.org/ma
getting libraries from several
sources.
Without a generally acknowledged name space scheme different developers
will tend to walk all over each others variable/function names.
Especially as Javascript has global variables.
--
Wojtek :-)
--
http://mail.python.org/mailman/listinfo/python-list
Hello,
I spent a lot of time googling for a solution of this problem, with no
result.
I have a C++ application, in which I would like to embed Python interpreter.
I don't want to rely on an interpreter being installed on user machine,
instead I would like to distribute all the necessary files wit
ll the cases so this is not the issue.
> Are you getting any sort of error message?
When I run my app, it crashes while calling Py_Initialize(). The
console closes suddenly.
Is it necessary to create zip archive using zipfile.PyZipFile?
regards
2011/5/5 Ian Kelly
>
> On Wed, May 4, 2011
ackages directory to the sys.path by myself
(yet I don't know why sys.prefix and sys.exec_prefix are empty),
however how to deal with the PYTHONPATH, which is required to load
site.py and hence has to be defined at the very beginning?
thanks for your help
2011/5/5 Ian Kelly :
> On Thu, May 5
> Are you calling Py_SetProgramName? That may help to set sys.prefix
> and sys.exec_prefix. However, looking at site.py, it appears that
> it's only looking for proper directories. I don't think it will be
> able to add a site-packages inside a zip archive at all; you will just
> have to add tha
@Michel
use PIL downloaded from here: http://www.lfd.uci.edu/~gohlke/pythonlibs/
regards
2011/5/6 Christian Heimes :
> Am 06.05.2011 01:48, schrieb Michel Claveau - MVP:
>> Re!
>>
>> And why the problem no exist with PIL 1.1.6? (only 1.1.7)
>> Is that the version 1.1.6 does not use these librari
> I used py2exe in the past for that, see
> http://www.py2exe.org/index.cgi/ShippingEmbedded
Thanks for the advice, py2exe seems to be a great tool.
Unfortunately the application stops executing at the same place. It
might be the case of PIL library, I found some entries about it on
py2exe site.
Is there any special reason you don't want to use QThread?
http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qthread.html#details
regards
2011/5/11 Chris Angelico :
> On Wed, May 11, 2011 at 7:08 PM, vijay swaminathan wrote:
>> Sorry. My intention was not to send out a private message.
2011/5/11 Chris Angelico :
> On Thu, May 12, 2011 at 1:16 AM, Wojtek Mamrak wrote:
>> Is there any special reason you don't want to use QThread?
>> http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qthread.html#details
>
> Other than that QThread is part of QT
Yes, it is possible with use of PyQt.
2011/5/15 Rafael Durán Castañeda :
> On 15/05/11 01:01, OKB (not okblacke) wrote:
>>
>> Is there any Python library for interactive drawing? I've done
>> some googling but most searches for "drawing" lead me to libraries for
>> programmatic creation of
Hi, my goal is to obtain an interpreter that internally
uses UCS-2. Such a simple code should print 65535:
import sys
print sys.maxunicode
This is enabled in Windows, but I want the same in Linux.
What options have I pass to the configure script?
w.
--
https://mail.python.org/mailman/listin
Hi, my goal is to obtain an interpreter that internally uses UCS-2. Such a
simple code should print 65535:
import sys
print sys.maxunicode
This is enabled in Windows, but I want the same in Linux. What options have I
pass to the configure script?
w.
--
https://mail.python.org/mailman/listi
On Sunday, November 26, 2017 at 1:00:19 AM UTC+1, Terry Reedy wrote:
> You must be trying to compile 2.7. There may be Linux distributions
> that compile this way.
You're right, I need 2.7. Any hint which distro has got these settings?
> If you want to seriously work with unicode, many recommen
Hi, my goal is to obtain an interpreter that internally uses UCS-2. Such a
simple code should print 65535:
import sys
print sys.maxunicode
This is enabled in Windows, but I want the same in Linux. What options have I
pass to the configure script?
w.
--
https://mail.python.org/mailman/listi
On Sunday, November 26, 2017 at 1:00:19 AM UTC+1, Terry Reedy wrote:
> You must be trying to compile 2.7. There may be Linux distributions
> that compile this way.
You're right, I need 2.7. Any hint which distro has got these settings?
> If you want to seriously work with unicode, many recommend
de commant to execute my python script.
I have no idea how to run python script on my system that works the same as I
call it directly from windows command line.
regards
Wojtek
--
https://mail.python.org/mailman/listinfo/python-list
ting rid of this comment? I doubt that
the comment is a reason of this error, but it seems that
it shadows the real problem. Moreover, try to import urlparse
itself and check if you got the pyc file for urlparse.py
in your */lib/python2.5/ directory.
--
Regards,
Wojtek Walczak,
http://tosh.pl/g
[1] a valid URL? And are you sure that you want to send
something to the web serwer? By specifying the second argument
(args[3]) you're asking python to send HTTP "POST" request,
not "GET".
--
Regards,
Wojtek Walczak,
http://tosh.pl/gminick/
--
http://mail.python.org/mailman/listinfo/python-list
7;RED')
c.set_color('YELLOW')
print c.has_color('RED')
print c.has_color('BLUE')
print c.status_as_string(5)
HTH,
--
Regards,
Wojtek Walczak,
http://tosh.pl/gminick/
--
http://mail.python.org/mailman/listinfo/python-list
slash is left in the string. (This
behavior is useful when debugging: if an escape sequence is mistyped,
the resulting output is more easily recognized as broken.)
So, as long as the escape sequence is recognized it is changed
accordingly.
--
Regards,
Wojtek Walczak,
http://tosh.pl/gminick/
--
http://mail.python.org/mailman/listinfo/python-list
ary/struct.html
http://www.doughellmann.com/PyMOTW/struct/index.html
http://code.activestate.com/recipes/498149/
HTH,
--
Regards,
Wojtek Walczak,
http://tosh.pl/gminick/
--
http://mail.python.org/mailman/listinfo/python-list
shoot yourself in the foot and check what
the exceptions are, i.e.:
except:
import traceback
print traceback.format_exc()
Second, better use mechanize:
http://wwwsearch.sourceforge.net/mechanize/
HTH,
--
Regards,
Wojtek Walczak,
http://tosh.pl/gminick/
--
http://mail.
s of python. Take a look at this
example: http://aima.cs.berkeley.edu/python/utils.html
--
Regards,
Wojtek Walczak,
http://www.stud.umk.pl/~wojtekwa/
--
http://mail.python.org/mailman/listinfo/python-list
;>").replace("<","<")
HTMLParser.py:s = s.replace("&", "&") # Must be last
pydoc.py:return replace(text, '&', '&', '<', '<', '>',
'>')
xmlrpclib.py:s = replace(s, "&", "&")
So it could be BaseHTTPServer, cgi, cgitb, difflib, HTMLParser,
pydoc or xmlrpclib. Do you use any of these? Or maybe some other
external module?
--
Regards,
Wojtek Walczak,
http://www.stud.umk.pl/~wojtekwa/
--
http://mail.python.org/mailman/listinfo/python-list
it's described in the documentation.
--
Regards,
Wojtek Walczak,
http://www.stud.umk.pl/~wojtekwa/
--
http://mail.python.org/mailman/listinfo/python-list
rflowError: mktime argument out of range
>>>>
time module is written in C. time.mktime() function is actually
only a wrapper for mktime(3) and it also has its limits. Better
use datetime module instead.
--
Regards,
Wojtek Walczak,
http://www.stud.umk.pl/~wojtekwa/
--
http://mail.python.org/mailman/listinfo/python-list
; form-based authentication (using cookies) *and* HTTP basic
> authentication?
Use ClientCookie or even better - mechanize:
http://pypi.python.org/pypi/mechanize/
The docs aren't perfect, but you should easily
find what you are searching for.
--
Regards,
Wojtek Walczak,
http://www.stud.umk.p
Dnia Thu, 7 Aug 2008 12:37:55 -0700 (PDT), Samir napisa�(a):
> Some good online tutorials that I found really helpful include:
You might find it useful:
http://linkmingle.com/list/List-of-Free-Online-Python-Books-freebooksandarticles
--
Regards,
Wojtek Walczak,
http://www.stud.umk
ut I wouldn't worry about this.
Pythons 2.x will be around for quite some time (just as python
1.5.x is).
--
Regards,
Wojtek Walczak,
http://www.stud.umk.pl/~wojtekwa/
--
http://mail.python.org/mailman/listinfo/python-list
Dnia Thu, 7 Aug 2008 14:36:37 -0700 (PDT), szczepiq napisa�(a):
> Pardon me for most likely a dummy question but how do I find out if an
> object is a class?
Use types.ClassType:
>>> class Q:
...pass
...
>>> import types
>>> isinstance(Q, types.ClassTy
# or shadow 'string' module if it's imported.
def calculate_sum_1(string):
result = ''
for i in string:
if i.isdigit():
result += i
else:
result += ' '
return sum([int(i) for i in result.split()])
def calculate_sum_2(string):
lf.score > other.score:
return 1
return -1
==
Should work fine now.
--
Regards,
Wojtek Walczak,
http://www.stud.umk.pl/~wojtekwa/
--
http://mail.python.org/mailman/listinfo/python-list
vailable for subversion, out of the box, that I can import
> in my script?
There is no such module in standard library, but you can try
an external one. Check: http://pysvn.tigris.org/
--
Regards,
Wojtek Walczak,
http://www.stud.umk.pl/~wojtekwa/
--
http://mail.python.org/mailman/listinfo/python-list
>>> flags_set & flag2
2
>>> flags_set & flag3
0
>>> flags_set & flag4
8
>>> flags_set & flag5
0
--
Regards,
Wojtek Walczak,
http://www.stud.umk.pl/~wojtekwa/
--
http://mail.python.org/mailman/listinfo/python-list
,
not AF_INET. Note that you need root privileges to do so.
--
Regards,
Wojtek Walczak,
http://www.stud.umk.pl/~wojtekwa/
--
http://mail.python.org/mailman/listinfo/python-list
t; File "tcpsrv.py", line 15, in
> server.bind((host,port))
> File "", line 1, in bind
> socket.error: (19, 'No such device')
What's the value of host variable? AFAIR it should be the name
of the interface you want to bind to ('eth0',
the Programming FAQ:
http://www.python.org/doc/faq/programming/
And keep in mind that reload() is removed in Py3k. Hope this helps.
--
Regards,
Wojtek Walczak,
http://www.stud.umk.pl/~wojtekwa/
--
http://mail.python.org/mailman/listinfo/python-list
and it doesn't
> raise any warnings or mention anything in the doc string.
I think that the deprecation warnings were added in Python 2.6.
--
Regards,
Wojtek Walczak,
http://www.stud.umk.pl/~wojtekwa/
--
http://mail.python.org/mailman/listinfo/python-list
opriately. Got to investigate it further.
os.popen won't return any deprecation warning in Py2.6beta2 probably
because it is defined in Lib/platform.py and not in Lib/os.py and
I guess that somebody has forgotten to add the warnings in there.
--
Regards,
Wojtek Walczak,
http://www.stud.umk.pl/~wojtekwa/
--
http://mail.python.org/mailman/listinfo/python-list
27;
>>>
Next step would be to define your own replacing function:
def my_replace(mystr, mychars, myrepl):
"""Replace every character from 'mychars' string with 'myrepl' string
in 'mystr' string.
Example:
my_replace('Qwe.Asd/Zxc(', './(', 'XY') -> 'QweXYAsdXYZxcXY'"""
for i in mychars:
mystr = mystr.replace(i, myrepl)
return mystr
--
Regards,
Wojtek Walczak,
http://www.stud.umk.pl/~wojtekwa/
--
http://mail.python.org/mailman/listinfo/python-list
ing for os.popen() goes to the bin.
--
Regards,
Wojtek Walczak,
http://www.stud.umk.pl/~wojtekwa/
--
http://mail.python.org/mailman/listinfo/python-list
thon/ceval.c
My quick attempt:
http://www.stud.umk.pl/~wojtekwa/patches/from-import-py2.5.1.patch
--
Regards,
Wojtek Walczak,
http://www.stud.umk.pl/~wojtekwa/
--
http://mail.python.org/mailman/listinfo/python-list
ck (lambda m: ""), repeated replace, and repeated use of the form
>
> if ch in my_string:
> my_string = my_string.replace(ch, "")
>
> on representative data.
I don't have to, I can anticipate the results. I mentioned above
that using re is the best approach, but if one really wants to use
replace() multiple times (which will be slow, of course), it can
be done a bit cleaner than with str.replace().replace().replace()...
--
Regards,
Wojtek Walczak,
http://www.stud.umk.pl/~wojtekwa/
--
http://mail.python.org/mailman/listinfo/python-list
Dnia Wed, 13 Aug 2008 22:15:48 + (UTC), Wojtek Walczak napisa�(a):
> Then go for it :-) You can prepare a patch and ask on python-dev
> if the developers are interested.
>
> I was never hacking the import things on C level before,
> but a hint: you have to modify import_fro
>
> Chances are that you're wrong.
At the moment my average is about 0.75 of mistake per
post on comp.lang.python (please, bare with me ;-)).
I strongly believe that the statement I made above won't
make this number rise.
:)
--
Regards,
Wojtek Walczak,
http://www.stud.umk.pl/~wojtekwa/
--
http://mail.python.org/mailman/listinfo/python-list
n from
>> > Python/ceval.c
>
> Am I correct in thinking that PyPy would mean low level
> stuff like this will be Python instead of C?
> That would be nice.
I don't know PyPy, but I guess you're right here.
--
Regards,
Wojtek Walczak,
http://www.stud.umk.pl/~wojtekwa/
--
http://mail.python.org/mailman/listinfo/python-list
pated them correctly/incorrectly."?
Don't count on it. I never really cared about being right or wrong
and I am not one of those guys who are trying to prove something
that actually makes no difference at all. Nice tests, though :)
--
Regards,
Wojtek Walczak,
http://www.stud.umk.pl/~wojtekwa/
--
http://mail.python.org/mailman/listinfo/python-list
ses around the print instruction,
it's not a function. You could also write:
print "%d %d %d" % (x, y, z)
--
Regards,
Wojtek Walczak,
http://www.stud.umk.pl/~wojtekwa/
--
http://mail.python.org/mailman/listinfo/python-list
this helps.
--
Regards,
Wojtek Walczak,
http://www.stud.umk.pl/~wojtekwa/
--
http://mail.python.org/mailman/listinfo/python-list
r small things and it will like you:
>>> getattr(getattr(B, 'a')[0], 'test')
'test'
>>>
it works because:
>>> getattr(B, 'a') == B.a
True
>>> getattr(B, 'a')[0] == B.a[0]
True
>>>
--
Regards,
Wojtek Walczak,
http://www.stud.umk.pl/~wojtekwa/
--
http://mail.python.org/mailman/listinfo/python-list
ort sys
def printf(mystr):
print mystr
sys.stdout.flush()
--
Regards,
Wojtek Walczak,
http://www.stud.umk.pl/~wojtekwa/
--
http://mail.python.org/mailman/listinfo/python-list
the one passed to __init__? Try it in __init__ to make sure:
assert filename == 'your_hardcoded_value'
And why won't you try to store the filename as an attribute?
(even though I doubt it could help).
--
Regards,
Wojtek Walczak,
http://www.stud.umk.pl/~wojtekwa/
--
http://mail.python.org/mailman/listinfo/python-list
> assuming each iteration takes a picosecond, it'll take approx 40
> billion years to run the program.
I guess that's exactly why the OP asks the question. He just wants
to start as soon as possible ;-)
--
Regards,
Wojtek Walczak,
http://www.stud.umk.pl/~wojtekwa/
--
http://mail.python.org/mailman/listinfo/python-list
t;"The Effects of Moore's Law and Slacking on Large Computations"
>http://arxiv.org/abs/astro-ph/9912202
Kinda buddhist approach. Anyway, it might work out, unless the number
of for loops is increasing in time and in 18 months it may be - let's
say - 20 nested
maybe ctypes module will be helpful
for you.
--
Regards,
Wojtek Walczak,
http://www.stud.umk.pl/~wojtekwa/
--
http://mail.python.org/mailman/listinfo/python-list
that
> gets the same result?
What's "that"?
Do you mean _this_:
>>> somestr = "string1 string2 string3"
>>> for i in somestr.split():
...print i
...
string1
string2
string3
>>>
?
--
Regards,
Wojtek Walczak,
http://www.stud.umk.pl/~wojtekwa/
--
http://mail.python.org/mailman/listinfo/python-list
hitespace, so it's not the same as
str.split(' '). Moreover, specifying maxsplit argument whenever possible
seems to be a good practice. Anyway, go ahead with that xsplit thing :-)
--
Regards,
Wojtek Walczak,
http://www.stud.umk.pl/~wojtekwa/
--
http://mail.python.org/mailman/listinfo/python-list
ne-Python-Books-freebooksandarticles
--
Regards,
Wojtek Walczak,
http://www.stud.umk.pl/~wojtekwa/
--
http://mail.python.org/mailman/listinfo/python-list
tring4)'
To save some memory use finditer (as long as you don't have to search
for too many of these):
>>> for i in enumerate(pat.finditer(a)):
...if i[0] == 2:
... print i[1].group()
...
(string3)
>>>
--
Regards,
Wojtek Walczak,
http://www.stud.umk.pl/~wojtekwa/
--
http://mail.python.org/mailman/listinfo/python-list
On Mon, 18 Aug 2008 21:43:43 + (UTC), Wojtek Walczak wrote:
> On Mon, 18 Aug 2008 13:40:13 -0700 (PDT), Alexnb wrote:
>> Now, I am talking 1000's of these. I need to do something like this. I will
>> have a number, and what I want to do is go through this text file, just
On Mon, 18 Aug 2008 15:34:12 -0700 (PDT), Alexnb wrote:
> Also, on a side-note, does anyone know a very simple dictionary site, that
> isn't dictionary.com or yourdictionary.com.
This one is my favourite: http://www.lingro.com/
--
Regards,
Wojtek Walczak,
http://tosh.pl/gmini
s EOFError attribute?
Try this:
...
except (tarfile.TarError, EOFError):
...
--
Regards,
Wojtek Walczak,
http://tosh.pl/gminick/
--
http://mail.python.org/mailman/listinfo/python-list
led chilkat and it looks like
this library provides some 3des functionality.
HTH.
--
Regards,
Wojtek Walczak,
http://tosh.pl/gminick/
--
http://mail.python.org/mailman/listinfo/python-list
eforge.net/mechanize/
FYI and AFAIK, google doesn't allow to use their search engine
in this way. They even block certain IP addresses it it's constantly
abusing the search engine with too many requests.
--
Regards,
Wojtek Walczak,
http://tosh.pl/gminick/
--
http://mail.python.org/mailman/listinfo/python-list
pens if you change:
fpid.write(child.pid)
into:
fpid.write('%d\n' % (child.pid))
I think that the problem here is that fpid.write() fails silently
(probably TypeError), because it takes string as its first argument,
not integer.
--
Regards,
Wojtek Walczak,
http://tosh.pl/gminick/
--
http://mail.python.org/mailman/listinfo/python-list
o I overcome this, and make the script skip the empty files?
> (should I use another command?)
> 2) how do I interrupt the code without closing Python? (I have ActivePython)
Try the docs first. You need to read about 'continue' and
'break' statements: http://docs.python.org/
//www.python.org/doc/faq/general/
Question 4.22.
--
Regards,
Wojtek Walczak,
http://tosh.pl/gminick/
--
http://mail.python.org/mailman/listinfo/python-list
ut couldn't find it.
YOURFUNCTION.func_globals['YOURFUNCTION'].func_defaults
--
Regards,
Wojtek Walczak,
http://tosh.pl/gminick/
--
http://mail.python.org/mailman/listinfo/python-list
omes on c.l.py and asks about it.
--
Regards,
Wojtek Walczak,
http://tosh.pl/gminick/
--
http://mail.python.org/mailman/listinfo/python-list
many people, that
we should just forget it.
--
Regards,
Wojtek Walczak,
http://tosh.pl/gminick/
--
http://mail.python.org/mailman/listinfo/python-list
.write(retval)
should do the job.
--
Regards,
Wojtek Walczak,
http://tosh.pl/gminick/
--
http://mail.python.org/mailman/listinfo/python-list
7;re iterating through the same value in inner and outer loop.
Don't do that. It's hard to predict the behavior of such a code.
Regarding break statement, it breaks only the inner loop
and returns to the outer loop/block.
It would be great if you could reduce your code to a short pie
-c?
--
http://mail.python.org/mailman/listinfo/python-list
generate something if it's accessible anyway:
import string
print string.letters
--
Regards,
Wojtek Walczak,
http://tosh.pl/gminick/
--
http://mail.python.org/mailman/listinfo/python-list
port string
def letters():
a, B = (string.letters,) * 2
for i in zip(a, B):
yield i[0]
yield i[1]
l = letters()
print l.next()
print l.next()
print l.next()
--
and the output:
$ python genlet.py
a
a
b
$
Is that what you tried to achieve?
--
Regards,
Wojtek Walczak,
http://tosh.pl/gminick/
--
http://mail.python.org/mailman/listinfo/python-list
hat\path" then I need to get "c:\that".
>
> Does anyone have ideas?
Read about os.path module. It's all in there:
http://docs.python.org/lib/module-os.path.html
--
Regards,
Wojtek Walczak,
http://tosh.pl/gminick/
--
http://mail.python.org/mailman/listinfo/python-list
developer, but I think that the only way is to
set a timeout on server side. You can't be sure that the client
disconnected, but you can stop CGI script if there's no
action on client side for too long.
--
Regards,
Wojtek Walczak,
http://tosh.pl/gminick/
--
http://mail.python.org/mailman/listinfo/python-list
On Mon, 25 Aug 2008 06:31:53 -0700 (PDT), Alexandru Mosoi wrote:
> i want to execute a python script using exec open('script.py'). how do
> I pass arguments?
Take a look at subprocess module. It comes with a set of examples.
--
Regards,
Wojtek Walczak,
http://tosh.pl/
object class.
Check out point 9.5 in the tutorial.
--
Regards,
Wojtek Walczak,
http://tosh.pl/gminick/
--
http://mail.python.org/mailman/listinfo/python-list
the normal import call:
import sys
is equal to:
sys = __import__('sys')
If you need, let's say, to search for a module that lies
outside sys.module paths, then use imp's functions.
HTH.
--
Regards,
Wojtek Walczak,
http://tosh.pl/gminick/
--
http://mail.python.org/mailman/listinfo/python-list
conflicts in who knows what ways.
Then you can download tar.gz package, compile it, and try it
without installing :-)
--
Regards,
Wojtek Walczak,
http://tosh.pl/gminick/
--
http://mail.python.org/mailman/listinfo/python-list
some extent you can use regular expressions:
>>> re.findall(re.compile("\".*?\""), s)
['" c1\' d1 \' c2"']
>>> re.findall(re.compile("\'.*?\'"), s)
['\' b1 " c1\'', '\' c2" b2 \'']
>>>
but it won't work in all cases. You can read more here:
http://www.gnosis.cx/TPiP/
--
Regards,
Wojtek Walczak,
http://tosh.pl/gminick/
--
http://mail.python.org/mailman/listinfo/python-list
in pp.pids:
...if pp.procs[pid]['cmd'] == 'apache2':
... print pp.procs[pid]['tid']
...
5204
5205
5206
5208
>>>
it prints the PIDs of all the apache2 processes on my system.
Procpy is fine for my own needs, but if I were about to write
a code that is in
Give it a try. Try to design some functions that let you
view and add new lists/dictionaries to your variables.
--
Regards,
Wojtek Walczak,
http://tosh.pl/gminick/
--
http://mail.python.org/mailman/listinfo/python-list
i change the key to something like 'sabir' and
kev['sabir'] = kev['kabir']
del kev['kabir']
> how can i
> change the values of kabir?
kev['sabir'][0] = '[EMAIL PROTECTED]'
*untested*
--
Regards,
Wojtek Walczak,
http://tosh.pl/gminick/
--
http://mail.python.org/mailman/listinfo/python-list
; a="some string\r\n"
>>> a.rstrip()
'some string'
>>>
but be careful, because it will also cut whitespaces:
>>> a="some string\t \r\n"
>>> a.rstrip()
'some string'
>>>
so maybe you could do
-questions.html
HINT: the attribute you're accessing is not a callable.
--
Regards,
Wojtek Walczak,
http://tosh.pl/gminick/
--
http://mail.python.org/mailman/listinfo/python-list
es that "look right" to
people.
HTH.
--
Regards,
Wojtek Walczak,
http://tosh.pl/gminick/
--
http://mail.python.org/mailman/listinfo/python-list
above assigns the output variable with a return code, i.e. 0 in
> this case. How can I actually capture the data returned from
> subprocess.call, rather than just the return code?
Use subprocess.Popen instead of call.
--
Regards,
Wojtek Walczak,
http://tosh.pl/gminick/
--
http://mail.python.org/mailman/listinfo/python-list
On Tue, 2 Sep 2008 15:32:07 +0100, [EMAIL PROTECTED] wrote:
> But if I do :-
>#question.py
> from myglobals import *
> myglobals.answer = "WTF ?"
>
> will this work?
Why won't you try? In this case you should receive NameError.
--
Regards,
Wojtek Walczak
ave a short chunk of code that I can observer, that uses the
> mechanize.Browser implentation?
Take a look at the bottom of this post:
http://mail.python.org/pipermail/python-list/2006-June/390037.html
It seems that submit does the job.
--
Regards,
Wojtek Walczak,
http://tosh.pl/gminick/
--
property(getvalue, setvalue)
a = Square(5)
print a.square
print a.value
a.value = 10
print a.square
print a.value
a.square = 64
print a.square
print a.value
---
and the result:
$ python sqval.py
25
5.0
100.0
10
64
8.0
$
--
Regards,
Wojtek Walczak,
http://tosh.pl/gminick/
--
http://mail.python.org/mailman/listinfo/python-list
On Wed, 3 Sep 2008 14:31:17 + (UTC), Wojtek Walczak wrote:
> class Square(object):
>def __init__(self, val):
> self._square = pow(val, 2)
> self._value = math.sqrt(self.square)
^^
or just:
self._value = val
:-)
or 0 i.e whether the 2 files differ or not?
In python it's called difflib. Try to import it.
--
Regards,
Wojtek Walczak,
http://tosh.pl/gminick/
--
http://mail.python.org/mailman/listinfo/python-list
rcn.com/python/download/Descriptor.htm
--
Regards,
Wojtek Walczak,
http://tosh.pl/gminick/
--
http://mail.python.org/mailman/listinfo/python-list
akes?
Check pychecker or figleaf:
http://pychecker.sourceforge.net
http://darcs.idyll.org/~t/projects/figleaf/doc/
--
Regards,
Wojtek Walczak,
http://tosh.pl/gminick/
--
http://mail.python.org/mailman/listinfo/python-list
On Thu, 4 Sep 2008 12:06:14 +0200, Marco Bizzarri wrote:
>> As far as I understand you, you need descriptors:
>> http://users.rcn.com/python/download/Descriptor.htm
> I know descriptors a litte, Wojtek, but didn't use them often; can you
> elaborate a little more on you
1 - 100 of 113 matches
Mail list logo