Re: Is there a programming language that is combination of Python and Basic?

2009-04-18 Thread Tim Rowe
y evidence for that? There's a lot of typing in Ada (it shows its Pascal roots) but in all the studies I've seen Ada production code has consistently shown fewer errors than the more concise C/C++ family of languages. -- Tim Rowe -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a programming language that is combination of Python and Basic?

2009-04-18 Thread Tim Chase
SCREEN 13 PSET 160,100,255 Maybe, maybe not. What on earth does it do? I believe this attempts to set screen-mode 13 (I'm surprised this isn't a hex constant, though that may be a (Q)Basic quirk), which for older VGA cards was 320x200 with 256-colors. It then looks like it sets a point at

Re: Is there a programming language that is combination of Python and Basic?

2009-04-18 Thread Tim Rowe
27;ll see that it pretty much *is* Modula2". So whether Modula2 was a direct influence or not, it seems to have found its way in. -- Tim Rowe -- http://mail.python.org/mailman/listinfo/python-list

Re: Too early implementation

2009-04-18 Thread Tim Wintle
and approached the problem from various angles ;-) Tim Wintle -- http://mail.python.org/mailman/listinfo/python-list

Re: [OT] large db question about no joins

2009-04-18 Thread Tim Wintle
ic. (I'm a relational database user btw, but it seems to happen with object database people too - we get so used to our own paradigm that we don't think about other ways of doing the task) Tim Wintle -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a programming language that is combination of Python and Basic?

