Re: Python Newbie

2013-02-26 Thread Larry Hudson
y data type. The objects they reference have data types. Variables can be assigned and RE-assigned to any data type at any time. Again, I emphasize, QUIT THINKING IN ANOTHER LANGUAGE, it simply doesn't work. You might like it if it were so, but it simply does not match reality. -=- L

Re: Vowels [was Re: "monty" < "python"]

2013-03-20 Thread Larry Hudson
t of totally irrelevant trivia... (And I am going strictly from memory of hearing this, so I can't cite any references to confirm it, but anyway my memory says...) The word "apron" was originally "napron", and over the years the phrase "a napron" mutated to

Re: I hate you all

2013-04-06 Thread Larry Hudson
delimit code blocks, like the python syntax does. And in actual practice, that has been shown to be a Good Thing. Thank you, Timothy Madden -=- Larry -=- [1]. I just turned 76 and definitely tend to be a curmudgeon, so sorry if I sound too insulting, but it is the way I feel. -- http:

Re: While loop help

2013-04-09 Thread Larry Hudson
ng. I hope this jump-starts your thinking. Keep at it, it's worth the effort. -=- Larry -=- -- http://mail.python.org/mailman/listinfo/python-list

Re: While loop help

2013-04-10 Thread Larry Hudson
On 04/09/2013 11:44 PM, Larry Hudson wrote: On 04/09/2013 09:49 AM, thomasancill...@gmail.com wrote: So what would be the proper way to perform a loop of this program. I still can't quite figure out the best way to do it. My suggestion... (pseudocode) # Print a heading/introduction

Re: a couple of things I don't understand wrt lists

2013-04-16 Thread Larry Hudson
rning Python, I think you'll like it. (*)A special function for this isn't necessary in Python, it's already built in the the new-style string formatting. Try this statement: '{:,}'.format(100) (That's a colon and comma inside the curly braces.) -=- Larry -=- -- http://mail.python.org/mailman/listinfo/python-list

Re: binascii.crc32 results not matching

2005-12-11 Thread Larry Bates
Thanks so much for the offer, I had a friend do this for me and it works great. Regards, Larry Bates Heiko Wundram wrote: > Larry Bates wrote: > >> >> >>The algorithm looks very much like the source code for >>binascii.crc32 (but I'm not a C programmer). &g

Re: Help: how to run python applications as NT service?

2005-12-12 Thread Larry Bates
r of milliseconds before running a second time. The example just waits for a stop signal. Here is a skeleton of a service that should get you started. I HIGHLY recommend spending the money to purchase the book (Python Programming on WIN32). There are more extensive examples than the one you have tha

Re: IsString

2005-12-12 Thread Larry Bates
ple)) False >>> The old way was to use type(a), but I think isinstance is the new "preferred" method. Larry Bates -- http://mail.python.org/mailman/listinfo/python-list

Re: Executing a python script with arguments from a python script

2005-12-12 Thread Larry Bates
You can pass arguments into a python script, see getopt module. Then to call an external script you would use subsystem module (or os.system if you are on earlier version of python). If you can, just make the other python program into a function and import it as James Stroud suggests in a separate

Re: IsString

2005-12-12 Thread Larry Bates
, but reread the post. He asks "if a given variable is a character or a number". I figured that even if he is coming from another language he knows the difference between "a given variable" and the "contents of a give variable". I guess we will see ;-). This list is so good, he gets BOTH questions answered. -Larry Bates -- http://mail.python.org/mailman/listinfo/python-list

Re: Worthwhile to reverse a dictionary

2005-12-15 Thread Larry Bates
be stored as binary integers in ASCII (e.g. 'a' = 65, 'b'=66, etc.). You can go the other direction with chr(x). Not completely sure about what you want to accomplish, but this eliminates the need for the dictionaries. Larry Bates -- http://mail.python.org/mailman/listinfo/python-list

Re: Question about tuple lengths

