hello everyone.
i need to parse a an xml-like file. the problem that i'm facing is that this
file doesn't have the root element but in all other terms it is the same as
xml, i.e
does anybody know if there is a module in python that allows to process an
xml file without a root element? i t
On Tue, Aug 30, 2011 at 2:20 PM, Peter Otten <__pete...@web.de> wrote:
> rail shafigulin wrote:
>
> > hello everyone.
> >
> > i need to parse a an xml-like file. the problem that i'm facing is that
> > this file doesn't have the root element but in
i'm trying to learn OOP, python and pygame at the same time. so far it has
been ok, but i stumbled onto a problem
here is the code that causes problems
#!/usr/bin/python3.1
import pygame
pygame.init()
class BaseSprite(pygame.sprite.Sprite):
def __init(self, imagefile):
super(type(self), se
On Tue, Oct 11, 2011 at 10:56 AM, Hugo Arts wrote:
> On Tue, Oct 11, 2011 at 4:20 PM, rail shafigulin
> wrote:
> > i'm trying to learn OOP, python and pygame at the same time. so far it
> has
> > been ok, but i stumbled onto a problem
> >
> > here is the co
i created a class and in some instances when i use it call some of its
methods i need to print a method name. the online search did produce some
results but none of them seem to work for me. for example one of them said
just to use __name__ or func_name but it didn't work for me. i'm using
python 3
On Thu, Dec 8, 2011 at 10:17 AM, Joel Goldstick wrote:
>
>
> On Thu, Dec 8, 2011 at 9:49 AM, rail shafigulin > wrote:
>
>> i created a class and in some instances when i use it call some of its
>> methods i need to print a method name. the online search did produce
On Thu, Dec 8, 2011 at 10:40 AM, Lie Ryan wrote:
> On 12/09/2011 01:49 AM, rail shafigulin wrote:
>
>> i created a class and in some instances when i use it call some of its
>> methods i need to print a method name. the online search did produce
>> some results but none
i need to overwrite and attribute from the inherited class. i also need to
run the constructor of the super class. here is the code
import datetime
class DateTime(datetime.datetime):
def __init__(self, year, month, day, *args):
super().__init__(year, month, day, *args)
if self.year >= 1
On Fri, Dec 9, 2011 at 4:43 PM, rail shafigulin
wrote:
> i need to overwrite and attribute from the inherited class. i also need to
> run the constructor of the super class. here is the code
>
> import datetime
>
> class DateTime(datetime.datetime):
> def __init__(self, ye
i found something interesting during the timedate difference calculation
import datetime
import time
def main():
mydatetime = datetime.datetime.now()
time.sleep(1)
mydatetime2 = datetime.datetime.now()
diff = mydatetime - mydatetime2
print(diff)
if __name__ == '__main__':
main()
if
On Mon, Dec 12, 2011 at 4:14 PM, Lie Ryan wrote:
> On 12/13/2011 06:46 AM, rail shafigulin wrote:
>
>> i found something interesting during the timedate difference calculation
>>
>> import datetime
>> import time
>>
>> def main():
>> mydate
i writing some code to do device testing at my work. testing is related to
date and time, so naturally i decided to create a class that inherits from
datetime.datetime. main reason is that i need to add, subtract and compare
datetime objects and datetime.datetime allows me to do that. here is the
c
On Fri, Dec 16, 2011 at 5:26 AM, Steven D'Aprano wrote:
> rail shafigulin wrote:
>
>> i writing some code to do device testing at my work. testing is related to
>> date and time, so naturally i decided to create a class that inherits from
>> datetime.datetime. main
Hello everyone.
I'm trying to understand how to use the two methods. I know that __new__ is
used to create an object, while __init__ to initialize. But I'm not sure
what happens when I create an object.
I found the following code in the book (Python 3 Object Oriented
Programming by Dusty Phillips
Does anybody know if there is a way to make --help option to display
options in alphabetical order? Right now it displays options in the order I
added them. I'm using Python 3.1
Any help is appreciated.
Thanks.
___
Tutor maillist - Tutor@python.org
To
t everyone I've shown has switched and were
> glad
> they did. It's also on PyPi and github. In fact, the github page is
> probably the
> best place to check it out.
>
> -Modulok-
>
> On 12/18/12, rail shafigulin wrote:
> > Does anybody know if there is a way
f
> python arbitrarily enforcing its own order. Python likes being explicit
> about things like that.
>
> rail shafigulin wrote:
>>
>> Does anybody know if there is a way to make --help option to display
>> options in alphabetical order? Right now it displays option
On Tue, Dec 18, 2012 at 8:13 PM, Steven D'Aprano wrote:
> On 19/12/12 07:39, rail shafigulin wrote:
>
> I currently have it done this way. It just seems a bit odd that I have to
>> arrange it manually.
>>
>
> What's so special about alphabetical order? Woul
I'm attempting to write a script with command-line arguments. Based on some
reading I have done online and some advice from this mailing list I'm going
to use docopt and schema modules. The problem I'm facing is that I'd like
to be able to give this script to anyone who needs it by just using one
f
Does anybody know if there is a way to specify groups of mutually exclusive
options using argparse module?
Currently argpase allows to specify mutually exclusive options in the
following way
(taken from
https://docs.python.org/release/3.4.0/library/argparse.html#argparse.ArgumentParser.add_mutuall
>
>
>>
> Sorry, I didn't follow your example. Can you explain what you mean in
> English? What would be the outcome if you succeeded?
> What could the user do and not do?
The idea is to use two groups of parameters. The user can use only one
group of parameters.
For example say I have a the scri
21 matches
Mail list logo