2009-04-18 Thread Tim Wintle
that I feel jump is more than justified in some situations (when it's jumping to within 10-20 lines of the start position, and it's a routine that needs to be highly optimised - I'm thinking tail recursion etc.) (btw, how come nobody has mentioned python bytecode? Most flow control is

Re: Is there a programming language that is combination of Python and Basic?

2009-04-19 Thread Tim Wintle
gt; raise Exception > break > continue > if... elif... else... > for... else... > etc." Ah - apologies Tim -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a programming language that is combination of Python and Basic?

2009-04-19 Thread Tim Hoffman
I started my commercial programming in Business Basic, (actually MAI Basic 4, and it's equivalent on primos (can't think of it's name at the moment) then later BBX (Basis) We ran the same code (all development on MAI, and then translated the few differences programatically between MAI and Prime) a

Re: Is there a programming language that is combination of Python and Basic?

2009-04-19 Thread Tim Rowe
umps are bad. And then by showing the conclusion is false, you believe you have shown a contradiction? Try looking up "Affirming the consequent"! GOTO is an /unstructured/ jump. Raise, break, continue, if, for and so an are all /structured/ jumps. -- Tim Rowe -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a programming language that is combination of Python and Basic?

2009-04-20 Thread Tim Rowe
lear that you know the difference. Sorry for the confusion. -- Tim Rowe -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a programming language that is combination of Python and Basic?

2009-04-20 Thread Tim Rowe
: int frodo() { int rval = 0; if ((bilbo() == 0) || (gandalf() == 0) { /* lot's of code here */ } else rval = -1; return rval; } I'd be inclined to do it that way even if multiple exits were allowed; it just seems so much clearer. -- Tim Rowe -- http://mail.python.org/mailman/listinfo/python-list

Re: How save clipboard data as bmp file

2009-04-20 Thread Tim Golden
gopal mishra wrote: I am trying to save my clipboard data (format is CF_ENHMETAFILE) as BitMap file (.BMP). Have a look at PIL's ImageGrab module: http://www.pythonware.com/library/pil/handbook/imagegrab.htm I'm not sure if the current version supports metafiles, but it's easy enough to try.

Re: Python interpreter speed

2009-04-20 Thread Tim Wintle
ticed) You'll also probably notice that many of python's types (list, dict, etc.) might be slower for small sizes than Java's are - that's because they have been optimised to perform efficiently at any size, at the expense of being slightly less efficient than they could be for small sizes) Tim Wintle -- http://mail.python.org/mailman/listinfo/python-list

Re: The Python standard library and PEP8

2009-04-20 Thread Tim Wintle
On Sun, 2009-04-19 at 18:43 +0200, Emmanuel Surleau wrote: > Hi there, > > Exploring the Python standard library, I was surprised to see that several > packages (ConfigParser, logging...) use mixed case for methods all over the > place. I assume that they were written back when the Python stylin

Re: Python interpreter speed

2009-04-20 Thread Tim Roberts
compiled, exactly like Java. There is also IronPython, which is Python for the .NET framework. It compiles to a different intermediate language, which is also compiled at execution time to machine code. -- Tim Roberts, [email protected] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: generating random tuples in python

2009-04-20 Thread Tim Roberts
umbers strictly between 0 and 1 (inclusive)? In doing so, you will be making the numbers non-random. Statistically speaking, a sufficiently long series of random numbers will often have short sequences that are very close to each other. -- Tim Roberts, [email protected] Providenza & Boekelhe

Re: How to save clipboard data as bmp file

2009-04-21 Thread Tim Golden
gopal mishra wrote: I have used ImageGrab.grabclipboard() to get the clipboard image data, it returns None. This function only supports if the clipboard data format is CF_BITMAP. Is there any way to save clipboard data format CF_ENHMETAFILE to bitmap file using win32 programming. Well I'm symp

Re:

2009-04-21 Thread Tim Golden
karlos barlos wrote: hello to everybody... having problem withe this code : dom = raw_input("The Domain name..:") ad_user.Put('userPrincipalName',user['login']+'@(['dom']) but it wont change whay ? Some more context would help, including a code fragment and traceback if there is a

Problem updating AD user [was: Re:]

2009-04-21 Thread Tim Golden
[... snip vague question re AD user update ...] ... and please add a (useful) subject line TJG -- http://mail.python.org/mailman/listinfo/python-list

Re:

2009-04-21 Thread Tim Golden
karlos barlos wrote: ok sorry TIM I just took some piece of code that ADDs users to AD import win32com,win32com.client def add_acct(location,account): ad_obj=win32com.client.GetObject(location) ad_user=ad_obj.Create('user','c

Re: Accessing items in nested tuples

2009-04-21 Thread Tim Chase
IDLE 1.2.1 data=(("aa", ("bb", "cc", "dd")), ("ee", ("ff", "gg", "hh")), ("ii", ("jj", "kk", "ll"))) print data[0] ('aa', ('bb', 'cc', 'dd')) print data[1] ('ee', ('ff', 'gg', 'hh')) etc... I would like to be able to access the dataitem "aa" or "bb", "cc", "dd" individualy. You're s

Re: python command not working

2009-04-22 Thread Tim Golden
83nini wrote: On 22 Apr, 10:04, David Cournapeau wrote: On Wed, Apr 22, 2009 at 4:44 PM, 83nini <[email protected]> wrote: thanks for the tip, how do i add the path of python into my %PATH%? >From the command line (and from memory, I don't use windows regularly): set PATH=C:\python25;%PATH%

Re: Would you support adding UNC support to os.path on Windows?

2009-04-22 Thread Tim Golden
Larry Hastings wrote: I've written a patch for Python 3.1 that changes os.path so it handles UNC paths on Windows. You can read about it at the Python bug tracker: http://bugs.python.org/issue5799 I'd like to gauge community interest in the patch. After all, it's has been declined bef

Re: best "void" return of a member function

2009-04-22 Thread Tim Rowe
top of that. Most Ada MS Windows thick wrappers (ie, ones that feel natural to Ada) are built on top of Win32Ada, which stays as close to the underlying C interface as it can. -- Tim Rowe -- http://mail.python.org/mailman/listinfo/python-list

Re: What is the best framework or module in Python for a small GUI based application development?

2009-04-22 Thread Tim Chase
My requirement is to write an application which is GUI based has to run on browsers. Could you tell me which one would be suitable for this? These are generally 2 different things: either you're writing a local GUI rich-client (in which case, use the GuiProgramming wiki link Mike sent), or yo

Re: Learning Python the quick way

2009-04-24 Thread Tim Chase
I am not sure what will happen if I do the programing in python the find the program doesn't deliver the desired performance due to lack of a good compiler. I've rarely found this to be a problem unless you're doing CPU-intensive work. However, the usual workflow involves: 1) code it in Pyt

Re: http web fetch question

2009-04-24 Thread Tim Roberts
every hour for >10 hours straight... Really? s = sched.scheduler( time.time, time.sleep ) for hour in range(10): s.enter( 3600 * hour, 1, fetch_website, () ) s.run() >and why this is different than using something like time.sleep(). It's not different. sched.sche

Re: Learning Python the quick way

2009-04-25 Thread Tim Chase
Esmail wrote: Tim Chase wrote: However the first rule: profile first! Do you have a favorite profiling tool? What should someone new to Python (but not programming) use? I personally use the cheapo method of dropping in a few "print" statements to dump where I currently am in th

Re: Lisp mentality vs. Python mentality

2009-04-26 Thread Tim Chase
I liked very much your implementation for the compare function, it is very short and at the same time readable: def compare(a, b, comp=operator.eq): return (len(a) == len(b)) and all(comp(*t) for t in zip(a, b)) But I have only one problem, it is suboptimal, in the sense that:

Re: question about class vs class at

2009-04-26 Thread Tim Roberts
the output of the __repr__ function of the class. -- Tim Roberts, [email protected] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: CSV performance

2009-04-27 Thread Tim Chase
I'm using the CSV library to process a large amount of data - 28 files, each of 130MB. Just reading in the data from one file and filing it into very simple data structures (numpy arrays and a cstringio) takes around 10 seconds. If I just slurp one file into a string, it only takes about a second,

Re: CSV performance

2009-04-27 Thread Tim Chase
I have tried running it just on the csv read: ... print "finished: %f.2" % (t1 - t0) I presume you wanted "%.2f" here. :) $ ./largefilespeedtest.py working at file largefile.txt finished: 3.86.2 So just the CSV processing of the file takes just shy of 4 seconds and you said that just

Re: Web based application development using python

2009-04-28 Thread Tim Hoffman
Calling mod_python a web framework is a bit of a stretch. if you want to work at that level though mod_wsgi is worth a look, on top of that you can put a range of frameworks such as repose, django, turbo gears etc.. T On Apr 28, 12:55 pm, Rahul wrote: > > > 2) I have my web based applicat

Re: Web based application development using python

2009-04-28 Thread Tim Hoffman
On Apr 28, 7:50 pm, Rahul wrote: > On Apr 28, 1:02 pm, Marco Mariani wrote: > > > > > Rahul wrote: > > > 1) Do you have any idea about web based support (like mod_python) > > > provided by python.org (official web site) > > > > Details: - As we know mod_python is used for embeding python code int

Re: How to locate the bit in bits string?

2009-04-28 Thread Tim Chase
Li Wang wrote: Hi: If I use an integer to represent bits: e.g. 99 represents '1100011' How can I locate, say the second bit of 99(i.e. '1')? Although bin(99)[4] could be used to locate it, this transform cost too much memory (99 only needs 2Bytes, while string '1100011' needs 7Bytes). Anyone

Re: How to locate the bit in bits string?

2009-04-28 Thread Tim Chase
Li Wang wrote: 2009/4/29 Tim Chase : Li Wang wrote: If I use an integer to represent bits: [snip] Hummm, I have tried this method too, the problem is its time complexity. If the length of my bits is n, then the time complexity is O(n). When I tried to implement this in practice, it did

Re: How to locate the bit in bits string?

2009-04-28 Thread Tim Chase
data = file('source.bin').read() def get_bit(source, bit): idx, bit = divmod(bit, 8) byte = ord(source[len(source) - (1+idx)]) return (byte >> bit) & 1 My understanding is: when doing this step, every bit in the byte will be shifted bit-long. If it is get_bit(data, 100), and the sourc

Re: How to locate the bit in bits string?

2009-04-28 Thread Tim Chase
I want to concatenate two bits string together: say we have '1001' and '111' which are represented in integer. I want to concatenate them to '100' (also in integer form), my method is: ('1001' << 3) | 111 which is very time consuming. You omit some key details -- namely how do you know that

Re: how to coerce to a string in Python?

2009-04-28 Thread Tim Chase
Mark Tarver wrote: On 28 Apr, 19:58, Mark Tarver wrote: How do you coerce an object to a string in Python? 123 --> "1 2 3" [1,2,3] -> "[1,2,3]" etc Ah , 'str' a pure guess but it worked. You may also be interested in the repr() function. I'm afraid neither will give you 123 --> "1 2

Re: How to locate the bit in bits string?

2009-04-28 Thread Tim Chase
You omit some key details -- namely how do you know that "1001" is 4 bits and not "1001" (8-bits)? If it's a string (as your current code shows), you can determine the length. However, if they are actually ints, your code should work fine & be O(1). Actually, what I have is a list of inte

Re: Please explain this strange Python behaviour

2009-04-30 Thread Tim Chase
Train Bwister wrote: Please explain: http://python.pastebin.com/m401cf94d IMHO this behaviour is anything but the usual straight forward and obvious way of Python. Can you please point out the benefits of this behaviour? http://docs.python.org/tutorial/controlflow.html#more-on-defining-functi

Re: Please explain this strange Python behaviour

2009-04-30 Thread Tim Chase
Duncan Booth wrote: Tim Chase wrote: There _are_ cases where it's a useful behavior, but they're rare, so I don't advocate getting rid of it. But it is enough of a beginner gotcha that it really should be in the Python FAQ at www.python.org/doc/faq/general/ That'

Re: [Python-Dev] .pth files are evil

2009-05-01 Thread Tim Golden
Chris Withers wrote: I'll say! I think .pth files are absolute evil and I wish they could just be banned. +1 on anything that makes them closer to going away or reduces the possibility of yet another similar feature from hurting the comprehensibility of a python setup. I've seen this view e

Re: Accessing files in a directory which is a shortcut link (Windows)

2009-05-02 Thread Tim Golden
jorma kala wrote: Hi, I'd like to process files in a directory which is in fact a short cut link to another directory (under windows XP). If the path to the directory is for instance called c:\test. I have tried both following code snipets for printing all names of files in the directory: ++ sni

Re: Accessing files in a directory which is a shortcut link (Windows)

2009-05-02 Thread Tim Golden
Tim Golden wrote: Windows shortcuts are Shell (ie GUI Desktop) objects rather than filesystem objects. The filesystem doesn't treat them specially; just returns the .lnk file (or whatever it's called). As a caveat: they don't actually *have* to be called .lnk (altho' the