2005-12-15 Thread Larry Bates
uot;blah" without the comma of > length four? Is there a good reason for this or is this a bug? Additional note: You should not give a tuple a variable name of tuple, it masks the built-in tuple() function. This also goes for str, or other built-ins. This will "bite" you at some point if it hasn't already. -Larry Bates -- http://mail.python.org/mailman/listinfo/python-list

Re: Tuples

2005-12-15 Thread Larry Bates
work? Thanks for the help! > Works just fine for me. Suggestion: You should ALWAYS post your traceback instead of just saying "Why won't this work?". Your subject says "Tuples" then your example is on lists. Were you trying something like this on tuples

Re: Problem with exec

2005-12-16 Thread Larry Bates
iables and it > contains a 'config' entry, so why doesn't this work? > Not entirely sure why you want to do what you have outlined here but this works: class Cfg: pass #config = Cfg() def assign(config): setattr(config, 'Start' , [13, 26, 29, 34]) def foo(): config = Cfg() assign(config) print config.Start foo() You should probably post what you are trying to do. Maybe we can make a suggestion about the best approach. -Larry Bates -- http://mail.python.org/mailman/listinfo/python-list

Re: Browse type function

2005-12-16 Thread Larry Bates
Google is your friend: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/438123 -Larry Bates Tuvas wrote: > I am building a GUI interface with Tkinter. I need to have a way to > open and save files. Is there a nice GUI that can do that for me, ei, > show what files are avaliable,

Re: attach a pdf file to an email

2005-12-19 Thread Larry Bates
own, it should help as a guide. http://motion.sourceforge.net/related/send_jpg.py Larry Bates -- http://mail.python.org/mailman/listinfo/python-list

Re: RasAdminUserGetInfo

2005-12-19 Thread Larry Bates
[EMAIL PROTECTED] wrote: > Anyone got any idea how to use this? It looks like it isn't available > directly from the win32 extensions. > > Thanks, MW. > Google is your friend: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/rras/rras/rasadminusergetin

Re: RasAdminUserGetInfo

2005-12-20 Thread Larry Bates
o I'm a little stumped on where the road > goes from here..MW. > Sorry, I misread your initial post. You should be able to use ctypes to call the function or perhaps you can dispatch it manually. I'm not that familiar with the function. Larry Bates -- http://mail.python.org/mailman/listinfo/python-list

Re: parsing engineering symbols

2005-12-20 Thread Larry Bates
Something like: def cvt(input): if input.lower().endswith('k'): return float(input[:-1])*1000 . . add your other special symbols here . return None # didn't find a match Larry Bates Suresh Jeevanandam wrote: > Hi, > I want to convert a strin

Re: checking if a string contains a number

2005-12-20 Thread Larry Bates
You should probably work through the tutorials. Use a try block: try: x=float(s) except ValueError: print 'Non-numeric value %s found' % s -Larry Bates Suresh Jeevanandam wrote: > Hi, > I have a string like, > s1 = '12e3' > s2 = 'junk&

Re: Newbie: adding string values to a list?

2005-12-21 Thread Larry Bates
e advice on what I'm doing wrong? > > Many thanks and much warmth, > > planetthoughtful > You want to 'append' the string to the list. extend is used to combine two lists. Since your string isn't a list Python tries to help and converts it to one for you. That's why you get the individual letters. > result.append(name) -Larry Bates -- http://mail.python.org/mailman/listinfo/python-list

Re: A simple list question.

2005-12-22 Thread Larry Bates
erent things in one if statement and it is unclear where self.currentSlice comes from. You also need a condition on your elif. Perhaps more explanation is needed (at least for me to help). -Larry Bates -- http://mail.python.org/mailman/listinfo/python-list

Re: Indentation/whitespace

2005-12-23 Thread Larry Bates
r my code into smaller objects or rethink the process so that I process collections of objects. I've written in many different languages over a span of 32+ years and it seems to work for me. -Larry -- http://mail.python.org/mailman/listinfo/python-list

Re: Python as a Server vs Running Under Apache

2005-12-30 Thread Larry Bates
ke XMPRPC, DAV, FTP, that can take quite a lot of time to implement from scratch. It may not be for you, but you owe it to yourself to take a look. -Larry Bates -- http://mail.python.org/mailman/listinfo/python-list

