Re: [Tutor] which of these is more efficient?

2019-08-19 Thread nathan tech
not realise I could do something like: key=(x, y) game_map[key]=bla. LEarned a lot, so thanks! Nathan On 19/08/2019 15:02, Mats Wichmann wrote: > On 8/18/19 5:55 PM, nathan tech wrote: >> Hi there, >> >> So I am running over some coding ideas in my head for creatin

[Tutor] which of these is more efficient?

2019-08-19 Thread nathan tech
r(player_x)+":"+str(player_y) map[key]=default_grid_format Is this an efficient method compared to 1? Is it, code wise, sound logic? I guess I'm just looking for a second opinion from experienced peoples. thanks everyone. Nathan __

Re: [Tutor] just a quick logic check if someone has two seconds

2019-08-02 Thread nathan tech
/08/2019 23:10, nathan tech wrote: > >> import speedtest > This is not a standard library module so I have no idea > what it does so obviously there could be magic afoot of > which I am unaware. But assuming it behaves like most > Python code... > >> def do-test(

[Tutor] just a quick logic check if someone has two seconds

2019-08-01 Thread nathan tech
: If the user clicks the button, say, 3 times, will I have three separate speedtest objects? or will the python garbage collector clean them up for me so I only have one, which gets cleaned when do_test returns. Thanks for the answer in advance. Nathan

Re: [Tutor] Fwd: Re: would someone please explain this concept to me

2019-06-06 Thread nathan tech
Hi alan, thanks so much for clearing that up. Now you've explained it in that way, I understand what it is doing and how it went wrong. Thank you so much! Nathan On 06/06/2019 00:57, Alan Gauld via Tutor wrote: > On 05/06/2019 20:47, nathan tech wrote: > >> so for exa

[Tutor] Fwd: Re: would someone please explain this concept to me

2019-06-05 Thread nathan tech
Thought I addressed this to the list... Aparrently my mail client hates me. Forwarded Message Subject:Re: [Tutor] would someone please explain this concept to me Date: Wed, 5 Jun 2019 02:37:49 +0100 From: nathan tech <mailto:nathan-t...@hotmail.com> To:

[Tutor] would someone please explain this concept to me

2019-06-04 Thread nathan tech
t why does it work? Why does that semi unlink all the variables? Thanks Nathan ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] is this doable

2019-06-01 Thread nathan tech
l.send_signal()  # exit the program Hope I'm making more sense now, and thank you for the help everyone. Nate On 01/06/2019 04:30, Mats Wichmann wrote: > On 5/31/19 1:41 PM, nathan tech wrote: >> Hi there, >> >> So for a future project of mine, I was wondering something. >>

[Tutor] is this doable

2019-05-31 Thread nathan tech
Hi there, So for a future project of mine, I was wondering something. Is it possible, in python, to store a running task id in the registry? I might be using the complete wrong terms here, because I'm only used to doing this with a specific language, but here's what I want to do: python

[Tutor] tweeting from python

2019-05-26 Thread nathan tech
Hi there, I was wondering if anyone had some tips that might direct me to answers to this problem: I have a program which one downloads to your computer, and you install. Then, I want to add into this program a share button. This share button would send a tweet to your twitter saying, "I am

[Tutor] cython and threads, and feedparser

2019-05-12 Thread nathan tech
Hello! After a day of various attempts yesterday, I managed to get cython installed on my windows 10 machine. Allow me to prefix this by saying, if there is somewhere else I should put this, II'M SORRY! So I ran cython on my python project, and it worked fine, there was one error about an

Re: [Tutor] don't steel my code Mister user

2019-05-05 Thread nathan tech
bucks, the other is I'm a sucker for helping as many people as I can. Anyway, staying on topic here, I really appreciate all of you taking the time to give me advice and help, thank you very much :) Thanks Nate On 04/05/2019 22:50, Alan Gauld via Tutor wrote: > On 04/05/2019 15:35, nathan t

Re: [Tutor] don't steel my code Mister user

2019-05-04 Thread nathan tech
it would be £5, or $7, and 7 bucks just isn't worth all the effort to make python difficult to hack. Nothing is impossible, but, deterring the average user just for $7? Not worth it. Thanks anyway guys. Nate On 04/05/2019 12:46, Alan Gauld via Tutor wrote: > On 04/05/2019 00:45, nathan tech wr

[Tutor] don't steel my code Mister user