Re: Convert variable directly into a string (no ASCII)

2009-05-02 Thread Tim Roberts
.pack( 'BBB', a, b, c ) If you need them as 16-bit ints, you can use H instead of B. -- Tim Roberts, [email protected] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Self function

2009-05-04 Thread Tim Wintle
On Mon, 2009-05-04 at 19:51 +0100, Arnaud Delobelle wrote: > > Bearophile, there is a thread on python-ideas about tail-call > optimization at the moment. Oooh - haven't noticed that (and don't have time to follow it), but has anyone seen the results I got a week or so ago from briefly playing wi

Re: SQL and CSV

2009-05-05 Thread Tim Golden
Nick wrote: I have a requirement to read a CSV file. Normally, no problem, just import CSV and slurp the file up. However, in this case I want to filter out lines that have fields set to particular values. It would be neat to be able to do something like this. select * from test.csv where stat

Re: SQL and CSV

2009-05-05 Thread Tim Golden
Nick wrote: Part of the problem is that the 'selection' needs to be in a config file. I can put the if row['status'] != 'Cancelled': return True into a config, read it and eval it, but its not quite as clean as an sql route. Still not clear what the restriction is. If you were writing SQL you'

Re: Which one is best Python or Java for developing GUI applications?

2009-05-06 Thread Tim Rowe
2009/5/6 Dennis Lee Bieber : > (the "near" is because I feel Ada is > stricter than any other language) Try SPARK -- it's Ada based, but /much/ stricter. It's just right for some really critical stuff, but is no sort of an answer to "Which one is best Python or Jav

