Re: [Tutor] Slightly OT - Python/Java

2005-01-09 Thread David Rock
ChiPy, is going to have a speaker on Jython this Thursday, January 13th. For more information, check out the group site at: http://www.chipy.org Everyone is welcome, benginner to advanced. We love all kinds of input. You'd be surprised what you can learn when you get the chance to actually

Re: [Tutor] Python with MySQL ?

2005-01-11 Thread David Rock
The best one I've You might want to check out sqlobject, too http://sqlobject.org/ It gives you a relatively simple way to "objectify" SQL statements. -- David Rock [EMAIL PROTECTED] pgpRBRwPdqdc0.pgp Description: PGP signature ___

Re: [Tutor] A somewhat easier way to parse XML

2005-01-18 Thread David Rock
know ;-) Still, I can't help wishing I had a simple way to create a dict from a DOM. From a Python perspective, that seems more "Pythonic" to me as well. I guess it's just a different way of looking at it. -- David Rock [EMAIL PROTECTED] pgpq4Ua00eRSO.pgp Description: PGP signa

Re: [Tutor] A somewhat easier way to parse XML

2005-01-19 Thread David Rock
* Max Noel <[EMAIL PROTECTED]> [2005-01-19 11:48]: > > On Jan 19, 2005, at 03:58, David Rock wrote: > > >For me, it seems that the way you are supposed to interact with an XML > >DOM is to already know what you are looking for, and in theory, you > >_should

Re: [Tutor] newbie OSX module path question

2005-02-14 Thread David Rock
this means. Thanks again. It means it didn't find anything that matches that pattern, which suggests that the directory does not contain *.py files. That might be a problem. ;-) -- David Rock [EMAIL PROTECTED] pgpmTRknYUp8c.pgp Description: PGP signature

Re: [Tutor] reading from stdin

2005-03-01 Thread David Rock
roach to this, I like to use the fileinput module. In the case of the original example of mimicing grep, it allows you to easily handle both a list of files passed to the command or use it as a pipe. The default action if there are no files given is to use stdin. http://www.python.org/doc/2.4/l

[Tutor] csv module not raising exception properly

2005-04-07 Thread David Rock
s anyone know why this try block doesn't catch the exception? The version of Python I am using is 2.3.3 Thanks. -- David Rock [EMAIL PROTECTED] pgprCjzYhfyU7.pgp Description: PGP signature ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] csv module not raising exception properly

2005-04-07 Thread David Rock
* Kent Johnson <[EMAIL PROTECTED]> [2005-04-07 15:28]: > David Rock wrote: > >I am trying to catch an exception from the csv module but it doesn't > >seem to be generating a proper exception because I don't seem to be able > >to catch it. Here is what I

Re: [Tutor] csv module not raising exception properly [SOLVED]

2005-04-07 Thread David Rock
* David Rock <[EMAIL PROTECTED]> [2005-04-07 15:00]: > * Kent Johnson <[EMAIL PROTECTED]> [2005-04-07 15:28]: > > David Rock wrote: > > >I am trying to catch an exception from the csv module but it doesn't > > >seem to be generating a proper exception b

Re: [Tutor] getopt matching incorrect options

2005-07-11 Thread David Rock
opt http://docs.python.org/lib/module-getopt.html Long options on the command line can be recognized so long as they provide a prefix of the option name that matches exactly one of the accepted options. For example, if long_options is ['foo', 'frob'], the

Re: [Tutor] Removing a file from a tar

2007-06-27 Thread David Rock
s is not supported yet, you would probably have to reopen the tarfile, write it to a new one file-by-file, excluding the ones you don't want. Messy :-( -- David Rock [EMAIL PROTECTED] ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Help with plugins

2007-07-03 Thread David Rock
are trying to accomplish. Can you supply an example of an "extensible application" and also a longer description of what you mean when you say "plugin." Perhaps some links to what you have looked at so far would also help to clarify? -- David Rock [EMAIL PROTECTED]

Re: [Tutor] odd

2007-07-18 Thread David Rock
is the expected behaviour, per the documentation: http://docs.python.org/lib/built-in-funcs.html#l2h-58 -- David Rock [EMAIL PROTECTED] ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Running Python on Gentoo