2019-05-04 Thread nathan tech
Hi there, Hope you like the subject, I was feeling inventive. my question today concerns compilation. I hear this a lot from the communities I hang around in, and it is something I wonder about often. There are tools like py2exe and pyinstaller that are able to compile your python code into

Re: [Tutor] feedparser in python

2019-04-29 Thread nathan tech
. Thanks Nate On 29/04/2019 08:43, Alan Gauld via Tutor wrote: > On 29/04/2019 01:26, nathan tech wrote: > >> Most recently, I have started work using feedparser. > I've never heard of it let alone used it so there may > be another forum where you can get specific answers. > But

[Tutor] feedparser in python

2019-04-29 Thread nathan tech
Hello everyone, Most recently, I have started work using feedparser. I noticed, almost straight away, it's a  bit slow. For instance:     url="http://feeds.bbci.co.uk/news/rss.xml;     f1=feedparser.parse(url) On some feeds, this can take a few seconds, on the talk python to me feed, it

[Tutor] urlGET information

2019-04-28 Thread Nathan D'Elboux
a linux man page equivalent within the wheel that would provide more context? Thanks Nathan ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

[Tutor] Import error, no module named app script

2019-03-21 Thread nathan tech
Hi guys, So I recently begun using Mac to program in python. For one of the modules I am going to be using, it calls app script in order to send commands to voiceover, which is a screen reader for the MAC. The only problem is, it gives an error about no module named appscript. Indeed, when I go

Re: [Tutor] schedulers

2019-03-01 Thread nathan tech
pointing out the floors. :) Thanks again. Nathan On 28/02/2019 23:23, Alan Gauld via Tutor wrote: > On 28/02/2019 14:45, nathan tech wrote: > >> but I'm thinking, should I do this? > No. fOr several reasons... > >> def do_backup >>  # backup code here, >&g

[Tutor] schedulers

2019-02-28 Thread nathan tech
it in the background... def scheduler():  global tus # tus=time until schedule  while(time.time()>tus):   time.sleep(5)  scheduler() Is that wise? Is that how it should be done? This is a program for windows. Thanks! Nathan ___ Tutor maill

[Tutor] running a game server

2019-01-06 Thread nathan tech
Hello all, Above all I am a game developer and I want to make multi player games. For my first trick I want to make a game that is building related, with a map and such. For the map I was thinking of using a dict and running along those lines. My question is, is python really the way to go

[Tutor] playing sound files in python

2018-12-07 Thread nathan tech
Hello all! My name is nate, and I am relatively new to this list, relatively being just signed up. I have a question that you would think would be obvious, but alas I have struggled to figure out. How do I play sound files in python. More specificly, I want to play ogg files especially, with

Re: [Tutor] Argparse Error

2018-08-12 Thread Nathan Johnson
hon D:\Python\bytsh.py D:\Video\test.mp4 SyntaxError: unexpected character after line continuation character >>> which program should I be running this through? On Sun, Aug 12, 2018 at 12:24 PM, Alan Gauld via Tutor wrote: > On 12/08/18 16:52, Nathan Johnson wrote: > > Oka

Re: [Tutor] Argparse Error

2018-08-12 Thread Nathan Johnson
erstanding. On Sun, Aug 12, 2018 at 2:45 AM, Alan Gauld via Tutor wrote: > On 12/08/18 00:51, Nathan Johnson wrote: > > > Hello I am trying to glitch video files for artistic purposes by using a > > scrip I found on Reddit (linked below). This is the first time I have > tri

[Tutor] Argparse Error

2018-08-12 Thread Nathan Johnson
x64 Based PC Windows 10 Home Version 1803 OS Build 17134.191 Python 3.7.0 x32 Hello I am trying to glitch video files for artistic purposes by using a scrip I found on Reddit (linked below). This is the first time I have tried to use Python and I need some help with an error that I keep getting

[Tutor] Executing "if :" function on terminal

2017-09-05 Thread Nathan Kckaiyer
Dear Tutor, i have just started learning python. I have repeatedly hit a road block on my mac os terminal . Everytime i use the "if :" command i get syntax errors. i do not see any errors on text editor i am following instructions from a book Original input on editor >>> a=2 >>> if a==2 :

Re: [Tutor] Python Bind DNS Zone config

