Re: [Tutor] adding users to tweets on a list

2013-08-07 Thread Saad Javed
There was only Chris responding to the question so I removed the line above the quoted part in my responses that says "On Aug 6, 2013 11:36 PM, "Dave Angel" wrote:"... is that what's confusing? On Aug 6, 2013 11:36 PM, "Dave Angel" wrote: > Saad Javed wrote: > > > I want to add users to the twee

Re: [Tutor] adding users to tweets on a list

2013-08-07 Thread Alan Gauld
On 07/08/13 15:41, Saad Javed wrote: There was only Chris responding Apparently he didn't CC the list so the rest of us didn't see it(*). is that what's confusing? It's not just the lack of attribution but the fact we just didn't see the post to which you are replying. (*)It is possible

Re: [Tutor] Start multiple threads from Python

2013-08-07 Thread Chris Down
On 2013-08-05 12:17, Ryan Waples wrote: > Currently I am calling each analysis program one at a time with > subprocess.call(). This is working without a hitch, but as each analysis > can take a while to run, I want to try to speed things up. I realize I can > start three different python sessions

[Tutor] Can anyone explain this

2013-08-07 Thread Amandeep Behl
Can anyone explain this code below: import sys import os if __name__ == '__main__': sys.path.insert(0, "..") else: sys.path.insert(0, os.path.join( os.path.split(__file__)[0], '..')) ___ Tutor maillist - Tutor@python.org To unsubscrib

[Tutor] Python to open a "example.jmp" file

2013-08-07 Thread Bassam Dourassi
I am trying to open a JMP file using python. Here is the code I found online: # -*- coding: cp1252 -*- from win32com.client import Dispatch jmp = Dispatch("JMP.Application") doc = jmp.OpenDocument("C:/Users/bdourass/Desktop/Python/example.jmp") doc.CreateOneWay This is the error I get: Traceback

Re: [Tutor] adding users to tweets on a list

2013-08-07 Thread Chris Down
On 2013-08-06 18:36, Dave Angel wrote: > This version should be a bit cleaner than what I've seen on this thread. Our methods are almost the same, other than the fact that you don't use a generator, and you do the length validity check during the loop instead of preemptively, I'm not sure which I

[Tutor] Converting a string to an integer

2013-08-07 Thread Art Bullentini
This message was originally HTML formatted. View in a HTML capable client to see the original version.\r\n\r\nI'm trying to convert from a string of digits such as x = [y:y+1] into an integer using int(x). the book says I can do this, but I get an error message saying no can do. Anybody tell me

Re: [Tutor] adding users to tweets on a list

2013-08-07 Thread Dave Angel
On 08/06/2013 03:18 PM, Chris Down wrote: On 2013-08-06 18:36, Dave Angel wrote: This version should be a bit cleaner than what I've seen on this thread. Our methods are almost the same, other than the fact that you don't use a generator, and you do the length validity check during the loop in

[Tutor] Python Trouble, Please Help!

2013-08-07 Thread Jonathan Hong
Hello, I am currently working with the Python programming language and had a very basic question regarding the start up of Python. For some reason, when I open up the Command Prompt in my Windows 7 computer, I am unable to access python files. So when I type in the python command, I am able to sta

Re: [Tutor] Question

2013-08-07 Thread zubair alam
what exactly you want to do by [1,2,3] = "Anything" the above code is called unpacking of sequence, so there must be some variable on left side of assignment operator. but you have list of integers, why? On Tue, Jul 23, 2013 at 11:15 PM, Don Jennings wrote: > > On Jul 21, 2013, at 10:26

[Tutor] Question in regards to loops and matplotlib

2013-08-07 Thread Zachary Rizer
So I just started coding, and I'm so glad I chose Python to start me off! I really enjoy the clean layout, easy syntax, and power of the language. I'm doing astronomy research and I just started teaching myself matplotlib along with my general python work. I feel like I'm catching on quick, but I a

[Tutor] (no subject)

2013-08-07 Thread Rocko Brown
Hello, I am trying to generate a 2D histogram for two arrays of data in CSV format. The code is: x, y = '5k_vec.csv','tcd_5k.csv' H, xedges, yedges = np.histogram2d(x, y) H.shape, xedges.shape, yedges.shape # We can now use the Matplotlib to visualize this 2-dimensional histogram: extent = [ye

[Tutor] Online references for Python

2013-08-07 Thread Rene Datta
Hi: I was wondering if anyone could suggest a good quality online resource tool or compendium to provide a beginner's level of information to start learning the Python language. Thank you. Rene Datta reneda...@gmail.com ___ Tutor maillist - Tutor@pyt

Re: [Tutor] adding users to tweets on a list

2013-08-07 Thread Chris Down
On 2013-08-06 03:48, Saad Javed wrote: > I want to add users to the tweet from the list, the no. of users added > based on the length of the tweet. It looks like you're using Python 2, but you didn't specify. I'd probably do something like this: #!/usr/bin/env python MAX_LENGTH = 140

Re: [Tutor] hi