2007-07-27 Thread David Rock
n" in the kernel? This would potentially be something that could happen with ANY lniux system, not just gentoo. FWIW, I am having the same problem (even though I never actually tried on this system before) :-) -- David Rock [EMAIL PROTECTED] ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Running Python on Gentoo

2007-07-27 Thread David Rock
that off. I did want it more secure :-) -- David Rock [EMAIL PROTECTED] ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] input/output redirection

2005-09-08 Thread David Rock
processing. It also give me the flexibility of using it as a pipe OR assigning a wordlist of files to the script instead. http://www.python.org/doc/2.4.1/lib/module-fileinput.html import fileinput for line in fileinput.input(): process(line) -- David Rock [EMAIL P

Re: [Tutor] (no subject)

2005-09-13 Thread David Rock
ere that would undoubtedly perform much better than a PythonOS ever could. That doesn't mean it wouldn't be cool, though. :-) -- David Rock [EMAIL PROTECTED] pgpbDnlqYILFN.pgp Description: PGP signature ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] problems with the shebang line and linux

2006-02-16 Thread David Rock
0: 2321 202f 7573 722f 6269 6e2f 7079 7468 #! /usr/bin/pyth 010: 6f6e 0a70 7269 6e74 2022 4865 6c6c 6f22 on.print "Hello" 020: 0a . Bottom line, the error means bash can not find the application you told it to use, so somethin

Re: [Tutor] file?

2006-04-03 Thread David Rock
s: import zipfile try: ziparchive = zipfile.ZipFile(inputfilename, "r") except: print "error accessing file" You could get fancy and deal with various exceptions or read traceback info, too. Using the try block is generally considered

Re: [Tutor] for loops

2006-04-11 Thread David Rock
generally try to stay away from doing the work for you :-) -- David Rock [EMAIL PROTECTED] ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] School Boy Error

2006-04-15 Thread David Rock
se. I am trying to upload the first line in the > file to get myself started. The code is below:- You may want to check out the csv module to aid in any odd data input, too. http://docs.python.org/lib/module-csv.html -- David Rock [EMAIL PROTECTED] ___

Re: [Tutor] Beginner question(s)

2006-06-19 Thread David Rock
I don't know if its still around or if it runs on modern > > PDAs - I think it was PalmOS anyhow... > > > > > > Pippy is quite dead. No development done recently. It supposedly runs > fine, but runs only Python 1.5. La

Re: [Tutor] <> and chomp

2006-09-14 Thread David Rock
is similar to chomp http://docs.python.org/lib/string-methods.html#l2h-201 These aren't exact matches, but they are close. -- David Rock [EMAIL PROTECTED] ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] getting 'pwd' for XP ?

2006-09-28 Thread David Rock
ut found nothing suitable os.getcwd() http://docs.python.org/lib/os-file-dir.html -- David Rock [EMAIL PROTECTED] ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Equivalent to perl -e

2006-10-16 Thread David Rock
x27; What you will notice is it gets complicated in a hurry if you try to do loops or anything fancy because of formatting constraints. Not that it can't be done, but it would hurt to try. :-) -- David Rock [EMAIL PROTECTED] ___ Tutor maillist

Re: [Tutor] Equivalent to perl -e

2006-10-16 Thread David Rock
simple in a shell script and didn't have a good way to get the date info I wanted, so I started playing around with python -e. It really SHOULD just be a python script that calls shell stuff, not the other way 'round :-) Still, in the spirit of the OP, I thought it would be approp

Re: [Tutor] getopt module..

2006-10-22 Thread David Rock
what you expect to see from them, then the for o, a in opts: section is used to replace default values with information from the commandline. -- David Rock [EMAIL PROTECTED] ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Has anyone tried matplotlib...??

2006-10-23 Thread David Rock
hon user group) http://www.chipy.org meeting a few months ago. He's a great guy and he did some pretty impressive things with it. It also appears to interact well with ipython, an extremely powerful python interpreter shell (much better than the built-in shell) http://ipython.scipy.org/ -- Da

Re: [Tutor] 'elp!!!!!!!1Totally Clueless Newbie In Distress

2007-01-20 Thread David Rock
dy be in your path, so typing "python" at the propmt should result in it running the interpreter. If that works, exit the interpreter and type "python scriptname" That should run your script, and you will see the results in the command window because it won't close afte

Re: [Tutor] largest palindrome number