Re: Copy & Paste in a Dos box (was: Pyhton script to call another program)

2009-05-06 Thread Tim Chase
for windows this works: (can't cut and paste from a dos box!###%*&!!!) Depending on how it was spawned, you can either right-click in the window and choose Mark/Paste (when marking, use to terminate the selection; and selections are blockwise rectangular rather than linewise or characterwise

Re: Parsing text

2009-05-06 Thread Tim Chase
I'm trying to write a fairly basic text parser to split up scenes and acts in plays to put them into XML. I've managed to get the text split into the blocks of scenes and acts and returned correctly but I'm trying to refine this and get the relevant scene number when the split is made but I keep g

Re: hex(dummy)[2:] - issue...

2009-05-06 Thread Tim Chase
I need some advice :-) I'm using hex(dummy)[2:] to represent a color in hexadecimal format for the bgcolor in an html file. dummy is the color value in RGB of course... Now, if there's an R, G or B value of zero, this command only prints one single 0 instead of two. What's wrong with the code?

Re: How should I use grep from python?

2009-05-07 Thread Tim Chase
I'm writing a command-line application and I want to search through lots of text files for a string. Instead of writing the python code to do this, I want to use grep. This is the command I want to run: $ grep -l foo dir In other words, I want to list all files in the directory dir that contai