Re: query on python list

2005-12-30 Thread Larry Bates
3 If you want to know if list2 is found in list 1 it is as simple as: if list2 in list1: # # Do something here # if you want to know if any member of list2 is found in any list in list 1 then you can just do: Found=max([y in x for y in list2 for x in list1]) works and you should h

Re: oop in python

2005-12-30 Thread Larry Bates
to refer to it by a name. The best way to do this is to put the class instance in a dictionary and make the key 'new' instancedict={} instancedict['new']=Point() then you can call methods by: instancedict['new'].somemethod() -Larry Bates -- http://mail.python.org/mailman/listinfo/python-list

Re: multiple clients updating same file in ftp

2006-01-10 Thread Larry Bates
Preface the update with a rename. If the rename fails, someone else is updating the file, if it succeeds update the file and rename back when finished. Suggestion: ftp is not the best way to handle such a task. Use a database, XMLRPC or sockets is probably a better way. -Larry Bates [EMAIL

Re: copying a file from windows file system to ext2 and ext3

2006-01-10 Thread Larry Bates
SAMBA to expose a share to the Windows machine and just copy the file (with or without Python). HTH, Larry -- http://mail.python.org/mailman/listinfo/python-list

Re: batch tiff to jpeg conversion script

2006-01-11 Thread Larry Bates
n(root,f)) print "Generating jpeg for %s" % f im.thumbnail(im.size) im.save(jpgpath, "JPEG", quality=100) except Exception, e: print e continue print "A jpeg file already exists for %s" % f This code: 1) only processess .tif files 2) simplifies things by eliminating the splitext methods and slicing operations. 3) eliminates else branch -Larry Bates -- http://mail.python.org/mailman/listinfo/python-list

Shrinky-dink Python (also, non-Unicode Python build is broken)

2006-01-16 Thread Larry Hastings
hing could make it into the official Python source. However, I realize that this has terribly limited appeal; that, and the fact that Python releases are infrequent, makes me think it's not a terrible hardship if I had to re-hack up each new Python release by hand. Whatcha think, froods? /larry/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Shrinky-dink Python (also, non-Unicode Python build is broken)

2006-01-16 Thread Larry Hastings
Python using ctypes. There haven't been any changes to the three Windows-specific modules (msvcrt, winreg, and winsound) mentioned in any "What's New in Python 2.x" document, and 2.0 came out more than five years ago. /larry/ -- http://mail.python.org/mailman/listinfo/python-list

Re: problem of types:

2006-01-17 Thread Larry Bates
--- > > Changing 'list' to 'type(list)' don't change anything > Your string variable type is masking the built-in type function. You should avoid variables with names like type, list, str, tuple, ... (e.g. built-ins). As they will mask the built-ins from your program. -Larry Bates -- http://mail.python.org/mailman/listinfo/python-list

Re: ConfigParser: writes a list but reads a string?

2006-01-17 Thread Larry Bates
> print statements. > > Is there a pythonic way to read in a list from a .INI file with > ConfigParser? Is this expected behavior for ConfigParser? I would > not expect this conversion; rather, an exception when trying to write > the list if the list is not supported. > To read lists from .INI files I use following: listvalues=INI.get(section, option).split(',') where INI is an instance of ConfigParser There is the problem of if list items contain commas. -Larry Bates -- http://mail.python.org/mailman/listinfo/python-list

Re: Shrinky-dink Python (also, non-Unicode Python build is broken)

2006-01-17 Thread Larry Hastings
cares about non-Unicode builds on Windows, I suggest this approach would work just fine. /larry/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Progress Bars in python

2006-07-12 Thread Larry Bates
he script > is processing...? > > > Hari This also is shown in Python Cookbook: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/299207 Larry Bates -- http://mail.python.org/mailman/listinfo/python-list

Re: Python linker