2017-05-04 Thread Nathan D'Elboux
statement I need to either escape the opening { after the IN statement as the .format(new_domain)) statement doesnt seem to be detecting i have the {} ready to take the parameter new_domain? Thanks for the link it certainly helped On Wed, May 3, 2017 at 10:24 PM, boB Stepp <robertvst...@gmail.com&

[Tutor] Python Bind DNS Zone config

2017-05-03 Thread Nathan D'Elboux
ace of where i want the domain to be inserted into but i dont know how to structure the syntax of a zone file in a function within I apologise if its basic, i don't necessarily want the answer just given to me but more of a clue of how someone else may structure it a

[Tutor] Python trouble

2015-12-29 Thread Nathan Clark
This is a fibonnaci sequence generator, the colon causes a syntax error #set variables num_1 = 1 num_2 = 2 count = 0 terms = int(input("How many terms of the fibonnaci sequence would you like?") #function while terms != count : num_3 =num_1+num_2 print (num_3) num_1=num_2

Re: [Tutor] problem with code

2015-09-01 Thread Nathan Clark
5 at 4:08 PM, Job <jobrh2...@gmail.com> wrote: > #i would do it this way in python2 > #maybe you can use as reference > > time = int(raw_input('x')) > > If time => 2: > print 'y' > else: > print 'z' > > Good luck, > > Job > > > On

[Tutor] problem with code

2015-08-20 Thread Nathan Clark
I have written a basic program out of python and it is not functioning, please could you proof read my code and tell me how to fix it.It is in python 3.3 time=int(input(How long on average do you spend on the computer per day?) (print(that seems reasonable)) if time=2 else print (get a life)

[Tutor] Full screen mode

2014-10-21 Thread Nathan Spencer
Hi there, I'm running python on Scientific Linux. The problem is that I'm permanently stuck in full screen mode. Exiting out of that mode (via F11) doesn't do anything. Do you have any suggestions? Thanks, Nathan -- Nathaniel J. Spencer, PhD Post-Doctoral Research Associate Psychoacoustics

[Tutor] Writing to text files

2014-03-28 Thread Nathan Curnow (Year 10)
HU. HU. HU. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

[Tutor] New Python 3.3.2 Install Fails to Start-Up

2013-07-10 Thread Nathan Schlaffer
? Second, I tried to run my Python programs today via IDLE but when I checked the Edit Menu I couldn't find a Run Menu to execute or run my program. How do I run a program once I have written the code in IDLE? Sincerely, Nathan Schlaffer E-mail: nathanschlaf...@gmail.com

Re: [Tutor] Dynamic TKinter widgets?

2012-11-28 Thread Nathan
a single Frame and a loop that adds a variable number of widgets. Now I just destroy that Frame (and thus, the widgets it holds), recreate it, and repopulate it. Which, re-reading this discussion, is probably what you meant by standard practice. Thanks for your help! On Nov 25, 2012 8:10 PM, Nathan

Re: [Tutor] Dynamic TKinter widgets?

2012-11-25 Thread Nathan
On Nov 25, 2012 6:49 PM, ALAN GAULD alan.ga...@btinternet.com wrote: CC'ing the list... Oops, my bad. I forget to hit Reply All. I know you can use images instead of text with Labels, like you can with Buttons. The advantage of a Text widget, in this case, is that you can use both in the

[Tutor] Dynamic TKinter widgets?

2012-11-24 Thread Nathan
I'm working on a simple Tarot reading program in Python 2.7, and I'm having a bit of trouble with some GUI abstract. (Sorry, no code in here.) As of right now, all of the logic is working, and I can generate Tarot spreads that tell me, in text, the role of each card position, and what card is in

Re: [Tutor] Dynamic TKinter widgets?

2012-11-24 Thread Nathan
24 November 2012, Nathan wrote: I'm working on a simple Tarot reading program in Python 2.7, and I'm having a bit of trouble with some GUI abstract. (Sorry, no code in here.) As of right now, all of the logic is working, and I can generate Tarot spreads that tell me, in text, the role

Re: [Tutor] Python for Absolute Beginners

2012-09-28 Thread Nathan
Which edition do you have? My copy mentions nothing about a companion guide, so my guess is that you don't need it. That said, my copy also doesn't send me to any sites for the exercises. Everything I need is right in the book. On Sep 28, 2012 7:30 AM, Debbie Snowdon dsnow...@carolina.rr.com

[Tutor] Calling Classes From Tkinter Radio Buttons

2012-04-08 Thread Nathan
I'm using Tkinter for a GUI for a program of mine, and I'm trying to use radio buttons to select different functions, but it's not working right at all. Originally, I had something like class ClassOne(self): def ___str___(self): return This is the base class. class

Re: [Tutor] Floating Point Craziness

2011-06-13 Thread Nathan
who can tell me how to unsubscribe the message. At 2011-06-13 01:13:05,Steven DAprano st...@pearwood.info wrote: Ryan Strunk wrote: Hi everyone, I'm designing a timeline. When the user presses the right arrow, 0.1 is added to the current position. The user can add events to the timeline,

Re: [Tutor] Copying a mutable

2011-06-07 Thread Nathan
unsubscribe 在 2011-06-08 07:11:33,Walter Prins wpr...@gmail.com 写道: Hi, 2011/6/7 Válas Pétersuli...@postafiok.hu Hi, let X be a mutable container, such as dict/set/list=bytearray, and Y=X, When I change X, Y will follow it, having always the same value, although id(X)!=id(Y). That's not

[Tutor] Scripting-Puzzle Pirates

2010-10-24 Thread Nathan Finney
, Nathan Finney.___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

[Tutor] Simple Python Telnet Client (Help with Asynchronous IO)

2010-08-03 Thread Nathan Farrar
Hello All, I'm attempting to write a simple telnet client. Yes, I've been told that I should be using twisted to do this. I want to learn to do it myself first, so that I can fully understand the concepts - then I will scrap it and switch to using twisted. When I started, I didn't realize

[Tutor] Pexpect maxread searchwindowsize, timeout

2009-10-20 Thread Nathan Farrar
I haven't been able to find any real examples of pexpect usage, nor documentation. Just little bits here and there, so I'm kind of struggling through. I've got the follow bit of code I'm working with: def main(): try: print 'attempting to spawn connection ... ' session =

Re: [Tutor] Pexpect maxread searchwindowsize, timeout

2009-10-20 Thread Nathan Farrar
that pexpect uses a maxread and a searchwindowsize value, but I'm not sure how to use them. Any tips? Thanks again. On Tue, Oct 20, 2009 at 11:26 AM, vince spicer vinces1...@gmail.com wrote: On Tue, Oct 20, 2009 at 11:11 AM, Nathan Farrar nathan.far...@gmail.com wrote: I haven't been able

[Tutor] Help with pexpect

2009-10-16 Thread Nathan Farrar
times), I want to send a newline character to the session and continue gathering the output. Thanks for the help! Nathan -- The presence of those seeking the truth is infinitely to be preferred to the presence of those who think they've found it. –Terry Pratchett

