Re: sqlite3 with context manager

2011-09-06 Thread Tim Arnold
On 9/3/2011 3:03 AM, Carl Banks wrote: On Friday, September 2, 2011 11:43:53 AM UTC-7, Tim Arnold wrote: Hi, I'm using the 'with' context manager for a sqlite3 connection: with sqlite3.connect(my.database,timeout=10) as conn: conn.execute('update confi

Re: Best way to check that you are at the beginning (the end) of an iterable?

2011-09-07 Thread Tim Chase
On 09/07/11 18:22, Laurent wrote: Anyway I was just asking if there is something better than enumerate. So the answer is no? The fact that I have to create a tuple with an incrementing integer for something as simple as checking that I'm at the head just sounds awfully unpythonic to me. I've ma

Re: n00b formatting

2011-02-24 Thread Tim Chase
On 02/24/2011 04:46 PM, Verde Denim wrote: On Thu, Feb 24, 2011 at 12:49 PM, MRAB wrote: On 24/02/2011 16:41, Verde Denim wrote: x = '0D' y = '0x' + x print "%d" % int(y,0) TypeError: 'int' object is not callable what am i not seeing here?? I can only assume that at some point you assign

Re: wxPython SQLite and Reportlab demo

2011-02-24 Thread Tim Roberts
his announcement or your sourceforge.net page, do you say a single word about what this application actually is. Just a few sentences describing what the application does would go a long way toward stirring up interest in this app. -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc

Re: Suggestion Reqd for Designing a Website in Python

2011-02-24 Thread Tim Roberts
want your app to run on a web server so people use it through your browser). Please clarify. -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Maximum post data length

2011-03-03 Thread Tim Johnson
is plan A (I have plans B and C) Thanks -- Tim tim at johnsons-web.com or akwebsoft.com http://www.akwebsoft.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Switching between Python releases under Windows

2011-03-08 Thread Tim Golden
On 08/03/2011 14:55, Edward Diener wrote: I have multiple versions of Python installed under Vista. Is there any easy way of switching between them so that invoking python and file associations for Python extensions files work automatically ? Well, the answer depends a bit on how au fait you ar

Re: Switching between Python releases under Windows

2011-03-08 Thread Tim Golden
On 08/03/2011 15:58, Tim Golden wrote: On 08/03/2011 14:55, Edward Diener wrote: I have multiple versions of Python installed under Vista. Is there any easy way of switching between them so that invoking python and file associations for Python extensions files work automatically ? Well, the

Re: Dijkstra Algorithm Help

2011-03-09 Thread Tim Roberts
ying to pass this >parameter to the next function so that the distance from the start >node can be calculated How do those numbers say anything about the distances between nodes? -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: error in exception syntax

2011-03-09 Thread Tim Golden
On 09/03/2011 6:12 PM, Aaron Gray wrote: On Windows I have installed Python 3.2 and PyOpenGL-3.0.1 and am getting the following error :- File "c:\Python32\lib\site-packages\OpenGL\platform\win32.py", line 13 except OSError, err: ^ It works okay on my Linux machine r

Re: Purely historic question: VT200 text graphic programming

2011-03-11 Thread Tim Chase
On 03/11/2011 04:24 AM, GrayShark wrote: Oh yes, Cobol also worked on VMS (yikes! the columns just right issues!). IDENTIFICATION DIVISION. PROGRAM-ID. PAIN-PAIN-PAIN. PROCEDURE DIVISION. DISPLAY 'Thanks for dredging up painful memories'. DISPLAY 'I've spen

Re: Creating a very simple revision system for photos in python

