Re: I just wrote my first Python program a guessing game and it exits with an error I get this.

2013-06-05 Thread Tim Golden
On 05/06/2013 16:14, Armando Montes De Oca wrote: > On Wednesday, June 5, 2013 10:40:52 AM UTC-4, Armando Montes De Oca wrote: >> Traceback (most recent call last): >> >> File "Guessing_Game.py", line 32, in >> >> input (enter) >> >> File "", line 0 >> >> ^ >> >> SyntaxError: unexpecte

DOS or not? [was Re: How to tell Script to use pythonw.exe ?]

2013-07-03 Thread Tim Golden
On 03/07/2013 02:34, Andrew Berg wrote: > DOS is long > dead, and is much, much different under the hood from the console > subsystem in modern versions of Windows. While this is clearly true, it's by no means unusual for people to refer to the "DOS Box" or talk about "DOS commands" etc. even whe

Re: DOS or not? [was Re: How to tell Script to use pythonw.exe ?]

2013-07-03 Thread Tim Golden
On 03/07/2013 09:28, Andrew Berg wrote: > On 2013.07.03 02:34, Tim Golden wrote: >> While this is clearly true, it's by no means unusual for people to >> refer to the "DOS Box" or talk about "DOS commands" etc. even when >> they're quite w

Re: DOS or not? [was Re: How to tell Script to use pythonw.exe ?]

2013-07-03 Thread Tim Golden
On 03/07/2013 13:50, Tim Chase wrote: > On 2013-07-03 09:51, Tim Golden wrote: >> We can certainly agree on this. I can't count the number of emails >> I've deleted as too hot-headed in response to dismissive comments >> about Windows as a platform. Some of them,

Re: python.exe crash if opencv tries to access busy webcam

2013-07-03 Thread Tim Golden
On 03/07/2013 14:25, ifelset...@gmail.com wrote: > Hello, > > > I have a while loop taking images every 5 minutes from webcam. > Unfortunately, if the camera is busy, python.exe crashes and there is > no exception to catch. Is there a way to check if camera is busy to > avoid the crash? If pytho

Re: Python Script Hashplings

