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
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
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
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
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.
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
... lock file?
--
http://mail.python.org/mailman/listinfo/python-list
>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
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
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
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
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
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
For simple, it's hard to beat EasyGUI: http://www.ferg.org/easygui/
Bob
--
http://mail.python.org/mailman/listinfo/python-list
http://sourceforge.net/projects/pycron/
--
http://mail.python.org/mailman/listinfo/python-list
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
Look into the subprocess module. Possibly relevant link follows:
http://docs.python.org/lib/node244.html
--
http://mail.python.org/mailman/listinfo/python-list
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
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
Take a look at http://sourceforge.net/projects/pycron/ . It may give
you some ideas.
Bob
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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
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
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
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.
>
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
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
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
http://www.demonseed.net/~jp/code/magic.py
--
http://mail.python.org/mailman/listinfo/python-list
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
[EMAIL PROTECTED] wrote:
> Regards,
> [EMAIL PROTECTED]
Thanks!
--
http://mail.python.org/mailman/listinfo/python-list
Darwinism in action! :-P
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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
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
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
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
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
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
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
OK, I guess it WAS that easy. :-P
Thanks for the replys.
Bob
--
http://mail.python.org/mailman/listinfo/python-list
pyobfuscate
http://www.lysator.liu.se/~astrand/projects/pyobfuscate/
--
http://mail.python.org/mailman/listinfo/python-list
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
Take a look at: http://dirssync.sourceforge.net/
See if that gives you any direction.
--
http://mail.python.org/mailman/listinfo/python-list
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
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
CX_Freeze?
http://starship.python.net/crew/atuining/cx_Freeze/
--
http://mail.python.org/mailman/listinfo/python-list
How?
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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
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
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.
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:
>
> >
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
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.
58 matches
Mail list logo