2011-03-11 Thread Tim Golden
On 11/03/2011 16:05, Chris Hulan wrote: On Mar 11, 9:56 am, Thomas W wrote: I`m thinking about creating a very simple revision system for photos in python, something like bazaar, mercurial or git, but for photos. The problem is that handling large binary files compared to plain text files are q

Re: Grabbing user's agent and OS type

2011-03-11 Thread Tim Chase
On 03/11/2011 09:59 AM, Νικόλαος Κούρας wrote: ** agent = os.environ['HTTP_USER_AGENT'] # determination of user browser agent = agent.lower() if 'chrome' in agent: agent = 'Chrome' if 'firefox' in agent: agent = 'Firefox' if 'opera' in agent: agent = 'Oper

Re: Two random lists from one list

2011-03-11 Thread Tim Chase
On 03/11/2011 12:21 PM, noydb wrote: I am just looking to see if there is perhaps a more efficient way of doing this below (works -- creates two random teams from a list of players). Just want to see what the experts come up with for means of learning how to do things better. ### import random

PEP for module naming conventions

2011-03-11 Thread Tim Johnson
for my inquiry. Also, if there is an index of PEPs, a link to such would also be appreciated. thanks -- Tim tim at johnsons-web.com or akwebsoft.com http://www.akwebsoft.com -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP for module naming conventions

2011-03-11 Thread Tim Johnson
You can find the list of all PEPs at http://python.org/dev/peps/ Thank you for the links David. > -- > David Marek > dav...@atrey.karlin.mff.cuni.cz > http://davidmarek.cz And interesting web site. The future is with us. > > On Fri, Mar 11, 2011 at 10:52 PM, Tim Johnson wrote:

Re: organizing many python scripts, in a large corporate environment.

2011-03-12 Thread Tim Johnson
om. 3)Cut down on the number of executables by using 'loaderers'. 4)I modified legacy code to take lessons from the MVC architecture, and in fact my architecture following these changes could be called 'LMVCC' for loader model view controller config I hope I&#x

Changing class name causes process to 'hang'

2011-03-12 Thread Tim Johnson
ve never used a debugger with python. Never had to, python's error messages have always been my friend and mentor, but in this case there are no error messages. I would welcome hints on how to trouble-shoot this issue. TIA -- Tim tim at johnsons-web.com or akwebsoft.com http://www.akwebsoft

Re: organizing many python scripts, in a large corporate environment.

2011-03-12 Thread Tim Johnson
* Tim Johnson [110312 10:41]: <...> 3)Cut down on the number of executables by using 'loaderers'. Sheesh! Typo, meant to say 'loaders'.. sorry -- Tim tim at johnsons-web.com or akwebsoft.com http://www.akwebsoft.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Changing class name causes process to 'hang'

2011-03-12 Thread Tim Johnson
* Terry Reedy [110312 13:28]: > On 3/12/2011 2:53 PM, Tim Johnson wrote: > > Is 'cgilib' *your* wrapper of the cgi module, or from a third party. cgilib is my module. I use the cgi module as follows: ## code below import cgi self.form = cgi.FieldStorage(keep_blank

Re: How should I handle socket receiving?

2011-03-12 Thread Tim Roberts
g to want to use "select". You can store the objects in a dictionary where the key is the socket number. That way, you can use the result of the select and get your network object directly. -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Changing class name causes process to 'hang'

2011-03-13 Thread Tim Johnson
I use > >the name `cgitools' and only the name `cgitools'. I'm sure > >this comes from a side effect somewhere in the process. > >thanks for the reply One other thing I just realized: The process stops inside of a function call to another object method, if th

Re: Changing class name causes process to 'hang'

2011-03-13 Thread Tim Johnson
* Tim Johnson [110313 08:27]: > One other thing I just realized: > The process stops inside of a function call to another object > method, if that method call is removed, the process teminates. > :) I may have a solution later today, and will relay it to you if > found. M

Re: Changing class name causes process to 'hang'

2011-03-13 Thread Tim Johnson
* Terry Reedy [110313 13:46]: > On 3/13/2011 3:17 PM, Tim Johnson wrote: > >* Tim Johnson [110313 08:27]: > > Your fundamental problem is that you changed the api of your module. > When you do that, No. I created a 'fork' of the original so that the 'fork&#

Re: organizing many python scripts, in a large corporate environment.

2011-03-13 Thread Tim Johnson
* bukzor [110313 15:48]: > > Thanks Tim. > > I believe I understand it. You create loaders in a flat organization, > in the same directory as your shared library, so that it's found Not in the same directory as shared libraries. > naturally. These loaders use custom c

Re: PEP for module naming conventions

2011-03-13 Thread Tim Johnson
* Ben Finney [110313 17:15]: > Tim Johnson writes: > > > I need to be better informed on naming conventions for modules. For > > instance, I need to create a new module and I want to make sure that > > the module name will not conflict with any future or current python

Re: Switching between Python releases under Windows