[Tutor] Loop help

2009-08-16 Thread Nathan Wing
homework assignment. I was successful in problem one, but having a hard time with problem two. Any help would be greatly appreciated! Regards, Nathan Here is the problem: A wealthy donor has given MIT $500,000 to be used to pay the tuition of one student every other year until the money runs out

[Tutor] Passing perimeters in dictionary values?

2009-02-24 Thread nathan virgil
I'm experimenting with OOP using the Critter Caretaker script from Python Programming for the Absolute Beginner as my basis. I've noticed that a dictionary/function combo is a great way to handle menus, and so I've adapted the menu to read as: selection = raw_input(Choice: ) choices = {0:quit,

Re: [Tutor] Passing perimeters in dictionary values?

2009-02-24 Thread nathan virgil
On Tue, Feb 24, 2009 at 6:50 PM, Alan Gauld alan.ga...@btinternet.comwrote: Or you can build the param value into the dictionary: selection = raw_input(Choice: ) choices = { 0:(quit, None), 1:(crit.talk, Hi there), 2:(crit.eat, Nuts), 3: (crit.play, Soccer) 4: (crit.play, Baseball)}

Re: [Tutor] Passing perimeters in dictionary values?

2009-02-24 Thread nathan virgil
Erm, it's still not working... Whenever I try to use the talk method (which reports the mood, and doesn't take parameters), it says I gave it too many parameters. Maybe it might help if I posted the code in it's entirety # Critter Caretaker # A virtual pet to care for class

Re: [Tutor] Creating sub-menus?

2008-12-31 Thread nathan virgil
Okay, so I changed line 84 from: current_menu to: choice = current_menu, and the menu prtion seems to work fine. Only problem now is, once I select a formula, it repeats that function over and over again, never going back to a menu. Should I just add something like: choice = current_menu to