2011-08-27 Thread David Rock
e block, the value in your largest current value will actually be the largest palindrome. -- David Rock da...@graniteweb.com pgpqe98kqh5z1.pgp Description: PGP signature ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] PYTHONPATH (Mac OS X)

2012-01-13 Thread David Rock
e that gets generated automatically and is the code that is actually executed. Somehow, calling the method test inside the interpreter is different from running it on the commandline and you are picking up the pyc file. In either case, this format is iffy at best: if __name__ ==

Re: [Tutor] Which computer operating system is best for Python developers?

2012-02-22 Thread David Rock
stems, will be using methods that might be OS-specific (os.fork() comes to mind). As long as you keep things neutral, you shouldn't have huge issues. -- David Rock da...@graniteweb.com pgpOARLwWTZLn.pgp Description: PGP signature ___ Tutor mail

Re: [Tutor] creating dict of dict : similar to perl hash of hash

2012-03-06 Thread David Rock
ing data because it doesn't have to be the same data type. You can nest variables, lists, dicts, etc all at the same level: dict = {} dict['mylist'] = [1,2,3] dict['mystring'] = 'string' dict['mynum'] = 4 dict['anotherdict'] = {} dict['anotherdict']['anotherstring'] = 'string2' -- David Rock da...@graniteweb.com pgp8ik0yrru5G.pgp Description: PGP signature ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] creating dict of dict : similar to perl hash of hash

2012-03-06 Thread David Rock
herhash'} = {}; > $hash{'anotherhash'}{'anotherstring'} = 'string2'; > > Thomas Hah. Fair enough :-) -- David Rock da...@graniteweb.com pgpszglXkVXly.pgp Description: PGP signature ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Simple text file processing using fileinput module. "Grabbing successive lines" failure

2012-07-02 Thread David Rock
hich case, you can try to resolve the two lines, or fail out if the criteria isn't met. Essentially, your problem isn't with using fileinput, it's with how you handle each line that comes in. -- David Rock da...@graniteweb.com pgpsm5eZpm6mp.pgp Description: PGP signature _

Re: [Tutor] Seeking help with reading and writing files in Python

2012-07-08 Thread David Rock
part, you have already answered your own question. Specifically, you get your input file, FinalProjectBill.txt, by collecting data from the user, doing some calculations, and outputting to the file. I'm not sure I see the problem. :-( -- David Rock da...@graniteweb.com pgp

Re: [Tutor] Python and boot sequences

2012-07-08 Thread David Rock
ironment to use. I think we would need to better understand exactly what you are trying to build, but you are probably looking for something that would be a much lower level than python. -- David Rock da...@graniteweb.com pgp7NxdORAGka.pgp Description: PGP signature ___

Re: [Tutor] confusion about imports

2012-07-09 Thread David Rock
be able to differentiate. module1.DbPath() is not the same thing as module2.DbPath() Your functions.DbPath() is the way to go. -- David Rock da...@graniteweb.com pgpstgBsNVZmH.pgp Description: PGP signature ___ Tutor maillist - Tutor@python.org T

Re: [Tutor] starting to learn

2012-07-13 Thread David Rock
; development boat. > > So starting from scratch, how-to? Coming here is a good start. Welcome! Start here for beginning ideas: http://wiki.python.org/moin/BeginnersGuide You will find a number of good jumping-off points under the "Learning Python" section. Come back as you

Re: [Tutor] Confusion regarding the 'from' statement

2012-08-14 Thread David Rock
s they don't exist in the namespace, but test() knows about them. You are reading too much into the comment that the module is "deleted". -- David Rock da...@graniteweb.com ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] What are all those letters after terminal commands?

2012-08-23 Thread David Rock
can use on a commandline, options and arguments. Options are the switches that change the program's behavior and arguments are the inputs to the program (filenames, etc). -- David Rock da...@graniteweb.com ___ Tutor maillist - Tutor@python.org

Re: [Tutor] how to split/partition a string on keywords?

2012-08-23 Thread David Rock
something like: text = raw_input("Enter text: ") sep = 'and' parts = text.split(sep) for i in parts[:-1]: print i print sep print [-1] You might also want to consider stripping whitespace in the individual list items, too. -- David Rock da...@graniteweb.com __

Re: [Tutor] how to split/partition a string on keywords?

