I sometimes see issues like this at work because certain processes, including
scheduled tasks if I remember right, can run as Local System user instead of as
your user account. That tends to be a real pain for Python or Perl scripts
because that means that they don't have the associations config
Clover wrote:
> When trying to do some things on my Mac (starting Lyx, compiling Latex
> via TextMate) I get this error:
>
> python: execv:
> /Library/Frameworks/Python.framework/Versions/2.5/Resources/Python.app/Contents/MacOS/Python:
>
> No such file or directory
>
> I (and people on Lyx an
Lamonte Harris wrote:
> File "Desktop\python\newsystem\init.py", line 51, in random_n
> random_name = a+b+c+d+e+ 'temp.txt'
> TypeError: unsupported operand type(s) for +: 'int' and 'str'
>
> import random
> def random_name():
> a = random.randint(0,9)
> b = random.randint(0,9)
>
Shawn Milochik wrote:
> Although you're technically correct, I think there's a knee-jerk
> anti-regex reaction, citing the meaningless overhead. If you're
> running many thousands of records or something then it becomes a small
> issue compared to a replace statement or something. But in most cases
Robert Dailey wrote:
> Well, I don't know what is wrong with people then. I don't see how
> required arguments are of bad design. Some command-line applications are
> built around performing tasks based on information received. Compilers,
> for example. A compiler can't do much of anything unless y
Shawn Milochik wrote:
> Everybody hates regexes. Except me. Discrimination!
Actually, I love them, they are an amazingly powerful tool. I just happen to
also believe the old axiom "when all you have is a hammer, everything looks
like your thumb". Also the related "some people think when they see
Brian McCann wrote:
> Shawn, Tim ,Jay
>
> many thanks,
>
> It looks like there are many ways this problem can be approached
>
> either by using regex or a tokens
>
> Tim I'm not familiar with your solution, but will learn about that
> method also
> Jay, what do you mean by regex comes with a
Shawn Milochik wrote:
> Hopefully this will help (using your input file)
>
> #!/usr/bin/env python
> import re
> buildinfo = "input.txt"
> input = open(buildinfo, 'r')
>
> regex = re.compile(r"^\s*build.number=(\d+)\s*$")
>
> for line in input:
> if re.search(regex, line):
> print li
John K Masters wrote:
>>From what I have read the string module is obsolete and should not be
> used but I am working on a project that parses printable files created
> in a DOS program and creates a web page for each file. I am using the
> string.printable constant to determine which characters sh
Colin J. Williams wrote:
> I wish to sub-class (if that's the right word) datetime and to use a
> different signature for the constructor.
>
> The second part has gone smoothly, but it is difficult to access the
> type's methods from the sub-class instance.
>
> I'm beginning to wonder whether i
Robert Dailey wrote:
> Hi Jay,
>
> I apologize for not having been detailed enough. Right now I'm using a
> C++ library known as TinyXML to parse my XML files. When a menu is to be
> displayed, the XML is parsed and the appropriate images, text, etc that
> will display on the menu is loaded based
Robert Dailey wrote:
> I'm currently developing a game for a cell phone. The game has a GUI
> system that's currently using XML to define the individual menus.
> Basically this means that for every single menu the user goes to, it
> loads and parses an XML file. Would using Python S
Steve Holden wrote:
> greg wrote:
>> Jay Loden wrote:
>>> Like most things involving dynamic client side-javascript code and AJAX
>>> technology, it's a lot harder than you'd like it to be to solve the
>>> problem, but
>>> in cases where th
Jay Loden wrote:
> Dick Moores wrote:
>> >>> () is ()
>> True
>> >>> (1,) is (1,)
>> False
>>
>> Why?
>>
>> Thanks,
>>
>> Dick Moores
>
>From the docs for 'is':
The operators is and is not
Dick Moores wrote:
> >>> () is ()
> True
> >>> (1,) is (1,)
> False
>
> Why?
>
> Thanks,
>
> Dick Moores
>From the docs for 'is':
--
http://mail.python.org/mailman/listinfo/python-list
Steve Holden wrote:
> This discussion seems to assume that Excel spreadsheets are stored in
> some canonical form so that two spreads with the same functionality are
> always identical on disk to the last bit. I very much doubt this is true
> (consider as an example the file properties that can
Steve Holden wrote:
> As far as I'm concerned the major issue with trying to have "desktop web
> apps" compete with true windowed applications is the difficulty of
> maintaining sensible interactions with the interface. AJAX designs have
> increased the interaction level at the expense of greate
Paul Rubin wrote:
> Sullivan WxPyQtKinter <[EMAIL PROTECTED]> writes:
>> This program:
>> for i in range(10):
>> f.readline()
>> is absolutely every slow
>
> There are two problems:
>
> 1) range(10) builds a list of a billion elements in memory,
> which is many gig
kj7ny wrote:
> Is there a way that I can programmatically find the name of a method I
> have created from within that method? I would like to be able to log
> a message from within that method (def) and I would like to include
> the name of the method from which it was written without having to
>
Madhu Alagu wrote:
> I am looking template based report tools for python.It has the ability
> to deliver rich content onto the screen, to the printer or into PDF,
> HTML, XLS, CSV and XML files.
As others have mentioned, I don't believe that all of the above is implemented
in a single package. How
[EMAIL PROTECTED] wrote:
> Hello everybody, I'm new to python (...I work with cobol...)
>
> I have to parse a file (that is a dbIII file) whose stucture look like
> this:
> |string|, |string|, |string that may contain commas inside|, 1, 2, 3, |
> other string|
There are a number of relatively sim
Gabriel Genellina wrote:
> En Sat, 04 Aug 2007 19:17:35 -0300, Jay Loden <[EMAIL PROTECTED]>
> escribió:
>
>> Paul Rubin wrote:
>>> goldtech <[EMAIL PROTECTED]> writes:
>>>> So I can present the user with an HTML form in it - but how can I
>
Paul Rubin wrote:
> goldtech <[EMAIL PROTECTED]> writes:
>> So I can present the user with an HTML form in it - but how can I
>> write the form data to a local file on my work station?
>
> The simplest way is with the cgi and CGIHTTPServer modules. You'd
> write your form in an html file, with th
goldtech wrote:
> I want to have an HTML form from a local local html file write a text
> field's data to a local text file.
>
> I have no client or server side tools like PHP, JAVA. I don't know
> JavaScript. I can not add anything to the workstation I am using. It's
> going to have to be a clien
Miki wrote:
> Hello,
>
>> I'm using Python for the first time to make a plug-in for Firefox.
>> The goal of this plug-in is to take the source code from a website
>> and use the metadata and body text for different kinds of analysis.
>> My question is: How can I retrieve data from a website? I'm n
VanL wrote:
> Hello,
>
> A couple months ago there was an example posted in a blog of a rest
> interface for validating zip codes. If I recall correctly, the backend
> validator was written in python.
>
> The validator demo page had a single text input; next to the text input
> would appear e
[EMAIL PROTECTED] wrote:
> On Aug 2, 1:45 pm, Roman <[EMAIL PROTECTED]> wrote:
>> Is there a package that converts a string that contains special
>> characters in xml to to literal value. For instance, converts
>> stringhttp://myhome/¶mtohttp://myhome/¶m.
>>
>> Thanks in advance
>
> I've seen ex
Robert Dailey wrote:
> Both strings in your example are exactly the same, unless I'm missing
> something.
>
> On 8/2/07, Roman <[EMAIL PROTECTED]> wrote:
>> Is there a package that converts a string that contains special
>> characters in xml to to literal value. For instance, converts string
>> h
Joshua J. Kugler wrote:
> I am getting results like these with the time module:
>
import time
int(time.mktime(time.strptime('2007-03-11 02:00:00', '%Y-%m-%d %H:%M
> %S')))
> 1173610800
int(time.mktime(time.strptime('2007-03-11 03:00:00', '%Y-%m-%d %H:%M
> %S')))
> 1173610800
ti
Ian Witham wrote:
> Hello,
>
> I'm hoping someone here can put me on the right track with some broad
> concepts here.
>
> What I am hoping to achieve is a simple HTML page to be served over
> our company LAN, into which the users (Real Estate Agents) can enter a
> property address or reference nu
james_027 wrote:
> Hi,
>
> On Aug 1, 5:18 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote:
>> On Wed, 01 Aug 2007 09:06:42 +, james_027 wrote:
>>> for example I have this method
>>> def my_method():
>>> # do something
>>> # how do I get the name of this method which is my_method
momobear wrote:
> hi, Is there any way to show me detailed listings of all TCP and UDP
> endpoints in my microsoft windows XP in python way?
> thanks.
Not sure if it's exactly what you're looking for, but this might be of use as a
starting point at least:
http://aspn.activestate.com/ASPN/Cookboo
Steve Holden wrote:
> In this particular case the documentation is quite explicit about the
> return value and the documentation for the function runs to almost 400
> words. Do you expect *everything* to be in the source? That isn't
> practical, as documenting everything twice like that makes tw
Hexamorph wrote:
> Hexamorph schrieb:
>> Jay Loden schrieb:
>>> I have to agree with you WRT to the Python documentation, it does tend
>>> to be lacking and difficult to find things at times.
>
> Hmm, I find the Python documentation just excellent. You are
&
Robert Dailey wrote:
> Hey,
>
> Thanks a lot for your answers guys. I had already known that strings are
> immutable, but having been a C++ programmer for years I'm still trying to
> get over the fact that it's not std::string :) The python documentation
> isn't that easy to navigate in my opinion
Robert Dailey wrote:
> Hi,
>
> I have the following code:
>
> str = "C:/somepath/folder/file.txt"
>
> for char in str:
> if char == "\\":
> char = "/"
>
> The above doesn't modify the variable 'str' directly. I'm still pretty new
> to Python so if someone could explain to me why thi
Nagarajan wrote:
> On Jul 31, 9:03 am, Gilles Ganault <[EMAIL PROTECTED]> wrote:
>> Hello
>>
>> I'm sure there's a much easier way to read a two-column, CSV file into
>> an array, but I haven't found it in Google.
>>
>> Should I use the Array module instead?
[...snip]
> a = []
> import csv
> read
MarkyMarc wrote:
> Hi All,
>
> A small newbie Q.
>
> I have made a nice log function in me program. The program writes some
> data to me mysql database.
> When I write to the database I get som warnings back.
>
> Have do I write these to me log file?
> I know I have to use the the warnings api.
samwyse wrote:
> Interestingly enough, this works:
>
> C:\Python25>path=%path%;C:\Python25\Lib\site-packages\pywin32-210-
> py2.5-win32.eg
> g\pywin32_system32
>
> C:\Python25>python
> Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit
> (Intel)] on win32
> Type "help", "copyrigh
Roy Smith wrote:
> In article <[EMAIL PROTECTED]>,
> billiejoex <[EMAIL PROTECTED]> wrote:
>
>> Hi there.
>> I'm setting up test suite for a project of mine.
>> >From test suite, acting as a client, I'd like to know, in certain
>> situations, if the socket is closed on the other end or not.
>> I
Ben Finney wrote:
> Neil Cerutti <[EMAIL PROTECTED]> writes:
>
>> On 2007-07-24, Robert Dailey <[EMAIL PROTECTED]> wrote:
>>> Hi,
>>>
>>> I have a string in the following format:
>>>
>>> "00:00:25.886411"
>>>
>>> I would like to pass this string into the datetime.time() class
>>> and have it parse
Grant Edwards wrote:
> On 2007-07-25, Jeff <[EMAIL PROTECTED]> wrote:
>
>> That might be a memory problem if you are running multiple processes
>> regularly, such as on a webserver.
>
> I suppose if you did it in parallel 50 processes, you could use
> up 250MB of RAM. Still not a big deal on man
Brian Blais wrote:
> Hello,
>
> I am running OS X 10.4, on an Intel Mac, Python 2.5 not installed by
> source (I used the binary install from the website). When I do the
> following, I get an error:
>
> Python 2.5.1 (r251:54869, Apr 18 2007, 22:08:04)
> [GCC 4.0.1 (Apple Computer, Inc. build
Gilles Ganault wrote:
> Problem is, when I add re.DOTLINE, the search takes less than a second
> for a 500KB file... and about 1mn30 for a file that's 1MB, with both
> files holding similar contents.
>
> Why such a huge difference in performance?
>
> = Using Re =
> import re
>
pycraze wrote:
> Hi ,
>
> I am working on NTLM (Windows NT Lan Manager )APS
> (Authentication Proxy Server ) , to port to C language .
the 'wget' utility supports NTLM authentication as of version 1.1.0 or so, you
might try just looking at the C source code to wget if you're looking to
imp
Steve Holden wrote:
> It took a little bit more careful planning to get Icon pattern-matching
> structures right, but there was much more explicit control of
> backtracking. I only wish they'd grafted more OO concepts into it, then
> I might never have bothered with Python! Someone did do an OO
[EMAIL PROTECTED] wrote:
>> A slightly more generic match in case your package names turn out to be less
>> consistent than given in the test cases:
>>
>> #!/usr/bin/python
>>
>> import re
>> pattern = re.compile(r'(\w+?-(\d+[\.-])+\d+?)-\D+.*RPM')
>> pkgnames = ["hpsmh-1.1.1.2-0-RHEL3-Linux.RPM",
[EMAIL PROTECTED] wrote:
> On Jul 14, 3:39 am, "Viewer T." <[EMAIL PROTECTED]> wrote:
>> I am trying to write a script that deletes certain files based on
>> certain criteria.
>>
>> What I am trying to do is to automate the process of deleting certain
>> malware files that disguise themselves as sy
[EMAIL PROTECTED] wrote:
> I thought about doing that with python (for which I'm in process of
> learning), but maybe an other tool (like sed?) would be better suited
> for this job.
Generally speaking, in my experience, the best tool for the job is the one you
know how to use ;) There are of cou
Helmut Jarausch wrote:
> [EMAIL PROTECTED] wrote:
>> Extract the application name with version from an RPM string like
>> hpsmh-1.1.1.2-0-RHEL3-Linux.RPM, i require to extract hpsmh-1.1.1.2-0
>> from above string. Sometimes the RPM string may be hpsmh-1.1.1.2-RHEL3-
>> Linux.RPM.
>>
>
> Have a tr
If you're running on a UNIX platform, one option would be to use SSH to execute
the command remotely. Otherwise, you could also use a client/server setup to
have the two scripts communicate across the network and trigger actions etc. It
may also be possible to remotely execute an application on
Alex Martelli wrote:
> since what you're doing is...:
>
s = "onomatopoeia"
s = s.join(s[::-1])
s
> 'aonomatopoeiaionomatopoeiaeonomatopoeiaoonomatopoeiaponomatopoeiaoonoma
> topoeiatonomatopoeiaaonomatopoeiamonomatopoeiaoonomatopoeianonomatopoeia
> o'
>
> ...which isn't really jus
Evan Klitzke wrote:
>
>> I guess that's it. The first one reads more like a textbook example which
>> is about where I am at. Is there any speed benefit from the one liner?
>
> The one line is quite a bit faster:
>
> [EMAIL PROTECTED] ~ $ python -m timeit 's = "onomatopoeia"; s =
> s.join(s[::-
Matthew Peter wrote:
> For example, how do I get this to work?
>
> def func():
> print "This is", __?__
> return __caller__
>
> def echo():
> print "This is ", __?__
> return func()
>
>
print echo()
> This is echo
> This is func
> echo
This may not be what you're looking
vj wrote:
> I posted too soon:
>
>> Statement 1:
>> my $today = sprintf("%4s%02s%02s", [localtime()]->[5]+1900,
>> [localtime()]->[4]+1, [localtime()]->[3]) ;
>
> 1. is localtime the same as time in python?
http://perldoc.perl.org/functions/localtime.html
It's more like time.localtime()
One
Neil Cerutti wrote:
>> Is there a way to write a method that would list automatically
>> all the variables defined as a property (say by printing their
>> docstring and/ or their value), and only those variables?
>
> This is off the cuff. There's likely a better way.
>
> for k, v in MyClass.__di
All,
In studying Python, I have predictably run across quite a bit of talk about the
GIL and threading in Python. As my day job, I work with a (mostly Java)
application that is heavily threaded. As such our application takes good
advantage of multiple processors and we can often scale through
[EMAIL PROTECTED] wrote:
> [EMAIL PROTECTED] root]# python t4.py
> enter number: 6
> [EMAIL PROTECTED] root]#
>
> i.e it takes the input but doesn't print anything. If anybody can
> help... Thanx!
You're creating a function called "f" in the first line, but the script never
does anything with i
kj wrote:
>
> I've tried a bazillion ways to code dynamically generated methods,
> to no avail.
>
> The following snippet is a very simplified (and artificial) demo
> of the problem I'm running into, featuring my latest attempt at
> this. The idea here is to use __getattr__ to trap any attempt
billiejoex wrote:
> Hi there,
> unfortunately, I'm compelled to apply a sort of monkey patching at the
> code of an existing libreary that I can't modify directly.
> Here's my question
> Having such code:
>
> class test:
>
> def caller(self):
> self.b()
>
> def called(self):
>
billiejoex wrote:
> Hi there,
> unfortunately, I'm compelled to apply a sort of monkey patching at the
> code of an existing libreary that I can't modify directly.
> Here's my question
> Having such code:
>
> class test:
>
> def caller(self):
> self.b()
>
> def called(self):
>
Jay Loden wrote:
> Can you elaborate (or just point me to a good doc) on what
> you mean by an "old style" class versus the new style? I
> learned Python (well, am still learning) from an older book,
> and I just want to make sure that I'm using the preferred method.
Alex Martelli wrote:
>
> class a_class:
>
> This is ALL of the problem: you're using a legacy (old-style) class, and
> properties (particularly setters) don't work right on its instances (and
> cannot, for backwards compatibility: legacy classes exist exclusively to
> keep backwards compatibi
Robin Becker wrote:
> I wish to prevent a python script from running twice; it's an hourly job, but
> can take too long.
>
> My simplistic script looks like
>
>
> ...
> def main():
> fn = 'MARKER'
> if os.path.isfile(fn):
> log('%s: hourly job running already' % formatTi
Adam Pletcher wrote:
> Do you mean files marked in-use by the OS, like DLLs used by an open
> application?
>
> There shouldn't be anything preventing you from copying in-use files, or
> even read-only files if that's what you meant:
>
> import shutil
> shutil.copy('C:\\my_application\\test.
Stefan Behnel wrote:
> Jay Loden wrote:
>> Someone else mentioned lxml but as I understand it lxml will only work if
>> it's valid XHTML that they're working with.
>
> No, it was meant as the OP requested. It even has a very good parser from
> broken HTML.
Stefan Behnel wrote:
> Jay Loden wrote:
>> Someone else mentioned lxml but as I understand it lxml will only work if
>> it's valid XHTML that they're working with.
>
> No, it was meant as the OP requested. It even has a very good parser from
> broken HTML.
Neil Cerutti wrote:
> You could get good results, and save yourself some effort, using
> links or lynx with the command line options to dump page text to
> a file. Python would still be needed to automate calling links or
> lynx on all your documents.
OP was looking for a way to parse out part of
John J. Lee wrote:
> Johny <[EMAIL PROTECTED]> writes:
>
>> How can I get a website thumbnail?
>> I would like to allow visitors to add their URLs to our pages with
>> the thumbnail of their website.
>> Can anyone suggest a solution for web thumbnails?
>> Thanks
>> L.
>
Don't know if this rea
Carlos Luis Pérez Alonso wrote:
> I have the next piece of code:
>
>
> if re.search('^(taskid|bugid):\\d+',logMessage):
> return 0
> else:
> sys.stderr.write("El comentario tiene que contener el taski
Josiah Carlson wrote:
>
> Ahh, so you want to pass the method name to the method that you are
> returning to be called. No problem.
>
> >>> import functools
> >>>
> >>> class foo:
> ... def __getattr__(self, name):
> ... return functools.partial(self.ActualMethod, name)
> ...
>
Hi all,
First, apologies if anyone gets this twice, but it took me quite a
while to figure out that Python.org is evidently rejecting all mail
from my mail server because I don't have reverse DNS configured.
Anyway:
I'm not even sure how to phrase this question properly or the right
terminology o
You didn't mention platform, but I'm guessing from the mention of Screem that
you're using a Linux platform. On Linux I like kwrite and kate (both
similar, kate includes some other features like a built in terminal where you
can run some commands, ability to support projects, open multiple file
You didn't mention platform, but I'm guessing from the mention of Screem that
you're using a Linux platform. On Linux I like kwrite and kate (both
similar, kate includes some other features like a built in terminal where you
can run some commands, ability to support projects, open multiple file
Are visitors welcome? I just happen to be in NJ, and I would like to attend
my first PIG/IP Also, are you related in any way to LUG/IP?
-Jay
On Monday 17 January 2005 10:36, [EMAIL PROTECTED] wrote:
> Central New Jersey PIG Meeting -- Python Interest Group In Princeton
> PIG/IP
>
> PIG/IP will
75 matches
Mail list logo