[Tutor] Creating sub-menus?

2008-12-30 Thread nathan virgil
I was reading the Non-Programmer's Tutorial for Python, and became really proud of myself when I realized I could create a menu for functions. I decided to try to take this one step further and see if I could create not just a menu, but a menu with isub/i-menus, too! Ultimately, the idea I came up

Re: [Tutor] Hands-on beginner's project?

2008-10-03 Thread nathan virgil
in the current namespace, so it can't be compared to start. It looks like you wanted room = start. On 10/2/08, nathan virgil [EMAIL PROTECTED] wrote: Okay, I'm resurrecting this project. I did a little more work on it then what you see here, but that ended up getting accidentally deleted, and I

Re: [Tutor] Finding the streaks in heads/tails list

2008-10-03 Thread nathan virgil
You need to store the count before resetting it since you want to know the largest value of count over the list. Or at least keep a separate max variable that you update if count max. Fairly easy: if Cur_Count Max_Count: Max_Count = Cur_Count See? Just two extra lines of code.

Re: [Tutor] Hands-on beginner's project?

2008-10-03 Thread nathan virgil
On Fri, Oct 3, 2008 at 9:19 AM, David [EMAIL PROTECTED] wrote: Okay, I'm resurrecting this project. Where is this project code? http://www.linuxcrazy.com Right here. The content is going to eventually go through some drastic changes, but what's here should be good enough for testing. #

Re: [Tutor] Hands-on beginner's project?

2008-10-03 Thread nathan virgil
On Fri, Oct 3, 2008 at 10:02 AM, Luke Paireepinart [EMAIL PROTECTED]wrote: On Fri, Oct 3, 2008 at 8:50 AM, nathan virgil [EMAIL PROTECTED] wrote: On Fri, Oct 3, 2008 at 9:19 AM, David [EMAIL PROTECTED] wrote: Okay, I'm resurrecting this project. Where is this project code

Re: [Tutor] Hands-on beginner's project?

2008-10-03 Thread nathan virgil
On Fri, Oct 3, 2008 at 10:24 AM, nathan virgil [EMAIL PROTECTED]wrote: On Fri, Oct 3, 2008 at 10:02 AM, Luke Paireepinart [EMAIL PROTECTED] wrote: On Fri, Oct 3, 2008 at 8:50 AM, nathan virgil [EMAIL PROTECTED] wrote: On Fri, Oct 3, 2008 at 9:19 AM, David [EMAIL PROTECTED] wrote

Re: [Tutor] Hands-on beginner's project?

