Re: I want to know how to implement concurrent threads in Python

2013-05-27 Thread Daniel Gagliardi
fuck! fuck! i'm gonna be fired if i didnt get this shit! i told my boss id do it. fuck! im gonna pipe some crakc. fuck... 2013/5/26 Mark Lawrence > On 26/05/2013 20:10, Daniel Gagliardi wrote: > >> I want to know how to implement concurrent threads in Python >> >&g

I want to know how to implement concurrent threads in Python

2013-05-26 Thread Daniel Gagliardi
I want to know how to implement concurrent threads in Python -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Magazine

2013-05-25 Thread Daniel
All of the above, plus: - Best Pythonic tools for GUI - notorious projects (in science, education, NGOs, etc) using python Please keep us informed, and best wishes Daniel El 25/05/2013, a las 07:29, Michael Poeltl escribió: > * DRJ Reddy [2013-05-25 05:26]: >> Planning to start

My gui

2013-04-24 Thread Daniel Kersgaard
Today, being the last day of lectures at school, my instructor ran briefly through Tkninter and GUIs. I'd been looking forward to this particular lesson all semester, but when I got home and copied a sample program from my textbook verbatim, IDLE does nothing. No error, no nothing. Any ideas? He

Re: subclassable types

2013-02-22 Thread Daniel Urban
e's > structure. When type->tp_flags & Py_TPFLAGS_BASETYPE is true then > subclassing is allowed. But I know of no way to retrieve that > information from Python code. There is an (undocumented and CPython-specific) way: >>> range.__flags__ & (1 << 10) 0 >&

Re: Please provide a better explanation of tuples and dictionaries

2013-01-29 Thread Daniel W. Rouse Jr.
"John Gordon" wrote in message news:keaa9v$1ru$1...@reader1.panix.com... In "Daniel W. Rouse Jr." writes: I have recently started learning Python (2.7.3) but need a better explanation of how to use tuples and dictionaries. A tuple is a linear sequence of items, acc

Re: Please provide a better explanation of tuples and dictionaries

2013-01-29 Thread Daniel W. Rouse Jr.
"Chris Angelico" wrote in message news:mailman.1197.1359515470.2939.python-l...@python.org... On Wed, Jan 30, 2013 at 1:55 PM, Daniel W. Rouse Jr. wrote: I am currently using "Learning Python" by Mark Lutz and David Ascher, published by O'Reilly (ISBN 1-565

Please provide a better explanation of tuples and dictionaries

2013-01-29 Thread Daniel W. Rouse Jr.
Hi all, I have recently started learning Python (2.7.3) but need a better explanation of how to use tuples and dictionaries. I am currently using "Learning Python" by Mark Lutz and David Ascher, published by O'Reilly (ISBN 1-56592-464-9)--but I find the explanations insufficient and the numb

Re: New to python, do I need an IDE or is vim still good enough?

2012-12-27 Thread Daniel Fetchinson
rlier! Indeed.. BTW, I also use vim only, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: pygnomevfs get_local_path_from_uri replacement

2012-12-22 Thread Daniel Fetchinson
uri( uri ): return uri.split( '//' )[1] and it seems to work. In the program the function is always called in a try: except: block so if anything is not okay it will get caught, I don't have to catch exceptions inside the function. Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

pygnomevfs get_local_path_from_uri replacement

2012-12-22 Thread Daniel Fetchinson
ave simply lifted it. Does anyone know what a good replacement for get_local_path_from_uri is? Is there a gtk/gnome/etc related python package that contains it which would work with gnome 3? Or a totally gnome-independent python implementation? Cheers, Daniel -- Psss, psss, put it down! - http

Re: unpacking first few items of iterable

2012-12-13 Thread Daniel Fetchinson
>> a, b, c, *rest = myiterable >> Thanks, sounds great, how about python2? >> > > If you know the sequence has at least n items, you > can do a, b, c = seq[:3] Yeah, that's probably the simplest, without all the fancy stuff :) Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: unpacking first few items of iterable

