Hi!
I have big .txt file which i want to read, process and write to another .txt
file.
I have done script for that, but im having problem with croatian characters
(Š,Đ,Ž,Č,Ć).
How can I read/write from/to file in utf-8 encoding?
I read file with fileinput.input.
thanks
--
http://mail.python.o
It seems that some TypeError messages have changed between versions
2.5 and 2.6, e.g.:
from math import radians
radians ()
in 2.5, this leads to "radians () takes exactly 1 argument (0 given)"
whereas in 2.6, the message is now: "radians () takes exactly one
argument (0 given)"
I agree that the
format(one_number))
number=1,234,567
>>>
paz e amor (love and peace),
Alysson Bruno
===
Palmas(TO)
Brasil
Blog: http://abruno.com
Twitter: http://twitter.com/alyssonbruno
Facebook: http://www.facebook.com/ProfessorAlyssonBruno
===
mmhh... it comes to me now that the gap must be in function loading time...
I'll check ceval.c
However, isn't there a room for a slight optim here? (in this case, the
dead code is obvious, but it may be hidden by complex loops and
conditions)
Cheers
--
Bruno Dupuis
--
http://mail.python.org/mailman/listinfo/python-list
On Wed, Dec 05, 2012 at 04:15:59PM +, Neil Cerutti wrote:
> On 2012-12-05, Bruno Dupuis wrote:
> > Hi,
> >
> > I'm interested in compilers optimizations, so I study python
> > compilation process
> >
> > I ran that script:
> >
> >
On Wed, Dec 05, 2012 at 05:40:51PM +0100, Bruno Dupuis wrote:
> On Wed, Dec 05, 2012 at 04:15:59PM +, Neil Cerutti wrote:
> > Maybe it's the difference between LOAD_CONST and LOAD_GLOBAL. We
> > can wonder why g uses the latter.
>
> Good point! I didn't even no
a separate usage statement. So they used argparse for everything but the
> case where no command line args are given.
>
this is quite raw, but i'd add
import sys
if len(sys.argv) == 1:
sys.argv.append('-h')
before I call parser.parse_args()
Should work
--
Bruno Dup
gt;>> def f(x):
> ... return None
> ... print(x)
> ...
> >>> f('test')
> 42
This one is pretty scary
The difference between `return None` and `return` leads to inconsistency and
is in contradiction with the specs, AFAIK. I'm glad we pointed this out.
--
Bruno Dupuis
--
http://mail.python.org/mailman/listinfo/python-list
On Wed, Dec 05, 2012 at 03:41:19PM -0500, Terry Reedy wrote:
> On 12/5/2012 1:24 PM, Bruno Dupuis wrote:
> >On Wed, Dec 05, 2012 at 10:59:26AM -0700, Ian Kelly wrote:
> >>On Wed, Dec 5, 2012 at 10:34 AM, Steven D'Aprano
> >> wrote:
> >>>The difference
I added a patch on the issue tracker. It solves the bug for short
(<32700 bytes) functions
ref : http://bugs.python.org/file28217/16619-1.patch
--
Bruno Dupuis
--
http://mail.python.org/mailman/listinfo/python-list
On Wed, Dec 05, 2012 at 11:50:49PM +0100, Anatoli Hristov wrote:
> I'm confused again with a compare update function. The problem is that
> my function does not work at all and I don't get it where it comes
> from.
>
> in my DB I have total of 754 products. when I run the function is says:
> Total
On Thu, Dec 06, 2012 at 04:32:34AM +, Steven D'Aprano wrote:
> On Thu, 06 Dec 2012 03:22:53 +, Rotwang wrote:
>
> > On 06/12/2012 00:19, Bruno Dupuis wrote:
> >> [...]
> >>
> >> Another advice: never ever
> >>
> >> except XXXE
Therefore, it's
often better to make a package on PyPI, or, if the code is too short, to submit
your handy chunks on ActiveState. If it deserves a general approbation, it
may be included in Python stdlib.
Cheers
--
Bruno
--
http://mail.python.org/mailman/listinfo/python-list
nd dirty call to xclip -o, although there must be a pure python
implementation which in turn depends on the python framework you play
with (gtk/qt/wx/tk/...).
Short answer is : it depends on your system, and it may be easier and more
portable if you use a graphical toolkit.
cheers.
--
Brun
instituições que
criam aplicações para terceiros usando a linguagem Python. Acredito que talvez,
vocês contenham uma lista com essas instituições que utilizam Python.
Desde já agradeço a sua atenção;
Muito Obrigado;
Att; Bruno Andrade.
--
http
Em sábado, 14 de março de 2009 às 13:59:41 UTC-3, Casey escreveu:
> How about:
> from datetime import date, timedelta
> # Define the weekday mnemonics to match the date.weekday function
> (MON, TUE, WED, THU, FRI, SAT, SUN) = range(7)
> def workdays(start_date, end_date, whichdays=(MON,TUE,WED,THU,
&usg=AOvVaw2RFbMdp7h-toAR8c8BELtO>
Best regards,
Bruno
--
https://mail.python.org/mailman/listinfo/python-list
googleboy a écrit :
> Hi.
>
> I am trying to collapse an html table into a single line. Basically,
> anytime I see ">" & "<" with nothing but whitespace between them, I'd
> like to remove all the whitespace, including newlines. I've read the
> how-to and I have tried a bunch of things, but noth
self, name):
self.name = name
def greet(self, who):
return "hello %s, my name is %s" % (who, self.name)
lazy1 = LazyProxy(Greeter, 'toto')
print lazy1.greet('titi')
lazy2 = LazyProxy(Greeter, 'lolo')
lazy2.name =
; TypeError: eval() argument 3 must be dict, not Foo
>
> If you subclass dict it doesn't call the __getitem__ method.
Could it work with a UserDict subclass ?
--
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in '[EMAIL PROTECTED]'.split('@')])"
--
http://mail.python.org/mailman/listinfo/python-list
Aaron a écrit :
> I have a data sructure setup and I populate it in a loop like so:
>
> y=0
> while X:
>DS.name = "ASDF"
>DS.ID = 1234
>list[y] = DS;
>y = y + 1
>
> print list
Traceback (most recent call last):
File "", line 1, in ?
File "/usr/tmp/python-9150sSF", line 2,
Ivan Shevanski a écrit :
> Alright heres my problem. . .Say I want to carry over a variable from
> one function to another or even another run of the same function. Is
> that possible? Heres a quick example of what I'm talking about.
>
> def abc():
>x = 1
>y = x + 1
>print y
>
> def
Peter Otten wrote:
> Bruno Desthuilliers wrote:
>
>
>>2/ functional solution:
>>---
>>def make_funcs():
>>x = 0
>>def _abc():
>>x = 1
>>return x + 1
>>def _abcd():
>>re
On 2005-09-26, Micah Elliott <[EMAIL PROTECTED]> wrote:
>
> :Objection: I aesthetically dislike for the comment to be terminated
> with <> in the empty field case.
>
> :Defense: It is necessary to have a terminator since codetags may be
> followed by non-codetag comments. Or codetags could
TION00840
> Is there a trick to this? Do I have to store my own modules beneath
> C:\Python24\Lib? or can I use the organization I've tried just with some
> minor fixes to make python locate my modules?
briefly put, add an (even empty) __init__.py file in your lvk di
fers 'the best from Plone', (s/plone/cmf/
IMHO), it's about framework/system architecture, not OOTB application.
--
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in '[EMAIL PROTECTED]'.split('@')])"
--
http://mail.python.org/mailman/listinfo/python-list
hat this combination (dynamic typing
+ [pylint|pychecker] + unit tests) usually leads to fewer bugs than just
relying on declarative static typing.
What you fear can become reality with some (poorly designed IMHO)
scripting languages like PHP, but should not be a concern with Python.
Try working with
rror message will be pretty clear actually :)
>
>
> Now why, I wonder, does this loop never end :-)
> egold = 0
> while egold < 10:
> ego1d = egold+1
>
A more pythonic style would be:
egold = 0
while egold < 10:
ego1d += 1
And that o
I don't use emacs automatic completion, and I still rarely (read:
'never') run into this kind of problem in Python.
--
bruno desthuilliers
ruby -e "print '[EMAIL PROTECTED]'.split('@').collect{|p|
p.split('.').collect{|w| w.reverse}.join('.')}.join('@')"
--
http://mail.python.org/mailman/listinfo/python-list
hether the other class's author was
> notified or not.
>
> It's better to let the compiler automatically flag
> these things, than to depend on conventions.
Nope. *you* think it's better. Most of us here obviously think that
relying on convention is a good (and even better) so
mrstephengross a écrit :
> I'd like to do some basic SQL stuff in Python. It seems like there are
> a heck of a lot of SQL modules for Python. What's the simplest and
> easiest one to use?
Probably the one that go with your RDBMS.
--
http://mail.python.org/mailman/listinfo/python-list
ion was the OP's reaction, not Antoon's.
--
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in '[EMAIL PROTECTED]'.split('@')])"
--
http://mail.python.org/mailman/listinfo/python-list
CppNewB wrote:
> I am absolutely loving my experience with Python. Even vs. Ruby, the syntax
> feels very clean with an emphasis on simplification.
>
> My only complaint is that there doesn't appear to be a great commercial IDE
Why "commercial" ?
--
bruno des
def __init__(self,identifier):
self.id=identifier
self.allocated=identifier
and rerun the test.
I don't think this is a bug...
--
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in '[EMAIL PROTECTED]'.split('@')])"
--
http://mail.python.org/mailman/listinfo/python-list
Laszlo Zsolt Nagy a écrit :
> Dave wrote:
>
>> Hello All,
>>
>> I would like to gather some information on Python's runtime
>> performance. As far as I understand, it deals with a lot of string
>> objects. Does it require a lot string processing during program
>> execution? How does it handle
Alex Stapleton wrote:
>
> On 9 Oct 2005, at 19:04, Bruno Desthuilliers wrote:
>
>
>> Laszlo Zsolt Nagy a écrit :
(snip)
>>> Do you want to know how many internal string operations are done inside
>>> the Python interpreter? I believe it is not a useful in
ava and
Python here is that Python is smart enough to call the compiler by itself.
--
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in '[EMAIL PROTECTED]'.split('@')])"
--
http://mail.python.org/mailman/listinfo/python-list
now what am I doing wrong. Do
> you have an idea?
I assume the code snippets are exact copy/paste so this is not a typo
(like print data[51:] ...) - and I can't reproduce it here... even with
a string of 20381 characters.
mmm...
type(data) ???
--
bruno desthuilliers
python -c "prin
James Gan wrote:
> I want the object printed in a readable format. For example,
> x =[a, b, c, [d e]] will be printed as:
> x--a
> |_b
> |_c
> |___d
>|_e
>
> I tried pickled, marshel. They do different work.
>
> Is there another
> module which do thi
r is a bound method. You could
have found this by yourself...
Note that the getter/setter plague is useless and unpythonic. Use
properties instead if you need to control attributes access. There are
decorator idioms to make clean and easy properties, look here:
http://wiki.python.org/moin/Pyth
[EMAIL PROTECTED] wrote:
> If you change it to this it works. You should provide a get and a set
> function for a property.
The OP did:
-> command=property(getCommand, setNothing)
--
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w
Robin Becker a écrit :
> Is there a way to override a data property in the instance? Do I need to
> create another class with the property changed?
Do you mean attributes or properties ?
--
http://mail.python.org/mailman/listinfo/python-list
oogling and IDE project-page
> browsing. :-(
What about a Python IDE that embed Vim as it's editor ?
http://pida.berlios.de/index.php/Main_Page
HTH
--
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in
Robin Becker wrote:
> Bruno Desthuilliers wrote:
>
>> Robin Becker a écrit :
>>
>>> Is there a way to override a data property in the instance? Do I need
>>> to create another class with the property changed?
>>
>>
>>
>> Do you mean
mming ruby" from www.ruby-lang.org/en. the download
> python and spend a day or two reading the python tuturial from
> www.python.org.
Or better: DiveIntoPython
--
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.
somewhat more mature (which is not
surprising since Python is a little bit older than Ruby).
Else, both are hi-level highly dynamic object oriented languages, both
are fun to program with, and both are easy to get started with. So the
best thing to do is to give both a try and go with the one that
Stewart Midwinter a écrit :
> I've made a comparison of the relative popularity of blogging tools
> used by python programmers. I was surprised by the number of python
> developers not using python for their blogs; isn't that like GM
> employees driving Toyota cars?
>
> See my post at:
>
> http:
u'd better find some non-programmers having learn Ruby in a similar
context and ask them about this (with the buzzword around Rails, you
find such people easily...)
--
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in '[EMAIL PROTECTED]'.split('@')])"
--
http://mail.python.org/mailman/listinfo/python-list
to the mainstream but is worth
giving a try is Smalltalk - the father of OOPLs (Simula being the
GrandFather). BTW, most of Ruby's feature have been happily stolen from
Smalltalk !-)
> I've never given Perl a shot. It was another language I considered learning,
> but my father's fr
Michael Ekstrand wrote:
> On Friday 21 October 2005 07:07, bruno modulix wrote:
>
>>>>Python is more like Java.
>>
>>
>>Err... Python is more like what Java would have been if Java was a
>>smart dynamic hi-level object oriented language !-)
>>
&g
Scott David Daniels wrote:
> bruno modulix wrote:
>
>> ... Another language that failed to make it to the mainstream but is
>> worth giving a try is Smalltalk - the father of OOPLs (Simula being the
>> GrandFather).
>
> I would say Simula is the forefather of
at colons
s/at/add/
> at the end of the def
> and while statements, and this is also valid Python.
--
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in '[EMAIL PROTECTED]'.split('@')])"
--
http://mail.python.org/mailman/listinfo/python-list
is only
> supposed to store an integer in Data.fs. Thanks.
This is another problem, and I think you'd better start with the zope book.
But for you current use case, first have a look at Zope's access log.
--
bruno desthuilliers
python -c "print '@'.join(['.
PyPK wrote:
> hmm Thats one thing. Also I was thinking of something like benefites of
> python over other languages.
That's fairly context-dependant *and* subjective.
--
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('
. So "windows formatting" isn't a Python problem -
it's specific to to toolkit you're using. Since we don't know which
you're using, there's no way to answer your question.
--
bruno desthuilliers
python -c "print '@'.join(['.'.jo
Scott David Daniels wrote:
> bruno modulix wrote:
>
>> Scott David Daniels wrote:
>>
>>> bruno modulix wrote:
>>>
>>>> ... Another language that failed to make it to the mainstream but is
>>>> worth giving a try is Smalltalk - the fat
3 is the standard in many
> OSes, so it is possibly not the most portable solution
filter(isbad, somelist)
--
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in '[EMAIL PROTECTED]'.split('@')])"
--
http://mail.python.org/mailman/listinfo/python-list
the.theorist a écrit :
> I have a small, simple class which contains a dictionary (and some
> other stuff, not shown). I then have a container class (Big) that holds
> some instances of the simple class. When I try to edit the elements of
> the dictionary, all instances obtain those changes; I want
Mattia Adami a écrit :
> Hi to all.
> I'm intristing in write a plugin for browsers that can execute python
> code.
> I know the main problem is security. Many thread were opened about this
> in the ng.
> I would know if fork python rewriting some library could avoid
> problems. I.e. one problem is
Loris Caren a écrit :
> If
>
> a = 'apple'
> b = 'banana'
> c = 'cabbage'
>
> How can I get something like:-
>
> for i in 'abc':
> r = eval(i)
> if r == 'cabbage': r = 'coconut'
>
> actually change the object referenced by r rather
> than creating a new object temporarily referenced
dcrespo a écrit :
>>I think it would be time for you to read the Fine Manual...
>
>
> hi, thanks for your answer... I really did it the same way you
> suggested, but I forgot to tell you that I wanted to get a better way
> for doing it.
Let us know if you find one...
>
> By the way, knowing yo
Noah a écrit :
> I have a dictionary that I would like to expand to satisfy a
> function's agument list. I can used the ** syntax to pass a dictionary,
> but
> this only works if each key in the dictionary matches an argument.
> I cannot pass a dictionary that has more keys than the function has
>
Jeffrey Schwab a écrit :
> bruno at modulix wrote:
>
>> Steven D'Aprano wrote:
>>
>>> On Thu, 03 Nov 2005 10:14:23 +0100, bruno at modulix wrote:
>>>
>>>> Tieche Bruce A MSgt USMTM/AFD wrote:
>>>>
>>>>> I am new to
Steven D'Aprano a écrit :
> On Thu, 03 Nov 2005 20:19:03 +0100, bruno at modulix wrote:
>
>
>>Steven D'Aprano wrote:
>>
>>>On Thu, 03 Nov 2005 10:14:23 +0100, bruno at modulix wrote:
>>>
>>>
>>>
>>
Tieche Bruce A MSgt USMTM/AFD a écrit :
> Well, thanx for all the ... useful information.
>
> I thought that I would try, but this has turned out to be a waist of my time.
>
> Have fun playing with your egos
s/your egos/words/
If you can't stand a joke (possibly very bad, but that's another po
Colin J. Williams a écrit :
> bruno at modulix wrote:
>
>> venk wrote:
>>
>>> Hi,
>>> can some one properly explain the differences between class types and
>>> classic classes? ... Still face problems in identifying what is what.
>>
>&g
[EMAIL PROTECTED] a écrit :
> Your suggestion ('_name' -> implementation, 'name' -> API)
This is not "my" convention, it's *the* (mostly agreed upon) Python
convention. Like 'self', or CONSTANT, or a whole lot of things in Python.
> makes sense
> as a convention between programmers that know a
David Rasmussen a écrit :
> If I have a collection of dicts like:
>
> john = {'id': 1, 'name': "John Cleese", 'year': 1939}
> graham = {'id': 2, 'name': "Graham Chapman", 'year': 1941}
>
> I could store all of them in a list. But for easy lookup, I might store
> all these in a dict instead, like
Sam Pointon a écrit :
>>If I could just say to Python: john and graham (and ...) are all a part
>>of a "superdict" and either their id or their name can be used as keys.
>
>
>>Can I do that somehow?
>
>
> Sure you can. There are two obvious ways to do this - enlist the aid of
> a Superdict (or
David Rasmussen a écrit :
> What is the best book for Python newbies (seasoned programmer in other
> languages)?
I don't know if it's the "best", but a DiveIntoPython/PythonCookbook
combo may be a good choice.
--
http://mail.python.org/mailman/listinfo/python-list
Erik Max Francis a écrit :
> David T wrote:
>
>> Individuals, and perhaps groups of individuals are the creators of
>> works.
>
>
> When someone pays you to create a work, then they own the copyright,
Depends on the country's laws and the exact agreement.
--
http://mail.python.org/mailman/l
The Eternal Squire a écrit :
> Without copyright, how could one possibly earn a living writing a
> novel?
Without copyright, how could one possibly earn a living writing programs?-)
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] a écrit :
> I think I have an answer to my own question. In the
> WindowsComponents/__init__.py file, I have the following, that feels
> like a better answer for the problem. Is there a better answer than
> this?
>
> import os, sys
> sys.path.append(os.path.join(os.getcwd(), 'C
Steve a écrit :
> We are building a web app and the our backend is currently using python
> with php front end. We would like to do everything in python but php
> for our front end is so easy to use. We would like to use zope on our
> front end(no experience with it) can anyone provide any experi
Shi Mu a écrit :
> On 11/17/05, Carl J. Van Arsdall <[EMAIL PROTECTED]> wrote:
>
(Carl's top-post corrrected. Carl, please do not top-post)
>>
>>
>>Ben Bush wrote:
>>
>>>I wrote the following code to test the use of "try...exception",
>>>and I want n to be printed out. However, the following code'
[EMAIL PROTECTED] a écrit :
> Is there a function/class/module/whatever I can use to
> look at objects? I want something that will print the object's
> value (if any) in pretty-printed form, and list all it's attributes
> and their values. And do all that recursively.
> I want to be able to find
KvS a écrit :
> Ok, makes sense but didn't seem "natural" to me,
It will seem more natural if you understand that modules should be
modulars (ie: low coupling, high cohesion). A module should *never*
bother about no rely upon other modules being imported by the module it
imports itself. Err, n
Tony a écrit :
> If I'd like to learn Python for web-development, what are the options
> available?
There are too many *good* options for web developpement in Python.
> Thanks. tony
--
http://mail.python.org/mailman/listinfo/python-list
Gabriel Zachmann a écrit :
> Is it correct to say that the typical ownership problem, which
> frequently arises in C++, does not occur normally in Python?
What is this "typical ownership problem" ?
--
http://mail.python.org/mailman/listinfo/python-list
Raymond Hettinger a écrit :
> Gustav Hållberg wrote:
>
>>I tried finding a discussion around adding the possibility to have
>>optional underscores inside numbers in Python. This is a popular option
>>available in several "competing" scripting langauges, that I would love
>>to see in Python.
>>
>>E
Thomas a écrit :
> Hello,
>
> I am new to web programming but have some experience in technical
> programming in Python and other languages. I need to build a networked
> program which I would like to first deploy on an intranet and later on the
> web which provides access to a few technical a
[EMAIL PROTECTED] a écrit :
>
> I'm off to study the code. (Hmm.. how does python parse ("green",
> "red")[(i * 8 + j) % 2] command ...
("green", "red")[0] == "green"
("green", "red")[1] == "red"
(i * 8 + j) is somewhat trivial (just take care of precedence order),
and will return an integer
[EMAIL PROTECTED] a écrit :
Scott A. McIntyre wrote:
I looked around but didn't see any LDIF tools for perl or python...
Any assistance or advice is appreciated!!
Scott
Hello Scott,
Did you ever get this issue resolved? I have a similar need to merge
two LDIF files. I did find a program called m
her
black magic?
The better way is definitively to forget about black magic and
understand why mandatory 'self' is Good Thing (tm).
(Tip : even when [this|self|@|whatsoever] is not mandatory, using it
makes for much more readable code.)
Bruno
--
http://mail.python.org/mailman/listinfo/python-list
worzel a écrit :
I get what the difference is between a tuple and a list, but why would I
ever care about the tuple's immuutability?
Because, from a purely pratical POV, only an immutable object can be
used as kay in a dict. So you can use tuples for 'composed key'.
Antoon Pardon a écrit :
Op 2005-01-08, Bruno Desthuilliers schreef <[EMAIL PROTECTED]>:
worzel a écrit :
I get what the difference is between a tuple and a list, but why would I
ever care about the tuple's immuutability?
Because, from a purely pratical POV, only an immutable object c
er
Return a hash value for the object. Two objects with the same value
have the same hash value. The reverse is not necessarily true, but likely.
HTH
Bruno
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] a écrit :
In a file there can be several dictionaries like this
(snip)
I need to read only the the first and the last dictionaries.What is a
best solution?
Depends on your definition of 'best solution'.
--
http://mail.python.org/mailman/listinfo/python-list
Daniel Bickett a écrit :
This is certainly a worthy topic. There are several IDEs for Python
(one I like very much being Komodo) that have plenty of fancy
debugging features and advanced operations, however I have yet to
encounter (elsewhere) the convenience that comes with being able to
press F5 a
Pierre Barbier de Reuille a écrit :
Fuzzyman a écrit :
If you use IPython for your interactive mode stuff, you'll have a nice
history...
Regards,
Fuzzy
http://www.voidspace.org.uk/python/index.shtml
Best event : if your "EDITOR" system variable in "vim", using the "ed"
command in ipython will brin
jordan2856977 a écrit :
hellow everybody! I'm from china. I'm a beginner of python. in china,
python is not a fashionable language, so it's difficult to find some
books about python. finally,I find a book named "python how to
program" wrote by H.M.Deitel . who can tell me where can I find some
inte
[EMAIL PROTECTED] a écrit :
I want to know which compiler I can use ... thank you
To compile what ? Python code ? The compiler is in the standard lib.
--
http://mail.python.org/mailman/listinfo/python-list
Steve Holden a écrit :
(snip)
So, for example, your program might look like this:
base_price = int(raw_input(...))
tax_rate = int(raw_input(...)
tax_amount = base_price * ((100+tax_amount)/...)
s/(100+tax_amount)/(100 + tax_rate)/, I guess ?
--
http://mail.python.org/mailman/listinfo/python-list
nded me that in
the past I've never been able to very good, definitive documentation
on newstyle classes.
Well, the fact is that __[get|set]state__() have nothing to do with new
style classes, but with the Pickle protocol:
http://www.python.org/doc/2.3.4/lib/pickle-inst.html
(snip)
Bruno
--
ht
[EMAIL PROTECTED] wrote:
> Hi Matt,
> I also am almost a newbie (in Python) and my approach to variable
> naming
> follows more or less the Hungarian Type Notation Defined.
which is seen as a bad practice anywhere outside Win32...
http://mindprod.com/jgloss/unmainnaming.html
Thys Meintjes wrote:
> Greets,
>
> I have need of a Delphi/pascal to python converter. Googling didn't
> suggest any obvious leads so I'm trying here...
Have you tried with "python/delphi programer" ?-)
--
bruno desthuilliers
python -c "print '@
for i in xrange(flips):
coins[randrange(0, 2)] += 1
return coins[0], coins[1]
if __name__ == "__main__":
flips = 100
heads, tails = flip_coins(flips)
print "Heads: %d\nTails %d\nTotal: %d flips\n" % (heads, tails, flips)
#raw_input("Pre
'one',2:'two',3:'three'}
tup = tuple(dic.items())
The bad news is that dict are *not* ordered, so you'll have to sort the
result yourself if needed :(
The good news is that sorting a sequence is a no-brainer too !-)
> I must also add that I'm new to Pytho
George Sakkis wrote:
> I'd love to see IPython replace the standard interpreter.
I dont.
--
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in '[EMAIL PROTECTED]'.split('@')])"
--
http://mail.python.org/mailman/listinfo/python-list
Tim Williams (gmail) wrote:
(snip)
>>>>d = {1:'one',2:'two',3:'three'}
>>>>t = tuple([(k,v) for k,v in d.iteritems()])
Err... don't you spot any useless code here ?-)
(tip: dict.items() already returns a list of (k,v) tuples...)
--
1 - 100 of 4404 matches
Mail list logo