2008-10-02 Thread nathan virgil
Okay, I'm resurrecting this project. I did a little more work on it then what you see here, but that ended up getting accidentally deleted, and I haven't done anything with Python since. I'm running into one problem already, and I haven't really added any extra code. In the content (at this

[Tutor] Script Name/Path Information

2008-07-05 Thread Nathan Farrar
would output: FileInfo.py /home/username ... Thanks! Nathan ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Exploring the Standard Library

2008-07-05 Thread Nathan Farrar
I'd like to spend some time exploring the standard library. I'm running python on Ubuntu. How would I find the location of the modules (find / -name os.py does not yield results)? Thanks! Nathan ___ Tutor maillist - Tutor@python.org http

[Tutor] Hands-on beginner's project?

2008-06-24 Thread nathan virgil
I'm very new to Python, and (to a slightly lesser extent) programming in general. I'd like to get some experience by practicing simple-yet-functional programs, with a bit of an emphasis on games. The first game I'd like to attempt would be a simple, non-linear story, similar to those

[Tutor] free loop device

2008-05-05 Thread Nathan McBride
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hey Guys, I have a program that uses the loop devices. However I originally was finding the free one with: 'losetup -f'. Which returns the next free loop device. :D However, I found that some of the other distros have a version of losetup that

Re: [Tutor] free loop device

2008-05-05 Thread Nathan McBride
it to the end of /dev/loop_. The only other thing I had to do was put a check in incase there were no used loop devices in which case then it defaults to /dev/loop0. Works like a charm. :D Nate bob gailer wrote: Nathan McBride wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hey Guys, I have

Re: [Tutor] socket / over network

2008-04-06 Thread Nathan McBride
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Alan Gauld wrote: Nathan McBride [EMAIL PROTECTED] wrote Hi Nathan, Please don't reply to an existing message to start a new discussion. It messes up those of us using threaded mail/news readers and increases the likelihood that your message

[Tutor] socket / over network

2008-04-03 Thread Nathan McBride
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hey guys, I'm pretty tired of the lame backup solution we have at work. Could anyone point me to a (more or less newbieish) example of how to have python open a socket on one box and get data from it, then have another box write to it over the

Re: [Tutor] Maybe advanced pexpect question?

2008-03-25 Thread Nathan McBride
I'm thinking more along the lines as of running a program, sending tab to get to the field send text to put on the field, tab, send text ? On Sun, 2008-03-23 at 14:00 -0500, mwalsh wrote: Kent Johnson wrote: Nathan McBride wrote: I've used pexpect for a few projects and love it. Basically

[Tutor] Maybe advanced pexpect question?

2008-03-22 Thread Nathan McBride
I've used pexpect for a few projects and love it. Basically pexpect lets you spawn a program and interact with it from code like you yourself were running it in a console. How would you send the ctrl key? nomb ___ Tutor maillist - Tutor@python.org

Re: [Tutor] how to get response from os.system()

2008-03-17 Thread Nathan McBride
That's a great tip I'll have to save than. -Original Message- From: Martin Walsh [EMAIL PROTECTED] Sent: Monday, March 17, 2008 9:38 AM To: Nathan McBride [EMAIL PROTECTED] Cc: tutor@python.org Subject: Re: [Tutor] how to get response from os.system() Hi Nathan, Nathan McBride wrote

Re: [Tutor] how to get response from os.system()

2008-03-17 Thread Nathan McBride
That's a great tip I'll have to save than. -Original Message- From: Martin Walsh [EMAIL PROTECTED] Sent: Monday, March 17, 2008 9:38 AM To: Nathan McBride [EMAIL PROTECTED] Cc: tutor@python.org Subject: Re: [Tutor] how to get response from os.system() Hi Nathan, Nathan McBride wrote

Re: [Tutor] how to get response from os.system()

2008-03-17 Thread Nathan McBride
That's a great tip I'll have to save than. -Original Message- From: Martin Walsh [EMAIL PROTECTED] Sent: Monday, March 17, 2008 9:38 AM To: Nathan McBride [EMAIL PROTECTED] Cc: tutor@python.org Subject: Re: [Tutor] how to get response from os.system() Hi Nathan, Nathan McBride wrote

Re: [Tutor] how to get response from os.system()

2008-03-17 Thread Nathan McBride
That's a great tip I'll have to save than. -Original Message- From: Martin Walsh [EMAIL PROTECTED] Sent: Monday, March 17, 2008 9:38 AM To: Nathan McBride [EMAIL PROTECTED] Cc: tutor@python.org Subject: Re: [Tutor] how to get response from os.system() Hi Nathan, Nathan McBride wrote

Re: [Tutor] how to get response from os.system()

2008-03-16 Thread Nathan McBride
Why don't you just use 'commands.getoutput'? -Original Message- From: linuxian iandsd [EMAIL PROTECTED] Sent: Sunday, March 16, 2008 3:12 PM To: tutor@python.org Subject: Re: [Tutor] how to get response from os.system() use os.popen(your cmd here) On Sun, Mar 16, 2008 at 8:06 PM, Luke

Re: [Tutor] how to get response from os.system()

2008-03-16 Thread Nathan McBride
Would you mind perhaps show an example running an interactive command like su and show how to send input to the commands waiting propmts? -Original Message- From: linuxian iandsd [EMAIL PROTECTED] Sent: Sunday, March 16, 2008 3:17 PM To: tutor@python.org Subject: Re: [Tutor] how to get

Re: [Tutor] how to get response from os.system()

2008-03-16 Thread Nathan McBride
Yup I use the pexpect module for a lot however couldn't get 'pexpect.run' to work with mysqldump piping to gzip -Original Message- From: Jeff Younker [EMAIL PROTECTED] Sent: Sunday, March 16, 2008 6:59 PM To: Nathan McBride [EMAIL PROTECTED] Cc: tutor@python.org Subject: Re: [Tutor] how

[Tutor] beginner pexpect question

2008-02-13 Thread Nathan McBride
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hey guys, I'm practically still a beginner with python. I am working on a program that originally I used popen for but then switched to pexpect because it was easier for me to understand. I was hoping someone could help me get this working: I do a:

Re: [Tutor] beginner pexpect question

2008-02-13 Thread Nathan McBride
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Anyone have any recomendations? Seems like it is giving it the passwords since it finishes cleanly, but maybe not like I think? Nate Nathan McBride wrote: Hey guys, I'm practically still a beginner with python. I am working on a program

[Tutor] Is it possible?

2008-02-08 Thread Nathan McBride
Is it possible to write a program that you pipe other programs through and it measures the MBs per second of data moved? Like I could pipe it a cp and find out how fast the cp is working? Thanks, Nate ___ Tutor maillist - Tutor@python.org

Re: [Tutor] reading random line from a file

2007-07-18 Thread Nathan Coulter
---Original Message--- From: Tiger12506 [EMAIL PROTECTED] Yuck. Talk about a one shot function! Of course it only reads through the file once! You only call the function once. Put a second print randline(f) at the bottom of your script and see what happens :-) JS *sigh*