2011-03-13 Thread Tim Lesher
I've written a script to do just this, called switchpy.bat. It's described here: http://apipes.blogspot.com/2010/10/switchpy.html Or you can just grab the latest version at: https://bitbucket.org/tlesher/mpath/src/3edcff0e8197/switchpy.bat -- http://mail.python.org/mailman/listinfo/python-list

Dynamic loading of module with explicit file path

2011-03-14 Thread Tim Johnson
e) sys.path = sys_path return module ## 3 :: use the imp module import imp def my_import(module_name,path): fp, pathname, description = imp.find_module(module_name,[path]) module = imp.load_module(module_name, fp, pathname, description) return module TIA -- T

Re: python script to find Installed programs in Uninstall folder in registry

2011-03-14 Thread Tim Roberts
64 bit machines. There shouldn't be any difference. What error do you get, exactly? Also, let me point out that you can access the registry in a couple of ways, without invoking the overhead of WMI. I grant you that they are a bit wordier, but it might get you around this issue. -- Tim Rob

Re: How to schedule execution of code?

2011-03-15 Thread Tim Golden
On 15/03/2011 07:16, Virgil Stokes wrote: Suppose that I have some Python code (vers. 2.6) that has been converted into an *.exe file and can be executed on a Windows (Vista or 7) platform. What can one do to have this *.exe executed at a set of specific times each day? Well, once you've got an

Re: silent install python.msi

2011-03-15 Thread Tim Golden
On 15/03/2011 08:30, Cornelius Kölbel wrote: I am using the python.msi (at the moment 2.6) in a project and want to deploy the python package smoothly and nearly automatically. So my question is, if the python.msi provides some parameters, to pass the information like which components to install

Re: python script to find Installed programs in Uninstall folder in registry

2011-03-15 Thread Tim Golden
On 15/03/2011 03:42, KishoreRP wrote: I am working on creating a python script to find Installed programs in Uninstall folder in registry, the script works perfectly fine on 32 bit machines but errors out with a wmi error on 64 bit machines. You don't say what the error is (and your snippet doe

Re: newbie question (for loop)

2011-03-15 Thread Tim Morneau
You have to add the colon to the end of the statement if this is an accurate representation of the statement so: "for i in range(len(list)):" instead of "for i in range(len(list))" On 3/15/2011 2:01 AM, Sachin Kumar Sharma wrote: BB, I am getting error on the following syntax while r

Re: os.path.walk() to get full path of all files

2011-03-17 Thread Tim Golden
On 17/03/2011 08:58, Laurent Claessens wrote: file_list = [] for root, _, filenames in os.walk(root_path): for filename in filenames: file_list.append(os.path.join(root, filename)) What does the notation "_" stands for ? Is it a sort of /dev/null ? I know that in the terminal it represents

Re: Remove all directories using wildcard

2011-03-18 Thread Tim Golden
On 18/03/2011 16:41, JSkinn3 wrote: I'm new to python and I am trying to figure out how to remove all sub directories from a parent directory using a wildcard. For example, remove all sub directory folders that contain the word "PEMA" from the parent directory "C:\Data". I've trying to use os.w

Re: dynamic assigments

2011-03-24 Thread Tim Leslie
uot;def", "for" or any other variable which matches a keyword? Tim -- http://mail.python.org/mailman/listinfo/python-list

Re: why memoizing is faster

2011-03-25 Thread Tim Wintle
On Fri, 2011-03-25 at 09:49 +0100, Andrea Crotti wrote: > Terry Reedy writes: > > > > For the reason Stefan explained and hinted above. Try the following instead: > > > > def fib_iter(n, _cache = [1,1]): > > k = len(_cache) > > if n >= k: > > for i in range(k, n+1): > >_cache.appen

Where to put .pth files on slax

2011-03-25 Thread Tim Johnson
Hello: I'm trying to put together a test platform on a slax OS. Python 2.7 packages appear to be at /user/lib/python2.7. Where is the appropriate place to put a .pth file? Note, I have django on this system too, but slax does not resolved system paths. And that is 'slax' not &

Re: Where to put .pth files on slax

2011-03-25 Thread Tim Johnson
* Tim Johnson [110325 12:59]: > Hello: I'm trying to put together a test platform on a slax OS. > Python 2.7 packages appear to be at /user/lib/python2.7. > > Where is the appropriate place to put a .pth file? I must have stumped the chumps. And this chump hasn't used

Re: Dump interpreter history?

