[Tutor] os.is_file and os.is_dir missing from CPython 3.8.0b?

2019-06-14 Thread Tom Hale
', 'EX_NOUSER', 'EX_NOHOST', 'EX_UNAVAILABLE', 'EX_SOFTWARE', 'EX_OSERR', 'EX_OSFILE', 'EX_CANTCREAT', 'EX_IOERR', 'EX_TEMPFAIL', 'EX_PROTOCOL', 'EX_NOPERM', 'EX_CONFIG', 'ST_RDONLY', 'ST_NOSUID', 'ST_NODEV', 'ST_NOEXEC', 'ST_SYNCHRONOUS', 'ST_MANDLOCK', 'ST_WRITE', 'ST_APPEND', 'ST_NOATIME', 'ST_NODIRATIME', 'ST_RELATIME', 'POSIX_FADV_NORMAL', 'POSIX_FADV_SEQUENTIAL', 'POSIX_FADV_RANDOM', 'POSIX_FADV_NOREUSE', 'POSIX_FADV_WILLNEED', 'POSIX_FADV_DONTNEED', 'P_PID', 'P_PGID', 'P_ALL', 'WEXITED', 'WNOWAIT', 'WSTOPPED', 'CLD_EXITED', 'CLD_DUMPED', 'CLD_TRAPPED', 'CLD_CONTINUED', 'F_LOCK', 'F_TLOCK', 'F_ULOCK', 'F_TEST', 'RWF_DSYNC', 'RWF_HIPRI', 'RWF_SYNC', 'RWF_NOWAIT', 'POSIX_SPAWN_OPEN', 'POSIX_SPAWN_CLOSE', 'POSIX_SPAWN_DUP2', 'SCHED_OTHER', 'SCHED_FIFO', 'SCHED_RR', 'SCHED_BATCH', 'SCHED_IDLE', 'SCHED_RESET_ON_FORK', 'XATTR_CREATE', 'XATTR_REPLACE', 'XATTR_SIZE_MAX', 'RTLD_LAZY', 'RTLD_NOW', 'RTLD_GLOBAL', 'RTLD_LOCAL', 'RTLD_NODELETE', 'RTLD_NOLOAD', 'RTLD_DEEPBIND', 'GRND_RANDOM', 'GRND_NONBLOCK', 'MFD_CLOEXEC', 'MFD_ALLOW_SEALING', 'MFD_HUGETLB', 'MFD_HUGE_SHIFT', 'MFD_HUGE_MASK', 'MFD_HUGE_64KB', 'MFD_HUGE_512KB', 'MFD_HUGE_1MB', 'MFD_HUGE_2MB', 'MFD_HUGE_8MB', 'MFD_HUGE_16MB', 'MFD_HUGE_32MB', 'MFD_HUGE_256MB', 'MFD_HUGE_512MB', 'MFD_HUGE_1GB', 'MFD_HUGE_2GB', 'MFD_HUGE_16GB', 'pathconf_names', 'confstr_names', 'sysconf_names', 'error', 'waitid_result', 'stat_result', 'statvfs_result', 'sched_param', 'times_result', 'uname_result', 'terminal_size', 'DirEntry', '_exit', 'path', 'curdir', 'pardir', 'sep', 'pathsep', 'defpath', 'extsep', 'altsep', 'devnull', 'supports_dir_fd', 'supports_effective_ids', 'supports_fd', 'supports_follow_symlinks', 'SEEK_SET', 'SEEK_CUR', 'SEEK_END', 'makedirs', 'removedirs', 'renames', 'walk', 'fwalk', '_fwalk', 'execl', 'execle', 'execlp', 'execlpe', 'execvp', 'execvpe', '_execvpe', 'get_exec_path', 'MutableMapping', '_Environ', '_putenv', '_unsetenv', 'getenv', 'supports_bytes_environ', 'environb', 'getenvb', 'fsencode', 'fsdecode', 'P_WAIT', 'P_NOWAIT', 'P_NOWAITO', '_spawnvef', 'spawnv', 'spawnve', 'spawnvp', 'spawnvpe', 'spawnl', 'spawnle', 'spawnlp', 'spawnlpe', 'popen', '_wrap_close', 'fdopen', '_fspath', 'PathLike']) >>>> Thanks, -- Tom Hale ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

[Tutor] Running Lib/test/test_shutil.py

2019-06-13 Thread Tom Hale
ting my tests with running the existing tests :) Is there a doc that I've missed? Cheers! -- Tom Hale ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

[Tutor] Fw: Download issues for Python

2019-06-04 Thread tom milikic
Hi my name is Tom and I come from Brisbane in Australia. I cannot seem to download Python on my computer as I really need it to help with my Quantitative Finance studies. It seems to say that some program is missing from my computer? What do I do? I am running Windows and a Toshiba