Re: [Tutor] [Tutor} Why doesn't it choose a new number each time?

2007-02-15 Thread Nathan Pinno
. Thanks, Nathan Date: Wed, 14 Feb 2007 17:17:57 +0100 From: Rikard Bosnjakovic [EMAIL PROTECTED] Subject: Re: [Tutor] Why doesn't it choose a new number each time? To: tutor@python.org Message-ID: [EMAIL PROTECTED] Content-Type: text/plain; charset=ISO-8859-1; format=flowed On 2/14/07, Alan

[Tutor] Why doesn't it choose a new number each time?

2007-02-13 Thread Nathan Pinno
Hey all, I wrote a rock, paper, scissors game and every time you play without exiting, it chooses the same number. How can I fix this problem? The relative code is below: [code] # -*- coding: cp1252 -*-from random import * print Welcome to Rock, Paper, or Scissors!print by Nathan Pinnoprint

[Tutor] Why is startfile unavailable on my mac?

2006-12-04 Thread Nathan Cain
trying to open a url in a browser window. If startfile is just not available on the mac, can someone please give me some simple example code that will open http://www.python.org in a safari window? Thank you. *** Nathan Cain http://www.Web-Magnets.com

[Tutor] clicking a javascript link in a browser

2006-12-04 Thread Nathan Cain
There is a link on a pop-up window from a page that I opened with webbrowser.open() the link is: javascript:Events.clearList(); is there a way for python to click that link? Thank you. *** Nathan Cain http://www.Web-Magnets.com Refrigerator Magnets

Re: [Tutor] e-learning Python (PA)

2006-09-26 Thread Nathan Botts
That might depend on what you consider eLearning. I've found that the How to Think Like a Computer Scientist (http://ibiblio.org/obp/thinkCS/python/english2e/html/index.html) online book is a great learning guide. Or are you looking for something more interactive? -Nathan

Re: [Tutor] What's the invalid syntax?

2006-08-24 Thread Nathan Pinno
I sure did. It was choking because it was the wrong format. - Original Message - From: Bob Gailer [EMAIL PROTECTED] To: Nathan Pinno [EMAIL PROTECTED] Cc: Tutor mailing list tutor@python.org Sent: Thursday, August 24, 2006 12:56 PM Subject: Re: [Tutor] What's the invalid syntax? My

[Tutor] What's the invalid syntax?

2006-08-23 Thread Nathan Pinno
E Y N: print "Go North" k = k + 1 elif X E Y == N: print "Go East" k = k + 1 elif X E Y N: print "Go SouthEast" k = k + 1 elif X E Y N: print "Go NorthEast" k = k + 1 else: print "Congrats! You found the hurkle in", %d1.

Re: [Tutor] What's the invalid syntax?

2006-08-23 Thread Nathan Pinno
Sorry, but it only showed a text-box with the message Invalid syntax!, then highlighted the %. HTH, Nathan Pinno - Original Message - From: Alan Gauld [EMAIL PROTECTED] To: Nathan Pinno [EMAIL PROTECTED]; Tutor mailing list tutor@python.org Sent: Wednesday, August 23, 2006 10:10 PM

[Tutor] How do I make Python read a string character by character?

2006-08-23 Thread Nathan Pinno
Hey all, How do I make Python read a string character by character? Thanks, Nathan ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Is there a method like this already?

2006-07-24 Thread Nathan Pinno
def calculate_days(year, month, day): [/code] Just being curious, Nathan Pinno ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] What's the invalid syntax?