2012-08-23 Thread David Rock
* David Rock [2012-08-23 15:03]: > * Jared Nielsen [2012-08-23 12:05]: > > Hi all, > > I'm new to programming and Python. > > I want to write a script that takes a string input and breaks the string at > > keywords then outputs the pieces on separate lines. >

Re: [Tutor] how to split/partition a string on keywords?

2012-08-23 Thread David Rock
rn (parts[0],) else: return parts[:-1] + repart(parts[-1]) if __name__ == '__main__': text = "Ham and cheese omelette with hasbrowns and coffee." parts = repart(text) for part in parts: print part.strip() # Clean up whitespace w

Re: [Tutor] reading lines from a list of files

2015-05-12 Thread David Rock
ile reader, plus a host of other useful methods for info about the file you are reading. Part of what you really need to define is the context of your question of "better." What is your use case? From where is your list of files coming? Is it truly just "read and forget"? Your

Re: [Tutor] Pep 8, about indentation

2015-08-10 Thread David Rock
p as well. set softtabstop=4 It's very handy for allowing the delete key to go back TAB number of spaces (ie, deletes those 4 spaces you just inserted). -- David Rock da...@graniteweb.com ___ Tutor maillist - Tutor@python.org To u

Re: [Tutor] Pep 8, about indentation

2015-08-10 Thread David Rock
* Alex Kleider [2015-08-10 11:26]: > On 2015-08-10 08:33, David Rock wrote: > > > You might want to add softtabstop as well. > > set softtabstop=4 > > > > It's very handy for allowing the delete key to go back TAB number of > > spaces (ie, deletes thos

Re: [Tutor] how to grep a word and make a dictionary from multiple lines.

2016-01-04 Thread David Rock
ay to break out of your logic when the next mpath is seen. You will also want to think about what to do with all your LUNs. You have four per mpath, not one. Do you want to capture only one, or do you need all of them? -- David Rock da...@graniteweb.com

Re: [Tutor] how to grep a word and make a dictionary from multiple lines.

2016-01-05 Thread David Rock
path" 2. looking up by value would work, but maybe you should do it the other direction. Your SCSI values will be unique, so use that as the key a "simpler" logic is probably: a) read file b) store the LUN value from your mpath line c) iterate over lines and find SCSI key, then

Re: [Tutor] PLEASE I NEED HELP URGENTLY

2016-01-09 Thread David Rock
comeEvent(handled=False, test=, > result=, outcome='error', exc_info=(, TypeError('this constructor takes no > arguments',), ), reason=None, expected=False, shortLabel=None, > longLabel=None) is not JSON serializable This doesn't appear to be all of your code. What&#

Re: [Tutor] Recommendations for best tool to write/run Python :p:

2016-03-03 Thread David Rock
vironment but the OP > specifically mentioned writing longer programs and editing > files which is not what IPython does best. I suspect that's > why it didn't get a mention earlier. Very likely, but it's definitely worth mentioning as a runtime environmen

Re: [Tutor] Changing the interpreter prompt symbol from ">>>" to ???

2016-03-12 Thread David Rock
SCII > terminals? ~(:>) I'm using mutt in a screen session on raspbian. Looks fine to me. I have put a lot of effort into "properly" displaying "weird" things, though. -- David Rock da...@graniteweb.com ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Study Tips

2016-05-30 Thread David Rock
oes something for you, it will be more satisfying and more likely to stick in your brain. -- David Rock da...@graniteweb.com ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] OT: Recommendations for a Linux distribution to dual-boot with Win7-64 bit

2016-06-28 Thread David Rock
herry-pick packages from testing; that’s a little advanced (but something to keep in mind). — David Rock da...@graniteweb.com ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] OT: Recommendations for a Linux distribution to dual-boot with Win7-64 bit

2016-06-28 Thread David Rock
t be. The easiest thing to do is google for your distro name and the brand of device and see if there are any issues. If you follow my earlier advice on trying a liveCD of your chosen distro first, that will give you a really good idea if your hardware will work. — Davi

Re: [Tutor] OT: Recommendations for a Linux distribution to dual-boot with Win7-64 bit

2016-06-28 Thread David Rock
is more important), try out Mint. You may or may not like it, but you won’t know until you try. I still say a dry run in a VM to get a feel for it would do wonders for you regardless. — David Rock da...@graniteweb.com ___ Tutor maillist - Tuto