Re: ISO exemplary Python scripts

2009-05-08 Thread Tim Roberts
installed with your interpreter is one of the best repositories. It contains hundreds of working, well-tested scripts, most of which have the ability to run by themselves. -- Tim Roberts, [email protected] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: ISO exemplary Python scripts

2009-05-10 Thread Tim Roberts
the "Python way of thinking". Command-line argument processing is not a particularly unique task, so the same techniques that work for parsing things from files, or for handling arguments in a list, work equally well for handling arguments, especially with the help of getopt and optparse. -- Tim Roberts, [email protected] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: win32 How to make sure a file is completely written?

2009-05-11 Thread Tim Golden
justind wrote: Hello, I'm using http://code.activestate.com/recipes/156178/ to watch a folder in windows. Wow, that takes me back. There's a bit more info (and a different technique) here if you're interested: http://timgolden.me.uk/python/win32_how_do_i/watch_directory_for_changes.html Bu

[silly] Re: issue with twisted and reactor. Can't stop reactor

2009-05-11 Thread Tim Harig
On 2009-05-11, Gabriel wrote: > Subject: issue with twisted and reactor. Can't stop reactor Not having written anything using twisted I cannot help you much with your code; but, I cannot resist commenting about your subject line: I suspect that if are having an issue with your reactor after bein

piping input to an external script

2009-05-11 Thread Tim Arnold
able output. My subprocess code must be wrong, but I could use some help to see what the problem is. python2.5.1, freebsd6 thanks, --Tim -- http://mail.python.org/mailman/listinfo/python-list

Re: Complete frustration

2009-05-12 Thread Tim Golden
Dave Angel wrote: [... snip sound advice about file associations etc. ...] One thing to bear in mind is that any settings, however obtained, in the User part of the registry (HKCU\Software\) will override those in the Machine part of the registry (HKLM\Software...). If you think you've set t

Re: dict would be very slow for big data

2009-05-12 Thread Tim Chase
i am trying to insert a lot of data into a dict, which may be 10,000,000 level. after inserting 10 unit, the insert rate become very slow, 50,000/ s, and the entire time used for this task would be very long,also. would anyone know some solution for this case? As others have mentioned, you'v

Re: Help with a HTTP GET request

2009-05-12 Thread Tim Harig
On 2009-05-13, Paul Hemans wrote: > http://localhost/common/foxisapi.dll/tmsmail.x2.isapi? Note the entire URL. > So I am trying httplib I have encoded the GET request with urllib.quote urllib would be much easier if you don't need low level control -- it will automatically call httplib for you.

Re: Help with a HTTP GET request

2009-05-12 Thread Tim Harig
On 2009-05-13, Tim Harig wrote: > import urllib > url = > "http://localhost/common/foxisapi.dll/tmsmail.x2.isapi? content = urllib.urlopen(url).read() forgot to urlencode: host = "http://localhost"; request = r"""/common/foxisapi.dll/tmsmail.x2.isapi?

Re: Help with a HTTP GET request

2009-05-12 Thread Tim Harig
On 2009-05-13, Tim Harig wrote: > host = "http://localhost"; > request = r"""/common/foxisapi.dll/tmsmail.x2.isapi? schema='' class='replicateApplication.getChanges' /""" > url = host + urllib.quote(request) > content =