2011-03-25 Thread Tim Chase
On 03/25/2011 04:40 PM, Daniel Mahoney wrote: On Fri, 25 Mar 2011 17:03:55 -0400, Ken D'Ambrosio wrote: Hey, all. A co-worker asked me a question, and I've got no idea how (or if) it can be done. Bottom line: he'd like to save off the text from an interpreter session, his thinking being that

Incompatible _sqlite3.so

2011-03-27 Thread Tim Johnson
that this is a version problem. I'd like to try _sqlite3.so for python 2.7 (32-bit). If anyone has one or can tell me where get one, I would appreciate it. I am reluctant to install 2.7 on my workstation right now. thanks -- Tim tim at johnsons-web dot com or akwebsoft dot co

Re: Incompatible _sqlite3.so

2011-03-27 Thread Tim Johnson
* Alexander Kapps [110327 13:58]: > On 27.03.2011 23:24, Tim Johnson wrote: > >I have python 2.6.5 on my main workstation with ubuntu 10.04. I am > >attempting to set up a temporary test platform on an asus netbook > >with slax running from an SD card. I have installed a py

Re: Incompatible _sqlite3.so

2011-03-27 Thread Tim Johnson
* Alexander Kapps [110327 15:14]: > On 28.03.2011 00:21, Tim Johnson wrote: > > >>Python 2.6: > >>http://www.slax.org/modules.php?action=detail&id=3118 > > > > That module is *not* trusted. See the warning? > > > You don't trust an unveri

Re: Incompatible _sqlite3.so

2011-03-27 Thread Tim Johnson
* Tim Johnson [110327 16:59]: > * Alexander Kapps [110327 15:14]: > > On 28.03.2011 00:21, Tim Johnson wrote: > > > > >>Python 2.6: > > >>http://www.slax.org/modules.php?action=detail&id=3118 > > > > > > That module is *not* trusted.

Re: best python games?

2011-03-27 Thread Tim Delaney
included, and this has been used by fans to provide ongoing bugfixes and improvements. Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

Re: Non-deterministic output

2011-03-28 Thread Tim Wintle
On Mon, 2011-03-28 at 12:42 +0200, Esben Nielsen wrote: > We are making a prototype program in Python. I discovered the output was > non-deterministic, i.e. I rerun the program on the same input files and > get different output files. We do not use any random calls, nor > threading. > > One of us

Re: delete namespaces

2011-03-29 Thread Tim Chase
On 03/29/2011 08:14 PM, monkeys paw wrote: How do i delete a module namespace once it has been imported? I use import banner Then i make a modification to banner.py. When i import it again, the new changes are not reflected. Is there a global variable i can modify? Delete it from sys.modules

Re: delete namespaces

2011-03-30 Thread Tim Golden
On 30/03/2011 8:03 PM, Terry Reedy wrote: On 3/30/2011 5:10 AM, Jean-Michel Pichavant wrote: 3/ if you want to do the 2/ but require a painful long prologue to your test, then you may want to use the builtin reload. Use it with care, because any existing object created from the previous module

Re: Get USB ID of a serial port through pyserial?

2011-03-31 Thread Tim Golden
On 30/03/2011 20:01, John Nagle wrote: Is there some way to get the USB ID of a serial port through pyserial on Linux and/or Windows? USB serial port devices have device names determined by when they were plugged in. So, if you have more than one USB serial device, you need the USB device's built

Re: Extracting subsequences composed of the same character