[Tutor] Understanding error in recursive function

2016-04-08 Thread Tom Maher
Hi, As a test I am trying to write a function that returns the sum of values attached to one key in a dictionary. I am wondering why the code that I wrote is returning: "maximum recursion depth exceeded " Here is the code: animals = { 'a': ['aardvark'], 'b': ['baboon'], 'c': ['coati']} x = anima

[Tutor] Simple game

2016-03-24 Thread Tom Maher
originally tried to equate raw_input to x as a marker but thought that maybe that changed the raw_input to be read AS x in the code even after input. So instead I entered raw_input in every section to represent the inputted value. Still stops at the prompt. Not sure if it is something obvious or if it i

[Tutor] What do each of these functions do?

2016-02-15 Thread Tom Brodle
I have requested help related to a program before, but did not see an answer. I am new to the communicating with "tutor", IE I may have missed the answer. This time I will simplify my inquiry. My previous programming has been with "Basic", so please give me a break. What do the following two li

[Tutor] Help needed

2016-02-04 Thread Tom Brodle
is still running. I did not think that programs actually did stop until the # power was removed. Thanks Tom ___ Tutor maillist - Tutor@python.org To unsubscribe or

Re: [Tutor] How to plot amount of lines but the amount is a input

2015-12-30 Thread Tom Xu
Dear Pythoneers, sorry for bothering. I want to draw several curves in one graph, but the amount of curves is not a fixed number. My homework is below: --- import matplotlib.pyplot as plt import math if __name__=='__main__': try:

[Tutor] How to plot amount of lines but the amount is a input

2015-12-30 Thread Tom Xu
Dear Pythoneers, I want to draw several curves in one graph, but the amount of curves is not a fixed number. My homework is below: --- import matplotlib.pyplot as plt import math if __name__=='__main__': try: n=int(input('how many curves? ')) ulist=[] thetalist=[]

[Tutor] output formatting question

2015-08-06 Thread tom arnall
i have read -- with what i think is a reasonable amount of attention -- all of the doc' i can find about string formatting in python. for the life of me, i cannot see how any of the other methods do more than you can do with, to use a concrete example: print "Here %s a number: %3d" % ("is",

[Tutor] howto create virtual environment for Enthought Training on Debian?

2014-08-19 Thread Tom Roche
ly I'm not seeing any howto's on Enthought's site[1]. Please reply to me as well as the list: I'm on the digest, which gets huge. Alternatively, add your answer to this StackOverflow[2] (which I setup at Enthought's apparent recommendation[1]). TIA, Tom Roche [1]: ht

[Tutor] For Loop Question

2012-12-23 Thread Tom Tucker
Python Gurus, I got a question for ya. Below I have three instance variables (self.A, self.B, etc). How can I use the below for loop for A, B, C to also call those instance variables? Example ### . . self.A = 1 self.B= 2 self.C= 3 myDict = {'A': 1, 'B':

Re: [Tutor] ssh connection

2012-12-17 Thread Tom Tucker
One option is PyExpect http://www.noah.org/python/pexpect/ On Mon, Dec 17, 2012 at 8:40 AM, Ufuk Eskici wrote: > Hello All, > > Can we make an SSH connection with Pyhton 3.3 ? > > I want to connecto to my router, send commands and receive outputs. > > Thanks. > Ufuk > > __

Re: [Tutor] Trouble running Python on Windows Vista

2012-06-14 Thread Tom Avos
Thanks!! De: Emile van Sebille Para: tutor@python.org Enviado: jueves, 14 de junio de 2012 16:35 Asunto: Re: [Tutor] Trouble running Python on Windows Vista On 6/14/2012 12:19 PM Tom Avos said... > Yes, If I open the file from the IDLE and then I press

Re: [Tutor] Trouble running Python on Windows Vista

2012-06-14 Thread Tom Avos
Yes, If I open the file from the IDLE and then I press "f5" it works, but I want to know why it does not work if I write the filename after the ">>>" prompt . That way is much more handy, I would like to make it work.   ____ De: Kwpol

Re: [Tutor] Trouble running Python on Windows Vista

2012-06-14 Thread Tom Avos
De: Tom Avos Para: "Flynn, Stephen (L & P - IT)" Enviado: jueves, 14 de junio de 2012 13:19 Asunto: Re: [Tutor] Trouble running Python on Windows Vista Great! You're right.. It works from the Command Line :-)   So, how should I call

[Tutor] Trouble running Python on Windows Vista

2012-06-14 Thread Tom Avos
Hi there, I'm learning Python. I have to work with a Notebook running Widows Vista Home Premium.(have no other choice) It works fine when working in Interactive Mode or by  Opening a .py file from the IDLE and then running it by pressing F5, but I can not run .py files by invoking them from the

Re: [Tutor] Iterate Suggestion

2012-04-14 Thread Tom Tucker
All, Thanks for the help. On Sat, Apr 14, 2012 at 1:33 PM, Bod Soutar wrote: > > > On 14 April 2012 18:29, Bod Soutar wrote: > >> >> >> On 14 April 2012 16:27, Tom Tucker wrote: >> >>> >>> Hello all. Any suggestions how I could easily

[Tutor] Iterate Suggestion

2012-04-14 Thread Tom Tucker
Hello all. Any suggestions how I could easily iterate over a list and print the output 3 across (when possible)? One method I was considering was removing the recently printed item from the list, checking list length, etc. Based on the remaining length of the list I would then print X across. Ya

Re: [Tutor] python telnet

2011-10-22 Thread Tom Tucker
Take a look at pyexpect. I have used this mod to ssh into juniper firewalls, excute a command, save results and exit. Instead of exiting you can drop down to interactive mode. On Oct 22, 2011 3:40 PM, "Rayon" wrote: > ** ** > > ** ** > > ** ** > > *From:* Rayon [mailto:ra...@gtt.co.gy] > *Sent:*

Re: [Tutor] Mac IDE

2011-09-29 Thread Tom Tucker
Another IDE to consider that supports the MAC OS is PyCharm from JetBrains. On Thu, Sep 29, 2011 at 7:50 AM, Wayne Werner wrote: > On Thu, Sep 29, 2011 at 5:50 AM, Walter Prins wrote: > >> On 29 September 2011 10:42, Robert Johansson < >> robert.johans...@math.umu.se> wrote: >> >>> Hi, >>> >

[Tutor] newbie needs pypy setup tips

2011-07-30 Thread Tom Roche
:00:34) > [PyPy 1.5.0-alpha0 with GCC 4.4.3] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > debug: OperationError: > debug: operror-type: ImportError > debug: operror-value: No module named _pypy_inte