2006-07-19 Thread Larry Bates
ren't very interested in your application. -Larry [EMAIL PROTECTED] wrote: > I develop shareware applications that need to be extremely slim (less > than 1 MB is preferable). > > Delphi applications easily meet this requirement and I can expect end > users to download the .NET fr

Re: using names before they're defined

2006-07-19 Thread Larry Bates
What about something like: supply = supply() compressor = compressor(supply) combuster = combuster(compressor) compressor.append(combuster) turbine = turbine(combuster) combuster.append(turbine) -Larry Bates [EMAIL PROTECTED] wrote: > I have a problem. I'm writing a simulation progra

Bug? Certainly a new *behavior* from subprocess in 2.5 on Win32

2006-07-20 Thread Larry Hastings
sults to the command shell, but *also* prints this: Exception exceptions.AttributeError: "'NoneType' object has no attribute 'append'" in > ignored Calling Popen() with a stdout = subprocess.PIPE does not throw this exception. I vaguely intimate that this i

Re: Help Needed. Removing a Folder Problem

2006-07-20 Thread Larry Bates
cess module and use something like (not tested): retcode = call([r' C:\copiedfiles\*.*', cmd_out]) This will wait for execution of to complete prior to returning. -Larry Bates Kilicaslan Fatih wrote: > When I push a button to trigger the code: > > def runCC

Re: Checking File permissions

2006-07-20 Thread Larry Bates
.S_IWRITE) Larry Bates Anoop wrote: > Hi All > > Please tell me how to check the existence of a file and the read > permission to the file using python script > > Thanks for ur inputs > > Anoop > -- http://mail.python.org/mailman/listinfo/python-list

Re: using names before they're defined

2006-07-20 Thread Larry Bates
ppend/extend it. IMHO it makes what is going on intuitively obvious. -Larry Bates [EMAIL PROTECTED] wrote: > Bruno, > > Thanks. An issue is that I need to be able to link multiple objects to > a single object etc. > Say for example using the previous wording, I might have com

Re: Bug? Certainly a new *behavior* from subprocess in 2.5 on Win32

2006-07-20 Thread Larry Hastings
Delaney, Timothy (Tim) wrote: > Could you raise this as a bug on Sourceforge? Done; it is "request ID" 1526203. https://sourceforge.net/tracker/index.php?func=detail&aid=1526203&group_id=5470&atid=105470 Cheers, /larry/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Language Design: list_for scope?

2006-07-21 Thread Larry Bates
>>> d={1:'x',2:'thing',3:'thing',4:'thing',5:'thing', \ 6:'z',7:'thing',8:'thing',9:'y'} >>> [x for x in d if d[x]=="thing"] [2, 3, 4, 5, 7, 8] -Larry Bates guthrie wrote: >

Re: Finding the name of a class

2006-08-01 Thread Larry Bates
e sake of practice, and am trying to > print the name of the class that a traced method belongs to. This seems > like it should be easy, but I think I've been staring at the problem too > long. print print b.__class__.__name__ gives what you want -Larry Bates -- http://mail.python.org/mailman/listinfo/python-list

Re: Finding the name of a class

2006-08-01 Thread Larry Bates
Dennis Lee Bieber wrote: > On Tue, 01 Aug 2006 10:56:52 -0500, Kirk Strauser <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > >> Larry Bates wrote: >> >>> print print b.__class__.__name__ gives what you want >> That doesn'

Re: Simple HTML display of a select query

2006-08-02 Thread Larry Bates
[2]) print " Now the fun comes when you wish to embellish this with font sizes, colors, background colors, then the frameworks come in really handy. -Larry Bates -- http://mail.python.org/mailman/listinfo/python-list

Re: Hiding Console Output

2006-08-02 Thread Larry Bates
way to prevent the > output of x.exe from python? > Check out the subprocess module. With it you can control more than with os.system(). -Larry -- http://mail.python.org/mailman/listinfo/python-list

Re: OS independent files

2006-08-03 Thread Larry Bates
info from the user's environment. The "trickiest" part will be to find what code is necessary to track down the users "home directory" on each different operating system. Hope this helps. -Larry Bates -- http://mail.python.org/mailman/listinfo/python-list

