how can I retrieve a particular tweet, having its tweet id?

2013-09-23 Thread Andres Soto
 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

2012-10-09 Thread Andres Soto
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

2012-04-29 Thread Andres Soto
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 "", line 1, in 
    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?

2012-04-02 Thread Andres Soto
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


Re: How can I verify if the content of a variable is a list or a string?

2012-01-31 Thread Andres Soto


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 
>To: Andres Soto  
>Cc: "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  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


How can I verify if the content of a variable is a list or a string?

2012-01-31 Thread Andres Soto
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: 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 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


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

2012-01-04 Thread Andres Soto
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 
>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 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


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