2012-12-13 Thread Daniel Fetchinson
>>Hi folks, I swear I used to know this but can't find it anywhere: >> >>What's the standard idiom for unpacking the first few items of an >>iterable whose total length is unknown? >> >>Something like >> >>a, b, c, _ = myiterable >> >>where _ could eat up a variable number of items, in case I'm onl

unpacking first few items of iterable

2012-12-13 Thread Daniel Fetchinson
terested in the first 3 items? Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: Help with unittest2

2012-12-13 Thread Daniel Laird
On Thursday, December 13, 2012 3:09:58 PM UTC, Miki Tebeka wrote: > On Thursday, December 13, 2012 7:03:27 AM UTC-8, Daniel Laird wrote: > > > I do am import unittest2 as unittest > > > NameError: global name 'assertListEqual' is not defined > > According t

Help with unittest2

2012-12-13 Thread Daniel Laird
All, I am new to python and am stuck with python 2.6 (Ubuntu 10.04 and dont want to force switch to 2.7) I want to use assertListEqual and other new test functions. However I do am import unittest2 as unittest The code does not fail but any use of the new functions results in: NameError: global n

Help "joining" two files delimited with pipe character ("|")

2012-12-05 Thread Daniel Doo
Hello, I am new to Python. Is there a method to "join" two pipe delimited files using a unique key that appears in both files? I would like to implement something similar to the Unix join command. Thanks for your help! Topeka Capital Markets Disclaimers - ht

assign only first few items of a tuple/list

2012-12-04 Thread Daniel Fetchinson
mmon idiom for this that does? Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Encoding conundrum

2012-11-20 Thread Daniel Klein
With the assistance of this group I am understanding unicode encoding issues much better; especially when handling special characters that are outside of the ASCII range. I've got my application working perfectly now :-) However, I am still confused as to why I can only use one specific encoding.

[Python 3.3/Windows] Path Browser seems to be broken

2012-11-20 Thread Daniel Klein
If you try to expand any of the paths in the Path Browser (by clicking the + sign) then it not only closes the Path Browser but it also closes all other windows that were opened in IDLE, including the IDLE interpreter itself. I did a Google search and it doesn't look like this been reported. If t

Path Browser seems to be broken

2012-11-20 Thread Daniel Klein
If you try to expand any of the paths in the Path Browser (by clicking the + sign) then it not only closes the Path Browser but it also closes all other windows that were opened in IDLE, including the IDLE interpreter itself. A Google search doesn't look like this been reported. If this is truly a

[SOLVED] Re: Making `logging.basicConfig` log to *both* `sys.stderr` and `sys.stdout`?

2012-10-24 Thread Daniel Dehennin
Daniel Dehennin writes: > Hello, Hi [...] > I tried to setup the same for my scripts with > "logging.config.dictConfig()" without much success, I want to limit > output to stdout to INFO, everything bellow INFO should be sent to > stderr instead. > > Any hints?

Re: Making `logging.basicConfig` log to *both* `sys.stderr` and `sys.stdout`?

2012-10-23 Thread Daniel Dehennin
#x27; : 'logging.StreamHandler', 'stream' : 'ext://sys.stderr', 'level' : 'WARNING', 'formatter' : 'stderr', } }, 'root' : { 'level' : options.log_level.upper(), 'handlers' : ['stdout', 'stderr'], }, } logging.config.dictConfig( config ) return logging.getLogger() #+end_src Regards. -- Daniel Dehennin EOLE pgpP128hCWd2L.pgp Description: PGP signature -- http://mail.python.org/mailman/listinfo/python-list

Re: can we append a list with another list in Python ?

2012-10-23 Thread Daniel Fetchinson
> can we append a list with another list in Python ? using the normal routine > syntax but with a for loop ?? x = [1,2,3] y = [10,20,30] x.extend( y ) print x this will give you [1,2,3,10,20,30] which I guess is what you want. Cheers, Daniel -- Psss, psss, put it down!

Re: get each pair from a string.