Re: [Tutor] if os.path.exists() or if not os.path.exists()?

2011-03-24 Thread Tom Zych
log.write('No existe el archivo ' +shx + "\n") > if os.path.exists(dbf): > print 'El archivo ' +dbf +' existe' > log.write('No existe el archivo ' +dbf + "\n") I don't know about the rest, but you

Re: [Tutor] Recursively flatten the list

2011-03-24 Thread Tom Zych
ing code would be more readable. Regarding this line: if type(i) == type([]): This also works: if type(i) == list: But this is better: if isinstance(i, list): isinstance(obj, class) means "is obj an instance of class or a subtype of class", so it's more general. Do

Re: [Tutor] Checksum program

2011-03-23 Thread Tom Zych
ote what type of object it is. Your loop will work but it's not Pythonic - you can iterate over a sequence directly: for i in message: # i = a character (string of length 1) from message print "Processing", i -- Tom Zych / freethin...@pobox.com "Because if

Re: [Tutor] atr in dir Vs. hasattr

2011-03-16 Thread Tom Zych
OTOH, I got True in 3.1.1. As the docs say, detailed behavior may change across releases. I suppose there must be some reliable way to get a list of *all* an object's attributes, but I don't see it. -- Tom Zych / freethin...@pobox.com ___ T

Re: [Tutor] Static Variable in Functions

2011-03-15 Thread Tom Zych
Steven D'Aprano wrote: > Most of the common built-in Python objects are immutable: > ... > while a few are mutable: > > lists > dicts > sets Also, bytearrays. -- Tom Zych / freethin...@pobox.com ___ Tutor maillist - Tutor

[Tutor] Init Script (RHEL 5 Linux)

2011-03-07 Thread Tom Tucker
Hello. I am trying implement a *one time* execution of an init script. Any recommendation on how to fork or detach this script from the normal init 3 execution process so that it doesn't hold up other activities? Thanks Here is the high level logic. 1. Execute script 1. perform these

[Tutor] Defining Exceptions

2011-02-02 Thread Tom Brauch
All, I am a python neophyte and not terrible well versed in programming (as will become obvious shortly) I have a script which is reading a serial device on a schedule. The device outputs a header at the beginning of every read. I have a data file which I am appending and would like to eliminat

Re: [Tutor] Convert an IP address from binary to decimal

2011-01-18 Thread Tom Lin
于 2011-1-18 21:08, Christian Witts 写道: > On 18/01/2011 14:45, Tom Lin wrote: >> Hi guys, >> >> Please help me with this: >> Convert an IP address from binary string to decimal format.There are >> some preconditions: >> 1.IP address is in the form of '00