2011-03-31 Thread Tim Chase
On 03/31/2011 07:43 PM, candide wrote: Suppose you have a string, for instance "pyyythhooonnn ---> " and you search for the subquences composed of the same character, here you get : 'yyy', 'hh', 'ooo', 'nnn', '---', '' >>> import re >>> s = "pyyythhooonnn ---> " >>> [m.group(0)

Re: Extracting subsequences composed of the same character

2011-03-31 Thread Tim Chase
On 03/31/2011 07:43 PM, candide wrote: "pyyythhooonnn ---> " and you search for the subquences composed of the same character, here you get : 'yyy', 'hh', 'ooo', 'nnn', '---', '' Or, if you want to do it with itertools instead of the "re" module: >>> s = "pyyythhooonnn ---> " >>

Re: call php function from python

2011-04-01 Thread Tim Roberts
e yourself look exactly like a human being at a browser. Fortunately, that's not too hard. -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: python2.7.1 freebsd development version

2011-04-01 Thread Tim Golden
On 01/04/2011 15:25, Tim wrote: hi, I can't seem to find the development version of python2.7.1; maybe there isn't one any longer, but according to this post, there was a bug in the configure script that affects freebsd machines; the patch to fix it was made, but I think I'm not p

Re: python2.7.1 freebsd development version

2011-04-01 Thread Tim Golden
On 01/04/2011 16:34, Tim wrote: On Apr 1, 10:55 am, Tim Golden wrote: On 01/04/2011 15:25, Tim wrote: hi, I can't seem to find the development version of python2.7.1; maybe there isn't one any longer, but according to this post, there was a bug in the configure script that affec

Re: Fun python 3.2 one-liner

2011-04-05 Thread Tim Wintle
gt; want to limit him/herself to 80 characters in 2011? I'd rather have two files open with 80 columns in them than a single file with 160 columns and have to switch between files. Tim Wintle -- http://mail.python.org/mailman/listinfo/python-list

Re: Literate Programming

2011-04-08 Thread Tim Arnold
;ve got a system in reasonable shape. You have full control over the display and you can make the code files go anywhere you like when you run pdflatex on your file. --Tim Arnold -- http://mail.python.org/mailman/listinfo/python-list

Re: [Feature Request] dict.setdefault()

2011-04-11 Thread Tim Chase
On 04/11/2011 05:44 PM, Chris Angelico wrote: On Tue, Apr 12, 2011 at 8:41 AM, MRAB wrote: I'm not sure that "setdefault" should take **kw args for this because of its existing argument structure (key + optional value). A new method like "updatedefault" may be better, IMHO. It would act like "

Re: Literate Programming

2011-04-11 Thread Tim Arnold
"Hans Georg Schaathun" wrote in message news:aca678-b87@svn.schaathun.net... > On Fri, 8 Apr 2011 12:58:34 -0400, Tim Arnold > wrote: > : If you already know LaTeX, you might experiment with the *.dtx docstrip > : capability. > > Hi. Hmmm. That's a

Re: split string but ignore sep inside double quotes

2011-04-13 Thread Tim Golden
On 13/04/2011 15:59, Jonno wrote: I have the following unicode object: u'3,"Some, text",more text' and I want to split it into a list like this: [3,"Some, text", more text] In other words I want to split on the comma but not if it's inside a double-quote. You want the csv module which is desi

Re: Questions about GIL and web services from a n00b

2011-04-15 Thread Tim Wintle
rallel *processes* as you have cores/CPUs (assuming you're designing an application that can have multiple instances running in parallel so that you can run over multiple servers anyway). Tim Wintle -- http://mail.python.org/mailman/listinfo/python-list

Re: Python IDE/text-editor

2011-04-16 Thread Tim Chase
On 04/16/2011 02:17 AM, Ben Finney wrote: Emacs can run Python in a buffer, and has “tabbar-mode” to display a row of tabs Likely the same features are available in Vim, by I've never used Vim for lots of Python coding. Vim since v7 has offered tabs, though I personally stick mostly to split-

Re: Python IDE/text-editor

2011-04-17 Thread Tim Chase
On 04/17/2011 04:19 PM, Ben Finney wrote: No, it's not. Vim is THE way. Clearly there is only one standard text editor, and that's ‘ed’ While it's funny, I'm curious how many folks on c.l.p have done any/much python coding in ed. I've had to do a bit on a router running an embedded Linux t

Re: strange use of %s

2011-04-18 Thread Tim Golden
On 18/04/2011 09:29, Tracubik wrote: Hi all, i'm reading a python tutorial in Ubuntu's Full Circle Magazine and i've found this strange use of %s: sql = "SELECT pkid,name,source,servings FROM Recipes WHERE name like '%%%s% %'" %response response is a string. I've newbie in sql. why do the code

Programmatically log in and request XML

2011-04-18 Thread Tim Johnson
DARD-XML') Am I at the correct starting point? If so, I can take it from there If not, Can someone recommend a better approach? thanks -- Tim tim at johnsons-web dot com or akwebsoft dot com http://www.akwebsoft.com -- http://mail.python.org/mailman/listinfo/python-list

Re: List comprehension vs filter()

2011-04-20 Thread Tim Roberts
art of the local namespace of the outer function, but it's not part of the local namespace of the lambda. You can solve this through the common lamba idiom of a closure: lst=filter(lambda x,posttype=posttype: x["type"].lower()==posttype,lst) -- Tim Roberts, t...@probo.com Providenza

Re: learnpython.org - an online interactive Python tutorial

2011-04-23 Thread Tim Chase
On 04/23/2011 11:51 AM, Dotan Cohen wrote: harrismh777 wrote: If an operation like (+) is used to add 1 + '1' then the string should be converted to int and the addition should take place, returning a reference to object int (2). No, the int 1 should be cast to a string, and the result shoul

Re: Cannot get past this string related issue

2011-04-26 Thread Tim Golden
On 26/04/2011 14:48, Oltmans wrote: Greetings, I hope you're doing well. I'm stuck in a strange issue, most likely due to my own ignorance. I'm reading a config file using ConfigParser module and passing database related info to _mssql. [ ... ] Config file looks like following [DB_INFO] serv

Re: [OT] Comparing VCS tools (was ""Development tools and practices for Pythonistas")

2011-04-26 Thread Tim Chase
On 04/26/2011 01:42 PM, Algis Kabaila wrote: Thomas, have you tried bzr (Bazaar) and if so do you consider hg (Mercurial) better? And why is it better? (bzr is widely used in ubuntu, which is my favourite distro at present). Each of the main 3 (bzr, hg, git) have advantages and disadvantage

Re: minimal python27.dll?

2011-04-27 Thread Tim Golden
On 27/04/2011 11:43, est wrote: I need to ship python runtime environment package on Windows, if I want to stripping unnessasery functions from python27.dll to make it as small as possible(and perhaps finally UPX it), which parts of python27.dll do you think can be removed? Perhaps have a look

Re: [OT] VCS tools (was "Development tools and practices for Pythonistas")

2011-04-27 Thread Tim Chase
On 04/27/2011 04:24 AM, Jean-Michel Pichavant wrote: Ben Finney wrote: Mercurial – are the ones to choose from. Anoyone recommending a VCS tool that has poor merging support (such as Subversion or, heaven help us, CVS) is doing the newcomer a disservice. True enough. But the modern crop of fir

Re: [OT] Comparing VCS tools

2011-04-27 Thread Tim Chase
On 04/26/2011 09:45 PM, Ben Finney wrote: Tim Chase writes: Bazaar (bzr) Cons: - was slow, though I understand they've worked on improving this Right, that's not a count against Bazaar for at least the last several versions (since 2009 at least). Bazaar is easily fast

Re: [OT] VCS tools

2011-04-28 Thread Tim Chase
On 04/28/2011 04:50 PM, Ben Finney wrote: This has been a pretty informative thread so far. Please keep it coming. I am a hardware development guy and do very little software development. I have been vaguely aware of tools for version control but inspired by this thread I have started looking at

Re: [OT] From svn to something else?

2011-04-29 Thread Tim Chase
On 04/29/2011 05:07 AM, Hans Georg Schaathun wrote: How easy and reliable is it to import my svn version history into one of the three big DVCS-s mentioned here? I'd say that one of the things SVN has going for it is that it's the lingua-franca of VCSes, so just about everything (especially t

Re: [OT] From svn to something else?

2011-04-29 Thread Tim Chase
On 04/29/2011 12:01 PM, Hans Georg Schaathun wrote: wrote: : I'd say that one of the things SVN has going for it is that it's : the lingua-franca of VCSes, so just about everything (especially : the 3 big names mentioned in this thread: hg, bzr, git) can talk : to svn pretty uneventfully

Re: [OT] VCS for non-text (was Development tools and practices for Pythonistas)

2011-04-30 Thread Tim Chase
On 04/30/2011 04:15 AM, Martin Schöön wrote: You guys are very code focused, which is natural given where we are. Having absorbed what I have seen here, looked a little at Mercurial, read a little on the webs of Fossil and Bazaar I start to think there is great merit in all this VCS stuff for ot

Re: What other languages use the same data model as Python?

2011-05-04 Thread Tim Roberts
onstant 4. Such an abomination is simply not possible in C. Is that implemented under-the-hood with pointers/addresses? Of course it is. However, that does not change the parameter passing model as defined by the language specification. -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Development tools and practices for Pythonistas

2011-05-06 Thread Tim Golden
On 06/05/2011 10:51, Jonathan Hartley wrote: On Apr 26, 3:39 pm, snorble wrote: I appreciate any advice or guidance anyone has to offer. The 'Python Project HOWTO' gives good advice in terms of setting up a new project, what files and directories to create, what to put in version control, etc

Re: if statement multiple or

2011-05-06 Thread Tim Golden
On 06/05/2011 14:17, scattered wrote: On May 6, 8:25 am, Christian Heimes wrote: Am 06.05.2011 14:09, schrieb scattered: sets could also work if set('abc')& set(line) == set(): print line Right! Sets work in this special case, because the OP just wants to search for a single char.

Re: What other languages use the same data model as Python?

2011-05-09 Thread Tim Golden
On 09/05/2011 15:29, Steven D'Aprano wrote: [... snippage galore ...] Slightly abstract comment: while I don't usually get much enjoyment out of the regular "Python is call-by-value; no it isn't; yes it is" debates, I always enjoy reading Steven D'Aprano's responses. Thanks, Mr D'A. :) TJG --

Re: Need Assistance on this program.

2011-05-12 Thread Tim Golden
On 12/05/2011 10:45, vijay swaminathan wrote: I tried using that as well. The problem is, the thread becomes dead as soon as it executes the invocation of command prompt. Can you post the code you're using, please? This should be simple so maybe you've misunderstood something in the threading

Re: Need Assistance on this program.

2011-05-12 Thread Tim Golden
On 12/05/2011 11:29, vijay swaminathan wrote: <... snippet from code ...> print 'Invoking Command Promptt..' #subprocess.call(["start", "/DC:\\PerfLocal_PAL", "scripts_to_execute.bat"], shell=True) subprocess.call(["start", "C:\\windows\\system32\\cmd.exe"], shell

Re: os.popen command working differently on Windows

2011-05-12 Thread Tim Golden
On 12/05/2011 15:11, Ayaskanta Swain wrote: Please help me in solving the following issue I am facing while executing my python script. Basically I am executing the OS specific move command to move a file/dir from one location to another. Why? Why not use os.rename or shutil.move which already

Re: Need Assistance on this program.

2011-05-13 Thread Tim Golden
On 13/05/2011 06:22, vijay swaminathan wrote: Hi Tim., Thanks.. This works as I had expected. are there any documentation for the subprocess.call method? I tried going through the python doc but could not narrow down. http://docs.python.org/library/subprocess.html?highlight=subprocess%20call

Re: Assistance in understanding the sub-Process module

2011-05-13 Thread Tim Golden
On 13/05/2011 12:03, vijay swaminathan wrote: 1. The class definition as per the documentation is: /class /subprocess.Popen(/args/, /bufsize=0/, /executable=None/, /stdin=None/, /stdout=None/, /stderr=None/, /preexec_fn=None/, /close_fds=False/, /shell=False/, /cwd=None/, /env=None/, /universal_n

Re: Regular Expression for words (with umlauts, without numbers)

2011-05-13 Thread Tim Chon
]+ cheers, --tim On Fri, May 13, 2011 at 9:01 AM, Jens Lechtenboerger < lech...@helios.uni-muenster.de> wrote: > Dear experts, > > I'm looking for a regular expression to recognize natural language > words with umlauts but without numbers. While \w with re.U does > r

Re: Get the IP address of WIFI interface

2011-05-15 Thread Tim Golden
On 15/05/2011 12:04 PM, Neal Becker wrote: Far.Runner wrote: Hi python experts: There are two network interfaces on my laptop: one is 100M Ethernet interface, the other is wifi interface, both are connected and has an ip address. The question is: How to get the ip address of the wifi interface

Re: Get the IP address of WIFI interface

2011-05-15 Thread Tim Golden
On 15/05/2011 20:23, Jun Hu wrote: Thanks for the tip, it is really helpful! however the class of Win32_NetworkAdapterConfiguration doesn't include the interface type (you can NOT tell if it is a wifi interface), so I change the code a bit like following: import wmi wlan_int_id=None for nic in

Re: Question about available python lib for a task

2011-05-15 Thread Tim Roberts
can do it without Excel, using the COM interfaces for "structured storage", like IPropertySetStorage and IPropertyStorage. >Is pywin32 one of the possible lib available? You will need PyWin32 in order to use COM to launch Excel, or use the structured storage interfaces. -- Tim Rob

Re: obviscating python code for distribution

2011-05-16 Thread Tim Chase
On 05/15/2011 10:29 PM, Ben Finney wrote: What is it you think you would gain by obfuscating the code, and why is that worthwhile? What evidence do you have that code obfuscation would achieve that? Based on past experience at several employers', the preeminent reason for obfuscating is to mak

Re: where to find shared python script?

2011-05-17 Thread Tim Golden
On 17/05/2011 13:53, Yue Chao wrote: I am new to python and thank you for your help! the first question is, is there any resource online where we can find shared python script (like reading a csv file for ready plot making, I know to use csv module while I find it's not good enough) . I don't k

Re: os.access giving incorrect results on Windows

2011-05-19 Thread Tim Golden
On 19/05/2011 20:37, Ayaskanta Swain wrote: Please help me in solving this issue. I want to check the write permissions on a directory on windows from my python script. I tried to use *os.access(dirpath, os.W_OK)*to check whether the user has write access or not, but it gives me incorrect result

Re: os.access giving incorrect results on Windows

2011-05-19 Thread Tim Golden
On 19/05/2011 20:56, Andrew Berg wrote: On 2011.05.19 02:43 PM, Tim Golden wrote: This is basically issue2528 [1]. The problem is that, although Windows (and Python) expose a version of os.access to match the Posix function, the meaning is so far removed on Windows as to be useless. Does this

Re: os.access giving incorrect results on Windows

2011-05-20 Thread Tim Golden
On 19/05/2011 21:40, Andrew Berg wrote: On 2011.05.19 03:08 PM, Tim Golden wrote: * A R_OK check always succeeds if the file's attributes can be read at all So is this the same as F_OK then, or does it return false if the user isn't allowed to read permissions? * A W_OK check fa

Re: os.access giving incorrect results on Windows

2011-05-20 Thread Tim Golden
On 20/05/2011 09:21, Tim Golden wrote: [... re os.access on Windows ...] (Sorry; just got back to this this morning). I might raise this on python-dev. If you want to follow, my post is here: http://mail.python.org/pipermail/python-dev/2011-May/111530.html TJG -- http://mail.python.org

Re: List of WindowsError error codes and meanings

2011-05-20 Thread Tim Golden
On 20/05/2011 18:56, Andrew Berg wrote: This is probably somewhat off-topic, but where would I find a list of what each error code in WindowsError means? WindowsError is so broad that it could be difficult to decide what to do in an except clause. Fortunately, sys.exc_info()[1][0] holds the speci

Re: and becomes or and or becomes and

2011-05-22 Thread Tim Roberts
IS funny. Interesting how a careful choice of arugments will fool us. One of my favorite math jokes is like that. A teacher asked a student to reduce the following fraction: 16 64 He says "all I have to do is cancel out the sixes, so the answer is 1/4". -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem in using subprocess module and communicate()

2011-05-23 Thread Tim Golden
On 21/05/2011 16:56, vijay swaminathan wrote: I'm having some problem in using the communicate() along with the subprocess.I would like to invoke a command prompt and pass on a .bat file to execute. I went through the subprocess module and understood that using communicate, we can send the send

Re: Problem in using subprocess module and communicate()

2011-05-23 Thread Tim Golden
[cc-ing back to the list; please keep the conversation over there...] On 23/05/2011 13:11, vijay swaminathan wrote: What I want to achieve is, I want to run a batch file on a command prompt. The reason for using thread is not for running multiple scripts simultaneously. It is just to monitor my

Re: NEED HELP- read file contents, while loop to accept user input, and enter to exit

2011-05-24 Thread Tim Golden
On 24/05/2011 09:31, Cathy James wrote: dear mentor, I need help with my code: 1) my program won't display file contents upon opening #1) open file and display current file contents: f = open ('c:/testing.txt'', 'r') f.readlines() If you're running this in an interactive interpreter, I would

Re: File access denied after subprocess completion on Windows platform

2011-05-24 Thread Tim Golden
On 24/05/2011 11:01, Claudiu Nicolaie CISMARU wrote: The problem appears when I close the called program (in our case calc.exe). The (1) part (the call of os.rename) raise an exception: (32, 'The process cannot access the file because it is being used by another process') [Error 32] The process

<    3   4   5   6   7   8   9   10   11   12   >