2012-10-22 Thread Daniel Nogues
Hello rusi This is a little bit faster: s = "apple" [s[i:i+2] for i in range(len(s)-1)] >>> timeit("""s = "apple" ... [a+b for a,b in zip(s, s[1:])]""",number=1) 0.061038970947265625 >>> timeit("""s = "apple" ... [s[i:i+2] for i in range(len(s)-1)]""",number=1) 0.0467379093170166 Reg

Re: len() on mutables vs. immutables

2012-10-18 Thread Daniel Urban
On Thu, Oct 18, 2012 at 8:42 PM, Demian Brecht wrote: >> str, bytes, bytearrays, arrays, sets, frozensets, dicts, dictviews, and >> ranges should all return len in O(1) time. That includes the possibility >> of a subtraction as indicated above. > > Awesome. Pretty much what I figured. Of course, I

Re: system tray or notification area in python

2012-10-17 Thread Daniel Fetchinson
programming, I'd start another projet first - I think you will have >>> a tough way to succeed with this project. >> >> I certainly wouldn't start with Xlib in C, but if python bindings >> would be available that would make life much easier. >> >

Re: Fwd: system tray or notification area in python

2012-10-17 Thread Daniel Fetchinson
when you write that you have no experience with > GUI programming, I'd start another projet first - I think you will have > a tough way to succeed with this project. I certainly wouldn't start with Xlib in C, but if python bindings would be available that would make life much easier. Cheers, Daniel > Christian > -- > http://mail.python.org/mailman/listinfo/python-list > -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Fwd: system tray or notification area in python

2012-10-16 Thread Daniel Fetchinson
rk immediately with gtk from C. But I have zero experience with gui programming in python. So any pointers would be much appreciated how to implement a system tray in python. Gtk is I guess just one option, one could use other stuff from python but I wouldn't know what the simplest approach is.

system tray or notification area in python

2012-10-16 Thread Daniel Fetchinson
Where would I start something like this? Any pointers would be greatly appreciated! Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: Help me abstract this (and stop me from using eval)

2012-10-03 Thread Daniel Klein
On Wednesday, October 3, 2012 5:40:12 PM UTC+1, Daniel Klein wrote: > Thank you Steven! That was PRECISELY what I was looking for. (And kwpolska!) -- http://mail.python.org/mailman/listinfo/python-list

Re: Help me abstract this (and stop me from using eval)

2012-10-03 Thread Daniel Klein
Thank you Steven! That was PRECISELY what I was looking for. -- http://mail.python.org/mailman/listinfo/python-list

Help me abstract this (and stop me from using eval)

2012-10-03 Thread Daniel Klein
Hi! I've got import scripts for a bunch of csv files into an sqlite database. I have one csv file per language. I don't write directly to the sqlite db; this is a django app and I'm creating items in my django models. My script (scripts, unfortunately) work just fine, but it feels beyond stupi

Re: terminate called after throwing an instance of 'CABRTException'

2012-10-02 Thread Daniel Fetchinson
t;>>> [name for name in sys.modules if "abrt" in name.lower()] > [] > > gives a non-empty result I'd investigate where the culprit is imported -- > /usr/lib/python2.6/sitecustomize.py would be the obvious candidate. Indeed! Thanks a lot, /usr/lib/python2.6/si

terminate called after throwing an instance of 'CABRTException'

2012-10-02 Thread Daniel Fetchinson
e is that I have all sorts of recent files in /var/cache/abrt/pyhook-* indicating that somehow abrt is doing things even though it is not running, for instance chkconfig --list | grep abrt shows it off in all run levels. What's going on? Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: Does python have built command for package skeleton creation?

2012-09-24 Thread Daniel Nogues
alternatively you can use virtualenv to create virtual environments http://www.virtualenv.org/en/latest/index.html however, if what you want is automated generation of some of the code, you can adopt an IDE or create some macros in your text editor of choice. From: alex23 Date: 24 Septem

Re: Demise of Mr. Kenneth Gonsalves

2012-08-03 Thread Daniel Roseman
and to the Django community in general. Please pass on condolences to his family and friends. -- Daniel. -- http://mail.python.org/mailman/listinfo/python-list