Re: piping input to an external script

2009-05-12 Thread Tim Arnold
"Dave Angel" wrote in message news:[email protected]... > Tim Arnold wrote: >> Hi, I have some html files that I want to validate by using an external >> script 'validate'. The html files need a doctype header attached before &

Re: about Python doc reader

2009-05-13 Thread Tim Golden
Shailja Gulati wrote: Hi , I am currently working on "Information retrieval from semi structured Documents" in which there is a need to read data from Resumes. Could anyone tell me is there any python API to read Word doc? If you haven't already, get hold of the pywin32 extensions: http:/

Re: (Winows) Finding out which process has locked a file.

2009-05-13 Thread Tim Golden
CinnamonDonkey wrote: Hi all, Does anyone know how I can programatically find out which process (resolved to human friendly string, i.e. executable) has a lock on a file. I have a script running which occassionally fails because it is trying to delete a file in use by another process. When this

Re: When *don't* I use 'self' in classes?

2009-05-13 Thread Tim Chase
e f = Foo() print dir(f) # has an "abc" but not an "xyz" f.test_me() So in your case, unless you *need* to keep the comport/baudrate around, I'd just use -tim DEFAULT_BAUD = 9600 class Foo: def __init__(self, comport): self.comport = comport

Re: please help with python program

2009-05-14 Thread Tim Golden
chedderslam wrote: IOError: [Errno 13] Permission denied: u'D:/My Music/Ani DiFranco/ Canon/Disc 1\\folder.jpg' I have removed the read-only attribute on the folder, and added "Everyone" with full control for security. Not sure what else to do. I would really like to get this working so any hel

Re: about Python doc reader

2009-05-14 Thread Tim Golden
[forwarding back to the list] Please reply to the list: I'm not the only person who can help, and I might not have the time even if I can. Shailja Gulati wrote: I have installed win32com but still not able to run tht code as its giving error File "readDocPython.py", line 1, in ? import

Re: about Python doc reader

2009-05-14 Thread Tim Golden
Shailja Gulati wrote: Sorry about mailing u Tim.It just happened by mistake. Reg win32api , i m still facing the same problem of Import error...Could anyone pls help?? m stuck Shailja. Did you download and install the download .exe from the link below? http://sourceforge.net/project/platfo

Re: python copy method alters type

2009-05-14 Thread Tim Chase
Zhenhai Zhang wrote: Really weired; Here is my code: a = ["a", 1, 3, 4] print "a:", a c = copy(a) Where do you get this copy() function? t...@rubbish:~$ python2.5 Python 2.5.4 (r254:67916, Feb 17 2009, 20:16:45) >>> help(copy) Traceback (most recent call last): Fil

Re: about Python doc reader

2009-05-14 Thread Tim Golden
norseman wrote: I did try these. Doc at once: outputs two x'0D' and the file. Then it appends x'0D' x'0D' x'0A' x'0D' x'0A' to end of file even though source file itself has no EOL. ( EOL is EndOfLine aka newline ) That's cr cr There are two blank lines at begining. cr

Re: (Windows) Finding out which process has locked a file.

2009-05-15 Thread Tim Golden
CinnamonDonkey wrote: > I have to say, this has got to be one of the > least helpful groups I am subscribed to. I'm genuinely surprised to hear you say that, especially about this thread to which you (who appear to be the OP) have received several replies all pointing you towards the sysinternals

Re: capture stdout and stderror from within a Windows Service?

2009-05-15 Thread Tim Golden
Chris Curvey wrote: Ahhh, Blake put me on the right track. If you want any of the streams, you have to supply values for all of them, like so: p = subprocess.Popen(step, shell=True stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.PIPE) (stdout, stderr) = p.com

Re: (Windows) Finding out which process has locked a file.

2009-05-15 Thread Tim Golden
CinnamonDonkey wrote: Thanx for the response Tim! :-) Great site! > I'm genuinely surprised to hear you say that... Early morning frustration... I appologise to all... you are totally right. Thank you to all for the responses. Well it's big of you to apologise. In return, I&

