Hi!
I have two super classes:
class SuperClass1(object):
def __init__(self, word):
print word
class SuperClass2(object):
def __init__(self, word, word2):
print word, word2
Also I have subclass of these classes:
class SubClass(SuperClass1, SuperClass2):
def
On Jul 24, 11:20 am, Raymond Hettinger raymond.hettin...@gmail.com
wrote:
On Jul 24, 12:47 am, Lacrima lacrima.ma...@gmail.com wrote:
Hi!
I have two super classes:
class SuperClass1(object):
def __init__(self, word):
print word
class SuperClass2(object):
def
Hello!
I need to format a decimal (floating point) number in the following
way:
10 results in '10'
10.5 results in '10.5'
10.50 results in '10.5'
10.5678 results in 10.57
How can I achieve this using standard Python string formatting
operations?
Something like '%.2f' works almost as expected:
Hello, Chris!
Thanks for your really quick reply! It works!
On 1 April 2010 12:14, Chris Rebert c...@rebertia.com wrote:
On Thu, Apr 1, 2010 at 2:08 AM, Lacrima lacrima.ma...@gmail.com wrote:
Hello!
I need to format a decimal (floating point) number in the following
way:
10 results
On Mar 26, 10:22 am, Michele Simionato michele.simion...@gmail.com
wrote:
On Mar 25, 2:24 pm, Michele Simionato michele.simion...@gmail.com
wrote:
On Mar 25, 1:28 pm, Ethan Furman et...@stoneleaf.us wrote:
Michele,
Was wondering if you'd had a chance to re-post your lectures -- just
Hello!
I use Ubuntu 9.10 Karmic Koala. It has Python 2.6 as default
installation.
And I installed Python 2.5 alongside (for the need of Google
AppEngine). But it seems like my Python 2.5 installation lacks ssl
support. I can't import ssl and starting appengine server fails with
'module' object
On Mar 10, 11:23 pm, Martin v. Loewis mar...@v.loewis.de wrote:
I don't know how to solve this problem and I am looking forward for
help.
Try running python setup.py install directly, after downloading and
unpacking the package.
Regards,
Martin
Thanks a lot! It helped!
--
Hello!
I use mock library http://www.voidspace.org.uk/python/mock/. There is
no user group for the library, so I post in comp.lang.python and hope
that people who use it will help me.
The library allows to patch objects, using patch decorator. Patching
is done only within the scope of the
On Feb 18, 3:20 am, Ben Finney ben+pyt...@benfinney.id.au wrote:
Lacrima lacrima.ma...@gmail.com writes:
Right, isolation [of test cases] is essential. But I can't decide to
which extent I should propagate isolation.
You used “propagate” in a sense I don't understand there.
For example
On Feb 16, 7:38 pm, Phlip phlip2...@gmail.com wrote:
This paper _almost_ gets the
idea:http://www.netobjectives.com/download/Code%20Qualities%20and%20Practi...
Do you run your tests after the fewest possible edits? Such as 1-3
lines of code?
Hi!
I run my tests all the time (they almost
On Feb 16, 10:30 pm, Ben Finney ben+pyt...@benfinney.id.au wrote:
Lacrima lacrima.ma...@gmail.com writes:
And I have already refused to write totally isolated tests, because it
looks like a great waste of time.
It only looks like that until you chase your tail in a long, fruitless
On Feb 16, 2:17 am, Ben Finney ben+pyt...@benfinney.id.au wrote:
Lacrima lacrima.ma...@gmail.com writes:
Minimock has wider usage and community, but I have some troubles using
it. Maybe I am wrong, but with minimock you always have to keep track
the order of imports in your test modules
On Feb 15, 9:56 pm, Phlip phlip2...@gmail.com wrote:
Lacrima wrote:
Thanks for your reply! Isn't what you are talking about integration
tests? And unit tests should be fully isolated? So even for method
'some_method()' of class A I should mock instance of class A (i.e. to
mock 'self
Hello!
I am newbie mastering test driven development. I can't clarify myself
which mock library to use.
There are number of them and which one do you prefer?
Two libraries that attracted my attention are:
* minimock
* dingus
As for me the latest one, dingus, is the easiest (see this screencast:
On Feb 15, 6:57 pm, Phlip phlip2...@gmail.com wrote:
Lacrima wrote:
I am newbie mastering test driven development. I can't clarify myself
which mock library to use.
There are number of them and which one do you prefer?
Two libraries that attracted my attention are:
* minimock
On Jan 19, 12:56 pm, Chris Withers ch...@simplistix.co.uk wrote:
Hi All,
I'm wondering what test runner I should use. Here's my list of requirements:
- cross platform (I develop for and on Windows, Linux and Mac)
- should not prevent tests from running with other test runners
(so no
On Dec 20, 1:35 am, mdipierro massimodipierr...@gmail.com wrote:
Errata. I said The dal supports transactions where I meant the dal
supports migrations.
Of course it also supports transactions as well as distributed
transactions.
Sorry, if this is not related to this topic.
Does web2py
Hello!
I am learning TDD with Python and there is not much information about
this topic. Python is shipped with unittest module. That is fine, but
I also discovered other libraries: nose and py.test. They promise to
make life yet easier for a developer. But I still can't figure out,
which
Hello!
I use sqlite3 module for my sqlite database. I am trying to substitute
table name in sql query.
import sqlite3
con = sqlite3.connect('mydb')
cur = con.execute(select * from table where name='Joe')
That's ok
cur = con.execute(select * from table where name=?, ('Joe',))
That's ok too
On Oct 27, 4:36 pm, Tim Chase python.l...@tim.thechases.com wrote:
Lacrima wrote:
I want to store some data, using anydbm module.
According to docs the object returned by anydbm.open() supports most
of the same functionality as dictionaries; keys and their
corresponding values can
Hello!
I want to store some data, using anydbm module.
According to docs the object returned by anydbm.open() supports most
of the same functionality as dictionaries; keys and their
corresponding values can be stored, retrieved, and deleted...
I don't understand how I can make a table in DBM
Hello!
I am newbie in python and I have really simple question, but I need
your advice to know how to do best.
I need to store a number of dictionaries in certain place. I've
decided to store them in a separate module.
Like this:
dicts.py
---
dict1 = {}
dict2 = {}
On Jul 20, 3:31 pm, Diez B. Roggisch de...@nospam.web.de wrote:
Lacrima wrote:
Hello!
I am newbie in python and I have really simple question, but I need
your advice to know how to do best.
I need to store a number of dictionaries in certain place. I've
decided to store them
On Jul 20, 4:05 pm, Jean-Michel Pichavant jeanmic...@sequans.com
wrote:
Lacrima wrote:
Hello!
I am newbie in python and I have really simple question, but I need
your advice to know how to do best.
I need to store a number of dictionaries in certain place. I've
decided to store them
Hello!
I've solved this problem, using pyCurl.
Here is sample code.
import pycurl
import StringIO
b = StringIO.StringIO()
c = pycurl.Curl()
url = 'https://example.com/'
c.setopt(pycurl.URL, url)
c.setopt(pycurl.WRITEFUNCTION, b.write)
c.setopt(pycurl.CAINFO, 'cert.crt')
c.setopt(pycurl.SSLKEY,
On Jul 8, 10:54 pm, Piet van Oostrum p...@cs.uu.nl wrote:
Lacrima lacrima.ma...@gmail.com (L) wrote:
L Hello!
L I have just started using Emacs to write python scripts.
L I installed python-mode.el
L Then I just tried this code:
L print 'hello world'
L When I press C-c RET, new blank
On Jul 9, 2:31 pm, Piet van Oostrum p...@cs.uu.nl wrote:
Lacrima lacrima.ma...@gmail.com (L) wrote:
L Thanks for your reply!
L My file name is 'trains.py'.
L When I do C-h k C-c RET, it shows me help from manual: C-c RET runs
L the command py-execute-import-or-reload
L which
On Jul 9, 8:42 pm, Piet van Oostrum p...@cs.uu.nl wrote:
Lacrima lacrima.ma...@gmail.com (L) wrote:
L Thank you for really useful and detailed explanation. Now I can test
L my code usingEmacs.
L But I think it works for me in a little bit different way.
L My file contains only the print
Hello!
I have just started using Emacs to write python scripts.
I installed python-mode.el
Then I just tried this code:
print 'hello world'
When I press C-c RET, new blank window is opened and emacs says:
(Shell command succeeded with no output)
So where is my 'hello world'?
When I do C-c
Hello!
I am trying to use urllib to fetch some internet resources, using my
client x509 certificate.
I have divided my .p12 file into mykey.key and mycert.cer files.
Then I use following approach:
import urllib
url = 'https://example.com'
xml = '''request
... somexmlsomexml/somexml
/request'''
On Jul 4, 11:24 am, Chris Rebert c...@rebertia.com wrote:
On Sat, Jul 4, 2009 at 1:12 AM, Lacrimalacrima.ma...@gmail.com wrote:
Hello!
I am trying to use urllib to fetch some internet resources, using my
client x509 certificate.
I have divided my .p12 file into mykey.key and mycert.cer
On Jul 4, 12:38 pm, Martin v. Löwis mar...@v.loewis.de wrote:
This works Ok! But every time I am asked to enter PEM pass phrase,
which I specified during dividing my .p12 file.
So my question... What should I do to make my code fetch any url
automatically (without asking me every time to
I am new to python.
And now I am using trial version of Wing IDE.
But nobody mentioned it as a favourite editor.
So should I buy it when trial is expired or there are better choices?
--
http://mail.python.org/mailman/listinfo/python-list
Hello!
I think I have a very simple question, but I can't understand how to
access object properties in a way described below.
For example I have an instance of any class:
class Person:
def __init__(self):
self.name = 'John'
self.email =
On May 21, 7:04 pm, MRAB goo...@mrabarnett.plus.com wrote:
Lacrima wrote:
Hello!
I think I have a very simple question, but I can't understand how to
access object properties in a way described below.
For example I have an instance of any class:
class Person:
def __init__(self
On May 6, 3:36 pm, Chris Rebert c...@rebertia.com wrote:
On Wed, May 6, 2009 at 5:24 AM, Piet van Oostrum p...@cs.uu.nl wrote:
Lacrima lacrima.ma...@gmail.com (L) wrote:
L Hello!
L For example I have two classes:
class First:
L def __init__(self, *args, **kwargs):
L
Hello!
For example I have two classes:
class First:
def __init__(self, *args, **kwargs):
pass
class Second:
def __init__(self, somearg, *args, **kwargs):
self.somearg = somearg
How can I test that First class takes 1 required argument and
class First:
def __init__(self, *args, **kwargs):
pass
class Second:
def __init__(self, somearg, *args, **kwargs):
self.somearg = somearg
How can I test that First class takes 1 required argument and Second
class takes no required
On Apr 28, 6:38 pm, J. Cliff Dyer j...@sdf.lonestar.org wrote:
On Tue, 2009-04-28 at 10:41 +, Duncan Booth wrote:
Lacrima lacrima.ma...@gmail.com wrote:
If it is not possible what are common techniques to use iterator or
generator objects that allow restarting when it is needed
Hello!
I am quite new to Python and I have maybe simple (or maybe not)
question.
Is it possible to restart generator when it is exhausted?
For example:
a = ['a', 'b', 'c']
g = (i for i in a)
g.next()
'a'
g.next()
'b'
g.next()
'c'
g.next()
Traceback (most recent call last):
File
On Apr 28, 1:04 pm, Chris Rebert c...@rebertia.com wrote:
On Tue, Apr 28, 2009 at 2:54 AM, Lacrima lacrima.ma...@gmail.com wrote:
Hello!
I am quite new to Python and I have maybe simple (or maybe not)
question.
Is it possible to restart generator when it is exhausted?
No. You have
41 matches
Mail list logo