Re: lambda in list comprehension acting funny

2012-07-11 Thread Daniel Fetchinson
turn x**i > > i = 3 > def f3(x): return x**i > > Is there any surprise that all three functions return the same value? > They all point to the same global variable i. I'm not sure what it is > about lambda that fools people into thinking that it is different (I've > even been fooled myself!) but it is not. Thank you Steve! Precise and clear, as always! Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: lambda in list comprehension acting funny

2012-07-11 Thread Daniel Fetchinson
t; >Try giving the lambda a default parameter (they get calculated and > have their value stored at the time the lambda is defined) like this: >funcs = [ lambda x, i=i: x**i for i in range( 5 ) ] Thanks a lot! I worked around it by def p(i): return lambda x: x**i funcs = [ p(i) fo

Re: lambda in list comprehension acting funny

2012-07-10 Thread Daniel Fetchinson
> funcs = [ lambda x: x**i for i in range( 5 ) ] > print funcs[0]( 2 ) > print funcs[1]( 2 ) > print funcs[2]( 2 ) > > This gives me > > 16 > 16 > 16 > > When I was excepting > > 1 > 2 > 4 > > Does anyone know why? And more importantly, what's the simplest way to achieve the latter? :) -- Psss,

lambda in list comprehension acting funny

2012-07-10 Thread Daniel Fetchinson
funcs = [ lambda x: x**i for i in range( 5 ) ] print funcs[0]( 2 ) print funcs[1]( 2 ) print funcs[2]( 2 ) This gives me 16 16 16 When I was excepting 1 2 4 Does anyone know why? Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org

Re: Pytz error: unpack requires a string argument of length 44

2012-06-13 Thread Daniel Klein
The windows box is my development box, it's not where the script will be running in the end. It'll be running on a Linux box where I don't have root so python setup.py install isn't an option (to my understanding). So what happened is that 7zip didn't unzip the .tar.gz2 properly, but it does fi

Re: About a list comprehension to transform an input list

2012-06-08 Thread Daniel Urban
] > > I wonder whether there can be a single list comprehension expression to get > this > result without the aid of the auxiliary function. > > Do you have any comments on this? >>> l = [0,1,2,3,4,5,6,7,8,9] >>> [n if n%2 else 100+n for n in l] [100, 1, 102, 3, 104, 5, 106, 7, 108, 9] Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: Namespace hack

2012-06-05 Thread Daniel Fetchinson
like to. > > Can you be less condescending? Of course! :) Anyway, the point I was trying to make is that Steve's example is kinda cool but only as a funny exercise and not something for real life. Let's toy with python kinda thing, which is always welcome but with a big fat aster

Re: Namespace hack

2012-05-24 Thread Daniel Fetchinson
name__] = staticmethod(obj) > else: > raise TypeError('bad export') > Namespace = type(func.__name__, (), ns) > return Namespace() > > > Have fun! Funny, you got to the last line of "import this" but apparently skipped the second line: Explicit is better than implicit. And you didn't even post your message on April 1 so no, I can't laugh even though I'd like to. Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: Good data structure for finding date intervals including a given date

2012-05-21 Thread Daniel Stutzbach
On Wed, May 16, 2012 at 5:38 AM, Jean-Daniel wrote: > On Sun, May 13, 2012 at 2:29 PM, Alec Taylor > wrote: > > There is an ordered dict type since Python 3.1[1] and Python 2.7.3[2]. > > Ordered dict are useful, but they only remember the ordered in which > they were add

Re: Good data structure for finding date intervals including a given date

2012-05-16 Thread Jean-Daniel
/3.1/ > [2] http://www.python.org/getit/releases/2.7.3/ > [3] http://dl.acm.org/citation.cfm?id=645413.652131 > > On Sat, May 12, 2012 at 10:17 PM, Jean-Daniel > wrote: >> >> Hello, >> >> I have a long list of n date intervals that gets added or suppressed &

Re: Open Source: you're doing it wrong - the Pyjamas hijack