2013-07-26 Thread Tim Golden
On 26/07/2013 11:37, Devyn Collier Johnson wrote: > > On 07/25/2013 09:54 AM, MRAB wrote: >> On 25/07/2013 14:42, Devyn Collier Johnson wrote: >>> If I execute a Python3 script with this haspling (#!/usr/bin/python3.3) >>> and Python3.3 is not installed, but Python3.2 is installed, would the >>> s

Re: C extension module doesn't throw exception after setting error indicator through PyErr_SetString()

2012-08-02 Thread Tim Golden
On 02/08/2012 09:57, rahul wrote: > I am implementing a C extension module, during this I saw that when I > set the global error indicator and error message through > PyErr_SetString() API and return false. > > But it doesn't throw any error when I tried to check the error > through sys.exc_info()

Re: C extension module doesn't throw exception after setting error indicator through PyErr_SetString()

2012-08-02 Thread Tim Golden
On 02/08/2012 10:21, rahul wrote: > > Hi TJG, > > The above link also doesn't strictly said that return value should be > NULL only, it only said that usually NULL pointer used. No where I > saw that it is nessasory t > > At http://docs.python.org/c-api/exceptions.html. it is written that > "Mos

Re: C extension module doesn't throw exception after setting error indicator through PyErr_SetString()

2012-08-02 Thread Tim Golden
On 02/08/2012 10:50, rahul wrote: > When I use same code base for Python 3.x, then behavior is different. In this > when I return false then also it throws exception but only when any other > statement get executed after this > > like below code: > ... > ... >b = None >try: > a =

Re: Running Python web apps on shared ASO servers?

2012-08-12 Thread Tim Golden
On 12/08/2012 21:52, Gilles wrote: On Sun, 12 Aug 2012 07:56:26 +0200, Dieter Maurer wrote: You should probably read the mentioned forum resources to learn details about the Python support provided by your web site hoster. Yup, but so far, no answer, so I figured someone here might now. Thos

Re: Filter versus comprehension (was Re: something about split()???)

2012-08-25 Thread Tim Golden
On 25/08/2012 13:57, David Robinow wrote: On Fri, Aug 24, 2012 at 3:03 PM, Walter Hurry wrote: On Fri, 24 Aug 2012 14:29:00 -0400, Dennis Lee Bieber wrote: It appears to be a change Google made in the last month or two... My hypothesis is that they are replacing hard EOL found in inbound NNTP

Re: how to get os.py to use an ./ntpath.py instead of Lib/ntpath.py

2012-09-11 Thread Tim Golden
On 11/09/2012 04:46, Steven D'Aprano wrote: > On Mon, 10 Sep 2012 15:22:05 -0700, ruck wrote: > >> On Monday, September 10, 2012 1:16:13 PM UTC-7, Steven D'Aprano wrote: > [...] >>> That's not so much a workaround as the officially supported API for >>> dealing with the situation you are in. Why d

Re: Python on Windows

2012-10-19 Thread Tim Golden
On 19/10/2012 14:24, graham wrote: > Thanks to everyone who replied. > > Python was installed in the subdirectory C:\Python27 with the file > feedparser.py residing in C:\Python27\Lib\email. > > Setting the Windows environment variable (which did not previously > exist) to C:\Python27\Lib\email a

Re: Python on Windows

2012-10-19 Thread Tim Golden
On 19/10/2012 14:24, graham wrote: > Python was installed in the subdirectory C:\Python27 with the file > feedparser.py residing in C:\Python27\Lib\email. > > Setting the Windows environment variable (which did not previously > exist) to C:\Python27\Lib\email allowed me to import feedparser > succ

Re: Python on Windows

2012-10-19 Thread Tim Golden
[Could I suggest snipping some of the preceding replies unless you're referring directly to them? Just leave enough to make the context clear] [... attempts to find feedparser module for beginner's tutorial ...] On 19/10/2012 15:12, graham wrote: > Once again thanks to those that replied. > > Si

Re: Python on Windows

2012-10-19 Thread Tim Golden
On 19/10/2012 15:23, Mark Lawrence wrote: > On 19/10/2012 14:44, Tim Golden wrote: >> >> (In general, PyPI is the first place to look for Python packages). >> >> > > For the benefit of the OP and others this is worth reading on how to get > Python packag

Re: Is there a way to programmatically turn on remote registry?

2012-10-22 Thread Tim Golden
On 22/10/2012 15:51, Kevin Holleran wrote: > Back at it this morning. The RPC was due to needing to run it under > another account (or so I think now...). However, the RemoteRegistry > service is not just STOPPED but DISABLED. > > I am trying to see if there is a call to actually set the state to

Re: Is there a way to programmatically turn on remote registry?

2012-10-22 Thread Tim Golden
On 22/10/2012 16:38, Kevin Holleran wrote: Thanks, I will look into that. WMI is enabled, but everything WMI query I wrote (& I am NOT a WMI expert or even close) gave me a bunch of NIC info, but not the info I am after in the registry (driver description, driver date, driver version for the

Re: Is there a way to programmatically turn on remote registry?

2012-10-23 Thread Tim Golden
On 22/10/2012 21:01, Kevin Holleran wrote: > Tim, > > I am looking here: > > SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{BF9F6FB0-C999-4D19-BED0-144F77E2A9D6} > > Enumerating the keys for a BusType == 5, then grabbing the values of > DriverDesc, DriverDate, & DriverVersion. > > So I am

Re: Fast forward-backward (write-read)

2012-10-24 Thread Tim Golden
On 24/10/2012 08:07, Virgil Stokes wrote: > On 23-Oct-2012 22:03, Cousin Stanley wrote: >> Virgil Stokes wrote: >> >>> Not sure about "tac" --- could you provide more details on this >>> and/or a simple example of how it could be used for fast reversed >>> "reading" of a data file ? >>tac is av

Re: Is there a way to programmatically turn on remote registry?

2012-10-24 Thread Tim Golden
On 24/10/2012 12:40, Kevin Holleran wrote:> Here is the full traceback: > > [output] > Scan_NIC_Driver_Info_1.2.py -i > testing_MSK_Server.csv -o MSK_Test_output.csv -u unreachable.csv > Parsing input file... > > Connecting to IP... > > Traceback (most recent ca

Re: Is there a way to programmatically turn on remote registry?

2012-10-24 Thread Tim Golden
On 24/10/2012 13:36, Kevin Holleran wrote: > Here is the output as you requested. Again thanks for your time & help. > I hate monopolizing one person's time so much Heh. Everyone else is welcome to chip in :) Ok, try specifying the parameter names. (I remember someone having problems before

Re: Is there a way to programmatically turn on remote registry?

2012-10-24 Thread Tim Golden
On 24/10/2012 14:26, Kevin Holleran wrote: > On Wed, Oct 24, 2012 at 9:11 AM, Tim Golden Ok, try specifying the parameter names. (I remember someone having > problems before caused by mismatched param order): > > > > OK, tried that as well as specifying the parameter

Re: Question about long-running web scripts

2012-10-25 Thread Tim Golden
On 25/10/2012 12:45, Gilles wrote: > I'd like to check something about running Python web applications. > > Generally speaking, the reason scripts run faster when called > through FastCGI or the mod_* modules, is because the interpreter is > already up and running. But when running PHP scripts, th

Re: Question about long-running web scripts

2012-10-25 Thread Tim Golden
On 25/10/2012 13:40, Gilles wrote: > On Thu, 25 Oct 2012 13:03:14 +0100, Tim Golden > wrote: >> (Your question is a little confused at the end. I'm choosing to >> understand: why can't we just run Python one-shot, like CGI? The likely >> alternative meaning is:

Re: Question about long-running web scripts

2012-10-26 Thread Tim Golden
On 26/10/2012 10:58, Gilles wrote: > On Thu, 25 Oct 2012 14:24:16 +0100, Tim Golden > wrote: >>> But actually, I didn't mean one-shot scripts, where the Python >>> interpreter + script must be loaded each time, but rather: If I leave >>> a Python runnin

Re: Proper place for everything

2012-11-02 Thread Tim Golden
On 02/11/2012 11:20, Jason Benjamin wrote: > Anybody know of the appropriate place to troll and flame about various > Python related issues? I'm kind of mad about some Python stuff and I > need a place to vent where people may or may not listen, but at at least > respond. Thought this would be a

Re: Proper place for everything

2012-11-02 Thread Tim Golden
On 02/11/2012 13:49, Jason Benjamin wrote: > Yeah, alright. I've just found that if you mention anything about a > library that has well established competitors, the post will tend to get > ignored here. I'm not sure exactly what you're referring to. (Perhaps you can link to an existing post or d

Re: Proper place for everything

2012-11-02 Thread Tim Golden
On 02/11/2012 18:51, Jason Benjamin wrote: On another note, it appears that Google (the only archive I can find for this group) only has a little under 400 messages archived for this group http://mail.python.org/pipermail/python-list/ http://markmail.org/search/?q=python#query:python%20list

Re: Executing .exe on a remote Windows machine

2012-11-08 Thread Tim Golden
On 08/11/2012 14:25, Kevin Holleran wrote: > Good morning, > > I wrote a python script to connect out to a bunch of my remote machines > that are running some software. It modifies a bunch of the config files > for me. After making the changes, I need to restart the software. The > way to do th

Re: Executing .exe on a remote Windows machine

2012-11-08 Thread Tim Golden
On 08/11/2012 15:37, Kevin Holleran wrote: > [code] > try: > print("Attempting to restart Splunk...") > subprocess.call(["psexec", "" + host, "'c:\\Program > Files\\Splunk\\bin\\splunk.exe'", "restart"]) > [/code] > > & am getting: > > [output] > Attempting to restart

Re: Detect file is locked - windows

2012-11-14 Thread Tim Golden
On 14/11/2012 08:55, Hans Mulder wrote: > On 14/11/12 02:14:59, Mark Lawrence wrote: >> On 14/11/2012 00:33, Ali Akhavan wrote: >>> I am trying to open a file in 'w' mode open('file', 'wb'). open() will >>> throw with IOError with errno 13 if the file is locked by another >>> application or if user

Re: Detect file is locked - windows

2012-11-14 Thread Tim Golden
On 14/11/2012 00:33, Ali Akhavan wrote: > I am trying to open a file in 'w' mode open('file', 'wb'). open() > will throw with IOError with errno 13 if the file is locked by > another application or if user does not have permission to open/write > to the file. What version of Python are you using?

Re: Detect file is locked - windows

2012-11-14 Thread Tim Golden
On 14/11/2012 00:33, Ali Akhavan wrote: > I am trying to open a file in 'w' mode open('file', 'wb'). open() > will throw with IOError with errno 13 if the file is locked by > another application or if user does not have permission to open/write > to the file. > > How can I distinguish these two ca

Re: Detect file is locked - windows

2012-11-14 Thread Tim Golden
On 14/11/2012 11:51, Hans Mulder wrote: > It would be nice if he could give specific error messages, e.g. > > "Can't write %s because it is locked by %s." > > vs. > > "Can't write %s because you don't have write access." > > I can't speak for Ali, but I'm always annoyed by error message

Re: Problem with subprocess.call and windows schtasks

2012-11-18 Thread Tim Golden
On 18/11/2012 13:48, Tom Borkin wrote: import subprocess #subprocess.call(['SchTasks /Create /SC ONCE /TN "My Tasks" /TR "C:/Program Files/Apache Group/Apache2/htdocs/ccc/run_alert.py" /ST 07:50'], shell=True) subprocess.call(['SchTasks /Create /SC ONCE /TN "test" /TR "run_alert.py" /ST 07:50'],

Re: windows question: default click action points to wrong python version

2012-11-21 Thread Tim Golden
On 21/11/2012 08:23, Gelonida N wrote: > Hi, > > I installed python 2.6 and python 2.7 on a windows 7 machine. > > At the moment Python 2.7 is the interpreter being used if I 'start' a > python script without explicit interpreter. > > I always thought, that 'repairing' Python 2.6 (reinstalling i

Re: Problem with subprocess.call and windows schtasks

2012-11-21 Thread Tim Golden
On 20/11/2012 23:41, Tom Borkin wrote: > Using shlex, I now have this: > #!\Python27\python > import os, subprocess > path = os.path.join("C:\\", "Program Files", "Apache Group", "Apache2", > "htdocs", "ccc", "run_alert.py") > #subprocess.call(['SchTasks', '/Create', '/SC', 'ONCE', '/TN', '"test"',

Re: windows question: default click action points to wrong python version

2012-11-21 Thread Tim Golden
On 21/11/2012 20:53, Tony the Tiger wrote: On Wed, 21 Nov 2012 09:23:00 +0100, Gelonida N wrote: What am I missing? The PATH environment variable? Nope. PATH doesn't affect either double-clicking or running a .py file on the command line (unless, obviously, you run it by typing "python my

Re: send email with bcc

2012-11-30 Thread Tim Golden
On 30/11/2012 20:25, Ed wrote: to = 'e...@domain.gov' bcc = 'e...@domain.net' [... snippage ...] smtp.sendmail(sender, [to] + bcc, msg.as_string()) Well, you crucially don't show us the rest of the traceback. But I imagine you'd have got something like this: ActivePython 2.7.2.5 (Activ

Re: Iterating over files of a huge directory

2012-12-17 Thread Tim Golden
On 17/12/2012 15:41, Chris Angelico wrote: > On Tue, Dec 18, 2012 at 2:28 AM, Gilles Lenfant > wrote: >> Hi, >> >> I have googled but did not find an efficient solution to my >> problem. My customer provides a directory with a hge list of >> files (flat, potentially 10+) and I cannot rea

Re: PIL or something to open EXIF Metadata with Python

2013-01-09 Thread Tim Golden
On 09/01/2013 14:45, Jose Trevino wrote: > I am trying to load the PIL module to manage exif metadata with > Python but have had no success. Try pyexiv2: http://tilloy.net/dev/pyexiv2/ TJG -- http://mail.python.org/mailman/listinfo/python-list

Re: Query windows event log with python

2013-01-12 Thread Tim Golden
On 12/01/2013 06:09, robey.lawre...@gmail.com wrote: I am looking to write a short program to query the windows event log. It needs to ask the user for input for The event type (Critical, Error, and Information), and the user needs to be able to specify a date since when they want to view result

Re: Query windows event log with python

2013-01-14 Thread Tim Golden
On 13/01/2013 05:55, robey.lawre...@gmail.com wrote: > On Saturday, January 12, 2013 8:34:01 PM UTC+11, Tim Golden wrote: >> On 12/01/2013 06:09, email.addr...@gmail.com wrote: >> >>> I am looking to write a short program to query the windows event >> >>>

Re: Thought of the day

2013-01-15 Thread Tim Golden
On 15/01/2013 16:48, Antoine Pitrou wrote: > Steven D'Aprano pearwood.info> writes: >> >> A programmer had a problem, and thought Now he has "I know, I'll solve >> two it with threads!" problems. > > > Host: Last week the Royal Festival Hall saw the first performance of a new > logfile by one o

Re: Windows subprocess.call problem

2013-01-21 Thread Tim Golden
On 21/01/2013 11:25, Tom Borkin wrote: > Hi; > I have this code: > > #!/Python27/python > import os, subprocess, sys > lyrics_path = "/Users/Tom/Documents/lyrics" > os.chdir(lyrics_path) > > songs = ['livin-la-vida-loca', 'whos-that-lady'] > for song in songs: > subprocess.call(['notepad.exe'

Retrieving the full command line

2013-01-22 Thread Tim Golden
[Python 2.7/3.3 (and hg tip) running on Windows. Not Windows-specific, though]. I use the python -mpackage incantation to run a package which has a __main__.py module and which uses relative imports internally. I'm developing under cherrypy which includes a reloader for development. The reloader

Re: Retrieving the full command line

2013-01-22 Thread Tim Golden
On 22/01/2013 14:53, Terry Reedy wrote: > On 1/22/2013 4:24 AM, Tim Golden wrote: >> [Python 2.7/3.3 (and hg tip) running on Windows. Not Windows-specific, >> though]. >> >> I use the python -mpackage incantation to run a package which has a >> __main__.py modul

Re: Retrieving the full command line

2013-01-23 Thread Tim Golden
On 23/01/2013 03:58, Steven D'Aprano wrote: > Currently, if I have a package __main__.py that prints sys.argv, I get > results like this: > > steve@runes:~$ python3.3 /home/steve/python/testpackage/__main__.py ham > spam eggs > ['/home/steve/python/testpackage/__main__.py', 'ham', 'spam', 'eggs'

Re: Retrieving the full command line

2013-01-24 Thread Tim Golden
On 24/01/2013 10:06, Oscar Benjamin wrote: > On 24 January 2013 04:49, Steven D'Aprano > wrote: > [SNIP] >> >> Contrariwise, I don't believe that there is currently *any* way to >> distinguish between running a script with or without -m. That should be >> fixed. > > As I said earlier in the threa

Re: Retrieving the full command line

2013-01-24 Thread Tim Golden
On 24/01/2013 10:56, Tim Golden wrote: > if the package which is reconstructing the command line the package > which was the target of the original command line. Sorry: if the package which is reconstructing the command line *is not* the package which was the target of the original c

Re: Retrieving the full command line

2013-01-24 Thread Tim Golden
On 24/01/2013 11:30, Oscar Benjamin wrote: > I don't really understand what your spec is. Why do you need to > inspect this information from sys.argv? Can you not just always use > 'python -m pkg' as your entry point? Sorry about the confusion. I think my original point was simply one of surprise

Re: Retrieving the full command line

2013-01-24 Thread Tim Golden
On 24/01/2013 15:28, Oscar Benjamin wrote: > On 24 January 2013 13:45, Tim Golden wrote: >> On 24/01/2013 11:30, Oscar Benjamin wrote: >>> I don't really understand what your spec is. Why do you need to >>> inspect this information from sys.argv? Can you not just a

Re: Retrieving the full command line

2013-01-24 Thread Tim Golden
On 24/01/2013 16:53, Oscar Benjamin wrote: >> Does it work if you use the -m option to run a module rather than a script? > > Sorry that was written incorrectly. I meant to say: does it work when > a module is directly on sys.path rather than as a submodule of a > package? In this case __package__

Re: Retrieving the full command line

2013-01-24 Thread Tim Golden
On 24/01/2013 20:01, Oscar Benjamin wrote: On 24 January 2013 17:13, Tim Golden wrote: A package-based module run via -m (python -m package.module) works as described (including the implicit __main__ module, my primary use-case). Does it work in the "python -m package.module" case

Re: Cycle around a sequence

2012-02-08 Thread Tim Golden
On 08/02/2012 08:26, Mark Lawrence wrote: On 08/02/2012 01:26, Dennis Lee Bieber wrote: On Wed, 08 Feb 2012 01:10:28 +, Mark Lawrence wrote: I'm looking at a way of cycling around a sequence i.e. starting at some given location in the middle of a sequence and running to the end before com

Re: check if directory is writable in a portable way

2012-02-28 Thread Tim Golden
On 28/02/2012 10:07, Andrea Crotti wrote: How should I check if I can create files in a directory? I tried to simply check if the directory is writeable with this function: def is_writable(name): """Return true if the file is writable from the current user """ return os.access(name, os.W_OK) b

Re: check if directory is writable in a portable way

2012-02-28 Thread Tim Golden
On 28/02/2012 12:01, Andrea Crotti wrote: On 02/28/2012 11:34 AM, Tim Chase wrote: On 02/28/12 04:07, Andrea Crotti wrote: How should I check if I can create files in a directory? So maybe the only solution that works is something like try: open(path.join('temp', 'w')) except OsError: return F

Re: Windows Contextmenu

2012-03-13 Thread Tim Golden
On 13/03/2012 09:41, Szabo, Patrick (LNG-VIE) wrote: I wrote the following Script which I want to run from the open with contextmenu in Windows. For that purpose I used py2exe to make an exe out of it. [... snip ...] Now the script runs fine but I don’t get all arguments from sys.argv. No

Re: Python is readable

2012-03-15 Thread Tim Golden
On 15/03/2012 14:19, Kiuhnm wrote: On 3/15/2012 15:06, Mark Lawrence wrote: On 15/03/2012 11:48, Kiuhnm wrote: BTW, aren't those ':' redundant? Kiuhnm Nope. Python 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" fo

Re: is this foolish?

2012-04-12 Thread Tim Golden
On 12/04/2012 10:35, Cameron Simpson wrote: > I've found myself using a Python gotcha as a feature. Have a look at Peter Inglesby's lightning talk from a recent London Python Dojo: http://inglesp.github.com/2012/03/24/mutable-default-arguments.html TJG -- http://mail.python.org/mailman/listin

Re: Recruiting for Python Developer - Perm

2012-05-22 Thread Tim Golden
Someone will soon pop up and tell you that job ads are unwelcome on this list and that you should post to the Python Jobs board --> http://www.python.org/community/jobs/ However, the python-uk list is probably a better place for UK-focused jobs, as long as you have something which is definitely Py

Re: How do you copy files from one location to another?

2011-06-17 Thread Tim Golden
On 17/06/2011 06:06, John Salerno wrote: Based on what I've read, it seems os.rename is the proper function to use, but I'm a little confused about the syntax. Basically I just want to write a simple script that will back up my saved game files when I run it. So I want it to copy a set of files/d

Re: SQL Server 2008R2 databases via Python 2.7 and Windows XP and higher

2011-06-17 Thread Tim Golden
On 17/06/2011 16:01, pyt...@bdurham.com wrote: Looking for some real-world advice on what is the best way to access MS SQL Server 2008R2 databases via Python 2.7 running under Windows XP, Vista, and Windows 7 and Windows Server 2005 and 2008. Based on my research, here's my list of choices: mxODB

Re: User Authentication

2011-06-22 Thread Tim Golden
On 22/06/2011 14:34, Anurag wrote: Hi All, I am working on application which needs to do a authentication against LDAP, if LDAP not installed then local system account (administrator user in windows and root user in Linux). This should work on both Windows and Linux. Which library I should use

Re: connect windows share

2011-06-22 Thread Tim Golden
On 22/06/2011 19:38, Travis Altman wrote: I want to be able to connect to a windows share via python. My end goal is to be able to recursively search through windows shares. I want to do this in Linux as well. So given a share such as \\computer\test I would like to search through the test dir

Re: Python 2.7 and cmd on Windows 7 64 (files lost)

2011-06-23 Thread Tim Golden
On 23/06/2011 07:33, Michel Claveau - MVP wrote: Hi! (sorry for my bad english...) On Win 7 64 bits: Command-Line CD \Python27 dir C:\Windows\System32\SoundRecorder.exe:==> OK Python.exe import os os.system("dir C:\\Windows\\System32\\SoundRecorder.exe") ==> Do not found t

Re: User Authentication

2011-06-23 Thread Tim Golden
On 23/06/2011 06:02, Anurag wrote: On Jun 22, 7:01 pm, Adam Tauno Williams wrote: On Wed, 2011-06-22 at 06:34 -0700, Anurag wrote: Hi All, I am working on application which needs to do a authentication against LDAP, if LDAP not installed then local system account (administrator user in windo

Re: Python 2.7 and cmd on Windows 7 64 (files lost)

2011-06-23 Thread Tim Golden
On 23/06/2011 09:08, Thorsten Kampe wrote: * Tim Golden (Thu, 23 Jun 2011 08:31:26 +0100) Certain commands, including "dir" and "copy" are not executables in their own right, but merely subcommands of cmd.exe. Right, "internal commands". You've got two o

Re: User Authentication

2011-06-23 Thread Tim Golden
On 23/06/2011 16:07, Anurag wrote: My application is a web based application for both windows and Linux. The web part is developed using Django. So if Python does not support it then any support for local sytem account authentication in Django? I am looking for a common library for both Linux an

Re: windows 7 create directory with read write execute permission for everybody

2011-06-27 Thread Tim Golden
On 26/06/2011 21:57, Gelonida wrote: Hi, What do I have to do under python windows to create a directory with all permissions, such, that new files / directories created below will inherit the permissions. The reason I am asking is, that I'd like to create a directory structure where multiple

Re: How to get a dateiled process information on windows?

2011-07-01 Thread Tim Golden
On 01/07/2011 21:06, Leandro Ferreira wrote: I need to write an application that monitors the memory consumption of a process, there is some library that facilitates this work? I searched on google found nothing more interesting. Have a look at WMI TJG -- http://mail.python.org/mailman/listinf

Re: Require information on python API for Subversion related work

2011-08-02 Thread Tim Golden
On 02/08/2011 14:02, Shambhu Rajak wrote: I need an api that can be used to do following operations on Subversion repository tool: 1.Create branch 2.Check out 3.Check in 4.Merge http://pysvn.tigris.org/ (which is, by the way, the first Google hit for "Python Subversion bindings") TJG -

Re: PyWhich

2011-08-05 Thread Tim Golden
On 05/08/2011 14:51, Steven D'Aprano wrote: Tim Chase wrote: On 08/04/2011 07:34 PM, Steven D'Aprano wrote: Billy Mays wrote: #!/usr/bin/python I believe the recommended, platform independent hash-bang line is #!/usr/bin/which python I think you mean #!/usr/bin/env python Doh! I

Re: Directions on accessing shared folder in windows network

2011-08-11 Thread Tim Golden
On 10/08/2011 21:43, Christian Heimes wrote: Am 10.08.2011 21:52, schrieb Ameet Nanda: Hi, Can anyone point me to a way to access windows shared folders from the network using a python script. I tried accessing using open, which is mentioned to work perfectly on the web, but it gives me followi

Re: How to Check Write Access of a Folder on Windows

2011-08-12 Thread Tim Golden
On 12/08/2011 11:41, Ayaskanta Swain wrote: Hi, I have a requirement where I need to check the write permissions on a directory on Windows platform. I don’t want to use the python function os.access( ), since it does not work correctly on Windows. It is giving incorrect results to me. Another o

Re: Windows service in production?

2011-08-16 Thread Tim Golden
On 16/08/2011 05:32, snorble wrote: Anyone know of a Python application running as a Windows service in production? I'm planning a network monitoring application that runs as a service and reports back to the central server. Sort of a heartbeat type agent to assist with "this server is down, go c

Re: Windows service in production?

2011-08-17 Thread Tim Golden
On 16/08/2011 15:46, snorble wrote: Interesting. Normally I would use py2exe then do "myapp.exe -install" to install the app as a service. How do you handle installing the service? Also what does the service show under the properties, for the executable? "python.exe script.py" or something else?

Re: How to Check Write Access of a Folder on Windows

2011-08-17 Thread Tim Golden
On 16/08/2011 13:38, Ayaskant Swain wrote: Hi Tim, Thanks for your reply. It seems this issue is related to python bug -http://bugs.python.org/issue2528 But the patch code looks complex to me. I want to make changes only in my python script which will read an user given directory path& check it'

Re: List spam

2011-08-18 Thread Tim Golden
On 18/08/2011 13:58, Jason Staudenmayer wrote: I really like this list as part of my learning tools but the amount of spam that I've been getting from it is CRAZY. Doesn't anything get scanned before it sent to the list? I haven't seen any significant quantity of spam on the list for ages. (Th

Re: To cmd.exe

2011-08-22 Thread Tim Golden
On 22/08/2011 14:21, aba ca wrote: How can I send to cmd.exe "netstat -an"? Look at the subprocess module, and especially the .check_output convenience function: http://docs.python.org/library/subprocess.html#subprocess.check_output TJG -- http://mail.python.org/mailman/listinfo/python-list

Re: Setting the time in Win7

2011-08-22 Thread Tim Golden
If memory serves, you need to enable a specific privilege to set the time in Vista+. Just a moment... Have a look here: http://support.microsoft.com/kb/300022 and look for SeSystemtimePrivilege generally. Sorry; I'm a bit rushed at the moment. Feel free to post back if that isn't clear TJG

Re: Setting the time in Win7

2011-08-23 Thread Tim Golden
On 22/08/2011 20:42, Bob Greschke wrote: Several people have been hacking away on this computer we are testing on, so I'm not sure what settings -- other than all of them -- have been messed with, but popen("time ...") seems to work, but system("time ...") does not. I'm going to restore the machi

Re: Detecting Ctrl-Alt-Del in Windows

2011-09-02 Thread Tim Golden
Obviously, this is a windows-based question. I know that Ctrl-Alt-Del is handled deep inside the OS, and I'm not trying to interrupt that. But is there some way to detect that a C-A-D has been pressed? Others have pointed out that this shouldn't really be possible for reasons of security. (And

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: 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: 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: 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: 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: 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: 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 picking that fix

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

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

  1   2   3   4   5   6   7   8   9   10   >