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

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

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

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

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-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-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

Tkinter Progress Bar

2019-08-22 Thread Daniel
If i have a figure like 13247347347437x23828328382 how to make a progress bar in tkinter that shows the time the pc takes to give the result? --- Este email foi escaneado pelo Avast antivírus. https://www.avast.com/antivirus -- https://mail.python.org/mailman/listinfo/python-list

Print to Paper

2019-10-04 Thread Daniel
How to do a code to print to paper? please post here a "Hello World" code to be printed on paper with an inkjet. Thanks Daniel --- Este email foi escaneado pelo Avast antivírus. https://www.avast.com/antivirus -- https://mail.python.org/mailman/listinfo/python-list

Python 3.8 install

2019-11-07 Thread Daniel
How to install Python 3.8 on top of Python 3.6? -- Este email foi escaneado pelo Avast antivírus. https://www.avast.com/antivirus -- https://mail.python.org/mailman/listinfo/python-list

Re: Regular Expression for the special character "|" pipe

2014-05-27 Thread Daniel
What about skipping the re and try this: 'start=|ID=ter54rt543d|SID=ter54rt543d|end=|'.split('|')[1][3:] On 27.05.2014 14:09, Vlastimil Brom wrote: 2014-05-27 12:59 GMT+02:00 Aman Kashyap : I would like to create a regular expression in which i can match the "|" special character too. e.g.

Mock return_value

2015-03-09 Thread Daniel
I have a dao.py module with a dao class declared and I want to use mock to set a return value for a dao function, dao.execute_ldap_search(). import mock import unittest import model, dao class TestPeopleDAO(unittest.TestCase): ldap_person_response = SOME_DICT @mock.patch('dao.dao')

Re: Mock return_value

2015-03-09 Thread Daniel
I found that the following change worked: @mock.patch('dao.dao.execute_ldap_search') def test_find_by_last_first_comma(self, mock_dao): # setup the mock mock_dao.return_value = self.ldap_person_response Daniel On Monday, March 9, 2015 at 10:28:20 AM UTC-5, Da

Re: Mock return_value

2015-03-09 Thread Daniel
On Monday, March 9, 2015 at 10:28:20 AM UTC-5, Daniel wrote: > I have a dao.py module with a dao class declared and I want to use mock to > set a return value for a dao function, dao.execute_ldap_search(). > > import mock > import unittest > import model, dao >

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: 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, >

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

what is the keyword "is" for?

2006-08-15 Thread daniel
I'm so confused by the keyword "is" and "==" equal sign, it seems they could be exchanged in some contexts, but not in others, what's the difference between them in terms of comparation? thanks... daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: what is the keyword "is" for?

2006-08-15 Thread daniel
s all compound types (dictionary for instance) behave in this way. however, when list is replaced with other built-in types like integers : a = b = 3 changing one of them cause the two objects differ... best regards. daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: what is the keyword "is" for?

2006-08-15 Thread daniel
Martin v. Löwis wrote: > daniel wrote: > > when I tried to check the stuff out, found sth interesting that if you > > define variables in a style like this: > > a = b = ['a', 'b'] > > changing one list affects the other, and they still refer to sam

always raise syntax error!

2006-10-12 Thread daniel
I use listchars in vim to all my tabs and trailing spaces visible, make sure they are used consistently, but python still raise syntax error, no further description, and just make no sense to me. anyone heard of such issue or the like before? many thanks daniel -- http://mail.python.org/m

Re: always raise syntax error!