Re: paramter passing question

2006-08-04 Thread Larry Bates
win = MyFrame2(self, -1, "", sim_name=sim_name) win.Show(True) class MyFrame2(wx.Frame): def __init__(self, *args, **kwds): . . self.sim_name=kwds.get('sim_name',

Python 2.5b2 and excepthook problem

2006-08-07 Thread Larry Bates
n isn't called because the print statement isn't executed upon entering the function. Has something changed that I missed? Thanks in advance for any assistance. Regards, Larry Bates -- http://mail.python.org/mailman/listinfo/python-list

Re: Getting previous file name

2006-08-07 Thread Larry Bates
> Just some quick ideas (not tested): change test1.append(create_date) to test1.append((create_date, filename)) that way the filename will tag along during the sorting as a tuple in the test1 list. You will also need to change prev_file = walktree(path) to create_date, prev_file = walktree(p

Re: Best way to construct an email - attach a html file and send

2006-08-09 Thread Larry Bates
to > myself whenever there is an error in the application > > thanks a lot > py > Here is a link to a class that will allow you to attach files. You can either write the HTML to a tempfile and attach or modify a little to accept a string or cstringIO object instead. H

Re: seaching a list...

2006-08-10 Thread Larry Bates
king for and let the database do the searching. I can promise you this will almost always be faster and more flexible. Something like: Assume the columns are called rownumber, c1, c2, c3, c4 and the table is indexed on c1, c2, c3, and c4. This will happen almost instantly no matter how many rows you

Re: some n00b question

2006-08-11 Thread Larry Bates
n. It takes a little while to get going, IMHO it is the best Python GUI for Windows (it is also cross- platform if that interests you). -Larry -- http://mail.python.org/mailman/listinfo/python-list

Re: A little assistance with os.walk please.

2006-08-14 Thread Larry Bates
dirs, you can delete them from the dirs list here and they won't get walked. You MUST delete them in place with del dirs[n] or dirs.pop or some other function that deletes in-place. You might want to type: help(os.walk) to get some more info. -Larry Bates -- http://mail.python.org/mailman/listinfo/python-list

Re: Compiling wxPython app for Windows; Single EXE

2006-08-14 Thread Larry Bates
nstaller can help you with all these things. The combination of py2exe and Inno Installer is hard to beat. -Larry Bates -- http://mail.python.org/mailman/listinfo/python-list

Re: Memory problem

2006-08-14 Thread Larry Bates
in ? > MemoryError > > Any way to get around this problem? I have a machine of 4G memory. The > total number of data points (float) that I need to read is in the order > of 200-300 millions. > > Thanks. > On my 1Gb machine this worked just fine, no memory error. -Larry Bates -- http://mail.python.org/mailman/listinfo/python-list

Re: Memory problem

2006-08-14 Thread Larry Bates
eldom done in Python. I think you should probably be looking at http://numeric.scipy.org/ if you want to have "traditional" arrays of floats. -Larry -- http://mail.python.org/mailman/listinfo/python-list

Re: Adding a char inside path string

2006-08-16 Thread Larry Bates
Sounds like you can split the string on a space and throw away the right side: s='\\serverName\C:\FolderName1\FolderName2\example.exe' -u ABC -g XYZ p=s.split(" ", 1)[0] print p '\\serverName\C:\FolderName1\FolderName2\example.exe' Larry Bates Hitesh wrote:

Re: Dynamic objects

2006-08-17 Thread Larry Bates
f AddEquipment(name, data): equipment[name]=Equipment(data) same for Equipment class and Component class. class Equipment: def __init__(self): self.components={} def AddComponent(name, data): components[name]=Component(data) class Component: def __init__(self, data) self.data=data -Larry Bates -- http://mail.python.org/mailman/listinfo/python-list

Re: Py2Exe and sys.argv : The Lost Arguments

2006-08-17 Thread Larry Bates
7;t work at all (not sure why). Funny thing is that if I select two .txt files and do a Open With Notepad, Explorer only opens one of them. So I think it is Explorer that is throwing away the extra arguments. Otherwise I would expect it to open multiple notepad instances. -Larry Bates Thomas

Re: Need advice on how to improve this function

2006-08-21 Thread Larry Bates
r k in l[1]]) > s.write('<%s %s>' % (tagname, attributes)) > else: > s.write('<%s>' % tagname) > if tagname in ('html', 'head', 'body'): > s.write('\n\n') > for ll in l[1:]: > as_html(ll, s) > s.write('' % tagname) > if tagname not in ('a', 'b', 'ul'): > s.write('\n\n') > elif isinstance(l, str): > s.write(l) > > > All comments welcome. TIA > Before you put too much work into this you might want to take a look at HTMLgen: http://www.python.net/crew/friedrich/HTMLgen/html/main.html -Larry -- http://mail.python.org/mailman/listinfo/python-list