2012-05-15 Thread Daniel Fetchinson
ecision, you do not have to like that decision, you do not have to | > | accept that decision.| > Again, if you don't like the lead developer just fork the project, come up with a new name, new website

Re: Good data structure for finding date intervals including a given date

2012-05-12 Thread Jean-Daniel
it fast is to have done some preprocessing at insertion time, so that not all intervals are processed at query time. On Sat, May 12, 2012 at 2:30 PM, Karl Knechtel wrote: > On Sat, May 12, 2012 at 8:17 AM, Jean-Daniel > wrote: >> I am looking for a fast way to find the intervals &

Good data structure for finding date intervals including a given date

2012-05-12 Thread Jean-Daniel
Hello, I have a long list of n date intervals that gets added or suppressed intervals regularly. I am looking for a fast way to find the intervals containing a given date, without having to check all intervals (less than O(n)). Do you know the best way to do this in Python with the stdlib? A var

Re: Open Source: you're doing it wrong - the Pyjamas hijack

2012-05-09 Thread Daniel Fetchinson
nity, new infrastructure, new fame, etc, and I sure as hell like to take the easy road as opposed to the hard road". Until you clearly explain your reasoning for taking over as opposed to forking, the default answer is the above one. Cheers, Daniel -- Psss, psss, put it down! - http

Re: Open Source: you're doing it wrong - the Pyjamas hijack

2012-05-09 Thread Daniel Fetchinson
It's also quite ironic that the initial complaining started from how the domain name www.pyjs.org is not available only pyjs.org is. At the same time the Rebel Chief's listed domain name on github, see https://github.com/xtfxme, gives you a server not found: http://the.xtfx.me/ :) On 5/9/12, ant

Re: For loop

2012-05-01 Thread Daniel
You could also try http://docs.python.org/library/stdtypes.html#str.join like this: for i in range(5): print "".join(str(i) for j in range(i)) -- http://mail.python.org/mailman/listinfo/python-list

Re: random number

2012-03-25 Thread Daniel da Silva
If you want it as an int: random.randint(10, 99) Or as a string: s = '%06d' % random.randint(0, 99) On Mon, Mar 26, 2012 at 2:08 AM, Nikhil Verma wrote: > Hi All > > How can we generate a 6 digit random number from a given number ? > > eg:- > > def number_generator(id): > rando

Re: Fetching data from a HTML file