2006-10-13 Thread daniel
;" or "(" not matching...etc. tks again.. daniel -- http://mail.python.org/mailman/listinfo/python-list

is it possible to send raw data through ftp?

2006-10-19 Thread daniel
-like object, I have to use socketobj.makefile() to do that, how can I stop and resume that transfer then? the abort() generates lots of wierd and unexpected behavior, I guess if there is a way to upload raw data buffer, the restart action should be implemented more easily. thanks. d

Re: is it possible to send raw data through ftp?

2006-10-19 Thread daniel
On Oct 20, 1:10 pm, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > daniel wrote: > > well, I'm trying to use ftplib to upload data that received from > > socket, and the application is required to restart the transfer at a > > specific interval so as to generat

Network Simulator in Python

2006-10-23 Thread Daniel
Hi, I was wondering if anybody can give me pointers on an existing network simulator in Python somthing like ns2 which would model all the real world internet dynamics including TCP stacks, congestion, flow control etc. Every help is appreciated, Thanks -- http://mail.python.org/mailman/listin

Re: Network Simulator in Python

2006-10-24 Thread Daniel
Any help ? Daniel wrote: > Hi, > > I was wondering if anybody can give me pointers on an existing network > simulator in Python somthing like ns2 which would model all the real > world internet dynamics including TCP stacks, congestion, flow control > etc. > > E

Help on writing P2P Streaming client

2006-11-02 Thread Daniel
I want to write a P2P streaming client where ine user broadcasts and many users receive the streaming content and forward like BitTorrent. Can anybody provide pointers for starting in Python. I have done couple of small projects in Python but I need to get this done. Every help is appreciated. T

decimal by default

2006-06-28 Thread Daniel
er to use Decimal by default instead of float (but only in the eval() calls). I understand the performance implications and they are of no concern. I'm also willing to define a single global Decimal context for the expressions (not sure if that matters or not). Is there a way to do what I want without rolling my own parser and/or interpreter? Is there some other alternative that would solve my problem? Thanks, ~ Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: decimal by default

2006-06-29 Thread Daniel
co_consts)...) Wow, what an elegant solution! I had no hope that it would be this simple. I always wondered what compile() was useful for and now I know at least one thing. I'll try it out tomorrow. Thanks a lot Alex! ~ Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: Libraries in python

2006-09-02 Thread Daniel
out resource availablitiy... all I want to do is bundle the library when I deploy (preferably in the form of a single file). That's my $0.02 on Python packaging and library dependencies. In my opinion it's one of the few things that Java got right that Python didn't. ~ Daniel -- http://mail.python.org/mailman/listinfo/python-list

python threading

2006-09-13 Thread daniel
can someone give me a good threading tutorial thx -- http://mail.python.org/mailman/listinfo/python-list

ImportError: Don't know how to import XYZ (type code 3)

2006-09-19 Thread daniel
Trying to load a C++ module that is wrapped with boost_python and get the error ImportError: Don't know how to import XYZ (type code 3) I think type code 3 is means that it is a C++ wrapped .pyd. I have know idea what that means or how to fix it. Any ideas? D. -- http://mail.python.org/m

Python Threading

2006-09-20 Thread daniel
Hello, Can anyone explain the main points in working with threads in Python. Why use threading and not Thread.I have read an article that i have to subclass the Thread class and override some function. -- http://mail.python.org/mailman/listinfo/python-list

anybody using python 2.5 that raises error while importing?

2006-09-22 Thread daniel
there's a dll extension used to be imported with no error under version 2.4.3, but the new python complains that the name of the module can't be found. seems not mentioned in the official documentation, any work around to fix the issue without switching back to the old version? tk

Re: anybody using python 2.5 that raises error while importing?

2006-09-23 Thread daniel
John Machin wrote: > daniel wrote: > > there's a dll extension used to be imported with no error under version > > 2.4.3, but the new python complains that the name of the module can't > > be found. seems not mentioned in the official documentation, any work >

Re: anybody using python 2.5 that raises error while importing?

2006-09-23 Thread daniel
o get my work done. thanks again.. daniel -- http://mail.python.org/mailman/listinfo/python-list

where the hell is the run command of PyPe editor?

2006-09-24 Thread daniel
I'm trying to use PyPe, but I just got so frustrated when attempting to run a script, this is the very first feature I would use for an editor, OMG. I browsed through every single menu item and gave up... any help would be appreciated, (the most silly question ever, sounds like a new computer use

where the hell is the run command of PyPe editor?

2006-09-24 Thread daniel
puter user. ;--() tks daniel -- http://mail.python.org/mailman/listinfo/python-list

why logging re-raise my exception and can't be caught?

2006-09-30 Thread daniel
how could this happen, just weird.. can I make the logging module behave as I expected? tks in advance. daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: why logging re-raise my exception and can't be caught?

2006-09-30 Thread daniel
your help.. I do appreciate it. daniel -- http://mail.python.org/mailman/listinfo/python-list