[Tutor] Convert an IP address from binary to decimal

2011-01-18 Thread Tom Lin
_ip = sys.argv[1:] convert(bin_ip) Thanks in advance and excuse my poor English. Best regards, Tom ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

[Tutor] extending a VS python with cygwin

2010-08-09 Thread Tom Roche
...] >or: setup.py --help-commands >or: setup.py cmd --help > error: invalid command 'mingw32' What's the appropriate syntax here? Or how else should I fix this? Apologies if this is a FAQ. If this is the wrong list/forum/whatever for this query, please direct m

Re: [Tutor] bind line-oriented device output?

2010-03-29 Thread Tom Roche
control character." Unfortunately when I search the PDF http://tinyurl.com/waspWLS9500manual for "control character" I get no hits. Are there synonyms for that term in this context? TIA, Tom Roche ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

[Tutor] bind line-oriented device output?

2010-03-28 Thread Tom Roche
de to which one could say, see this device? and this file? Make the device's output go only to that file. For extra credit, don't let anything else write that file while this code is running. Can python do that? Or does one need to get closer to the metal? TIA, Tom Roche _

[Tutor] Network Socket question

2010-02-20 Thread Tom Green
socket hangs on RECV. Sorry if I am not explaining this correctly. Maybe someone can share with me some papers on writing Windows sockets. Thank you, Tom Green. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http

Re: [Tutor] composing one test suite from two test cases

2010-01-11 Thread Tom Roche
Tom Roche Sun, Jan 10, 2010 at 10:44 PM >> How to create a single unittest test suite class that runs all >> methods from multiple TestCase classes? Kent Johnson Mon, 11 Jan 2010 06:42:39 -0500 > The supported way to do this is to create a test suite. There is an > ex

[Tutor] composing one test suite from two test cases

2010-01-10 Thread Tom Roche
uite in python? (FWIW the python version=2.5.2: downlevel, I know, but the box also needs to run ArcGIS.) TIA, Tom Roche ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Pack as HEX question

2009-10-24 Thread Tom Green
Sweet nice tip I love this list. Thank you. Mike On Sat, Oct 24, 2009 at 7:40 PM, Dave Angel wrote: > Tom Green wrote: > >> Thanks for your reply Dave. I am capturing the data off the network >> (wireshark) and saving it in WinHex for testing. I am actually building a &g

Re: [Tutor] Pack as HEX question

2009-10-24 Thread Tom Green
is a better way. Mike On Sat, Oct 24, 2009 at 4:43 PM, Dave Angel wrote: > Tom Green wrote: > >> Alan, >> >> Thanks for your response and hopefully I can clear things up. I apologize >> for not being more clear. >> >> I obtain the HEX encoded data

Re: [Tutor] Pack as HEX question

2009-10-24 Thread Tom Green
This is what I have so far, import struct EncryptString="313B372C2E2C63362E2128" XorKey="41424344" key = struct.unpack("d", XorKey) num_ints = len(EncryptString)/11 data = struct.unpack("%dd"% num_ints,EncryptString) The above code generates an error the my string must be a string length of 16

Re: [Tutor] Pack as HEX question

2009-10-24 Thread Tom Green
: > > "Tom Green" wrote > > > wondering if there was someway in Python to indicate that the string is a >> string of HEX values similar to Perl's pack. >> > > You need to be very careful in your terminology here. > > Is it "a string of he

[Tutor] Pack as HEX question

2009-10-24 Thread Tom Green
Hello everyone, First, I wanted to thank everyone in advance for your help and any feedback is appreciated. Here is what I am trying to accomplish: I have this encrypted data that was sent across the network. The decryption is a simple XOR with a 16 byte key. I started writing a basic Python s

Re: [Tutor] Conversion question

2009-06-16 Thread Tom Green
Thanks I just happened to find the site myself. I guess I have to pass each character to the function and build the 8-bit ASCII string or is there a better way to do it? On Tue, Jun 16, 2009 at 3:37 PM, Wayne wrote: > On Tue, Jun 16, 2009 at 2:25 PM, Tom Green wrote: > >> Correct

Re: [Tutor] Conversion question

2009-06-16 Thread Tom Green
Correct 8-bit ASCII. Sorry about that. I am using Python 2.5.2, which doesn't support bin. If I upgraded how would I go about converting the entire string to 8-bit ASCII? I appreciate your help. On Tue, Jun 16, 2009 at 3:05 PM, Lie Ryan wrote: > xchime...@gmail.com wrote: > > Thanks for th

Re: [Tutor] Best Python Editor

2009-06-15 Thread Tom Green
This has been a great discussion and when I first entered college I was required to take Pascal. At that time we used Turbo Pascal IDE--if you want to call it an IDE. As with anything technology advances and we have new tools for the job and I became spoiled once Visual Studio hit the market. I

