durumdara wrote:
> Hi Larry!
>
>> durumdara wrote:
>> You can easily find out roughly how many bytes are in your .ZIP archive
>> by using following:
>>
>> zipbytes=Zobj.fp.tell()
>>
>
> The main problem is not this.
> I want to write a backup s
in get_type
raise ValueError, "unknown url type: %s" % self.__original
ValueError: unknown url type: www.google.com
Note the traceback.
you need to call it with type in front of the url:
>>> import urllib2
>>> urllib2.urlopen('http://www.google.com')
>
Python's interactive mode is very useful for tracking down this type
of problem.
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
Twisted wrote:
> On Jun 9, 8:21 pm, "BCB" <[EMAIL PROTECTED]> wrote:
>> "Paul McGuire" <[EMAIL PROTECTED]> wrote in message
>>
>> news:[EMAIL PROTECTED]
>>
>>> On Jun 9, 6:49 am, Lew <[EMAIL PROTECTED]> wrote:
> In particular, Perl code looks more like line
> noise than like code from any k
e there may be ways of doing this, I have found that you are much
better off opening another window and run your script from the bare
OS. It will help you catch problems that you may miss in the
interpreter shell. It also solves this problem completely.
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
; thanks very much.-
>
Wouldn't it be better to make the process that you start respond gracefully
to some signal? Either a command over a socket or some other signal?
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
all the class
instances. If you reset it based on param it will be reset every time
you create a new instance of the Base class with a different param. Is
that really what you want to do? If so just use:
class Base(object):
dataset = None
def __init__(self, param):
if self.d
log
class main:
def getfilefromdialog(self):
self.filenamefromdialog=...
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
teProcess(execute_target,
commandLine,
processAttributes,
threadAttributes,
bInheritHandles,
dwCreationFlags,
newEnvironment,
currentD
Then it is pretty easy to do something in my code like:
section='Testcases'
cases=[x for x in INI.options(section) if x.startswith('case_')]
for case in cases:
casefile=INI.get(section, case)
#
# Process each casefile here
#
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
king), but I thought I should
> check here first and see if someone could help me wrap my brain around
> this problem. You'll never learn if you never try, right?
>
Just use a database with an auto-incrementing column. It will handle all
the "threading" that you think you require and each call will return the next
number you need.
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
f your users aren't programmers, then why not just run Python over
> the network? That's what we do at my place of employment. The only
> machines that have Python actually installed are development machines.
>
> Mike
>
Another solution is to use py2exe to convert your python program into an .exe
file that you can distribute. Then they require no Python installation at all.
I use py2exe and Inno Installer to do just that and it works great.
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
Johny wrote:
> Is it possible to create a file on Linux with access rights?
> For example
> owner can read and write into the file
> others can only read from the file
> Thanks for replies
> L.
>
See os.chmod()
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
gain depending on access required).
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
en creates files for me, so I'm uncertain why you think it isn't for you.
the .read() method accepts the number of bytes not the buffer to store bytes
read.
data=self.m_file.read(4) would read 4 bytes into string object pointed to by
data.
sizeof() in Python is len()
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
explicit requirement:
def foo(arg1):
if isinstance(arg1, (basestring, unicode):
print "is string"
else:
print "is NOT string"
return
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
act nature of your problem I can tell you that
the src string you have defined won't work becaust \t is a tab character. To
make shutil.copyfile work you need to do:
src = r"c:\mydata\test\mygeo.mdb"
dst = r"v:\updated\data\mygeo.mdb"
or
src = "c:\\mydata\\test\\mygeo.mdb"
dst = "v:\\updated\\data\\mygeo.mdb"
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
re filename.html")
(at least this works on my system).
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
Carsten Haese wrote:
> On Tue, 2007-04-17 at 16:54 -0500, Larry Bates wrote:
>> Does anyone know if there is a way to make a Python COM object
>> act like a proper iterator in VB/Delphi?
>
> I don't use COM, VB, or Delphi, but Google turned up these two
> references
Carsten Haese wrote:
>> [...]
>>> On Tue, 2007-04-17 at 16:54 -0500, Larry Bates wrote:
>>>> Does anyone know if there is a way to make a Python COM object
>>>> act like a proper iterator in VB/Delphi?
>> [...]
>
> After more googling, starin
Clement wrote:
> how to get the file from NFS share in python..
>
NFS share is mounted on your local directory, you get to it
the same way you would any other file (e.g. go to the mount
point and get the file).
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
LAN bandwidth C won't help at all.
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
Clement wrote:
> On Apr 19, 11:44 pm, Larry Bates <[EMAIL PROTECTED]> wrote:
>> Clement wrote:
>>> how to get the file from NFS share in python..
>> NFS share is mounted on your local directory, you get to it
>> the same way you would any other file (e.g.
e a real use
> case when we would test for endswith like this? (knowing that it must
> return false?)
>
> Thanks for any ideas/experience.
> Boris
>
Seems like a convenience I've never used.
>>> a="abcdef"
>>> a.endswith('cd',2,4)
True
>>> a[2:4].endswith('cd')
True
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
gt; in case of a collision, so when you lookup a key they can tell which
> you're really looking for.
Maybe this will help:
http://wiki.python.org/moin/DictionaryKeys
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
x27;t support XML Schema validation.)
>
> Any suggestions?
I don't know if it meets ALL of your requirements but this might
help:
http://www.reportlab.org/pyrxp.html
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
2,4:3}
>>>> a = b
>
Syntax error in the first example but if you fix that the first two are
equivalent (but I would suspect that the second would be faster for large
dictionaries).
The third example both a and b point to the same dictionary after the a=b
which you can see from:
>>> a is b
True
>>> id(a)
31760224
>>> id(b)
31760224
>>>
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
Gabriel Genellina wrote:
> En Fri, 20 Apr 2007 14:28:00 -0300, Larry Bates
> <[EMAIL PROTECTED]> escribió:
>
>> Bill Jackson wrote:
>>> What is the benefit of clearing a dictionary, when you can just reassign
>>> it as empty?
>>
>> If you have o
and is intended to
replace popen (which still works if you prefer to use it).
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
gt;>> What hardware? What OS?
>> Debian Sarge/Etch, i386..
>>
>> :P
>
> Gret. Now we only need to guess what scan code reader you use
>
>
>
I believe he his referring to keyboard scancodes not a scanner.
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
application, you should contact their tech
support for a solution. The problem isn't specifically a Python
problem but rather an implementation problem with their app.
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
e some chance of figuring
out why this working code stops. There's nothing wrong with this code,
the problem is somewhere else.
Suggestion:
lineCount = 0
for line in sysFile:
lineCount +=1
print str(lineCount) + " -- " + line
can be written:
for lineCoun
s in VB, Delphi, and
Python I am once again reminded why I love Python. I have more lines
of declarations in the Delphi version than in the Python program for some
tests.
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
ar!!!
>
> How can I do this?
>
Use a dictionary. Example:
var1=10
var2="abc"
var2=1.2
vardict['var1']=var1
vardict['var2']=var2
vardict['var3']=var3
print vardict['var1']
print vardict['var2']
print vardict['var3']
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
t the interruption as
> cleanly as possible?
>
> thanks!
>
I suspect that you would make a file-like object that has a read
method and pass it to storbinary instead of your normal fp argument.
Then you can signal it to stop gracefully. Haven't tested, but
it shoul
27;a','b','c','y','z']
key in {'key1':1, 'key2': 2}
The in you see with a for isn't associated with the for loop
but rather the sequence you are iterating over
for i in range(10):
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
of the same. Keep up the good work. Cheers!
>
the generic http browser upload doesn't give you any opportunity to
have a callback so you can update the screen with any progress.
There are some Java solutions available, but IMHO it will take a
major change to browser's http upload imp
uch.
Normally you define a Python class that has methods that ADxList.OnUpdate
is expecting to be able to call. Then depending on implementation you
either call it with an instance of that class or you may have to wrap
the instance in a COM IDispatch object by calling win32com.server.util.wrap()
around an instance of the function. Sorry I can't be more helpful.
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
way the remainder.
3) You can sort on float just fine, so why do you need int()?
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
rn ''.join(rtnvals)
Then in your main program
bS=blockStruct()
bs.hstring='this is a test'.ljust(240, ' ')
bs.W=12
bs.X=17
bs.Y=1
bs.Z=0
print bS
Seemed to be a good way that made debugging and understanding
easy for me.
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
haven't found any setup that works.
>
I think that most people accomplish this by:
class blah:
__initial_values={'a': 123, 'b': 456}
def __init__(self):
self.__dict__.update(self.__initialvalues)
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
n my 32-bit windows machines.
> Thanks.
>
Sounds like system can't find defrag. Usually this is because of a path
issue. Are you running the script in the foreground or scheduled? Can
you open a command prompt and enter the command and have it work? If
you give full path, this shouldn't be the problem.
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
nt. I have the
// callback working perfectly in pure-Python code.
//
oC.WSset_callback(@Callback);
When I compile I get:
[Pascal Error] wsAPICOM.dpr(151) E2281 Type not allowed in Variant
Dispatch call.
Thanks in advance for any assistance.
Regards,
Larry
--
http://mail.python.org/mailman/listinfo/python-list
minitotoro wrote:
> On May 2, 3:07 pm, Larry Bates <[EMAIL PROTECTED]> wrote:
>> [EMAIL PROTECTED] wrote:
>>> I have a script that runs fine in Windows 2003 (32-bit). It basically
>>> calls the Windows defrag command. When I try the exact same code on
>>>
hon code is now :
>
> def SqVal(self,val):
> ##volr=[val[0][0][i] for i in range(size(val,2))]
> ##voli=[val[0][1][i] for i in range(size(val,2))]
> ##mat1=mat(volr)+1j*mat(voli)
> ##up=linalg.pinv(mat1)
> ##out=up.real.tolist()
> ##out.extend(up.imag.tolist())
> return val
>
> By the way Do you have any idea to debug the com server script ? ( I
> would like to know if a can access the value in the function while
> calling it from vb 6)
>
>
>
>
> tahnks a lot !
>
>
Debugging COM objects is best done using logging module or at least
writing to a file during processing. You can review the log file
to see what was going on.
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
to a function. You should probably post
back to their website instead of here.
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
#x27;t see any empty values in any fields or anything...
>
You really should post some code and the actual traceback error your
get for us to help. I suspect that you have an ill-formed record in
your CSV file. If you can't control that, you may have to write your
own CSV dialect parser.
e different sections [section] with labels under each
section. Use configParser to read this and then get options with
geting(section, option).
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
t;""
> Depreciated is often confused or used as a stand-in for "deprecated";
> see deprecation for the use of depreciation in computer software
> """
>
>
> Alex
Isn't deprecated like depreciated but not quite to zero yet?
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
hanks
>
The best place to start is always:
import ConfigParser
help(ConfigParser)
Example:
section='INIT'
option='logfile'
logfile=configdict.get(section, option)
most of the methods are self explanitory.
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
to use a class to pass everything:
class _vars:
def __init__(self, vars=None):
if vars is not None:
for varname, value in vars.items():
setattr(self, varname, value)
return
vars=_vars({'_varA': 0, '_varB': 0})
Then you can access:
object that has all the methods any other string object
will have. Objects don't have to be named (via variables) to have
methods.
You could write:
underline="_"
underline.join(a)
> And still other times, is seems that "this" is an object, acted upon
> by "that" :
>
>>>> a = list("1234")
>>>> b = "_".join(a)
>>>> b.split("_")
> ['1', '2', '3', '4', '5']
>
Not really, you can write:
underline="_"
b=underline.join(a)
c=b.split(underline)
seems perfectly clear to me (but I have to admit it took me a while
to see the beauty of python's syntax).
> BTW: it seems a bit odd to that the positions of the string, and the
> delimitor, are reversed between the complementory functions join(),
> and split(). I suppose if it weren't for OO, we have something
> terribly complicated, like:
>
> split(str, "_")
> join(str, "_")
>
> Again, those who think in Python, will understand right away that:
>
> math.count(x)
>
> is counting the substring "x" in the "math" string. But can you see
> where that might be confused to be a function called count() in the
> math module?
Actually it could be either. If you write your own class called math
that has a count method this would work. If the math module had a
count method (which it doesn't) and you import it, you might call that
method of the math module this way. One thing you will come to
appreciate is that you can replace virtually any module, function,
etc. in Python with your own code. A mistake many new python programmers
make is to shadow str, list, dict, etc. by using them as variable names.
Then later they can't figure out why they can't do str(n).
Hope the feedback helps.
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
7;)
lists=[]
for n, line in enumerate(fp):
try: l=eval(line)
except SyntaxError:
print "SyntaxError on line=%i" % (n+1)
lists.append(l)
If you want something different, I might use a tab between lists
and commas between values.
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
'',
> '3.0', '', '', '']
>
> It doesn't remove all of the empty elements. Is there a better way to
> split the original string? Or a way to catch all of the empty
> elements?
>
> Thanks
>
When you split on a space (' ') multiple spaces will return empty list
elements between them. Change to:
line = ' SRCPARAM 1 6.35e-07 15.00 340.00 1.10 3.0 '
li = line.split()
And you will get what you want:
['SRCPARAM', '1', '6.35e-07', '15.00', '340.00', '1.10', '3.0']
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
code that are dependent on
calldll. Anyone out there have a version that works with Python
2.5 so I don't have to a massive rewrite?
Thanks in advance,
Larry
--
http://mail.python.org/mailman/listinfo/python-list
beast.
As with any open source product it is much better to roll up your sleeves
and pitch in to fix a problem than to rail about "how it is stupidly
broken". You are welcome to submit a patch or at the very least a good
description of the problem and possible solutions. If you have
s to achieve this would be very appreciated.
>
> Thanks,
>
If you want "real" progress than you must do it with some asynchronous
communications via XMLRPC or sockets. You can "simulate" progress by
doing a little client-side javascript and include a progressive GIF.
Ther
n Python, I find I write almost
100% of my code in Python. This means that I am getting better at
Python not learning lots of other languages which I will never know
well.
I hope you find the information at least helpful.
Regards,
Larry
--
http://mail.python.org/mailman/listinfo/python-list
t would help me understand
> python syntax a little better.
>
> Thanks
>
> Richard
>
I find something like the following easy to read and easy to
extend the contents of searchkeys in the future.
searchkeys=range(60, 69) + [3]
goodlist=[(k, v) for k, v in mydict.items() if
self.__list.append(obj)
if self.__add_cb:
self.__add_cb(self, obj)
else:
raise ObjListException("append.obj must implement 'methodname'" \
method")
I would also write append_many as:
def extend(self, lst):
map(self.append, lst)
return
I would find it easier to remember extend (since that is very pythonic).
If your collection of objects is large, I would also consider
putting them in a dictionary instead of a list and indexing them
on ID.
Hope this helps in some way.
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
Thanks.
> Björn
>
I wrote this a donated to Python Cookbook some time ago, enjoy.
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/299207
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
Gigs_ wrote:
> does anyone know some good tutorial on pipes in python?
>
> thx
Pipes is specific only to Windows (you can use sockets
on Windows/Linux/mac). The only specific treatment of
pipes I've seen is in Python Programming for Win32 by
Mark Hammond/Andy Robinson.
-
t; Thanks.
> Björn
>
See example here:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/299207
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
o drag & drop components with wxPython ?
>
> thanks,
> Stef Mientki
The demo that comes with wxWindows has good examples of this.
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
Gabriel Genellina wrote:
> En Tue, 22 May 2007 11:11:45 -0300, Larry Bates
> <[EMAIL PROTECTED]> escribió:
>
>> Gigs_ wrote:
>>> does anyone know some good tutorial on pipes in python?
>>
>> Pipes is specific only to Windows (you can use sockets
&g
>
> Thanks!
> Gerardo
The server (Google) on the other end doesn't know what type of app you
are. It just responds to XMLRPC requests. I haven't used the interface
but I'm guessing that I would use Twisted to make XMLRPC request to Google
and process the response XML payloa
["Followup-To:" header set to comp.lang.lisp.]
On 2007-05-23, Xah Lee <[EMAIL PROTECTED]> wrote:
> The Concepts and Confusions of Prefix, Infix, Postfix and Fully
> Functional Notations
>
> Xah Lee, 2006-03-15
Xah, why do you post year-old essays to newsgroups that couldn't care
less about them?
nary when read
from a file. More info will be required to help more.
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
p memory or will it fail?
>> What about putting the data into a database? If the keys are strings the
>> `shelve` module might be a solution.
>>
>> Ciao,
>> Marc 'BlackJack' Rintsch
>
>
Purchase more memory. It is REALLY cheap these days.
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
t;e"]])
>>>> len(open("tmp.csv").readlines())
> 3 # number of lines
>>>> len(list(csv.reader(open("tmp.csv"
> 2 # number of records
>
> Peter
>
Did you try:
import crystal_ball
num_lines=crystal_ball(reader)
Sorry I couldn't resist.
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
e that your SMTP server uses this type of authentication?
Some SMTP servers use POP3 followed by SMTP to authenticate instead.
use telnet to verify, this link might help.
http://www.computerperformance.co.uk/exchange2003/exchange2003_SMTP_Auth_Login.htm#3)%20Auth%20Login
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
of new base class : 3DGraph, ..
>
> Thanks
>
> Alain
>
I believe what you are looking for is the 'as' clause on import
from module import Graph as Graph
class Circle(Graph):
pass
Circle will have Graph as its baseclass
from module import ColorGraph as Graph
class Circle(Graph):
pass
Circle will have ColorGraph as its baseclass
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
ook by Mark Hammond/Andy Robinson)
Reading source code to standard library
Reading ReportLab source (www.reportlab.org)
Reading PIL source (www.effbot.org)
Reading wxPython source (www.wxpython.org)
Monitoring this list on a daily basis
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
where 100% would be a perfect match
and any number lower would indicate that it was less
likely that it was a coverpage.
Thanks in advance for any thoughts or advice.
Regards,
Larry Bates
--
http://mail.python.org/mailman/listinfo/python-list
subprocess module.
import os
import sys
os.chdir('D:\\folder')
os.system('D:\\nec2++ -i inputfile.new -o outputfile.out')
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
27;t get it to work properly if the variable outside
> of the function call ends up having its state (e.g., its "next"
> pointer) modified by passing it into other functions.
>
> Any tips on getting this to work? I'm a native C++ programmer still
> learning Python, so I apologize for any confusion. Thanks.
>
By reference means that mutable objects can be modified (in place) by the
functions that they are passed into. This is a common mistake people make when
they first get started. Normally lists seem to throw people first.
I don't know how long the file is, but you probably should just read the entire
file into memory and process it from there.
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
metimes hundreds) of files. So what is the
problem. If you want a single file to distribute, look at Inno Installer. Use
it to make a single, setup.exe out of all the files that come out of py2exe
along with documentation, shortcuts, etc. that a good modern application needs.
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
2000, the some code raise the windows error 126, it
> can't load the module statistics.dll
>
> thanks in advance
>
Using Google on "windows error 126" turned this up, hope it helps.
http://flashexperiments.insh-allah.com/ApacheError126.html
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
istofdirs=[d for d in os.listdir(mydir) if os.pathisdir(d)]
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
added: I'm interesting in validating the file *content*
> - not the filename :-)
>
And what's wrong with bundling PIL in your application?
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
nd expecting them to by synchronized most likely won't
work.
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
or i am getting while creating the exe
> The following modules appear to be missing
> ['amara', 'ext.IsDOMString', 'ext.SplitQName']
>
> can anybody please help me with this?
>
> Thanks,
> Vinod
>
You should post this on gmane.comp.python.
us what operating system
you are running on. Most likely you will want to automate one of the off-the
shelf solutions rather than trying to roll your own.
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
;>> python. How can I do this?
>>> Using the subprocess-module.
>>> However, I'm not sure what DIR /AD /B does - but there are many
>>> functions in module os that might deliver what you want without invoking
>>> an external command.
>>> Diez- Hide quoted text -
>> - Show quoted text -
>
>
That is better done in python with:
import os
dirs=[d for d in os.listdir(os.curdir) if os.path.isdir(d)]
or
dirs=filter(os.path.isdir, os.listdir(os.curdir))
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
IL?
>
> Thanks.
>
ReportLab graphics works for me.
www.reportlab.org
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
IL?
>
> Thanks.
>
ReportLab graphics works for me.
www.reportlab.org
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
so','r')
> ofile = file('/tmp/ubuntu-7.04-desktop-i386.iso.out','w')
>
> encrypt2(crptz, ifile, ofile)
> ifile.close()
> ofile.close()
>
> # crypto_hardcoded.py ends here
>
Padding and keeping information in a header is how I solved the problem.
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
],
2:[Material2, 25.0],
3:[Material3, 12.5]
}
x=3
slab_arg=0
for i in range(1,x):
func, farg=mdict[i]
slab_arg+=func(farg)
Period=Slab(slab_arg)
Obviously not tested!
I sense that the Material functions should be consolidated into something more
general here.
-Larry Bates
--
http://mail.python.org/mailman/listinfo/python-list
>> See e.g. http://docs.python.org/tut/node16.html
>>
>>
> I should also point out that the subject line for this thread is
> inaccurate, as it wasn't rounding ints at all.
>
> regards
> Steve
What are they teaching in schools these days? I see questions like
xt files on that machine. That could be
different from notepad if the user has chosen to override the defaults.
os.system('notepad.exe c:\\junk.txt')
will force notepad.exe to load and it will load the file specified.
All depends on what you want to do.
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
ecific error shown is a DNS resolution problem. Based on the
URL "theHost" smtplib can't resolve to an IP address (which is what
socket.gethostbyname does). You don't say what happened when you changed to
ip,
but I suspect it is a different error or some other problem. Maybe a firewall
issue (port 25 not open?), but I'm just guessing.
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
ant, I think you can
accomplish it by using win32CreateProcess instead of subprocess. You can run
the application minimized or perhaps in a REALLY small window. If you have
modal dialog boxes, I don't think you can do anything as they don't run in the
parent windows frame but rather outside (I could be wrong about this).
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
you you can just loop on them.
fp=open(filename, 'r')
for line in fp:
# do something with line
fp.close()
-Larry Bates
--
http://mail.python.org/mailman/listinfo/python-list
Sandipan News wrote:
> What do I do? Can't do without Python!
> Any experience, advice, hope is welcome.
> Thanks.
> Sandipan
>
>
If you are asking if you can run COM objects created in Python on Windows Vista
Ultimate, the answer is yes. I have several.
-Larry
--
thijs
>
Question is, what should it be converted to when there is no corresponding
ascii character to map the offending character to? Do you want to throw it
away? Your expectation "works always" is very ill-defined. Write a small
function to process the strings yourself and set up a substitution dictionary
to
do the conversion yourself.
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
available for download for prior versions) to parse it for what you
want to extract.
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
ck (most recent call last):
File "", line 192, in run_nodebug
File "", line 2, in
TypeError: Error when calling the metaclass bases
module.__init__() takes at most 2 arguments (3 given)
>>>
Thanks in advance.
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
raw input or from some configuration file?
something like:
python program (pgm.py):
cmdline=raw_input("enter your parameters")
external file (cmd.txt):
"abc def" xyz
python pgm.py < cmd.txt
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
ch 'color' xml
> element inside and
> pull any that have
> values (which would be Black, Light Blue and Green). I'd like to know how to
> pull 'attributes'
> too.
>
> Thanks very much for your help.
>
> Jay
Python 2.5 has elementtree built
.EXE file. Don't
try to update the program via patching "pieces". Wrap everything in a proper
installer (I use and highly recommend Inno Setup). It can handle version
control, there is a plug-in for over-the-wire updates, etc. Best way I know of
to automate everything.
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
ng a list comprehension you would write this as:
for line in lines:
xin, yin, zin=[float(x) for x in line.split()]
This if course expects your data to be perfect. If
you want error handling (e.g. less or more than 3 values,
values that cause exception when passed to float, etc.)
you will have
1101 - 1200 of 1904 matches
Mail list logo