import cx_Oracle fails!

2005-05-18 Thread Daniel
Hello from Brazil :-) I'm trying to bring cx_Oracle alive on my Python 2.4.1 @ HP-UX 11 (suckz) and Oracle 10.1.0 64bits without success I've already tryied the suggestions from Bernard Delmée and Martin v. Löwis (topic "Python 2.3b1 + cx_oracle 3.0 on HP-UX"), but it didn't work, even when I rec

Re: import cx_Oracle fails!

2005-05-19 Thread Daniel
Yes dude, it worked! :-) Thank you very much (Muito obrigado!!!) -- http://mail.python.org/mailman/listinfo/python-list

Re: import cx_Oracle fails!

2005-05-19 Thread Daniel
And, completing my answer, I'm sending you all how I finally got the Python 2.4.1 and cx_Oracle-4.1 running on my HP-UX (sukz) box: Box: HP-UX B.11.11 Compiling Python 2.4.1 with gcc 3.4.3 = ./configure --with-libs='-lcl' Added Makefile options: CC=

Re: import cx_Oracle fails!

2005-05-25 Thread Daniel
Hi Bernard My system is a PA 8K series with 4096 MB and 2 processors, running 64 bit mode OS. I only created the recipe above after 1 week of mistakes :-), but I don't know if it will work with your branch of patches @ 11.23 version. I really hate HP-UX >-(, god bless BSD!!! :-D -- http://mai

Changing entities

2005-06-08 Thread Daniel
Hello all I need to build a program that check the sintax in a line: SIZE (1 BYTE) and change the correct number of bytes to the following format: SIZE(1) without the "BYTE" word. But, the number of bytes can be over 3 digits, and the entitie can't have spaces but the correct number of bytes i

Re: Changing entities

2005-06-09 Thread Daniel
Hi Kent Thanks for your help, it worked sucessfully. I have another question, I think it is a stupid and simple but... I need match a regular expression, change it erasing the other strings after this. Just like: a = "I'm going send to out of space, find another race" And I want to match "space

Re: Changing entities

2005-06-10 Thread Daniel
Hi Kent This isn't work with the following line: FieldGraphic56::= GraphicString EBCDIC BC= " " SIZE (56 BYTES) >>> byter = re.compile(r'SIZE \((\d+) BYTE\)') >>> s = 'SIZE (1 BYTE)' >>> byter.sub(r'SIZE(\1)', s) 'SIZE(1)' >>> byter.sub(r'SIZE(\1)', line) 'FieldGraphic56::= Gr

Re: Changing entities

2005-06-10 Thread Daniel
Hi Kent This isn't work with the following line: FieldGraphic56::= GraphicString EBCDIC BC= " " SIZE (56 BYTES) >>> byter = re.compile(r'SIZE \((\d+) BYTE\)') >>> s = 'SIZE (1 BYTE)' >>> byter.sub(r'SIZE(\1)', s) 'SIZE(1)' >>> byter.sub(r'SIZE(\1)', line) 'FieldGraphic56::= Gr

using Mac OS X CoreGraphics via ctypes

2007-06-14 Thread Daniel
mberOfPages method? cglib.CGPDFDocumentRelease(pdf) # END CODE [0] Splitting a PDF File <http://developer.apple.com/graphicsimaging/ pythonandquartz.html> Thanks in advance for any hints you can provide. ~ Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: using Mac OS X CoreGraphics via ctypes