Re: [Tutor] Best Python Editor

2009-06-14 Thread Tom Green
Since VIM seems to be the editor of choice and I have been programming in Python for many years using Pyscripter and Eclipse I was wondering how I could transition away from the IDE world to VIM. My main issue is how do I go about using VIM to debug my code? With Pyscripter and other IDES its as

Re: [Tutor] Best Python Editor

2009-06-13 Thread Tom Green
For Windows check out PyScripter. Its IDE is similar to Borland Delphi and I find it very easy to use. Whatever works for you would be "best" for you. PyScripter is FREE and I would highly recommend it for people who are new to Python or people with programming experience that are used to progra

Re: [Tutor] Conversion question

2009-05-05 Thread Tom Green
Thanks everyone for your replies. This reason for the long string is sometimes I have to pass a 32 byte key (MD5 hash value) to the socket. The data I am sending is the hex values i.e. 41=A. I believe the binascii will work. Mike On Mon, May 4, 2009 at 7:52 PM, Alan Gauld wrote: > >

Re: [Tutor] Conversion question

2009-05-04 Thread Tom Green
Thank you, I didn't realize it was that easy. I tried binascii before and I thought it didn't work properly. I appreciate it. Mike. On Mon, May 4, 2009 at 7:40 PM, Emile van Sebille wrote: > On 5/4/2009 4:17 PM Tom Green said... > >> First, thanks in advance for any in

[Tutor] Conversion question

2009-05-04 Thread Tom Green
First, thanks in advance for any insight on how to assist in making me a better Python programmer. Here is my question. I work with a lot of sockets and most of them require hex data. I am usually given a string of data to send to the socket. Example: "414243440d0a" Is there a way in Python to

Re: [Tutor] WINSOCK stdin question

2009-02-06 Thread Tom Green
The Python app is on the Server side. Sorry, I don't mean to cause hassle for anyone. I appreciate everyone's assistance. I am trying to reproduce what Netcat does. Thanks, Mike On Fri, Feb 6, 2009 at 9:19 PM, Kent Johnson wrote: > On Fri, Feb 6, 2009 at 3:52 PM, Tom Green wro

[Tutor] WINSOCK stdin question

2009-02-06 Thread Tom Green
. Basically this is a reverse shell. Any tips is much appreciated. Thank you, Tom ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Adding Lists?

2008-08-23 Thread Tom Wakelam
list quickly? Many thanks, Tom _ Make a mini you on Windows Live Messenger! http://clk.atdmt.com/UKM/go/107571437/direct/01/___ Tutor maillist - Tutor@python.org http://mail.python.org/ma

Re: [Tutor] IDE

2008-06-11 Thread Tom
I use PythonWin and find the Interactive Python Window invaluable. Does anyone know which of the IDE's mentioned above have a similar feature. (I'm on Vista,sorry!) Thanks. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/t

Re: [Tutor] How to get a script to open a text file with Python?

2008-06-11 Thread Tom
Or this can open most things: import webbrowser webbrowser.open_new('file///' + filename) On 11/06/2008, Alan Gauld <[EMAIL PROTECTED]> wrote: > > "Terry Carroll" <[EMAIL PROTECTED]> wrote > > > > > > > If TextPad is your default txt editor just use > > > os.system("foo.txt") > > > > > > > or os

Re: [Tutor] Supported platform

2008-05-21 Thread Tom Tucker
I would check the docs on the www.python.org website. >From the main page "Python runs on Windows, Linux/Unix, Mac OS X, OS/2, Amiga, Palm Handhelds, and Nokia mobile phones. Python has also been ported to the Java and .NET virtual machines." On Wed, May 21, 2008 at 2:11 PM, Amit Kumar <[E

[Tutor] Creating Sudoku

2008-04-06 Thread Tom Haynes
someone could help step me through what needs to be done that would be greatly appreciated! Thanks, Tom No virus found in this outgoing message. Checked by AVG. Version: 7.5.519 / Virus Database: 269.22.8/1362 - Release Date: 6/04/2008 11:12 AM

[Tutor] Library for Disk Usage (UNIX)

2008-03-26 Thread Tom Tucker
was looking at os.stat(/path)[WXYZ}, and os.path.getsize, but they are lacking. Thanks for the help, Tom ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] append string

2008-03-21 Thread Tom Tucker
Strings are immutable, you can't append to them. How about this >>> mystring = 'Elis' >>> mystring.append('Aeris') Traceback (most recent call last): File "", line 1, in AttributeError: 'str' object has no attribute 'append' >>> mystring + ' Aeris' 'Elis Aeris' >>> x = mystring + ' Aeri

