Re: a little help

2012-01-05 Thread Lie Ryan
On 01/06/2012 03:04 AM, Andres Soto wrote: Please, see my comments between your lines. Thank you very much for your explanation! * * *From:* Lie Ryan *To:* python-list@python.org *Sent:* Thursday, January 5, 2012 2:30 AM *Subject:* Re: a little help On 01/05

Re: a little help

2012-01-05 Thread Andres Soto
Please, see my comments between your lines. Thank you very much for your explanation! > > >From: Lie Ryan >To: python-list@python.org >Sent: Thursday, January 5, 2012 2:30 AM >Subject: Re: a little help > >On 01/05/2012 11:29 AM, Andres Soto wrote: >> my mistake i

Re: a little help

2012-01-05 Thread Andres Soto
could you be a little bit more explicit. I am a begginer and I don't understand you quite well Thanks Andres Soto > > From: 8 Dihedral >To: python-list@python.org >Cc: python-list@python.org >Sent: Thursday, January 5, 2012 2:48 AM &g

Re: a little help

2012-01-05 Thread 88888 Dihedral
Chris Angelico於 2012年1月5日星期四UTC+8上午7時29分21秒寫道: > On Thu, Jan 5, 2012 at 10:25 AM, Andres Soto wrote: > > My situation is the following: I am developing some code. I use the IDLE > > Editor to write it down. Then, I save it and import it from the command line > > interface, so it is already availab

Re: a little help

2012-01-05 Thread Lie Ryan
On 01/05/2012 11:29 AM, Andres Soto wrote: my mistake is because I have no problem to do that using Prolog which use an interpreter as Python. I thought that the variables in the main global memory space (associated with the command line environment) were kept, although the code that use it could

Re: a little help

2012-01-04 Thread Terry Reedy
On 1/4/2012 7:29 PM, Andres Soto wrote: As you explain me, Python behave like a compiled language: any time I make a change in the code, I have to "compile" it again, and re-run (and re-load the data). While you are developing a program and expect to make changes, you can try working with a s

Re: a little help

2012-01-04 Thread Andres Soto
>To: python-list@python.org >Sent: Wednesday, January 4, 2012 6:02 PM >Subject: Re: a little help > >I think you meant to send that to the list; hope you don't mind my >replying on-list. > >On Thu, Jan 5, 2012 at 10:56 AM, Andres Soto wrote: >> the problem is tha

Re: a little help

2012-01-04 Thread Chris Angelico
On Thu, Jan 5, 2012 at 11:29 AM, Andres Soto wrote: > my mistake is because I have no problem to do that using Prolog which use an > interpreter as Python. I thought that the variables in the main global > memory space (associated with the command line environment) were kept, > although the code t

Re: a little help

2012-01-04 Thread Chris Angelico
I think you meant to send that to the list; hope you don't mind my replying on-list. On Thu, Jan 5, 2012 at 10:56 AM, Andres Soto wrote: > the problem is that if I re-run the program, every time I change some > instructions, I have to read (load) again the data and that is what I want > to avoid.

Re: a little help

2012-01-04 Thread Chris Angelico
On Thu, Jan 5, 2012 at 10:25 AM, Andres Soto wrote: > My situation is the following: I am developing some code. I use the IDLE > Editor to write it down. Then, I save it and import it from the command line > interface, so it is already available from the prompt. > Then I load (read) some data from

a little help

2012-01-04 Thread Andres Soto
Hi, I am new using Python, although I have experience using other programming languages like Pascal, FORTRAN, C, Prolog, etc. I am using IDLE Editor for Python in coordination with the command line interface. My situation is the following: I am developing some code. I use the IDLE Editor to write

Re: A little help with pexpect

2009-07-19 Thread Piet van Oostrum
> Piet van Oostrum (PvO) wrote: [snip] >PvO> You can also consider using paramiko instead of pexpect. [snip] > chan = t.open_session() > chan.exec_command('cat') > chan.send('abcdefghijklmn\n') In a real program it is better to use sendall here, as send may decide to send only pa

Re: A little help with pexpect

2009-07-19 Thread Piet van Oostrum
> Hussein B (HB) wrote: >HB> Hey, >HB> I'm trying to execute a command over a remore server using pexpect >HB> + >HB> url = 'ssh internalserver' >HB> res = pexpect.spawn(url) >HB> print '1' >HB> res.expect('.*ssword:') >HB> print '2' >HB> res.sendline('mypasswd') >HB> print '3