Re: [Tutor] OT: Recommendations for a Linux distribution to dual-boot with Win7-64 bit

2016-06-29 Thread David Rock
ard do you have? Most Corsairs have a “BIOS switch” for exactly this issue. — David Rock da...@graniteweb.com ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] OT: Recommendations for a Linux distribution to dual-boot with Win7-64 bit

2016-06-29 Thread David Rock
> On Jun 29, 2016, at 12:32, boB Stepp wrote: > > On Wed, Jun 29, 2016 at 12:02 PM, David Rock wrote: >> >>> On Jun 29, 2016, at 11:20, boB Stepp wrote: >>> >>> My Christmas present of a Corsair mechanical gaming keyboard was not >>> _seen

Re: [Tutor] OT: Recommendations for a Linux distribution to dual-boot with Win7-64 bit

2016-06-29 Thread David Rock
say yes. It adds a layer of flexibility with you disk layout that you will be sad you don’t have later. > Thanks for all of the help even though this has been off-topic for this list! > > Meanwhile, more playing around with Mint!! have fun! — David Rock da...@graniteweb.com

Re: [Tutor] OT: Recommendations for a Linux distribution to dual-boot with Win7-64 bit

2016-06-29 Thread David Rock
-many packages depending on the complexity. All you need to worry about is the thing you want, and let the system do the rest. :-) — David Rock da...@graniteweb.com ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription o

Re: [Tutor] Regex/Raw String confusion

2016-08-03 Thread David Rock
al sequences in the documentation). For example, \s means any whitespace character, \w means any alphanumeric or underscore, \d means any digit, etc. You can look them up in the docs: https://docs.python.org/2/library/re.html — David Rock da...@graniteweb.com ___

Re: [Tutor] Downloading Slack Files

2016-08-16 Thread David Rock
r stops is because this test is never true: >if len(response.json()["files"]) == 0: >break Since you are downloading and not removing anything, there’s always going to be files so you will never break out of the while loop. I think you need to get the lis

Re: [Tutor] syntax error help

2016-08-26 Thread David Rock
e thing, please)? Where does it say the syntax error is? — David Rock da...@graniteweb.com ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Basic telnet question

2016-09-24 Thread David Rock
; it’s still trying to read everything until it times out. either add a short timeout value to your telnetlib.Telnet(), or try a different read method; for example, read_very_eager you could also try using telnetlib.set_debuglevel() to try and get more details about what’s actually

Re: [Tutor] Basic telnet question

2016-09-24 Thread David Rock
> On Sep 24, 2016, at 15:49, Phil wrote: > > On 25/09/16 01:01, David Rock wrote: >> >> when you say "the client is not responding, certainly not as expected”, >> what, exactly, is the output you get? >> > > In my dazed state I think I responde

Re: [Tutor] Basic telnet question solved