Re: uploading files to file system/zipping/downloading problems

2006-08-21 Thread Larry Bates
data f.write(total_data) f.close You should take a look at shutil module. It is copyfile method that makes your code must simpler (and faster I'm sure). do import shutl help(shutil.copyfile) import shutil shutil.copyfile(uload_file_name, target_file_name) -Larry Bates -- http://mail.python.org/mailman/listinfo/python-list

Re: CONSTRUCT - Module Attributes and Execution Environment

2006-08-22 Thread Larry Bates
2) IMHO all the suggestions are way more complicated than if __name__ == "__main__" and are not SOP for most pythoneers. I know what the former construct means/does. I have to decipher your class to figure our what the latter does and it doesn't really save you any code or provide a performance enhancement. -Larry -- http://mail.python.org/mailman/listinfo/python-list

Re: Accessing application data portably

2006-08-23 Thread Larry Bates
ws I use Inno Installer and it can modify these options inside the .ini file during the installation so that datafilepath points to where my data actually will live. Works perfectly for me. -Larry Bates -- http://mail.python.org/mailman/listinfo/python-list

Re: CONSTRUCT - Module Attributes and Execution Environment

2006-08-23 Thread Larry Bates
Georg Brandl wrote: > Larry Bates wrote: >> lazaridis_com wrote: >>> I would like to change the construct: >>> >>> if __name__ == '__main__': >>> >>> to something like: >>> >>> if exec.isMain(): >>> &

Re: Best way to construct an email - attach a html file and send

2006-08-23 Thread Larry Bates
a wrote: > where is the link > thanks a lot for your kind help > Larry Bates wrote: >> a wrote: >>> What is the best way to construct an email in python and also attach a >>> html file >>> >>> the html file to be attached is not on disk, but

Re: how to get file name of the running .py file