Re: [Tutor] int to string

2008-03-21 Thread Tom Tucker
>>> y = 3 >>> type(y) >>> x = str(y) >>> type(x) On Fri, Mar 21, 2008 at 8:05 PM, elis aeris <[EMAIL PROTECTED]> wrote: > how do I convert int to string? > > ___ > Tutor maillist - Tutor@python.org > http://mail.python.org/mailman/listinfo/tutor >

Re: [Tutor] rsync python script

2008-03-21 Thread Tom Tucker
The success or failure could be confirmed by checking the exit status and/or confirming host77 has the same /var/lib file structure as the source host. The later is the most accurate, however a bit more complicated to confirm. As for determining the reason for failure, possible causes off the top o

Re: [Tutor] rss feed reader, but having trouble with unicode

2008-02-28 Thread Tom
Yeah I was considering using that. Thanks for the tip. On 28/02/2008, Michael Langford <[EMAIL PROTECTED]> wrote: > feedparser.org also works really well for this sort of thing. Does a > lot of the unicode automagically for you. > >--michael > > > On Wed, F

[Tutor] SSH with Python

2008-02-27 Thread Tom
I have a webfaction server (highly recommended btw) and I'm trying to use automate some tasks over ssh but I'm not having much luck with pyssh http://pyssh.sourceforge.net/ . Some of the docs mention methods that don't exist in the version I downloaded, such as pyssh.run. I'm using windows vista

Re: [Tutor] rss feed reader, but having trouble with unicode

2008-02-27 Thread Tom
wrote: > Hello Tom, > > Try doing this: > > xml = unicode(xml, encoding, "ignore") > elem = ElementTree.fromstring(xml.encode("utf8")) > > > > #do stuff with elem... > > > > f

[Tutor] rss feed reader, but having trouble with unicode

2008-02-26 Thread Tom
I'm trying to write a little rss feed reader, but having trouble with unicode. I would appreciate some help as I feel I'm going round in circles. Even when the save command works, ElementTree won't or vice-versa. You can see what I've been trying from my commented out lines. I think there is a pro

[Tutor] Little subclass understanding problem

2007-11-15 Thread Tom
I am trying to understand what happens in the following scenario: class Sub_class(Base_class): def __init__(self, data): Base_class.__init__(self, data) as in: # snippet from http://viner.tv/go?set class Set(list): def __init__(self, value = []): list.__init__([]) The l

[Tutor] making a typing speed tester

2007-11-07 Thread Tom
Hi, I asked this question last year but got no response. I'm trying to write a program to test someones typing speed and show them their mistakes. However I'm getting weird results when looking for the differences in longer (than 100 chars) strings: import difflib # a tape measure string (just m

Re: [Tutor] difflib.SequenceMatcher with get_matching_blocks is incorrect

2007-11-05 Thread Tom
Hi, I asked this question last year but got no response. I'm trying to write a program to test someone's typing speed and show them their mistakes. However I'm getting weird results when looking for the differences in longer (than 100 chars) strings: import difflib # a tape measure string (just

Re: [Tutor] I need an 'atomic read/ write action'

2007-11-04 Thread Tom
my desktop computer (Vista Task Scheduler looks fancy but doesn't seem to work so well for me) which uses python 2.5? Thanks again. - Hide quoted text - On 05/11/2007, Kent Johnson <[EMAIL PROTECTED]> wrote: > Tom wrote: > > So all my ideas for how to record task x as '

[Tutor] I need an 'atomic read/ write action'

2007-11-04 Thread Tom
k need doing?' and the 'I'm going to do the task. Please no one else do it!' are atomic(?) and leave no room for mischief in between. Another problem is that the task may fail and need redoing, but I think I can solve that given a solution to the above. Do let me know if m

Re: [Tutor] killing bash, sshd... dangerous?

2007-10-28 Thread Tom Tucker
Instead of reading in an outputfile (.ps), try reading from command output. The correct terminology escapes me (for file in os.popen(cmd).readlines():). Are you looking for a auto logout method? For example if no activity after X minutes kill the shell. Bash and a few other shells have this func

Re: [Tutor] data type conversion for print statement

2007-09-25 Thread Tom Tucker
Excerpt from an email Danny Yoo sent to me and the list in 2005. I had the same question. ;-) Hi Tom, The 'print' statement is hardcoded to add a space between elements. print is meant to make output easy, at the cost of control. If we need more fine-grained control over output, w

Re: [Tutor] how to match regular expression from right to left

2007-09-16 Thread Tom Tucker
Yep, looks like it. >>> line = 'us::blah blah2 1002 blah3' >>> import re >>> TAG_pattern = re.compile(r"(us::.*) .*(1002|1003).*$") >>> if TAG_pattern.search(line): ... print 'we have a match' ... we have a match >>> >>> line2 ='us::blah blah2 1001 blah3' >>> if TAG_pattern.search(line2): ...

