how can I retrieve a particular tweet, having its tweet id?
how can I retrieve a particular tweet, having its tweet id, and the username, the date and the language? Regards Andrés Soto -- https://mail.python.org/mailman/listinfo/python-list
pydelicious documentation
Does somebody know where I can get the documentation for pydelicious? The documentation links (For code documentation see doc/pydelicious or doc/dlcs.py.) in http://packages.python.org/pydelicious/README.html#id3 gave me 404 Not Found nginx/1.1.19 Prof. Dr. Andrés Soto -- http://mail.python.org/mailman/listinfo/python-list
convert integer to string
I have already import string from string import * but I can not still convert an integer to string str(42) Traceback (most recent call last): File pyshell#20, line 1, in module str(42) TypeError: 'module' object is not callable What is it wrong? Thank you Prof. Dr. Andrés Soto DES DACI UNACAR-- http://mail.python.org/mailman/listinfo/python-list
How I can draw the grid lines at intervals with step=1?
Hi I am trying to draw a step (or staircase) function. My points are all integers. I would like that the grid lines help to identify the limits of each line, but when I draw the grid, it is set each 5 units. How can I draw the grid lines at intervals with step=1? Thanks for your help in advance Regards Andres -- http://mail.python.org/mailman/listinfo/python-list
How can I verify if the content of a variable is a list or a string?
Hi, I'm writing a function which receive a list which elements are strings or new lists (sublists) containing strings. How can I verify if sone element of the list (which is contained in a variable) is a list or a string? I found the method isinstance(object,class) but I don't know which class should I use for. Thank you, regards Prof. Dr. Andrés Soto DES DACI UNACAR-- http://mail.python.org/mailman/listinfo/python-list
Re: How can I verify if the content of a variable is a list or a string?
okok, my mistake is that I was using string in place of str. Thank you!! regards Prof. Dr. Andrés Soto DES DACI UNACAR From: Noah Hall enali...@gmail.com To: Andres Soto soto_and...@yahoo.com Cc: python-list@python.org python-list@python.org Sent: Tuesday, January 31, 2012 6:58 PM Subject: Re: How can I verify if the content of a variable is a list or a string? On Wed, Feb 1, 2012 at 12:44 AM, Andres Soto soto_and...@yahoo.com wrote: Hi, I'm writing a function which receive a list which elements are strings or new lists (sublists) containing strings. How can I verify if sone element of the list (which is contained in a variable) is a list or a string? I found the method isinstance(object,class) but I don't know which class should I use for. Thank you, regards Prof. Dr. Andrés Soto DES DACI UNACAR list and str my_list = [1, 2, 3] isinstance(my_list, list) True my_string = foobar isinstance(my_string, str) True -- http://mail.python.org/mailman/listinfo/python-list
Re: a little help
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 dihedral88...@googlemail.com To: python-list@python.org Cc: python-list@python.org Sent: Thursday, January 5, 2012 2:48 AM Subject: Re: a little help Chris Angelico於 2012年1月5日星期四UTC+8上午7時29分21秒寫道: On Thu, Jan 5, 2012 at 10:25 AM, Andres Soto soto_...@yahoo.com 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 files using that code. Let suppose that after that I make some changes in the code using again the IDLE Editor, save the program code, and…what else? The updated code is not already available from the command line interface. If I run the module, I lose the data already loaded (and it is a big amount). If I re-import it, the new code is not available Re-importing modules is a bit messy. The usual way to do this sort of thing would be to run the program directly from the command line, and terminate it when you're done. Is there a particular reason for wanting to import it that way? Chris Angelico Thus you are developing a module in python. Just use module_name_v??? in those experiments. The version compatible problem is developer's job. -- http://mail.python.org/mailman/listinfo/python-list -- http://mail.python.org/mailman/listinfo/python-list
Re: a little help
Please, see my comments between your lines. Thank you very much for your explanation! From: Lie Ryan lie.1...@gmail.com 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 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 change. 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). There is nothing to do. it is usually trivial to redefine state-free functions, you just need to copy and paste the new code into the shell. yes, I am already using that, but I thought that maybe there were a more elegant way. In Prolog, you just have to reload the code and nothing happens with the global variables Redefining a class is a bit more complicated, while you can redefine a class by the same technique (copy pasting the new class definition to the shell), it will not modify the class definition for existing instances of that class. Worst comes to worst, you could end up with a list of instances where half of the items come from the old definition and the other half from the new definition. I tried to use classes but I got not good results so I left it for a while If your global data are only of native types (e.g. list, dict, int, float), then you usually can safely carry your data between redefinitions; up to now, I am just using native types (e.g. list, dict, int, float). How can I carry my data between redefinitions? copying and pasting the new code into the shell? OK, that I am doing if you have objects in your global data that you want to preserve, you need to be really careful not to confuse instances from old definitions with instances from new definitions. yes, I understand that Also, reload() will reload a module with the new definition, but it does not touch existing function definitions in the global namespace; therefore if you want to use reload(), you probably should avoid from ... import ... (if you want to import module functions into your global namespace, then you'll need to reimport them after you reload the module). So here's the gotchas to be aware of when reloading modules: 1. import is cached, if you want to reimport a changed module you have to call reload() 2. reload does not modify anything in existing global namespace, if you have imported functions/class definition to your global namespace, you will need to reimport them after reloading. 3. be careful if you mix instances made from old definitions with instances made from new definitions, python does not modify the class definition of existing instances 4. be careful when reloading functions that have function attributes. The same caution applies when reloading class that have class attributes. -- http://mail.python.org/mailman/listinfo/python-list -- http://mail.python.org/mailman/listinfo/python-list
a little help
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 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 files using that code. Let suppose that after that I make some changes in the code using again the IDLE Editor, save the program code, and…what else? The updated code is not already available from the command line interface. If I run the module, I lose the data already loaded (and it is a big amount). If I re-import it, the new code is not available Any suggestion? Thanks Andres -- http://mail.python.org/mailman/listinfo/python-list
Re: a little help
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 change. 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). There is nothing to do. Thank you! Regards Prof. Dr. Andrés Soto DES DACI UNACAR From: Chris Angelico ros...@gmail.com 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 soto_and...@yahoo.com 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. Is it possible? That's normal with Python, yes. Usually you'll find that it's more hassle than it's worth to try to modify code live like that; even in languages specifically designed with this feature in mind, there's a lot to keep track of. It may be worth writing your program to take a snapshot of current state (eg with the pickle module); this might be easier than re-parsing a complicated input data set. But that can be a lot of bother too, and usually in the end it's just not worthwhile. ChrisA -- http://mail.python.org/mailman/listinfo/python-list -- http://mail.python.org/mailman/listinfo/python-list