2006-07-24 Thread Nathan Pinno
int(raw_input("Enter the 2nd month: ")) d2 = int(raw_input("Enter the 2nd day: ")) date2 = date(y2, m2, d2) return date2 print "Date Calculator"print "By Nathan Pinno"printwhile 1: menu() menu_choice() if choice == A: date1() days = int(raw_input(&q

Re: [Tutor] What's the invalid syntax?

2006-07-24 Thread Nathan Pinno
Ignore this. I've created too many errors to even begin to solve. - Original Message - From: Nathan Pinno To: Tutor mailing list Sent: Monday, July 24, 2006 7:24 PM Subject: What's the invalid syntax? What's the invalid syntax? [code] from datetime

[Tutor] Why doesn't it save the data before exiting?

2006-06-26 Thread Nathan Pinno
$"+str(accountlist[account]),"\n" else: print account," was not found." def withdraw(): print "Withdraw Funds." account = raw_input("Account: ") if accountlist.has_key(account): amount = float(raw_input("Amount: ")) accountlist[account] -= am

Re: [Tutor] Why doesn't it save the data before exiting? CORRECTION

2006-06-26 Thread Nathan Pinno
How do I know? Simple. Next time I load it and ask it to print the list of accounts and how much in each, I only get: Account Info then the menu again, with no info. Nathan Pinno - Original Message - From: Bob Gailer [EMAIL PROTECTED] To: Bob Gailer [EMAIL PROTECTED] Cc: Nathan Pinno

Re: [Tutor] Why doesn't it save the data before exiting? CORRECTION

2006-06-26 Thread Nathan Pinno
Would it be this line? pickle.dump(ac, store) Would this make it work? ac = pickle.dump(store) Nathan - Original Message - From: Bob Gailer [EMAIL PROTECTED] To: Nathan Pinno [EMAIL PROTECTED] Cc: tutor@python.org Sent: Monday, June 26, 2006 5:33 PM Subject: Re: [Tutor] Why doesn't

Re: [Tutor] Is this correct syntax for what I want?

2006-06-25 Thread Nathan Pinno
Thanks, it works now perfectly! Thanks for all the help! - Original Message - From: Alan Gauld [EMAIL PROTECTED] To: Nathan Pinno [EMAIL PROTECTED]; tutor@python.org Sent: Sunday, June 25, 2006 1:07 AM Subject: Re: [Tutor] Is this correct syntax for what I want? File C:\Python24

Re: [Tutor] Is this correct syntax for what I want?

2006-06-25 Thread Nathan Pinno
: account = line.strip() amount = line.next().strip() ac[account] = amount else: store = open(filename, 'w') store.close Thanks. Nathan Pinno - Original Message - From: Alan Gauld [EMAIL PROTECTED] To: Nathan Pinno [EMAIL PROTECTED]; tutor

Re: [Tutor] Is this correct syntax for what I want?

2006-06-24 Thread Nathan Pinno
$,accountlist[account]+\n TypeError: unsupported operand type(s) for +: 'float' and 'str' So how do I fix this error? Thanks for the help so far! - Original Message - From: Alan Gauld [EMAIL PROTECTED] To: Nathan Pinno [EMAIL PROTECTED]; tutor@python.org Sent: Saturday, June 24, 2006 3:54 PM

[Tutor] Needing help with my account tracker program.

2006-06-23 Thread Nathan Pinno
nt = float(raw_input("Amount: ")) accountlist[account] += amount print account,"\t $",accountlist[account] else: print account," was not found." def withdraw(): print "Withdraw Funds." account = raw_input("Account: ") if accountlist.has_key(account): amount =

Re: [Tutor] Is this correct syntax for what I want?

2006-06-23 Thread Nathan Pinno
The data is account name and 12.50 (example). I want to access the data to add and subtract from it. For example 12.50 - 2.25 = 10.25 10.25 + 4.75 = 15.00 Thanks, Nathan Pinno - Original Message - From: Alan Gauld [EMAIL PROTECTED] To: Nathan Pinno [EMAIL PROTECTED]; tutor@python.org

[Tutor] Is this correct syntax for what I want?

2006-06-22 Thread Nathan Pinno
I want to be able to add and subtract from a number in a tuple in alist. Is this thecorrect syntax? letterlist[x] = letterlist[x] + amount # for addition letterlist[x] = letterlist[x] - amount # for subtraction If this is not correct, what is the correct syntax? Thanks, Nathan Pinno

  1   2   3   >