2006-08-23 Thread Larry Bates
Jason Jiang wrote: > Hi, > > How to get the name of the running .py file like the macro _FILE_ in C? > > Thanks. > Jason > > > import os import sys print sys.argv[0] or if you just want the script and not the full path print os.path.basename(sys.argv

Re: Accessing application data portably

2006-08-23 Thread Larry Bates
Tom E H wrote: > Larry Bates wrote: >> Tom E H wrote: >>> My Python application includes some data files that need to be accessed >>> by modules I distribute with it. >>> >>> Where can I put them, and how should I arrange my code, so that it works >

Re: Where is Python in the scheme of things?

2006-10-04 Thread Larry Bates
it was getting completely unmanageable. If you only have to deal with GUI apps on Windows I guess VB or Delphi would be fine. If you need to deploy to multiple platforms (Windows, Linux, Mac) IMHO neither of them will work very well. C++ is as portable, but the extra code that you must write

Re: Request for recommendations: shared database without a server

2006-10-05 Thread Larry Bates
hat it would work for small number of users. With some good planning you should also be able to architect application so that you can even change the underlying database later without too much heartburn. -Larry Bates -- http://mail.python.org/mailman/listinfo/python-list

Re: PATCH: Speed up direct string concatenation by 20+%!

2006-10-05 Thread Larry Hastings
ms 3 | 9203ms | 10500ms 4 | 10656ms | 11656ms 5 | 12156ms | 13390ms 20 | 29359ms | 26703ms Interpret as you see fit, /larry/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Need array help

2006-10-06 Thread Larry Bates
; You have two choices in Python: list or array For simple lists of things use a list. If you want to do vector math or matrix-type calculations look at the array module. For you simple example, here is the python code: acctfile=[] numoffiles=4 data=10 ct=1 for i in xrange(numoffiles-1): ac

Re: Need array help

2006-10-06 Thread Larry Bates
Robert Kern wrote: > Larry Bates wrote: > >> If you want to >> do vector math or matrix-type calculations look at the >> array module. > > The array module in the standard library does not provide such > capabilities. If you need them, look at numpy. > &

Re: can regular ol' python do a php include?

2006-10-10 Thread Larry Bates
y just use that. > > I get the feeling the answer is no, but maybe there's something I've > missed that will allow me to do this. > > Thanks. You might want to review: http://karrigell.sourceforge.net/ This comes just about as close to PHP-style "includes" (your term) as I have seen. -Larry Bates -- http://mail.python.org/mailman/listinfo/python-list

Re: Experiences with Py2Exe

2006-10-11 Thread Larry Bates
can't speak to Perforce python module as I've never used it myself. Start with a small console app and them move on to more complex applications. You may want to take a look at the py2exe newsgroup (gmane.comp.python.py2exe) for any questions. -Larry Bates -- http://mail.python.org/mailman/listinfo/python-list

Re: Experiences with Py2Exe

2006-10-11 Thread Larry Bates
s very well, is free, and seems to do everything people want in an installer. -Larry Bates -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Newbie question

2006-10-13 Thread Larry Bates
ave only 1 file (setup.exe) that needs to be distributed. Doesn't really matter ho many files it installs when it runs, that's all hidden from the user anyway. -Larry Bates -- http://mail.python.org/mailman/listinfo/python-list

Re: always raise syntax error!

2006-10-13 Thread Larry Bates
readers out here. Occassionally I will have phantom syntax errors that seem to be attributable to non-printing characters in a line. Other times the error is in fact far above the place pointed to by the syntax error. Start by commenting out large chunks of code with triple quotes a

Re: Return returns nothing in recursive function

2006-10-17 Thread Larry Bates
Matt, You should consider not using the long footer on posts to comp.lang.python. It doesn't make a lot of sense there. -Larry > This email is confidential and may be privileged. If you are not the intended > recipient please notify the sender immediately and delete the emai

Re: A question about list

2006-10-17 Thread Larry Bates
[EMAIL PROTECTED] wrote: > Hello: > Variable 'a' has the next values: > [[1,1],[2,2]] > and I want to take a to b as: > [[1,1,'='],[2,2,'=']] > How can I do this with only one line of instruction? > Thanks!! > To copy a list use: b=a[:] -La

Re: A question about list

2006-10-17 Thread Larry Bates
Larry Bates wrote: > [EMAIL PROTECTED] wrote: >> Hello: >> Variable 'a' has the next values: >> [[1,1],[2,2]] >> and I want to take a to b as: >> [[1,1,'='],[2,2,'=']] >> How can I do this with only one line of instruction? >

Re: Determining if a file is locked in Windows

2006-10-18 Thread Larry Bates
> Thanks in advance > Try the copy and catch the exception instead. -Larry Bates -- http://mail.python.org/mailman/listinfo/python-list

Re: Getting method name from within the class method

2006-10-18 Thread Larry Bates
print "a_method" There's nothing to be gained from accessing a variable unless you are going to be calling some other method to do the printing. -Larry -- http://mail.python.org/mailman/listinfo/python-list

Re: python module for finite element program

2006-10-20 Thread Larry Bates
forge.net/projects/feval/ http://www.code-aster.org/ (French site) http://www.icivilengineer.com/Open_Source/ http://adsabs.harvard.edu/abs/2000APS..DPPHP1088P -Larry -- http://mail.python.org/mailman/listinfo/python-list

Re: FTP over SSL

2006-10-20 Thread Larry Bates
you can do https put of a file over SSL to server and/or you can use Webdav (if DAV server is available on target server) to copy files as well. -Larry -- http://mail.python.org/mailman/listinfo/python-list

Re: Why doesn't this work?

2006-10-21 Thread Larry Bates
t;> class ts(datetime): ... def __new__(self): pass ... >>> a=ts() -Larry -- http://mail.python.org/mailman/listinfo/python-list

Re: _winreg.saveKey question

2006-10-23 Thread Larry Bates
is KEY_READ The result is a new handle to the specified key If the function fails, an EnvironmentError exception is raised. The default is KEY_READ so you can't update. -Larry Bates -- http://mail.python.org/mailman/listinfo/python-list

Re: _winreg.saveKey question

2006-10-23 Thread Larry Bates
is KEY_READ The result is a new handle to the specified key If the function fails, an EnvironmentError exception is raised. The default is KEY_READ so you can't update. -Larry Bates -- http://mail.python.org/mailman/listinfo/python-list

Re: The status of Python and SOAP?

2006-10-24 Thread Larry Bates
his code just seems to work). Since it is based on elementree, which is now in the standard library, I think it would be a good bet. Perhaps you could assist on the development? -Larry -- http://mail.python.org/mailman/listinfo/python-list