A little help with pexpect

2009-07-19 Thread Hussein B
Hey, I'm trying to execute a command over a remore server using pexpect + url = 'ssh internalserver' res = pexpect.spawn(url) print '1' res.expect('.*ssword:') print '2' res.sendline('mypasswd') print '3' res.sendline('ls -aslh') + What I want to do is to send a coup

Re: Semi-Newbie needs a little help

2009-07-07 Thread Nile
Thanks all for your help. I appreciate it. The problem was in the function. A simple bug which I should have caught but I had my mental blinders on and was sure the problem was outside the function. The answers have given me a lot to learn so thanks for that as well. -- http://mail.python.org/m

Re: Semi-Newbie needs a little help

2009-07-07 Thread Piet van Oostrum
> Nile (N) wrote: >N> I initialized the dictionary earlier in the program like this - >N> hashtable = {} >N> I changed the "dict" to hashtable but I still get the same result >N> I will try to learn about the defaultdict but I'm just trying to keep >N> it as simple as I can for now >N> R

Re: Semi-Newbie needs a little help

2009-07-06 Thread Gabriel Genellina
En Mon, 06 Jul 2009 19:49:41 -0300, MRAB escribió: Chris Rebert wrote: from collections import defaultdict counts = defaultdict(lambda: 0) Better is: counts = defaultdict(int) For speed? This is even faster: zerogen = itertools.repeat(0).next counts = defaultdict(zerogen) -- Gabriel Ge

Re: Semi-Newbie needs a little help

2009-07-06 Thread Dave Angel
MRAB wrote: Nile wrote: [snip] I initialized the dictionary earlier in the program like this - hashtable = {} I changed the "dict" to hashtable but I still get the same result I will try to learn about the defaultdict but I'm just trying to keep it as simple as I can for now Revised code f

Re: Semi-Newbie needs a little help

2009-07-06 Thread Rhodri James
On Tue, 07 Jul 2009 00:29:36 +0100, Nile wrote: Revised code for x in range(len(file_list)): d = open(file_list[x] , "r") data = d.readlines() k = 0 k = above_or_below(data) print "here is the value that was returned ",k hashtable[k] = hashtable.

Re: Semi-Newbie needs a little help

2009-07-06 Thread MRAB
Nile wrote: [snip] I initialized the dictionary earlier in the program like this - hashtable = {} I changed the "dict" to hashtable but I still get the same result I will try to learn about the defaultdict but I'm just trying to keep it as simple as I can for now Revised code for x in range

Re: Semi-Newbie needs a little help

2009-07-06 Thread Nile
On Jul 6, 5:22 pm, Chris Rebert wrote: > On Mon, Jul 6, 2009 at 3:02 PM, Nile wrote: > > I am trying to write a simple little program to do some elementary > > stock market analysis.  I read lines, send each line to a function and > > then the function returns a date which serves as a key to a > >

Re: Semi-Newbie needs a little help

2009-07-06 Thread Nile
On Jul 6, 5:30 pm, "Pablo Torres N." wrote: > On Mon, Jul 6, 2009 at 17:02, Nile wrote: > > Code > > >    for x in range(len(file_list)): > >    d = open(file_list[x] , "r") > >    data = d.readlines() > >    k = above_or_below(data)                                # This > > function seems to work

Re: Semi-Newbie needs a little help

2009-07-06 Thread MRAB
Chris Rebert wrote: On Mon, Jul 6, 2009 at 3:02 PM, Nile wrote: I am trying to write a simple little program to do some elementary stock market analysis. I read lines, send each line to a function and then the function returns a date which serves as a key to a dictionary. Each time a date is re

Re: Semi-Newbie needs a little help

2009-07-06 Thread Pablo Torres N.
On Mon, Jul 6, 2009 at 17:02, Nile wrote: > Code > >    for x in range(len(file_list)): >    d = open(file_list[x] , "r") >    data = d.readlines() >    k = above_or_below(data)                                # This > function seems to work correctly >    print "here is the value that was returned

Re: Semi-Newbie needs a little help

2009-07-06 Thread Chris Rebert
On Mon, Jul 6, 2009 at 3:02 PM, Nile wrote: > I am trying to write a simple little program to do some elementary > stock market analysis.  I read lines, send each line to a function and > then the function returns a date which serves as a key to a > dictionary. Each time a date is returned I want t

Semi-Newbie needs a little help