Re: ConfigParser and newlines

2009-05-15 Thread Tim Chase
test.cfg [Foo_Section] BODY = Line of text 1 Continuing Line of text 1 Executing the code === Python 2.5.1 Stackless 3.1b3 060516 (release25-maint, Mar 6 2009, 14:12:34) [GCC 4.3.0 20080428 (Red Hat 4.3.0-8)] on linux2 Type "help", "copyright", "credits

Re: Photoimage on button appears pixelated when button is disabled

2009-05-17 Thread Tim Golden
Dustan wrote: On May 15, 2:59 pm, Dustan wrote: In tkinter, when I place a photoimage on a button and disable the button, the image has background dots scattered through the image. Searching the web, I wasn't able to find any documentation on this behavior, nor how to turn it off. So here I am.

Re: Generating Tones With Python

2009-05-17 Thread Tim Harig
On 2009-05-18, Adam Gaskins wrote: > I am pretty sure this shouldn't be as hard as I'm making it to be, but > how does one go about generating tones of specific frequency, volume, and > L/R pan? I've been digging around the internet for info, and found a few This can be done with SDL which wou

Re: .pth in current directory: Why doesn't it work as the documentation says?

2009-05-18 Thread Tim Golden
David Lyon wrote: On Mon, 18 May 2009 14:34:33 +0200, Philipp Hagemeister wrote: Yes, but that processing will add /example/ to sys.path, right? It actually works the other way around. The directories listed in sys.path are scanned for .pth files. You can add packages by listing them inside

Re: ? 'in' operator and fallback to __getitem__

2009-05-18 Thread Tim Hoffman
Hi Marco Thats definately what I think is happening. I tried the following >>> class yy(object): ... def __getitem__(self,name): ... raise KeyError(name) ... def __contains__(self,name): ... raise KeyError(name) ... >>> aa = yy() >>> 'll' in aa Traceback (most recent call last): Fi

Re: Subversion commit from Python?

2009-05-19 Thread Tim Golden
Jack Trades wrote: I'm wondering if there's an easy way to do a 'svn commit' on a directory from Python. http://pysvn.tigris.org/ and in particular: http://pysvn.tigris.org/docs/pysvn_prog_guide.html TJG -- http://mail.python.org/mailman/listinfo/python-list

Re: how to get the spesific line of the text in the clipboard

2009-05-19 Thread Tim Chase
I want to get the eighth line in the text of the text in the clipboad, but when I call GetClipboardData I only get a string, how can I repair it? [snip] Split the string into lines and take the eighth line (at index 7). I've limited the number of splits to 8 because I'm not interested in any o

Re: Python mail truncate problem

2009-05-19 Thread Tim Roberts
est you grab the keys as a list and iterate through them: for key in mbox.keys(): msg = mbox[key] ... -- Tim Roberts, [email protected] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: finding repeated data sequences in a column

2009-05-20 Thread Tim Chase
lets say you have this column of numbers 128706 128707 128708 100 12 128706 128707 128708 128709 128706 128707 128708 100 12 6 How can I build up a program that tells me that this sequence 128706 128707 128708 is repeated somewhere in the colum

Re: URGENT! Changing IE PAC Settings with Python

2009-05-20 Thread Tim Golden
K-Dawg wrote: Thanks for any response. I am in a crisis where one of our networking guys moved where our PAC file is housed. There was a group policy set in Active Directory that set the PAC file location in Internet Explorer to the new location. However, we have 100 remote centers that have a

Re: LaTeXing python programs

2009-05-20 Thread Tim Arnold
"John Reid" wrote in message news:[email protected]... > Edward Grefenstette wrote: >> I'm typing up my master's thesis and will be including some of the >> code used for my project in an appendix. The question is thus: is >> there a LaTeX package out there that

Re: join two selects