Re: Sending Dictionary via Network

2006-10-24 Thread Larry Bates
; > > Buhi > You will need to pickle it first and unpickle it on the other end. Other than that, you should be able to send it just fine. -Larry -- http://mail.python.org/mailman/listinfo/python-list

Re: Tracing the execution of scripts?

2006-10-27 Thread Larry Bates
nt to the overall execution speed of my scripts, but then I don't have very many really speed sensitive scripts so your mileage might vary. Hope the information helps. -Larry -- http://mail.python.org/mailman/listinfo/python-list

Re: Configfile

2006-10-27 Thread Larry Bates
ave to get a file pointer (fp) and do the write as you noted. Also to get instance of ConfigParser you need: cp = ConfigParser.ConfigParser() (note the trailing parenthesis) If you want to read existing .INI file before doing this you need a cp.read('filename.ini') somewhere in your code. -Larry -- http://mail.python.org/mailman/listinfo/python-list

Re: Python windows interactive.

2006-10-30 Thread Larry Bates
e interpreter can load a text file with your program. A good "beginners" version of Python for windows is: http://www.activestate.com/Products/ActivePython/?tn=1 It has an easy to use interpreter window with both your program and interactive prompt open on the screen. To run a program yo

Re: Best way to have intermediate object description format

2006-11-03 Thread Larry Bates
will get the idea. Note: Please don't get too caught up in "premature optimization". I use this to process .INI files with thousands of lines and it goes through the process in fractions of a second. -Larry Sample Code (written completely from my memory): INI=ConfigParser.Confi

Re: Converting Microsoft Works databases.... *shudder*

2006-11-03 Thread Larry Bates
gt; often to be considered reliable stuff). > > -- Mike MS ships ODBC interface to xBase databases in all versions of Windows. You don't need Access. Just create DSN to your exported dBase database and MS Word, MS Excel, and any other ODBC aware product can read the data. If

Re: py2exe questions

2006-11-03 Thread Larry Bates
les are just placed in library.zip. At least it doesn't send your .py files along. -Larry -- http://mail.python.org/mailman/listinfo/python-list

Re: Having trouble with file modes

2006-11-03 Thread Larry Bates
Don't do that. Do something like renaming the old file to .bak (or .aside or something) and then create the entire file by opening it with 'w'. -Larry -- http://mail.python.org/mailman/listinfo/python-list

Re: how do I pass values between classes?

2006-11-04 Thread Larry Bates
wx.ID_OK: > self.filename=d.GetFilename() > self.dir=d.GetDirectory() > self.text.SetValue(os.path.join(self.dir, self.filename)) > > def OnUpload(self, event): > pass > > class MyApp(wx.App): > def OnInit(

<    4   5   6   7   8   9   10   11   12   13   >