Johhny wrote:
> Hello,
>
> I am trying to get the user that is running the scripts uid, I have had
> a look at the pwd module and it does not appear to offer that
> functionality. Is there any way within python to get that information ?
eg:
username = pwd.getpwuid(os.getuid())[4]
Eri
manstey wrote:
> That doesn't work. I just get an error:
>
> x = eval(line.strip('\n'))
>File "", line 1
> [('recId', 3), ('parse', {'pos': u'np', 'gen': u'm'})]
>
> SyntaxError: unexpected EOF while parsing
>
is the last line of your file empty ??
what with
for line in filA
Bruno Desthuilliers wrote:
> Fredrik Lundh wrote:
> > Bruno Desthuilliers wrote:
> >
> >>> on my machine, "key in dict" is about twice as fast as the full
> >
> >>> try/getitem construct when the key is present in the dict,
> >
> >>
> >> Doesn't it depends on the number of keys in the dict ?
>
Gary Wessle wrote:
>
> I need to traverse those files in the order they were created
> chronologically. listdir() does not do it, is there a way besides
> build a list then list.sort(), then for element in list_of_files open
> element?
are the name of the files describing the cration date, or
bruno at modulix wrote:
> Eric Deveaud wrote:
> (snip)
> >
> > sort can take a comparaison function.
>
> The problem with it is that it may slow down things a lot...
point taken.
I have to purge my mind from the other programing languages I practice. ;-
Nico Grubert wrote:
> Hi there,
>
> I am looking for a way to sort a list containing dictionaries.
>
> This is my example list:
> [{'Title': 'ABC', 'from_datetime': DateTime('2006/04/25 12:45:00
> GMT+2')}, {'Title': 'DEF', 'from_datetime': DateTime('2006/04/18
> 12:45:00 GMT+2')}, {'Titl
Thomas Girod wrote:
> Hi there.
>
> I have a list containing integer values from 0 to 255. With this list I
> have informations width and height, as width * height = len(my_list)
>
> What I want to do is to convert this array into a pixmap of dimension
> width * height in order to draw it in
News wrote:
> bruno at modulix wrote:
> >
> > Have you looked at optparse ?
> >
> I have.
>
> The module optparse seemed to be aimed at reading from commandline
> versus pulling attributes from a read line.
hu
lets see
optparse seems to be reading from commandline. that's not fa
News wrote:
> Hi everyone,
>
> My goal is to pull command switches/options from a file and then assign
> the values to select variables which would eventually be included in a
> class object.
>
> The data file looks something like this but the switches could be in any
> order and not all ma
Burton Samograd wrote:
> Hi,
>
> I'm writing an app that stores some user configuration variables in a
> file ~/.program/config, which it then imports like so:
>
> import sys
> from posix import environ
> sys.path.append(environ["HOME"]+"/.program")
> impor
robin wrote:
> yo!
>
> thank you everone! here's how i finally did it:
> converting the string into a list:
>
> input = net.receiveUDPData()
> input = list(eval(input[0:-2]))
no pun intented but as you did not know how to use split and join,
please please DON'T USE eval
robin wrote:
> hi,
>
> i'm doing some udp stuff and receive strings of the form '0.87
> 0.25 0.79;\n'
> what i'd need though is a list of the form [0.87 0.25 0.79]
> i got to the [0:-3] part to obtain a string '0.87 0.25
> 0.79' but i can't find a way to c
[EMAIL PROTECTED] wrote:
>
> Eric Deveaud wrote:
> > [EMAIL PROTECTED] wrote:
> > > Like in C we comment like
> > > /*
> > > Bunch of lines of code
> > > */
> > >
> > > Should we use docstring """ ""
[EMAIL PROTECTED] wrote:
> Like in C we comment like
> /*
> Bunch of lines of code
> */
>
> Should we use docstring """ """
I would say NO.
docstring are displayed by pydoc, thus a pydoc on your code will display some
inconsistent information ;-)
> Or there is something else too ??
some m
Dan Sommers wrote:
> If these are both true, then *new* .DS_Store files could
> be created after I've made the list and before I've made
> the tarball.
not python related, but in order to creater the tarball without the .DS_Store
files why don't you use the --exclude=PATTERN option from tar ??
John Salerno wrote:
> This is a real small point, but I'd like to hear what others do in this
> case. It's more an 'administrative' type question than Python code
> question, but it still involves a bit of syntax.
>
> One thing I like to do is use tabs for my indentation, because this
> ma
16 matches
Mail list logo