2009-05-21 Thread Tim Golden
gert wrote: I am trying to figure out how to join two selects ? SELECT * FROM search SELECT eid, SUM(pnt) AS total_votes FROM vote CREATE TABLE votes ( eid INTEGER PRIMARY KEY, uid VARCHAR(64), pnt INETEGER DEFAULT 0, ); CREATE TABLE search ( eid INTEGER PRIMARY KEY, tx

Re: monitoring friendly applications

2009-05-21 Thread Tim Roberts
, waiting for i/o, or lost >in some C call. >... >By any chance, does something like this exist? Would someone be >interested with this development? http://www.letmegooglethatforyou.com?q=python+daemon+tools -- Tim Roberts, [email protected] Providenza & Boekelheide, Inc. -- ht

Re: making a python program in windows

2009-05-21 Thread Tim Roberts
this is to bring up the System control panel applet (shortcut: WindowsKey + Pause/Break), Advanced, Environment Variables. In the System variables, click PATHEXT and Edit, and add ;.PY;.PYW to the end. -- Tim Roberts, [email protected] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: making a python program in windows

2009-05-22 Thread Tim Golden
rustom wrote: Thanks for this (and all other) tips. Strangely now my m/c shows things exactly like so. A new .py file gets associated with python but two days ago it was with pythonw?! Any recos on where I could read up on this stuff? I by "all this stuff" you mean: Windows file associations, t

Re: While Statement

2009-05-22 Thread Tim Wintle
("float(200)/5*100") >>> b = timeit.Timer("(200*100.)/5") >>> a.timeit(1000) 12.282480955123901 >>> b.timeit(1000) 3.6434230804443359 Tim W -- http://mail.python.org/mailman/listinfo/python-list

Re: python question

2009-05-22 Thread Tim Wintle
ere is then open a terminal, cd to that directory, and then type: python setup.py install (you may need to do "sudo" before it) - that will normally automatically compile any extensions written in C hope that helps. Tim W -- http://mail.python.org/mailman/listinfo/python-list

Re: While Statement

2009-05-22 Thread Tim Wintle
On Fri, 2009-05-22 at 09:59 -0400, Dave Angel wrote: > > Tim Wintle wrote: > > On Fri, 2009-05-22 at 13:19 +0200, Andre Engels wrote: > >> Change "float(number/total*100)" to "float(number)/total*100" and it > >> should work: > &g

Abstract Classes

2009-05-23 Thread Tim Cook
_(self,m,p): m=m p=p class B(A): implements(IB) def __init__(self,m,p,x,s): A.__init__(m,p) x=x s=s or maybe even: class B(A): implements(IB) def __init__(self,m,p,x,s): super(A.__init__(m,p)) x=x s=s Thanks for any pointers. Tim -- Timothy Cook, MSc

Re: How to pass multiline flag to re.sub without using re.complie.

2009-05-23 Thread Tim Chase
I have a regex that needs multiline flag. Some where I read I can pass multiline flag in regex string itself without using re.compile. If anybody have any idea about how to do that please reply. As detailed at [1], """ (?iLmsux) (One or more letters from the set 'i', 'L', 'm', 's', 'u', 'x'.)

Re: I need help building a data structure for a state diagram

2009-05-24 Thread Tim Chase
I'm working on a really simple workflow for my bug tracker. I want filed bugs to start in an UNSTARTED status. From there, they can go to STARTED. From STARTED, bugs can go to FINISHED or ABANDONED. I know I can easily hard-code this stuff into some if-clauses, but I expect to need to add a

Re: making a python program in windows

2009-05-24 Thread Tim Roberts
rustom wrote: > >Thanks for this (and all other) tips. >Strangely now my m/c shows things exactly like so. A new .py file gets >associated with python but two days ago it was with pythonw?! No, .py files are always associated with python.exe. .pyw files are associated with pythonw.

Re: formating query with empty parameter

2009-05-25 Thread Tim Chase
if one of parameter in values is empty, I'm getting TypeError: not enough arguments for format string But how to handle such situation? It is ok for DB, that some of values are empty. def __insert(self, data): query = """ BEGIN; INSERT INTO table

Re: formating query with empty parameter

2009-05-25 Thread Tim Chase
To stave off this problem, I often use: values = [ data['a'], data['b'], data['c'], data['d'], data['e'], data['f'], data['g'], ] params = ', '.join('%s' for _ in values) query = """ BEGIN; INSERT INTO table (a,b,c,d,e,f,g) VALU

<    51   52   53   54   55   56   57   58   59   60   >