2012-03-23 Thread Daniel Fetchinson
On 3/23/12, Sangeet wrote: > Hi, > > I've got to fetch data from the snippet below and have been trying to match > the digits in this to specifically to specific groups. But I can't seem to > figure how to go about stripping the tags! :( > > Sum class="green">24511 align='center'>02561.496 > [min]

Re: Odd strip behavior

2012-03-22 Thread Daniel Steinberg
strip() removes leading and trailing characters, which is why the 't' in the middle of the string was not removed. To remove the 't' in the middle, str1.replace('t','') is one option. On 3/22/12 3:48 PM, Rodrick Brown wrote: #!/usr/bin/python def main(): str1='this is a test' str2=

[ANN] markup.py 1.8

2012-02-18 Thread Daniel Nogradi
A new release of markup.py is available at http://markup.sourceforge.net/ This new release is compatible with both python 2 and 3. What is markup.py? Markup.py is an intuitive, light weight, easy-to-use, customizable and pythonic HTML/XML generator. The only goal is quickly writing HTML/XML segm

Re: format a measurement result and its error in "scientific" way

2012-02-17 Thread Daniel Fetchinson
of digits for the value that makes sense for the given error. So what you call "non sense" is part of the problem to be solved. Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: format a measurement result and its error in "scientific" way

2012-02-17 Thread Daniel Fetchinson
guess, it's failing because scaleb() (which was new in > 2.6) is buggily expecting a decimal argument, but adjusted() returns an int. > Convert the results of the two adjusted() calls to decimals, and I > think it should be fine. Great, with python 2.7 it works indeed! Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: format a measurement result and its error in "scientific" way

2012-02-16 Thread Daniel Fetchinson
On 2/16/12, Ian Kelly wrote: > On Thu, Feb 16, 2012 at 1:36 AM, Daniel Fetchinson > wrote: >>>> Hi folks, often times in science one expresses a value (say >>>> 1.03789291) and its error (say 0.00089) in a short way by parentheses >>>> like so: 1.0379(9

Re: format a measurement result and its error in "scientific" way

2012-02-16 Thread Daniel Fetchinson
le).to_integral() > if 'E' in value_str: > index = value_str.index('E') > return value_str[:index] + error_str + value_str[index:] > else: > return value_str + error_str > >>>> format_error(1.03789291, 0.00089) > &

format a measurement result and its error in "scientific" way

2012-02-15 Thread Daniel Fetchinson
value correspondingly. I've been searching around for a simple function that would take 2 float arguments and would return a string but didn't find anything although something tells me it's been done a gazillion times. What would be the simplest such function? Cheers, Daniel -- Pss

building foo.pyd, _initfoo vs. initfoo

2012-01-22 Thread Daniel Franke
r -> the function name also comes with a leading underscore '_', i.e. "_initfoo", not "initfoo" Could someone knowledge with Windows and MinGW help me to sort this out? Tools used: cmake-2.8.3, mingw-? with gcc-4.4 and Python-2.7.2 from python.org. Thanks Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: defining class and subclass in C

2012-01-14 Thread Daniel Franke
On Saturday 14 January 2012 22:15:36 Daniel Franke wrote: > Here I'd expect "" instead?! And I never managed a proper > subclass :| Found an explanation on type/class at [1]: "he difference between the two is whether the C-level type instance structure is flagged as hav

defining class and subclass in C

2012-01-14 Thread Daniel Franke
x27;d like to subclass "cb" not from "ca", but from the Python "class A" - if possible?! Could somepne kindly point out my mistake(s) and set me back on track? Thanks Daniel -- #include typedef struct { PyObject_HEAD } ca; static PyTypeObject ca_Type

RE: [TIP] Anyone still using Python 2.5?

2011-12-21 Thread Staple, Daniel (BSKYB)
We've a bunch of windows servers stuck on python 2.5 since an API we use on them is shipped to us pyc's only - forcing us to stay with that version. Most of our other machines are on 2.6 or 2.7. -Original Message- From: testing-in-python-boun...@lists.idyll.org [mailto:testing-in-pytho

Re: SQLObject 1.2.0

2011-11-21 Thread Daniel Fetchinson
Thanks a million Oleg! Cheers, Daniel On 11/20/11, Oleg Broytman wrote: > Hello! > > I'm pleased to announce version 1.2.0, the first stable release of branch > 1.2 of SQLObject. > > > What is SQLObject > = > > SQLObject is an object-relationa

Re: issue with pexpect

2011-10-05 Thread Daniel
Okey i figure it out how to do the job in fedora i added slight delay before sending each command either by the delaybeforesend attribute or by the time module ;) cheers On Wed, 2011-10-05 at 14:47 +0200, Nizamov Shawkat wrote: > 2011/10/5 Daniel <5960...@gmail.com>: > > Hello

Re: A tuple in order to pass returned values ?

2011-10-05 Thread Daniel Dorani
this feature has been removed in python3 in accordance to the PEP 3113 (http://www.python.org/dev/peps/pep-3113/), you should consider using the * operator http://docs.python.org/tutorial/controlflow.html#unpacking-argument-lists . -- http://mail.python.org/mailman/listinfo/python-list

Re: issue with pexpect

2011-10-05 Thread Daniel
there is no such implementation in fedora you can su as a root .. i can su from regular user to root with no problems the problem come when i use the pexpect module On Wed, 2011-10-05 at 14:47 +0200, Nizamov Shawkat wrote: > 2011/10/5 Daniel <5960...@gmail.com>: > > Hello, >

issue with pexpect

2011-10-05 Thread Daniel
Hello, For about week i am experiencing a problem with pexpect that's why i hope you can help me :). Following is my code which tries to remove some files from the root dir and the code works on linux debian and freebsd but with no success on linux fedora .. any idea why this happen only in fedora

issue with pexpect

2011-10-05 Thread Daniel
Hello, For about week i am experiencing a problem with pexpect that's why i hope you can help me :). Following is my code which tries to remove some files from the root dir and the code works on linux debian and freebsd but with no success on linux fedora .. any idea why this happen only in fedora

Re: fun with nested loops

2011-09-01 Thread Daniel
I thought a bit about Carl's and Thomas' proposals, and it gave me an idea how this problem could be approached: Break is relatively easy to implement with a context manager that returns an iterable that throws an exception specific to that context manager: with named_loop(i for i in range(10)) as

Re: fun with nested loops

2011-09-01 Thread Daniel
Hi Steve, Thanks for your comments, I appreciate any input. > Do you think the software in the Apple iPod is "simple"? Or Microsoft No, that's much more complicated that what I am doing. But the iPod probably (?) doesn't get new algorithms based on a specification discussed with non-programmers on

Re: fun with nested loops

2011-08-31 Thread Daniel
> Do you only ever have one top-level loop that you would be naming? If no, unfortunately not. The rough structure is several loops deep, and I need to break/continue/restart many of them. Continue is used more than break, because most of the time that I find some strange value, I'd just _continue

Re: fun with nested loops

2011-08-31 Thread Daniel
> one more idea, a kind of named loop: interesting idea, thanks. > > When it become too complicate, I use state > machine:http://en.wikipedia.org/wiki/Finite-state_machine I unsuccessfully played a bit with a FSM, but there is a lot of data that is passed around between the states and a lot of

fun with nested loops

2011-08-31 Thread Daniel
Dear All, I have some complicated loops of the following form for c in configurations: # loop 1 while nothing_bad_happened: # loop 2 while step1_did_not_work: # loop 3 for substeps in step1 # loop 4a # at this point, we may have to -leave lo

OT

2011-08-19 Thread Daniel Fetchinson
I'll be 59 in a couple of months. -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: Data issues with Django and Apache

2011-08-14 Thread Daniel Roseman
On Sunday, 14 August 2011 03:20:30 UTC+1, John Gordon wrote: > I'm devleoping a website using the Django framework along with Apache, > and I'm seeing some odd data issues. > > During the course of navigating through the website content, a user > will cause the creation of some data records with

Re: [Python-ideas] allow line break at operators

2011-08-11 Thread Daniel Greenfeld
Something like this already exists: a = 0 b = 1 if (True == True and False == False and a + 1 == b and b - 1 == a): print 'meh' So I've got no idea what this proposal is about except for the dropping of readability of Python. -1 Daniel Greenfeld

Re: how to sort a hash list without generating a new object?

2011-08-03 Thread Daniel Stutzbach
different performance characteristics, and a sorteddict works just like a dict but keeps the keys sorted. -- Daniel Stutzbach -- http://mail.python.org/mailman/listinfo/python-list

Re: blist question

2011-07-07 Thread Daniel Stutzbach
d into Python source code? > Seems unlikely. -- Daniel Stutzbach -- http://mail.python.org/mailman/listinfo/python-list

Re: web hosting, first hand experiences?

2011-07-04 Thread Daniel Fetchinson
f dreamhost and webfaction >> does anyone have any recent experiences with these two? Or others? >> >> Cheers, >> Daniel >> > > Hi Daniel, > > I can wholeheartedly recommend WebFaction. I currently have an account > running 3 different CherryPy applications

web hosting, first hand experiences?

2011-07-03 Thread Daniel Fetchinson
e have any recent experiences with these two? Or others? Cheers, Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: keeping local state in an C extension module

2011-06-30 Thread Daniel Franke
precated as of Python 2.7. Please switch to the new Capsules API." which is of no concern here :) Thanks heaps! Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: keeping local state in an C extension module

2011-06-30 Thread Daniel Franke
get a reasonable solution working for 2.[567], I might as well go back to Py_InitModule() and static variables. It's somewhat ugly, but it works. Thanks for the info! Daniel -- http://mail.python.org/mailman/listinfo/python-list

keeping local state in an C extension module

2011-06-30 Thread Daniel Franke
Here, of course, the functions PyObjectFromRawPointer(void*) and void* PyRawPointerFromPyObject(PyObject*) are missing. Is there anything like this in the Python C-API? If not, how could it be implemented? Or is this approach a stupid idea to begin with? Pointers would be highly appreciated. Thanks

Re: Python basic program problem

2011-06-27 Thread Daniel Kluev
world') hello world In future, please include full tracebacks and python version info. -- With best regards, Daniel Kluev -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Bluetooth

2011-06-26 Thread Daniel Kluev
or your own app. -- With best regards, Daniel Kluev -- http://mail.python.org/mailman/listinfo/python-list

Re: Rant on web browsers

2011-06-21 Thread Daniel Kluev
from it. -- With best regards, Daniel Kluev -- http://mail.python.org/mailman/listinfo/python-list

Re: New member intro and question

2011-06-18 Thread Daniel Fetchinson
; (http://www.geek.com/articles/gadgets/dreamplug-puts-a-1-2ghz-arm-pc-in-a-power-outlet-2011022/) > which isn't too shabby but I wonder if it will work. The netbook I use with fedora linux and basically every major python release from 2.4 to 3.2 has more limited resources :) So yes, python wo

Re: Run Python script from JS

2011-06-17 Thread Daniel Kluev
est regards, Daniel Kluev -- http://mail.python.org/mailman/listinfo/python-list

Re: integer to binary 0-padded

2011-06-15 Thread Daniel Rentz
Hi, Am 15.06.2011 14:29, schrieb Olivier LEMAIRE: Hi there, I've been looking for 2 days for a way to convert integer to binary number 0-padded, nothing... I need to get numbers converted with a defined number of bits. For example on 8 bits 2 = 0010 bin(2)[2:].zfill(8) Regards D

Re: Recursion error in metaclass

2011-06-11 Thread Daniel Urban
ink this is the mentioned bug: http://bugs.python.org/issue1294232 Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: scope of function parameters (take two)

2011-05-31 Thread Daniel Kluev
s exec to create new function, with signature of function you pass to your decorator, so it does not matter what names you used for args in decorator itself. -- With best regards, Daniel Kluev -- http://mail.python.org/mailman/listinfo/python-list

Re: sqlalchemy and Unicode strings: errormessage

2011-05-31 Thread Daniel Kluev
xt)) Use UnicodeText instead of Text. > A_record = A_class('BUM', 'Bäumer') If this is python2.x, use u'Bäumer' instead. -- With best regards, Daniel Kluev -- http://mail.python.org/mailman/listinfo/python-list

Re: scope of function parameters (take two)

2011-05-31 Thread Daniel Kluev
ords=None, defaults=None) So this decorator achieves needed result and preserves function signatures. -- With best regards, Daniel Kluev -- http://mail.python.org/mailman/listinfo/python-list

Re: scope of function parameters (take two)

2011-05-30 Thread Daniel Kluev
/getitem can modify object too if class overrides them). Obviously it would not save you from functions which use global/globals() or some other ways to change state outside their scope. -- With best regards, Daniel Kluev -- http://mail.python.org/mailman/listinfo/python-list

Re: scope of function parameters (take two)

2011-05-30 Thread Daniel Kluev
n use map(lambda x: , list_of_x), and you will have your isolated scopes. Although due to lambdas supporting only expressions, following this style leads to awkward and complicated code (and/or instead if, map instead for, and so on). -- With best regards, Daniel Kluev -- http://mail.python.org/

Re: scope of function parameters (take two)

2011-05-30 Thread Daniel Kluev
hon. On a sidenote, I wonder what is the reason to keep word 'variable' in python documentation at all. I believe word 'name' represents concept better, and those, who come from other languages, would be less likely to associate wrong definitions with it. -- With best regards,

<    1   2   3   4   5   6   7   8   9   10   >