2007-06-15 Thread Daniel
when I try passing it directly as if it were a constant: GCS_RGB = cglib.kCGColorSpaceGenericRGB cs = cglib.CGColorSpaceCreateWithName(GCS_RGB) I get a segfault too. ctypes said kCGColorSpaceGenericRGB was a function pointer, so I thought maybe I needed to call it to get the value (not ve

Re: using Mac OS X CoreGraphics via ctypes

2007-06-18 Thread Daniel
On Jun 18, 6:07 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > Daniel wrote: > >> > # the next line causes a segfault - what's the right way to do this? > >> > #GCS_RGB = cglib.kCGColorSpaceGenericRGB() > > >> Usually, thi

Re: Pretty Printing Like Tidy for HTML

2007-07-07 Thread Daniel
On Sat, 07 Jul 2007 21:35:40 +0300, David <[EMAIL PROTECTED]> wrote: > > All, > > Is there a pretty printing utility for Python, something like Tidy for > HTML? > > That will change: > > xp=self.uleft[0]+percentx*(self.xwidth) > > To: > > xp = self.uleft[0] + percentx * (self.xwi

Re: What is the most efficient way to test for False in a list?

2007-07-08 Thread Daniel
On Mon, 09 Jul 2007 06:21:31 +0300, Simon Forman <[EMAIL PROTECTED]> wrote: > > On Jul 8, 7:43 pm, lex <[EMAIL PROTECTED]> wrote: >> Of course there is the always the iteration method: >> >> list = [1, True, True, False, False, True] >> status = True >> for each in list: >> status = status a

Re: bool behavior in Python 3000?

2007-07-10 Thread Daniel
>> > Do you care to explain what is broken? >> My preference would be for the arithmetic operations *,+,- >> to be given the standard interpretation for a two element >> boolean algebra: >> http://en.wikipedia.org/wiki/Two-element_Boolean_algebra > > If I understand this right, the biggest differ

Re: Getting values out of a CSV

2007-07-12 Thread Daniel
On Fri, 13 Jul 2007 05:59:53 +0300, <[EMAIL PROTECTED]> wrote: > > How do I access the value in the second row in the first position of a > CSV? Or the 3rd row, in the fifth position? > > a,b,c,d,e,f,g,h,i > j,k,l,m,n,o,p,q,r > r,s,t,v,w,x,y,z > > I'd want to get at "j" and "w". I know I can do >

Re: Getting values out of a CSV

2007-07-12 Thread Daniel
On Fri, 13 Jul 2007 08:51:25 +0300, Gabriel Genellina <[EMAIL PROTECTED]> wrote: >> data = [row for row in csv.reader(open('some.csv', 'rb')) > > Note that every time you see [x for x in ...] with no condition, you can > write list(...) instead - more clear, and faster. > > data = list(csv.read

Re: Getting values out of a CSV

2007-07-13 Thread Daniel
>> > Note that every time you see [x for x in ...] with no condition, you >> can >> > write list(...) instead - more clear, and faster. >> > >> > data = list(csv.reader(open('some.csv', 'rb'))) >> >> Faster? No. List Comprehensions are faster. > > [EMAIL PROTECTED] pdfps $ python -m timeit -c 'da

Re: Getting values out of a CSV

2007-07-13 Thread Daniel
On Fri, 13 Jul 2007 16:18:38 +0300, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: >> $ python -m timeit -c 'import csv; data = >> list(csv.reader(open("some.csv", >> "rb")))' >> 1 loops, best of 3: 44 usec per loop >> $ python -m timeit -c 'import csv; data = [row for row in >> csv.re

Re: NoneType object not iterable

2007-07-13 Thread Daniel
On Fri, 13 Jul 2007 20:44:13 +0300, <[EMAIL PROTECTED]> wrote: > > Hi! > My code is > > > db = {} > > >> def display(): >> keyList = db.keys() >> sortedList = keyList.sort() >> for name in sortedList: >> line = 'Name: %s, Number: %s' % (name, db[name]) >> print line.r

Re: NoneType object not iterable

2007-07-13 Thread Daniel
On Fri, 13 Jul 2007 21:13:20 +0300, Bjoern Schliessmann <[EMAIL PROTECTED]> wrote: > > Daniel wrote: > >> db is out of scope, you have to pass it to the function: > > What's wrong about module attributes? > I made a mistake -- http://mail.python.org/mailman/listinfo/python-list

Re: Dynamic method

2007-07-16 Thread Daniel
Type(fun, f, Foo) >>> f.fun() <__main__.MyCallable object at 0x648d0> <__main__.Foo object at 0x64810> >>> ~ Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: a=0100; print a ; 64 how to reverse this?

2007-07-17 Thread Daniel
On Tue, 17 Jul 2007 14:09:35 +0300, mosi <[EMAIL PROTECTED]> wrote: > > Problem: > how to get binary from integer and vice versa? > The simplest way I know is: > a = 0100 > a > 64 > > but: > a = 100 (I want binary number) > does not work that way. > > a.__hex__ exists > a.__oct__ exists > > but

Re: a=0100; print a ; 64 how to reverse this?

2007-07-17 Thread Daniel
On Tue, 17 Jul 2007 14:09:35 +0300, mosi <[EMAIL PROTECTED]> wrote: > > Problem: > how to get binary from integer and vice versa? > The simplest way I know is: > a = 0100 > a > 64 Also that is not binary - that is octal, binary would be: '0100' (denoted as a string, since 0100 in octal

Re: a=0100; print a ; 64 how to reverse this?

2007-07-17 Thread Daniel
On Tue, 17 Jul 2007 21:22:03 +0300, Wildemar Wildenburger <[EMAIL PROTECTED]> wrote: > > Bruno Desthuilliers wrote: >> mosi a écrit : >> >>> Problem: >>> how to get binary from integer and vice versa? >>> [snip] >>> What`s the simplest way to do this? >>> >> >> [EMAIL PROTECTED]:~$ python >> Pyt

Re: accessing javascript variables within psp code

2007-07-17 Thread Daniel
On Wed, 18 Jul 2007 04:29:27 +0300, BAnderton <[EMAIL PROTECTED]> wrote: > > Hello all, > > Question: Is there any way to access a javascript variable from > within psp code? > > > I'm aware of how to do the reverse of this (js_var='<%=psp_var%>'). > > > Here's a non-working example of what I'm

Re: Sort lines in a text file

2007-07-22 Thread Daniel
On Sun, 22 Jul 2007 06:03:17 +0300, leegold <[EMAIL PROTECTED]> wrote: > say I have a text file: > > zz3 uaa4a ss 7 uu > zz 3 66 ppazz9 > a0zz0 > > I want to sort the text file. I want the key to be the number after > the two "zz". Or I guess a string of two zz then a numberS

Re: Sort lines in a text file

2007-07-22 Thread Daniel
On Sun, 22 Jul 2007 06:03:17 +0300, leegold <[EMAIL PROTECTED]> wrote: > say I have a text file: > > zz3 uaa4a ss 7 uu > zz 3 66 ppazz9 > a0zz0 > > I want to sort the text file. I want the key to be the number after > the two "zz". Or I guess a string of two zz then a numberS

Re: Why PHP is so much more popular for web-development

2007-07-25 Thread Daniel
On Wed, 25 Jul 2007 20:42:54 +0300, walterbyrd <[EMAIL PROTECTED]> wrote: > I'm fairly new to web-development, and I'm trying out different > technologies. Some people wonder why PHP is so popular, when the > language is flawed in so many ways. To me, it's obvious: it's because > it's much easie

Re: defaultdict of arbitrary depth

2007-08-21 Thread Daniel
Any reason why this wouldn't work? >>> from collections import defaultdict >>> def rdict(*args, **kw): ... return defaultdict(rdict, *args, **kw) ... >>> d = rdict() >>> d[1][2][3][4][5] # ... defaultdict(, {}) ~ Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: IEC - cannot find button

2007-10-29 Thread daniel
#x27;t working. I guess it could have to do w/ privileges. I'm using a VPN connection. I tried turning off my antivirus software before running the module. I can click on the button I want manually, and get the page I need, so I wonder if I can adjust some settings to allow Python to take control of certain things? That or I thought it might have to do w/ a javascript error. By looking at the tag, does 'PDF Preview' look like the name of the button or the button caption? Let me know what you think. Daniel -- http://mail.python.org/mailman/listinfo/python-list

trouble with PAMIE

2007-10-29 Thread daniel
I'm using PAMIE to automate some web browsing. My problem is with the buttonClick() method. It seems to work unless the button is supposed to open a new window, in which case nothing happens. There is no error message. Any ideas? Daniel -- http://mail.python.org/mailman/listinfo/python-list

trouble with PAMIE

2007-10-29 Thread daniel
I'm trying to use PAMIE to automate some web browsing. My problem is with the buttonClick() method; it seems to work unless the button is supposed to open a new window. Specifically, the button is supposed to open a PDF Preview in a new window. Any ideas? Daniel -- http://mail.pytho

trouble with PAMIE

2007-10-29 Thread daniel
I'm trying to use PAMIE to automate some web browsing. My problem is with the buttonClick() method; it doesn't seem to work when the button is supposed to open a new window. For example, I can use it to submit a username and password and advance to the next page but it fails on a button that opens

Re: My python programs need a GUI, wxPython or PyQt4?

2007-01-23 Thread Daniel
ter game company. 2. There seems to be a lot of documentation available for PyQt4. 3. PyQt4 seems to be easier to learn. 4. My programs does not need to support Linux or Unix. Or am I wrong? Flame people, for the love of God, flame!! :) -Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: While loop with "or"? Please help!

2007-01-25 Thread Daniel
2007-01-25 11:26:09 [EMAIL PROTECTED] wrote in message <[EMAIL PROTECTED]> > Hmm, my while loop with "or" doesn't seem to work as I want it to... > How do I tell the while loop to only accept "Y" or "y" or "N" or "n" > input from the str(raw_input)? > > Thank's in advance! > > Snippet of code:

Re: running applications in python

2007-01-25 Thread Daniel
2007-01-25 18:28:44 lee <[EMAIL PROTECTED]> wrote in message <[EMAIL PROTECTED]> > how can i run or open a windows application from the python prompt?for > e.g.mediaplayer opening,folder acess etc Here's another way of doing it: import os TheCommandIwantTorun = '"C:\Program\Windows Media Player

boolean flag vs threading.Event

2007-02-27 Thread Daniel
(such as my boolean 'terminated' flag). If that is the case, why bother using threading.Event for this purpose? Thanks, ~ Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: boolean flag vs threading.Event

2007-02-27 Thread Daniel
> But what are you gaining, really [by using a boolean flag instead of an > Event]? I agree Chris, the Event is better and it certainly does not add much if any overhead. Thanks for the response. ~ Daniel -- http://mail.python.org/mailman/listinfo/python-list

what is the difference between tuple and list?

2006-05-16 Thread daniel
is there any typical usage that shows their difference? thanks daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: what is the difference between tuple and list?

2006-05-16 Thread daniel
thank you all for replying, I'm new to python, and just reading the python tutorial now. I did not expect the FAQ to contain any relevant topics, so thanks Simon... your comments did make sense, I should have read the tutorial more thoroughly, It's not a good question, I admit. ;-) English is not

logging multiple messages

2009-01-15 Thread Daniel
I was fighting with a problem all day that was producing multiple messages in my logging output. The problem was related to the fact that I was defining logging handlers multiple times. I found the following posting from a few years ago that related to my problem: http://groups.google.com/group/

where is handle_timeout in SocketServer

2009-02-11 Thread Daniel
I've just been reading the docs to help me with a SocketServer issue. I found in the docs (http://docs.python.org/library/socketserver.html) a reference to a member attribute timeout and a member function handle_timeout() is made. I am using python 2.5 and there's no indication that these were add

Re: where is handle_timeout in SocketServer

2009-02-11 Thread Daniel
On Feb 11, 4:01 pm, Daniel wrote: > I've just been reading the docs to help me with a SocketServer issue. > I found in the docs (http://docs.python.org/library/socketserver.html) > a reference to a member attribute timeout and a member function > handle_timeout() is made.  I am

Python syntax question

2008-10-08 Thread Daniel
I hope this question is OK for this list. I've downloaded Rpyc and placed it in my site packages dir. On some machines it works fine, on others not so much. Here is one error I get when I try to import it: >>> import Rpyc Traceback (most recent call last): File "", line 1, in File "C:\Pyth

Re: Python syntax question

2008-10-08 Thread Daniel
On Oct 8, 12:07 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > On Wed, 08 Oct 2008 11:02:49 -0700, Daniel wrote: > > Here is one error I get when I try to import it: > > >>>> import Rpyc > > Traceback (most recent call last): > >

Re: Python syntax question

2008-10-13 Thread Daniel
> > David Blubaugh > > -Original Message- > From: Daniel [mailto:[EMAIL PROTECTED] > Sent: Wednesday, October 08, 2008 3:11 PM > To: [EMAIL PROTECTED] > Subject: Re: Python syntax question > > On Oct 8, 12:07 pm, Marc 'BlackJack' Rintsch <[EMAIL PRO

Python logging and ThreadingTCPServer

2008-10-17 Thread Daniel
rious strange characters and space. Sometimes it seems that the first process never is able to write to the log file after the second process starts writing. Is this a known issue/bug? Are there any known workarounds? Thanks, Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: Interface to Matlab

2008-10-17 Thread Daniel
oogled "python matlab" and "java matlab" Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: Interface to Matlab

2008-10-22 Thread Daniel
On Oct 17, 2:26 pm, Lawrence D'Oliveiro <[EMAIL PROTECTED] central.gen.new_zealand> wrote: > In message > <[EMAIL PROTECTED]>, Daniel > wrote: > > > Have you looked at > >http://www.scipy.org/ > > andhttp://matplotlib.sourceforge.net/ > > >

Sync paramstyle between sqlite and mysql

2008-11-10 Thread Daniel
Hello, I'm developing an application that accesses both a MySQL and an SQLite database. I would like to have named parameters in my SQL and have found the following: For MySQL my named parameters need to look like this: %(paramname)s For SQLite my named parameters need to look like this: :paramn

Re: Remote control of firefox (mozilla) from a python program

2008-11-10 Thread Daniel
On Nov 10, 9:23 am, Scott <[EMAIL PROTECTED]> wrote: > I have a requirement to control a firefox web browser from an external > python program.  The python program running under linux from a command > shell needs to first find all open firefox web browser windows read > the URL currently displayed

Re: Sync paramstyle between sqlite and mysql

2008-11-11 Thread Daniel
On Nov 10, 11:00 am, Daniel <[EMAIL PROTECTED]> wrote: > Hello, > > I'm developing an application that accesses both a MySQL and an SQLite > database.  I would like to have named parameters in my SQL and have > found the following: > > For MySQL my named p

how to acces the block inside of a context manager as sourcecode

2008-11-18 Thread Daniel
k.extract_stack() print f[0] def __enter__(self): pass def __exit__(self,type,value,traceback): if type is not None: print 'exception' pass Any ideas? Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: how to acces the block inside of a context manager as sourcecode

2008-11-19 Thread Daniel
umentation (it contains many parameters that need to be well documented), so I print the source code, cut it out and glue it into my lab notebook. Now I want to automate this process, i.e. the dataStore should print the sourcecode. Daniel > There isn't a solution in the general case, beca

Re: how to acces the block inside of a context manager as sourcecode

2008-11-20 Thread Daniel
part of the report. Thank you for your ideas Daniel class CM( object ): def __enter__(self): self.startline= inspect.stack( )[ 1 ][ 0 ].f_lineno print 'startline',self.startline filename = inspect.stack( )[-1][1] def getIndentation(line):

Re: starting a Python 2.5 executable without the DOS window

2009-02-27 Thread Daniel
On Feb 27, 8:19 am, Vlastimil Brom wrote: > >> 2009/2/27 Greg Miller : > >> > I am working on a program that controls a piece of equipment.  The GUI/ > >> > control software is written with Python2.5/wxPython.  I would like to > >> > know if there is a way of starting the GUI without the DOS windo

package questions

2009-05-22 Thread Daniel
Hello, I've posted about this before, but after reading the docs, I have a few more questions here are the docs: http://docs.python.org/tutorial/modules.html#packages here is my previous post: http://groups.google.com/group/comp.lang.python/browse_thread/thread/3a352159f6828eb9/cda8395d36827d20 I

Re: package questions

2009-05-22 Thread Daniel
On May 22, 11:29 am, Scott David Daniels wrote: > Daniel wrote: > > Hello, > > > I've posted about this before, but after reading the docs, I have a > > few more questions > > here are the docs:http://docs.python.org/tutorial/modules.html#packages &g

Re: package questions

2009-05-22 Thread Daniel
On May 22, 3:37 pm, Scott David Daniels wrote: > Daniel wrote: > > I'm on WinXP using Python 2.5  Sorry I didn't mention that at first. > > Generally, you want the full version number (my 2.5 is 2.5.4). > However, I set up your demo setup, and found that 2.6.2 worke

  1   2   3   4   5   6   7   8   9   10   >