2016-09-25 Thread David Rock
> On Sep 24, 2016, at 18:59, Phil wrote: > > On 25/09/16 07:17, David Rock wrote: >> header = tn.read_until("character is '^]’.”, timeout=5) >> print(header) > > Thank you David, read_until() led me to a result. It seems that the telnetlib > doesn'

Re: [Tutor] formatting xml (again)

2016-12-27 Thread David Rock
in f1: if between [x02] and [x03]: output =+ line.strip() else: f2.write(output) output = "" Basically, you need to loop over everything between your markers and put them in a single entry, then send that one entry all

Re: [Tutor] formatting xml (again)

2016-12-27 Thread David Rock
stx and etx (comment lines, other data that you don't want), then it gets a lot harder. If you don't have at least a marginally consistent input, your only real option is probably going to be scanning by character and looking for the \x02 and \x03 to get a glob of data, then parse that glob

Re: [Tutor] formatting xml (again)

2016-12-27 Thread David Rock
ter). That would artificially create "record" data that you could manipulate and combine partial segments into complete xml records to parse. Might be faster, might not, probably would get complicated pretty quickly but could be an option. Without seeing actual data, it's tough to spec

Re: [Tutor] formatting xml (again)

2016-12-27 Thread David Rock
ml doesn't care about layout and whitespace etc. > > Which xml parser are you using - I assume you are not trying > to parse it manually using regex or string methjods - that's > rarely a good idea for xml. Yeah, since everything appears to be .., the "event" flags of [\

Re: [Tutor] (no subject)

2017-02-07 Thread David Rock
while loop is testing for r, p, and s to all be equal to each other and set, which is not what you want to test. Basically, your while loop is immediately false as soon as you run your script. You need to rework your logic to test the player’s value. — David Rock da...@graniteweb.com ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Q about .join() Thanks!

2017-02-13 Thread David Rock
e a specific order by design so will always be in the order they were created. What are you trying to do with join() on a dictionary in the first place? Is there a specific outcome you are trying to get? It’s unlikely that using join on a dictionary is what you actually want. — David Rock da...@g

Re: [Tutor] printing items form list

2017-03-03 Thread David Rock
e he wasn't looking, and > sneaked in some commas and spaces ;) > > That's cheating... yeah, just a little. :-) You can use join for this: suitcase = ["book", "towel", "shirt", "pants"] output = ', '.join(suitcase) print ("You

Re: [Tutor] printing items form list

2017-03-03 Thread David Rock
yours: You have a book, towel, shirt, pants, in your luggage. String concatenation with a loop is notorious for adding extra stuff at the end. To get it right, you have to take into account what to do at the end of the list, which adds code complexity. — David Rock da...@graniteweb.com ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] how to control putty window

2012-12-20 Thread David Rock
th a couple auto-commands on connect, but that's not the same thing. If it's a long string of commands, you might be better to pscp a shell script to the target with one command, and then call that script with the putty profile. I would research automating putty first, then see if there

Re: [Tutor] Binary/Decimal convertor

2013-01-11 Thread David Rock
d to do is figure out how to use a loop (eg, while loop, for loop). I would recommend thinking about some pseudocode to determine your program's flow and then try to build something to accomplish that. -- David Rock da...@graniteweb.com ___ Tutor m

Re: [Tutor] First Python Test

2013-02-02 Thread David Rock
al prompt. Verified on 10.6.8 -- David Rock da...@graniteweb.com ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] First Python Test

2013-02-04 Thread David Rock
oogling for "cocoa emacs" returns: http://emacsformacosx.com/ Perhaps that will work for you. I've tested that it works on my system, at least ("works" = it ran). -- David Rock da...@graniteweb.com ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Dictionaries and multiple keys/values

2013-03-26 Thread David Rock
x27;) >>> data ['French'] Then just put the list as the value. d['characteristics'] = data >>> data = 'Canadian, Pub Food'.split(',') >>> d['characteristics'] = data >>> d['characteristics'] ['Canadian', ' Pub Food'] -- David Rock da...@graniteweb.com ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Text Editors and Linux (was Re: exit message)

2013-05-08 Thread David Rock
So it's really more about personal taste than anything. If you _like_ what you are using, that's fine. I wouldn't like that setup. All options are valid options. Try them all and find what you like. -- David Rock da...@graniteweb.com _

Re: [Tutor] Text Editors and Linux (was Re: exit message)

2013-05-08 Thread David Rock
* Steven D'Aprano [2013-05-09 10:29]: > On 09/05/13 02:57, David Rock wrote: > > > > Well, not to start a flame war, but that is all subjective. > > Did I say otherwise? I was very careful to say "more natural FOR ME, > faster FOR ME". Not at all, but it w

Re: [Tutor] Text Editors and Linux (was Re: exit message)

2013-05-09 Thread David Rock
ich again, works well, but is not necessarily intuitive. > Or use emacs... :-) There's always one. You aren't helping the case for console apps with that one at all. :-) -- David Rock da...@graniteweb.com ___ Tutor maillist - Tutor@p

Re: [Tutor] Text Editors and Linux (was Re: exit message)

2013-05-09 Thread David Rock
moment. Yes, the disconnect/reconnect is nice (I use it a lot). It's not exactly relevant to merits of console interfaces vs GUI, though. That's more of a "this is a cool baked-in capability for working with lousy network connections", which you can also do with things like V

Re: [Tutor] Text Editors and Linux (was Re: exit message)

2013-05-09 Thread David Rock
* Alan Gauld [2013-05-09 16:50]: > On 09/05/13 15:42, David Rock wrote: > > >> Or use emacs... :-) > > > > There's always one. You aren't helping the case for console apps with > > that one at all. :-) > > But then emacs can also be considered

Re: [Tutor] How convert an int to a string