Re: [Tutor] how to add arguments to a command line program

2007-09-14 Thread Tom Tucker
See optparse or sys.argv. On 9/14/07, shawn bright <[EMAIL PROTECTED]> wrote: > > lo there all, > > i want to write a program that will be called from another program. > I need to pass it one variable. > i s

Re: [Tutor] Tutor Digest, Vol 43, Issue 36

2007-09-12 Thread Tom Tucker
d degrade the version and save it and > > run > > updates manually..so,that can any one plz..tell me how to start from > > first > > step... > > > > -- > > Best Regards, > > M.Srikanth Kumar, > > -- next part -- > >

Re: [Tutor] automate daily tasks

2007-09-11 Thread Tom Tucker
Are you looking for a method to automate the execution of your Python program? Is that the question? If yes, have you tried using cron or at jobs (man cron or man at). Tom On 9/11/07, chinni <[EMAIL PROTECTED]> wrote: > > Hi all, > > I am working on MAC OS x my project is

Re: [Tutor] Question re Tutor List Etiquette

2007-08-14 Thread Tom Fitzhenry
(7th paragraph, "Now, here's a really useful rule, ...") I don't post that often so I don't get this that often, so it doesn't bother me that much, but I could see how it'd be annoying to those who post frequently. -- Tom Fitzhenry ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Simple way to compare Two lists

2007-08-10 Thread Tom Fitzhenry
ove. If neither SmallList or BigList are sorted, it's probably best to use your original method, which I cannot improve. -- Tom Fitzhenry ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] how do I input " as part of a string?

