Re: question about output

2005-10-05 Thread utabintarbo
Given that the format is consistent (and the last char is not part of the number you want), you can probably do something like this: x = int('10944800e'[:-1]) Disclaimer: I am a n00b. YMMV ;-) -- http://mail.python.org/mailman/listinfo/python-list

Re: How can I package a python script and modules into a single script?

2005-11-03 Thread utabintarbo
I believe you are thinking of "freeze", which is part of the normal python distro. There is also cx_Freeze ( http://starship.python.net/crew/atuining/cx_Freeze/ ) Bob -- http://mail.python.org/mailman/listinfo/python-list

Re: os.spawnl error

2005-11-17 Thread utabintarbo
I have found the judicious use of os.path.normpath(path) to be quite useful as well. Bob -- http://mail.python.org/mailman/listinfo/python-list

Encoding of file names

2005-12-08 Thread utabintarbo
Here is my situation: I am trying to programatically access files created on an IBM AIX system, stored on a Sun OS 5.8 fileserver, through a samba-mapped drive on a Win32 system. Not confused? OK, let's move on... ;-) When I ask for an os.listdir() of a relevant directory, I get filenames with em

Re: Encoding of file names

2005-12-08 Thread utabintarbo
Fredrik, you are a God! Thank You^3. I am unworthy I believe that may do the trick. Here is the results of running your code: >>> DIR = os.getcwd() >>> files = os.listdir(DIR) >>> file = files[-1] >>> file 'L07JS41C.04389525AA.QTR\xa6INR.E\xa6C-P.D11.081305.P2.KPF.model' >>> print file L07JS41C.

Re: Encoding of file names

2005-12-09 Thread utabintarbo
Part of the reason (I think) is that our CAD/Data Management system (which produces the aforementioned .MODEL files) substitutes (stupidly, IMNSHO) non-printable characters for embedded spaces in file names. This is part of what leads to my consternation here. And yeah, Windows isn't helping matte

Re: Allowing only one instance of a script?

2005-06-23 Thread utabintarbo
... lock file? -- http://mail.python.org/mailman/listinfo/python-list

Re: Favorite non-python language trick?

2005-06-24 Thread utabintarbo
>with colour do begin >red := 0; blue := 255; green := 0; >end; > >instead of: > >colour.red := 0; colour.blue := 255; colour.green := 0; Why not: from color import * red := 0 blue := 255 green := 0 ... -- http://mail.python.org/mailman/listinfo/python-list

How to kill easygui dialog?

2005-07-19 Thread utabintarbo
I am using an easygui(http://www.ferg.org/easygui/index.html) dialog (enterbox) to retrieve some info from a user. The program then goes on and does a bit of processing, sometimes for several minutes. In the meantime, the dialog stays there, dead but visible. I would prefer that either another dial

Re: How to kill easygui dialog?

2005-07-20 Thread utabintarbo
William, Thanks for the reply. No flames, but I am running on both Linux and Windows, so I need a x-platform solution. I thought I had it with easygui... Must try some other ideas -- http://mail.python.org/mailman/listinfo/python-list

X-Platform method of remote execution of Windows programs

2005-08-21 Thread utabintarbo
How can I execute a program in windows on a remote pc, from both linux and windows, using python (more-or-less) alone? Any help would be GREATLY appreciated! Bob -- http://mail.python.org/mailman/listinfo/python-list

Re: X-Platform method of remote execution of Windows programs

2005-08-22 Thread utabintarbo
Well, I can do this using WMI thru VBScript for Windows-Windows connections. What I would like is a method using python for both Windows-Windows and Linux-Windows connections. I've looked at pyWMI (http://tgolden.sc.sabren.com/python/wmi.html), and found it unclear in it's dealings with remote boxe

Re: X-Platform method of remote execution of Windows programs

2005-08-23 Thread utabintarbo
It seems as if I am doomed to use additional software on the windows box. Damn! The "unclarity" is in the authentication for the remote box. If I wish to start a process on a remote box with another user's credentials (other than the user I am logged in as), I am unsure as to how to accomplish thi

Re: file access dialog

2005-08-26 Thread utabintarbo
For simple, it's hard to beat EasyGUI: http://www.ferg.org/easygui/ Bob -- http://mail.python.org/mailman/listinfo/python-list

Re: time scheduling in ptyhon

2006-01-17 Thread utabintarbo
http://sourceforge.net/projects/pycron/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Finding the relative path of a file from a dir

2006-01-20 Thread utabintarbo
http://groups.google.com/group/comp.lang.python/browse_thread/thread/390d8d3e3ac8ef44/d8c74f96468c6a36?q=relative+path&rnum=1#d8c74f96468c6a36 -- http://mail.python.org/mailman/listinfo/python-list

Re: How to start more than one process at the same time?

2006-07-14 Thread utabintarbo
Look into the subprocess module. Possibly relevant link follows: http://docs.python.org/lib/node244.html -- http://mail.python.org/mailman/listinfo/python-list

Native Win32 text entry dialog?

2006-08-08 Thread utabintarbo
Is there a native Win32 text entry dialog available through the Win32 extensions. I am looking for something similar to easygui's (http://www.ferg.org/easygui/) enterbox. Any ideas? TIA -- http://mail.python.org/mailman/listinfo/python-list

Re: Native Win32 text entry dialog?

2006-08-11 Thread utabintarbo
Well, to answer my own question http://www.averdevelopment.com/python/EasyDialogs.html Thanks to all who responded! ;-P -- http://mail.python.org/mailman/listinfo/python-list

Re: schedule at specific hours

2006-08-11 Thread utabintarbo
Take a look at http://sourceforge.net/projects/pycron/ . It may give you some ideas. Bob -- http://mail.python.org/mailman/listinfo/python-list

Asychronous execution *with* return codes?

2006-10-05 Thread utabintarbo
I hope I have not overlooked a solution already posted, but I seem to be unable to suss out a way to achieve both multiple console-less executions of a given (console) application and gathering the return code from the application. What I have found: import subprocess # gives back return code, b

Re: Asychronous execution *with* return codes?

2006-10-05 Thread utabintarbo
MonkeeSage wrote: > utabintarbo wrote: > > pid = subprocess.Popen([app] + lstArgs).pid > > Check out the poll() method and the returncode attribute: > http://docs.python.org/lib/node533.html > Thanks for the reply. If I understand your meaning, I should do something like

Re: Asychronous execution *with* return codes?

2006-10-05 Thread utabintarbo
Justin wrote: > If you're on a POSIX system, you could use the usual fork/exec/wait: > Sorry. Win32. We are only allowed spoons - no sharp objects. :-P -- http://mail.python.org/mailman/listinfo/python-list

Re: Asychronous execution *with* return codes?

2006-10-11 Thread utabintarbo
Fredrik Lundh wrote: > utabintarbo wrote: > > > If so, how do I handle the poll() on long-running processes? Run a > > bunch and then start a check loop? > > or use a thread to keep track of each external process. > > This sounds most promising. Might you have a

Re: external file closed

2006-10-17 Thread utabintarbo
Jerry wrote: > On Oct 17, 12:43 pm, "kilnhead" <[EMAIL PROTECTED]> wrote: > > I am opening a file using os.start('myfile.pdf') from python. How can I > > know when the user has closed the file so I can delete it? Thanks. > > I assume you mean os.startfile. There is no way to do this directly. > o

Re: best way to check if a file exists?

2006-10-31 Thread utabintarbo
John Salerno wrote: > What is the best way to check if a file already exists in the current > directory? I saw os.path.isfile(), but I'm not sure if that does more > than what I need. > > I just want to check if a file of a certain name exists before the user > creates a new file of that name. >

Re: Python tools for managing static websites?

2006-11-02 Thread utabintarbo
Glenn Hutchings wrote: > I haven't seen mention of HTMLgen, another python package. Check it > out at: > > http://starship.python.net/crew/friedrich/HTMLgen/html/main.html > > Glenn For whatever reason, the Starship (hence that link) has been down for a while. :-( But I do agree that HTMLge

Re: Searching for a module to generate GUI events

2006-11-08 Thread utabintarbo
Stephan Kuhagen wrote: > Hello > > I'm searching for a Python Module which is able to generate GUI events on > different platforms (at least X11 and Windows, MacOSX would be nice), but > without being a GUI toolkit itself. So PyTk is not a choice, because I need > to use it, to control GUIs of oth

Re: Bundling an application with third-party modules

2006-06-14 Thread utabintarbo
A couple of alternatives: 1. py2exe/csFreeze-type thing. This would even relieve the customer of installing python 2. An Installshield-type installer can place files (essentially) wherever you want them HTH -- http://mail.python.org/mailman/listinfo/python-list

Re: determining file type

2006-06-14 Thread utabintarbo
http://www.demonseed.net/~jp/code/magic.py -- http://mail.python.org/mailman/listinfo/python-list

Re: list comprehension

2006-06-29 Thread utabintarbo
Simon Forman wrote: > results = [] > for var in some_iterable: > if some condition: > results.append(some expression) > > > The list comprehension version: > > results = [some expression for var in some_iterable if some condition] > > > There's more to it, but that's the basic idea. E

Re: python

2006-08-24 Thread utabintarbo
[EMAIL PROTECTED] wrote: > Regards, > [EMAIL PROTECTED] Thanks! -- http://mail.python.org/mailman/listinfo/python-list

Re: Programming isn't dangerous...

2006-09-05 Thread utabintarbo
Darwinism in action! :-P -- http://mail.python.org/mailman/listinfo/python-list

Re: Random image downloader for newsgroups (first script)

2006-09-07 Thread utabintarbo
Skip Montanaro wrote: > > > SERVER = "news.server.co.uk" #Insert news server here > > > GROUP = "alt.binaries.pictures.blah" #newsgroup will go here > > > > Just why do I imagine there will be an adult newsgroup in the end? > > I can see the freshmeat announcement now: "Random Boob Visualizer

Re: Exposing Excel as a Webservice

2006-09-15 Thread utabintarbo
Disclaimer: I am not an expert in python, or even programming, for that matter In any case, option #2 sounds like the most theoretically sound. It sounds like you are using Excel as a database, and your worker thread as a transaction queue. Something to consider: do you really need to modify

Win32: Access to network resources w/o user login

2006-09-26 Thread utabintarbo
Is there a way to (programmatically) access network resources from a WinXP client without a user being logged in? I guess I need to know where the fstab file is in Windows. :-P Some more background: I am trying to access a samba share which is set up for anonymous login (all unknown users are mapp

Re: Win32: Access to network resources w/o user login

2006-09-26 Thread utabintarbo
Steve Holden wrote: > http://oss.coresecurity.com/projects/impacket.html > > perhaps? > > regards > Steve > -- > Steve Holden +44 150 684 7255 +1 800 494 3119 > Holden Web LLC/Ltd http://www.holdenweb.com > Skype: holdenweb http://holdenweb.blogspot.com > Recent Ramblings

Re: Extra Newby question - Trying to create md5 File Listing

2006-09-28 Thread utabintarbo
Just for S&G's, I offer the following function which will return the md5sum of an arbitrarily large file. Found a while back while surfing def md5sum(fpath): """ function to return the md5sum (128 bit checksum) of the given file The sums are computed as described in RFC 1321. The

Re: can't open chm files all of a sudden

2006-10-04 Thread utabintarbo
John Salerno wrote: > Hi all. I apologize since this is only remotely Python related, but I > hope someone might now the solution. > > I tried opening my Python chm docs just now, as well as the one for > wxPython, and both are giving me an error dialog when I double-click > them and I can't open

Re: Threading

2006-11-30 Thread utabintarbo
Gheorghe Postelnicu wrote: >... > However, my question regards killing the actual children threads - > they are spending lots of time in system calls, so I cannot insert > some while loop in a derived Thread class. > > Any suggestions would be apreciated. > Have the threads look for a semaphore fi

Re: sockets, where can I find documentation?

2006-03-03 Thread utabintarbo
For a good general book on networking with python, try Foundations of Python Network Programming by John Goerzen. http://www.amazon.com/gp/product/1590593715/qid=1141390241/sr=1-9/ref=sr_1_9/104-7194399-1227965?s=books&v=glance&n=283155 -- http://mail.python.org/mailman/listinfo/python-list

globbing multiple wildcards

2005-05-07 Thread utabintarbo
I have a path spec similar to '/home/*/.mozilla/*/*/cache*/*' (this will probably look familiar to *nix users) with multiple wildcards. I am finding it difficult gathering ALL file pathnames which match this spec. Can anyone shed some light on this for a python noob? TIA Bob -- http://mail.pytho

Re: globbing multiple wildcards

2005-05-07 Thread utabintarbo
OK, I guess it WAS that easy. :-P Thanks for the replys. Bob -- http://mail.python.org/mailman/listinfo/python-list

Re: Ask for a tools to protect my .pyc file :)

2005-05-07 Thread utabintarbo
pyobfuscate http://www.lysator.liu.se/~astrand/projects/pyobfuscate/ -- http://mail.python.org/mailman/listinfo/python-list

Re: globbing multiple wildcards

2005-05-07 Thread utabintarbo
Is there any way to make this recursive? That is what I was looking for. Sorry I wasn't too clear before. Bob -- http://mail.python.org/mailman/listinfo/python-list

Re: Help implementing an idea

2005-06-17 Thread utabintarbo
Take a look at: http://dirssync.sourceforge.net/ See if that gives you any direction. -- http://mail.python.org/mailman/listinfo/python-list

Re: ??? POLICE AND CITY/UNIVERSITY OFFICIALS INCOMPETENCE LEADS TO 33 KILLED BY KOREAN-ALQAEDA TERRORIST ???

2007-04-17 Thread utabintarbo
On Apr 17, 10:32 am, Muhammad <[EMAIL PROTECTED]> wrote: > On Apr 17, 7:56 am, [EMAIL PROTECTED] wrote: >> - > You mentioned "Korean Al-Qaeda Terrorist" in the title! Honesty > demands that you establish it as a fact that the person was connected > to Al-Qaeda and that he was a terrorist and not s

Re: what has python added to programming languages? (lets be esoteric, shall we ; )

2006-04-21 Thread utabintarbo
Why does Python have to "add" anything, if it makes "that which came before" more easily accessible/usable? Perhaps that is its innovation. Is that not sufficient? -- http://mail.python.org/mailman/listinfo/python-list

Re: freeze tool like perl2exe?

2006-05-23 Thread utabintarbo
CX_Freeze? http://starship.python.net/crew/atuining/cx_Freeze/ -- http://mail.python.org/mailman/listinfo/python-list

Re: vb dll

2006-03-07 Thread utabintarbo
How? -- http://mail.python.org/mailman/listinfo/python-list

Re: Windows getting local ip address

2006-03-22 Thread utabintarbo
You can do essentially the same thing substituting "ipconfig" for ifconfig. Though I am sure there are better ways -- http://mail.python.org/mailman/listinfo/python-list

Raw strings as input from File?

2009-11-24 Thread utabintarbo
I have a log file with full Windows paths on a line. eg: K:\A\B\C\10xx\somerandomfilename.ext->/a1/b1/c1/10xx \somerandomfilename.ext ; txx; 11/23/2009 15:00:16 ; 1259006416 As I try to pull in the line and process it, python changes the "\10" to a "\x08". This is before I can do anything with

Re: Raw strings as input from File?

2009-11-24 Thread utabintarbo
On Nov 24, 3:27 pm, MRAB wrote: > > .readlines() doesn't change the "\10" in a file to "\x08" in the string > it returns. > > Could you provide some code which shows your problem? Here is the code block I have so far: for l in open(CONTENTS, 'r').readlines(): f = os.path.splitext(os.path.spli

Python creates "locked" temp dir

2010-12-07 Thread utabintarbo
I am using tempfile.mkdtemp() to create a working directory on a remote *nix system through a Samba share. When I use this on a Windows box, it works, and I have full access to the created dir. When used on a Linux box (through the same Samba share), the created directory shows as "locked", and I a

Re: Python creates "locked" temp dir

2010-12-08 Thread utabintarbo
subdir1/tmp/ program/y-Z0h3/file.ext' I also tried to create a similar dir under 'tmp' using os.mkdir and while the dir was not locked such that only the owner could do anything in it, it was not writeable by anything other than the owner, even when mode 0777 was specified explicitly.

Re: Python creates "locked" temp dir

2010-12-16 Thread utabintarbo
FWIW, I got around the issue with some samba mount options. They still show as 0700, but I, or anybody elsefor that matter, can still access them. Computers are weird. :P Thanks to all who responded. :) On Dec 10, 2:57 pm, Alex Willmer wrote: > On Dec 8, 6:26 pm, Christian Heimes wrote: > > >

Cross-platform file paths

2010-05-07 Thread utabintarbo
Until now, I have used the UNC under Windows (XP) to allow my program to access files located on a Samba-equipped *nix box (eg. os.path.normpath(r"\\serverFQDN\sharename\dir\filename")). When I try to open this file under Linux (Red Hat 5), I get a file not found error. Is there a cross-platform m

Re: Cross-platform file paths

2010-05-07 Thread utabintarbo
On May 7, 11:23 am, cassiope wrote: > > normpath will convert forward slashes to backslashes on WinXX systems, > but > does not seem to do the reverse on posix systems...so try changing > your > string to use forward slashes.  Also- is the path otherwise the same > on > your Linux system? > > HTH.