2013-06-22 Thread David Rock
thought str() would do it but it didn't. Reading about str() it talks of > string representation. So how can I convert it to a true string I can > slice and build my date look a like? Is there a requirement to store them as numbers in the first place? Why not just store them as a st

Re: [Tutor] Parse text with python

2013-10-17 Thread David Rock
: INUSE field may be empty, so you will grab the wrong value 1700 might be somewhere other than where you expect it etc -- David Rock da...@graniteweb.com ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mai

Re: [Tutor] help (Splitting a word into letters)

2014-03-18 Thread David Rock
ne 1, in IndexError: string index out of range >>> Can you be a little clearer what you need? Are you looking to store them in variables, an array, print them? If printing them, are you looking to output one per line, or spaced out? -- David Rock da...@graniteweb.com

Re: [Tutor] Help Noob Question

2014-03-28 Thread David Rock
he merits of one place over the other, just that simple organization is a good thing. Put it wherever you want, but at least keep it organized. Dropping everything in Desktop is not organized. -- David Rock da...@graniteweb.com ___ Tutor maill

Re: [Tutor] while loop

2014-03-31 Thread David Rock
So, instead of while n <= 10: Think about: while something <= n: and changing something and retesting. -- David Rock da...@graniteweb.com __

[Tutor] Question about O(N**2)

2014-05-03 Thread David Rock
#x27;, 'ignore').strip()] is an O(N**2)? 2. How do you know that fullPath.append(line.decode('utf-8', 'ignore').strip()) is not? -- David Rock da...@graniteweb.com ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] printing all text that begins with "25"

2014-10-02 Thread David Rock
ch would be to change the command you are running. I've never heard of hamachi list before; does it have any commandline options to display only IP addresses? -- David Rock da...@graniteweb.com ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] A question about using stdin/out/err vs named files

2014-10-19 Thread David Rock
nput(). A single file name is also allowed." It gives a fairly clean way to just "do the Right Thing" whether you are feeding files, or reading from stdin. -- David Rock da...@graniteweb.com ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] While until the end of a list

2017-03-13 Thread David Rock
ollow what you expect the output to be, though. What do you want the results of running the script to look like? — David Rock da...@graniteweb.com ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Problem on parsing data

2017-03-13 Thread David Rock
> On Mar 13, 2017, at 16:19, jarod_v6--- via Tutor wrote: > > > What can I do for parse better that file and Have only the comma outside the > string ? > I recommend using the cvs module rather than try to write your own. https://docs.python.org/2/library/csv.html

Re: [Tutor] CSV file Reading in python

2017-03-21 Thread David Rock
code and the errors you are getting so we can see what issue you are having. — David Rock da...@graniteweb.com ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Python - help with something most essential

2017-06-05 Thread David Rock
> On Jun 5, 2017, at 09:36, Schtvveer Schvrveve wrote: > > > And I was rejected. I just wish to understand what I could have done for > this to be better? > > I am a Python beginner, so I'm sure there are things I don't know, but I > was a bit surprised at the abruptness of the rejection and I

Re: [Tutor] Fahrenheit to Celsius Conversion another problem and Programming Paradigm

2017-06-14 Thread David Rock
ust keep trying things. When you run into something like this, the most effective way to troubleshoot is narrow it down to the essential issue. In this case, “why is the if statement always evaluating to true?” Look at the parts and re-read what each does (eg, reread how the ‘or’ operator works

Re: [Tutor] Fahrenheit to Celsius Conversion another problem and Programming Paradigm

2017-06-15 Thread David Rock
encouragement. Thank you. I’m glad it helped. For completeness, in case you didn’t notice, your elif statement has the same issue. elif unit == 'F' or 'f’: c = (temp - 32) * 5 / 9 print(str(temp) + ' F is equivalent to ' +

[Tutor] Why use main() ?

2017-07-05 Thread David Rock
f __name__ == '__main__': #code goes here vs def main(): #code goes here if __name__ == '__main__': main() I personally find using main() cumbersome, but many examples I come across use main(). Is there some fundamental benefit to using main() that I&

Re: [Tutor] Why use main() ?

2017-07-05 Thread David Rock
* Alan Gauld via Tutor [2017-07-05 20:36]: > On 05/07/17 16:37, David Rock wrote: > > > This is a question about the benefits of using a main() function vs not. > > > Others have answered for the pros, but I confess that I don't > always use a main(), but

  1   2   >