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
> On 01/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... > >> de

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

2019-08-01 Thread nathan tech
y question: 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 advanc

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 fo

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

2019-06-05 Thread nathan tech
mit And later did g.checklimit=7000 Would it change feeds[feed1]["limit"] too? Thanks Nathan On 05/06/2019 19:45, Alan Gauld via Tutor wrote: >> That is why I was going to use g.blank-feed as the template, >> assign that to d["feed 1's link"] then just

[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
s. but 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
app or through psutil.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 wonde

[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 mytes

[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 w

[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 in

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

2019-05-05 Thread nathan tech
alone 700 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

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

2019-05-04 Thread nathan tech
roducts 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,

[Tutor] don't steel my code Mister user

2019-05-03 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
ppreciated. 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 an

[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
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 i

Re: [Tutor] schedulers

2019-03-01 Thread nathan tech
guys 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 he

[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

[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 for

[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
PT> python 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: >

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 a

[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 wrote: &g

[Tutor] Python Bind DNS Zone config

2017-05-03 Thread Nathan D'Elboux
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

[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 num_2

Re: [Tutor] Squaring every digit in number

2015-11-21 Thread Nathan Hilterbrand
lueError: return 0 The "str(int(num))" could be shortened to "str(num)", also, but I liked being able to accept any argument that could be converted to an int, and also raising the ValueError before looping . Have fun at codewars Nathan Hilterbrand

Re: [Tutor] problem with code

2015-09-01 Thread Nathan Clark
15 at 4:08 PM, Job 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

[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
please help me? 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: natha

Re: [Tutor] Dynamic TKinter widgets?

2012-11-28 Thread Nathan
, "Nathan" wrote: > > On Nov 25, 2012 6:49 PM, "ALAN GAULD" 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 > w

Re: [Tutor] Dynamic TKinter widgets?

2012-11-25 Thread Nathan
On Nov 25, 2012 6:49 PM, "ALAN GAULD" 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 same widget. >>

Re: [Tutor] Dynamic TKinter widgets?

2012-11-24 Thread Nathan
quot; wrote: > On Saturday 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 worki

[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] 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" wrote: > ** > Help! I'm int

[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 ClassTwo(ClassOn

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" 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, and >> can l

Re: [Tutor] Copying a mutable

2011-06-07 Thread Nathan
unsubscribe 在 2011-06-08 07:11:33,"Walter Prins" 写道: Hi, 2011/6/7 Válas Péter 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 correct: Python 2.7 (r27:82525, Jul

[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 there

Re: [Tutor] Pexpect maxread & searchwindowsize, timeout

2009-10-20 Thread Nathan Farrar
tion I can see 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 wrote: > > > On Tue, Oct 20, 2009 at 11:11 AM, Nathan Farrar > wrote: >> >> I haven&#

[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 = pexp

[Tutor] Help with pexpect

2009-10-16 Thread Nathan Farrar
'--More--' is encountered (and it this can happen multiple 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 preferre

[Tutor] Loop help

2009-08-16 Thread Nathan Wing
first 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 run

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 Critter(object):

Re: [Tutor] Passing perimeters in dictionary values?

2009-02-24 Thread nathan virgil
On Tue, Feb 24, 2009 at 6:50 PM, Alan Gauld wrote: > > > 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
m going to go with, anyway. At least until I can learn about lambdas, or even some other solution. On Tue, Feb 24, 2009 at 2:42 PM, Kent Johnson wrote: > On Tue, Feb 24, 2009 at 2:03 PM, nathan virgil > wrote: > > I'm experimenting with OOP using the Critter Caretaker scri

[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] 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 ea

[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 sub-menus, too! Ultimately, the idea I came up wit

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: >>

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: > >> > &

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? > 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] 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
t; variable name > doesn't exist 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 wo

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 point,

[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 - T

[Tutor] Script Name/Path Information

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

[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 choose-your-ad

Re: [Tutor] free loop device

2008-05-05 Thread Nathan McBride
dded 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 SIGN

[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 does

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 a

[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 network

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 fo

[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 h

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 N

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 N

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 N

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 N

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@pyt

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
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, Luk

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 workin

[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:

[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 http://mail

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 >

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

2007-02-15 Thread Nathan Pinno
GUI stage. 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]>>

[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 "

[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 Re

[Tutor] Why is startfile unavailable on my mac?

2006-12-04 Thread Nathan Cain
Why is this unavailable to me? I am 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. **

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 intera

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" Sent: Thursday, August 24, 2006 12:56 PM Subject: Re: [Tutor]

[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

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] What's the invalid syntax?

2006-08-23 Thread Nathan Pinno
k = k + 1    elif X < E & Y < N:    print "Go NorthEast"    k = k + 1    else:    print "Congrats! You found the hurkle in", %d1.0, " guesses!" (k)    break    else:

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]

[Tutor] What's the invalid syntax?

2006-07-24 Thread Nathan Pinno
_input("Enter the 2nd year: "))    m2 = 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_

[Tutor] Is there a method like this already?

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

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: Sent: Monday, June 26, 2006 5:33 PM Subject:

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&qu

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

2006-06-26 Thread Nathan Pinno
    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] -= amount   

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

2006-06-25 Thread Nathan Pinno
lename): store = open(filename, 'r') for line in store: account = line.strip() amount = line.next().strip() ac[account] = amount else: store = open(filename, 'w') store.close Thanks. Nathan Pinno - Original

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]>; Sent: Sunday, June 25, 2006 1:07 AM Subject: Re: [Tutor] Is this correct syntax for what I want?

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

2006-06-24 Thread Nathan Pinno
print account,"\t $",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

  1   2   3   4   >