2013-08-07 Thread Vick
Hi, As per your request below, I have attached a stand-alone example (test3d.py) of my problem. I am trying to plot in 3D using ion() from a loop. The code should plot x,y,z coordinates from a loop in ion(). We should see the plot line moving and the marker moving as well. I have also attached a

Re: [Tutor] adding users to tweets on a list

2013-08-07 Thread Chris Down
On 2013-08-06 19:42, Chris Down wrote: > All that needs to happen is to move the pop to the top of the MAX_LENGTH > check: > > while len(new_message) + len(add) <= MAX_LENGTH: ...or, better, remove the if...break and just do: while users and len(new_message) + len(add) <= MAX_LENGTH: p

[Tutor] .txt matrix import

2013-08-07 Thread Joshua Kim
Hello, This is my first time using Tutor, so I apologize for any fallacies I may be making; my problem involves opening a .txt file which contains several lines of descriptive information followed by a tab delimited matrix of numerical values… I am trying to find an effective way in which to s

Re: [Tutor] adding users to tweets on a list

2013-08-07 Thread Chris Down
On 2013-08-06 14:40, Saad Javed wrote: > It will add max no. of users to one tweet until limit is reached. I want > all users added to the tweet. E.g. if 4 users can be added to the tweet > before reaching the limit, return three tweets...first two with 4 users > attached and the last one with thr

Re: [Tutor] adding users to tweets on a list

2013-08-07 Thread Chris Down
On 2013-08-06 22:31, Saad Javed wrote: > Thank you for your response. This code has a bug. > > If there is one user left in the user list, it doesn't print a tweet with > just that one user added. For example use this string: "These are my > friends living in the same city as i am. I have known the

Re: [Tutor] adding users to tweets on a list

2013-08-07 Thread Chris Down
On 2013-08-06 22:49, Saad Javed wrote: > That causes: > > Enter string: These are my friends living in the same city as i am. I have > known them for years. They are good people in general. They are: > Traceback (most recent call last): > File "chris_tweet_len.py", line 44, in > print("\n".j

Re: [Tutor] adding users to tweets on a list

2013-08-07 Thread Saad Javed
On Wednesday, August 7, 2013, Alan Gauld wrote: > On 07/08/13 15:41, Saad Javed wrote: > >> There was only Chris responding >> > > Apparently he didn't CC the list so the rest of us didn't see it(*). > > is that what's confusing? >> > > It's not just the lack of attribution but the fact we just d

Re: [Tutor] adding users to tweets on a list

2013-08-07 Thread Saad Javed
On Thursday, August 8, 2013, Chris Down wrote: > On 2013-08-08 02:40, Saad Javed wrote: > > Chris has been emailing me directly. Thats why his responses are not > > showing up in the conversation. > > Dear Chris, please remember to send your replies to > > tutor@python.orgwith > > the subject of

Re: [Tutor] .txt matrix import

2013-08-07 Thread Dave Angel
Joshua Kim wrote: > Hello, > > This is my first time using Tutor, so I apologize for any fallacies I may be > making; my problem involves opening a .txt file which contains several lines > of descriptive information followed by a tab delimited matrix of numerical > values… I am trying to find

Re: [Tutor] Converting a string to an integer

2013-08-07 Thread Walter Prins
On 31 July 2013 16:14, Art Bullentini wrote: > I'm trying to convert from a string of digits such as x = [y:y+1] into an > integer using int(x). the book says I can do this, but I get an error > message saying no can do. Anybody tell me what's going on? > > Please supply the actual code you've tr

Re: [Tutor] Python Trouble, Please Help!

2013-08-07 Thread Walter Prins
Hi, On 25 July 2013 00:23, Jonathan Hong wrote: > Hello, > > I am currently working with the Python programming language and had a very > basic question regarding the start up of Python. For some reason, when I > open up the Command Prompt in my Windows 7 computer, I am unable to access > pytho

Re: [Tutor] Can anyone explain this

2013-08-07 Thread Dave Angel
Amandeep Behl wrote: > Can anyone explain this code below: > > > > Can anyone explain this code > below:import sysimport > os                              if __name__ == > '__main__':      sys.path.insert(0, "..")  > else:                            sys.path.insert(0, > os.path.join(        os

Re: [Tutor] Can anyone explain this

2013-08-07 Thread Marc Tompkins
On Fri, Aug 2, 2013 at 4:33 PM, Amandeep Behl wrote: > Can anyone explain this code below: > > > import sys > import os > > if __name__ == '__main__': > sys.path.insert(0, "..") > else: > sys.path.insert(0, os.path.join( > os.path.split(__file__)[0], '..')) > When you run this

Re: [Tutor] inconsistent destruction

2013-08-07 Thread Steven D'Aprano
On Wed, Aug 07, 2013 at 08:54:26PM -0700, Jim Mooney wrote: > This bugs me for some reason. The final variable is saved in a for > loop but not in a list comprehension. It just seems to me they should > both be destroyed to avoid confusion. The variable in a for-loop is deemed to be in the same sc