2009-07-06 Thread Nile
I am trying to write a simple little program to do some elementary stock market analysis. I read lines, send each line to a function and then the function returns a date which serves as a key to a dictionary. Each time a date is returned I want to increment the value associated with that date. The

Re: New to python, can i ask for a little help? (Andrew Chung)

2009-05-15 Thread Gabor Urban
I gues, it was rather simple... Begin with simple tasks, figure out how to do them. If you are proceding well, then increase difficulty/complexity. Gabor -- Linux: Choice of a GNU Generation -- http://mail.python.org/mailman/listinfo/python-list

Re: New to python, can i ask for a little help?

2009-05-14 Thread Andrew Chung
Thank you to all who responded. You were right about the solution. That helped alot. Now maybe i can ask if anyone has any ideas for learning, such as websites or videos. I found one that i liked alot. http://iamar.net/subpages/PythonVid.html But i wondered how other people learned as beginners i

Re: New to python, can i ask for a little help?

2009-05-13 Thread Chris Rebert
On Wed, May 13, 2009 at 12:22 PM, warhammer1...@gmail.com wrote: > On May 12, 9:27 pm, Chris Rebert wrote: >> On Tue, May 12, 2009 at 9:18 PM, warhammer1...@gmail.com >> >> >> >> wrote: >> > I loaded python 3.1 >> > I can use the gui and i see the following: >> >> > Python 3.0.1 (r301:69561, Feb

Re: New to python, can i ask for a little help?

2009-05-12 Thread guang . zeng37
On May 13, 12:18 pm, "warhammer1...@gmail.com" wrote: > I loaded python 3.1 > I can use the gui and i see the following: > > Python 3.0.1 (r301:69561, Feb 13 2009, 20:04:18) [MSC v.1500 32 bit > (Intel)] on win32 > Type "copyright", "credits" or "license()" for more information. > > > > It would s

Re: New to python, can i ask for a little help?

2009-05-12 Thread Mensanator
On May 12, 11:18�pm, "warhammer1...@gmail.com" wrote: > I loaded python 3.1 > I can use the gui and i see the following: > > Python 3.0.1 (r301:69561, Feb 13 2009, 20:04:18) [MSC v.1500 32 bit > (Intel)] on win32 > Type "copyright", "credits" or "license()" for more information. > > > > It would s

Re: New to python, can i ask for a little help?

2009-05-12 Thread Chris Rebert
On Tue, May 12, 2009 at 9:18 PM, warhammer1...@gmail.com wrote: > I loaded python 3.1 > I can use the gui and i see the following: > > Python 3.0.1 (r301:69561, Feb 13 2009, 20:04:18) [MSC v.1500 32 bit > (Intel)] on win32 > Type "copyright", "credits" or "license()" for more information. > >

Re: New to python, can i ask for a little help?

2009-05-12 Thread Sam Tregar
On Wed, May 13, 2009 at 12:18 AM, warhammer1...@gmail.com < warhammer1...@gmail.com> wrote: > Python 3.0.1 (r301:69561, Feb 13 2009, 20:04:18) [MSC v.1500 32 bit > (Intel)] on win32 > Type "copyright", "credits" or "license()" for more information. > >>> print "hello world!" > SyntaxError: invalid

New to python, can i ask for a little help?

2009-05-12 Thread warhammer1...@gmail.com
I loaded python 3.1 I can use the gui and i see the following: Python 3.0.1 (r301:69561, Feb 13 2009, 20:04:18) [MSC v.1500 32 bit (Intel)] on win32 Type "copyright", "credits" or "license()" for more information. >>> It would seem that this is working correctly and there is no path problem. I am

Re: Need a Little Help on Tkinter and Python

2007-06-06 Thread W. Watson
Is there a pdf file or downloadable file of the Tkinter material? I like to put stuff in notebooks. W. Watson wrote: > Thanks for your responses. I've located the URL from the post above and > will check out the two books mentioned here. I used to do a lot of > scientific programming, but now j

Re: Need a Little Help on Tkinter and Python

2007-06-06 Thread W. Watson
Thanks for your responses. I've located the URL from the post above and will check out the two books mentioned here. I used to do a lot of scientific programming, but now just concentrate on science. Martin Blume wrote: > "W. Watson" schrieb >> I have about a 1600 line Pythron program I'd like t

Re: Need a Little Help on Tkinter and Python

2007-06-06 Thread Martin Blume
"W. Watson" schrieb > I have about a 1600 line Pythron program I'd like to > make some simple mods to, but have really just a nodding > acquaintance with Python and Tkinter. > [...] > Let's change that. > The book "Learning Python" from O'Reilly is excellent. If you are into scientific progr

Re: Need a Little Help on Tkinter and Python

2007-06-06 Thread Glenn Hutchings
On 6 Jun, 00:58, "W. Watson" <[EMAIL PROTECTED]> wrote: > is there a Tkinter intro manual somewhere Take a look at http://www.pythonware.com/library/tkinter/introduction Glenn -- http://mail.python.org/mailman/listinfo/python-list

Need a Little Help on Tkinter and Python

2007-06-05 Thread W. Watson
I have about a 1600 line Pythron program I'd like to make some simple mods to, but have really just a nodding acquaintance with Python and Tkinter. I know quite a few languages, including C++. Let's change that. I've not used anything but C in recent years, and C++ was in my bag before that alon

Re: A little help with time calculations

2005-10-19 Thread iminal
thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: A little help with time calculations

2005-10-19 Thread Steve Holden
iminal wrote: > what i have so far is : > > # Get values needed to make time calculations > CT = input("input your chronometer time (ex. 07:21:46): ") > CE = input("input your chronometer correction (ex. 00:01:32): ") > CEfastslow = raw_input("is your chronometer correction fast or

Re: A little help with time calculations

2005-10-18 Thread iminal
what i have so far is : # Get values needed to make time calculations CT = input("input your chronometer time (ex. 07:21:46): ") CE = input("input your chronometer correction (ex. 00:01:32): ") CEfastslow = raw_input("is your chronometer correction fast or slow: ") #decide eit

Re: A little help with time calculations

2005-10-18 Thread Steve Holden
iminal wrote: > I am trying to make a very simple program and am very new to the whole > programming thing. my program is supposed to ask a user for any time in > the for format XX:XX:XX and then ask for a time corrrection to add or > subtract to this. my only problem is that once the user inputs t

Re: A little help with time calculations

2005-10-18 Thread Diez B. Roggisch
iminal wrote: > I am trying to make a very simple program and am very new to the whole > programming thing. my program is supposed to ask a user for any time in > the for format XX:XX:XX and then ask for a time corrrection to add or > subtract to this. my only problem is that once the user inputs t

A little help with time calculations

2005-10-18 Thread iminal
I am trying to make a very simple program and am very new to the whole programming thing. my program is supposed to ask a user for any time in the for format XX:XX:XX and then ask for a time corrrection to add or subtract to this. my only problem is that once the user inputs the time and the correc

Re: need a little help with time

2005-08-27 Thread Randy Bush
i am doing disgusting looking junk based on calendar. example now = calendar.timegm(time.gmtime()) aWeek = 7*24*60*60 print time.strftime('%Y-%m-%d %H:%M:%S', time.gmtime(now + aWeek)) randy -- http://mail.python.org/mailman/listinfo/python-list

Re: need a little help with time

2005-08-26 Thread nephish
the mxDateTime thing should be great, i have to pass this stuff back and forth with MySQL DateTime fields, thanks a lot ! -- http://mail.python.org/mailman/listinfo/python-list

Re: need a little help with time

2005-08-26 Thread Eddie Corns
[EMAIL PROTECTED] writes: >Hey there. >i have a time string (created with strftime) then read from a file, >i am having some trouble understanding how to get the difference >between times. >i know i can structime(timestring) and get a time value, but i dont >know how to manipulate it. >basically,

Re: need a little help with time

2005-08-26 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > Hey there. > i have a time string (created with strftime) then read from a file, > i am having some trouble understanding how to get the difference > between times. > i know i can structime(timestring) and get a time value, but i dont > know how to manipulate it. > > bas

need a little help with time

2005-08-26 Thread nephish
Hey there. i have a time string (created with strftime) then read from a file, i am having some trouble understanding how to get the difference between times. i know i can structime(timestring) and get a time value, but i dont know how to manipulate it. basically, if i have string 2005-08-24 09:25

Generic communications module with a little help from classes...

2005-06-30 Thread [EMAIL PROTECTED]
Hi, What I want to do is create a module that offers a generic set of functions (send, recieve, etc...) and reffers the request to the correct module (rs-232, tcp/ip, etc..). I want all this to be unseen by the script that calls this module. I want the script to specify the communication type, and