2007-07-13 Thread Tom Tucker
Try escaping the quotes. f = open("data.ini","w") f.write("my \"car\" has been a great one for me") f.close() ~ >cat data.ini my "car" has been a great one for me On 7/13/07, elis aeris <[EMAIL PROTECTED]> wrote: also, why does the interpreter restart when I run this? f = open("data.ini"

Re: [Tutor] Regular Expression help

2007-06-27 Thread Tom Tucker
I think I have a solution. File (0012,0042) Clinical Trial Subject Reading ID LO 1 (0012,0050) Clinical Trial Time Point ID LO 1 (0012,0051) Clinical Trial Time Point Description ST 1 (0012,0060) Clinical Trial Coordinating Center Name LO 1 (0018,0010) Contrast/Bolus

Re: [Tutor] how can I compare a local directory or file with a remote one

2007-06-20 Thread Tom Tucker
What are we comparing? Size of files, number of files in a directory, md5sum of the files, directory size, etc? What about rsync? You can use rsync to compare directories between a source and destiantion system and just report differences. For example, comparing /etc directores between two RHEL

Re: [Tutor] leave tutorial

2007-05-30 Thread Tom Tucker
http://mail.python.org/mailman/listinfo/tutor On 5/30/07, Kriti Satija <[EMAIL PROTECTED]> wrote: i want to leave the tutorial Looking for people who are YOUR TYPE? Find them at in.groups.yahoo.com ___ Tutor maillist - Tutor@python.org http

Re: [Tutor] string replacement

2007-05-21 Thread Tom Tucker
One way is... CODE #!/usr/bin/python handle = file("test.txt",'a') number = 1 for num in range(1,5): handle.write("TestingSome%s\n" % (number)) handle.write("something%s-test\n" % (number)) number += 1 handle.close() OUTPUT TestingSome1 something1-

Re: [Tutor] Continue Matching after First Match

2007-05-21 Thread Tom Tucker
rtin Walsh <[EMAIL PROTECTED]> wrote: Hi Tom, Tom Tucker wrote: > Why the cStringIO stuff? The input data shown below is collected from > os.popen. I was trying to find an easy way of matching my regex. Ah, ldap... Oh yes, Matching with a string seemed easier than looping t

Re: [Tutor] Continue Matching after First Match

2007-05-18 Thread Tom Tucker
Disregard! Looks like part of my problem is the regex string. On 5/18/07, Tom Tucker <[EMAIL PROTECTED]> wrote: Please forgive the colors, just trying to help illustrate my question. The below code snipet works as designed, however the regex matches once and exits. I want it to co

[Tutor] Continue Matching after First Match

2007-05-18 Thread Tom Tucker
person objectClass: posixAccount objectClass: shadowAccount objectClass: inetorgperson objectClass: organizationalPerson loginShell: /usr/bin/ksh homeDirectory: /home/jtucker dn: uid=ttucker,ou=people,dc=companyA,dc=com loginShell: /usr/bin/zsh host: hostZ host: hostC uid: ttucker cn: Tom Tucker sn: Tu

Re: [Tutor] (no subject)

2007-05-18 Thread Tom Tucker
Very cool! Where is Inky, Blinky, Pinky, and Clyde? ;-) Maybe dog catchers would be better foes for Dusty. On 5/18/07, Teresa Stanton <[EMAIL PROTECTED]> wrote: Hi all: Remember when I was having problems moving my .gif around my Tkinter maze? Well, I was going about it all wrong (as some poi

Re: [Tutor] version and path

2007-05-14 Thread Tom Tucker
Does this help? On 5/14/07, linda. s <[EMAIL PROTECTED]> wrote: > On 5/14/07, Tom Tucker <[EMAIL PROTECTED]> wrote: > > I would use the traditional Unix find command to find the various > > versions installed. > > > > find / -name "python*"

Re: [Tutor] Web

2007-05-14 Thread Tom Tucker
Jeff, Can you clarify what you are looking to do. You have a small program that you want to distribute via Internet (allow users to view, download, etc)? You want to use Python to create a website? Integrate your program into a web page (modpython for example). On 5/14/07, Jeff Molinari <[EMAIL

Re: [Tutor] version and path

2007-05-14 Thread Tom Tucker
I would use the traditional Unix find command to find the various versions installed. find / -name "python*" On 5/14/07, linda.s <[EMAIL PROTECTED]> wrote: > how to check how many versions of Python i have in my mac machine? > also, how to put the path to the version I desire? > Thanks a lot! >

Re: [Tutor] Multiple lines with the command line

2007-04-16 Thread Tom Tucker
of', 'my', 'message'] #!/usr/bin/env python import sys message = sys.argv[1:] # save message variable to a file # execute mail command < file On 4/16/07, Tom Tucker < [EMAIL PROTECTED]> wrote: Have you tried the "email" module? http://docs.python.or

Re: [Tutor] Multiple lines with the command line

2007-04-16 Thread Tom Tucker
Have you tried the "email" module? http://docs.python.org/lib/module-email.html On 4/16/07, Kharbush, Alex [ITCSV] <[EMAIL PROTECTED]> wrote: I want to use the UNIX Mail program with python I need multiple entries with the os.system(cmd)line I will need something like this #output to uni

[Tutor] Matching on multiple log lines

2006-10-28 Thread Tom Tucker
I would appreciate any recommendations or assistance on how to read and parse this log. The log is constantly growing and has the potential of being large. For this reason, we are reading in line by line. How do I match on multiple lines, while reading a log line by line. Hopefully the logic e

[Tutor] Variable help

2006-10-08 Thread Tom R.
I have a number of arrays: player1 = [data, data, data] player2 = [data, data, data] player3 = [data, data, data] player4 = [data, data, data] I want to be able to do something like: count = 2 if player + count[3] == 5: do this do that count += 1 And that would do this and t

[Tutor] Roack, Paper Scissors

2006-08-12 Thread Tom Wilson
could someone please explain to me how the scripts for the rock, paper, scissors game work because i'm not quite sure. tom _ Windows Live™ Messenger has arrived. Click here to download it for free! http://imagine-ms

[Tutor] python

2006-08-09 Thread Tom Wilson
could someone explain to me how the "import" function works? tom _ The new Windows Live Toolbar helps you guard against viruses http://toolbar.live.com/?mkt=en-gb ___ Tuto

Re: [Tutor] stfftime question

2006-07-04 Thread Tom Tucker
= time.mktime(t1.timetuple())+(t1.microsecond/1000.) t2tuple = time.mktime(t2.timetuple())+(t2.microsecond/1000.) delta = (t2tuple - t1tuple) * 1000 print delta On 7/4/06, Tom Tucker <[EMAIL PROTECTED]> wrote: > Below is an example of me converting a datetime to milliseconds on a > Mac run

[Tutor] stfftime question

2006-07-04 Thread Tom Tucker
Below is an example of me converting a datetime to milliseconds on a Mac running Pythong 2.3.5. The same working code on a Solaris system with Python 2.3.2 fails. Any thoughts? What arguments am I missing? >From my Mac # Python 2.3.5 (#1, Oct 5 2005, 11:07:27) [GCC 3.3 20030304 (A

[Tutor] I HAVE A QUESTION

2006-03-25 Thread Tom Bachik
des easygui only demo boxes because thats all i can get it todo ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] i need help please read

2006-03-22 Thread Tom Bachik
ok does anyone know how to righ a script were a box pops up then if it goes over a number on the screen it pops up in the box become the input number so you can alter the number that popped up in the box? if you do can you right it and send it to me and  if you cant doit all but know how i can do p

  1   2   >