subject has it all. Thanks
--
https://mail.python.org/mailman/listinfo/python-list
Hello Covid fighters and dodgers,
I'm sort of confused by what I am seeing in a Pandas book.
This works:
fig = plt.figure()
ax1 = fig.add_subplot(2,2,1)
ax2 = fig.add_subplot(2,2,2)
ax3 = fig.add_subplot(2,2,3)
ax3.plot(np.random.randn(50).cumsum(), 'k--');
but also this works!
fig = plt.fi
possibly a stupid question. Let's say I have a (small) dataframe:
import pandas as pd
dframe = pd.DataFrame({'A': ['a0','a1','a2','a3'],
'B': ['b0','b1','b2','b3'],
'C': ['c0','c1','c2','c3'],
'D': ['d0','d1','d2','d3']}, i
On 4/6/2020 4:08 AM, Reto wrote:
Does this help?
Thank you, but not really. What I am trying to achieve is to have a way
to copy and paste small yet complete dataframes (which may be the result
of previous calculations) between a document (TXT, Word, GoogleDoc) and
Jupiter/IPython.
Did I m
On 4/6/2020 3:03 PM, Christian Gollwitzer wrote:
CSV is the most sensible option here. It is widely supported by
spreadsheets etc. and easily copy/pasteable.
Thank you Christian.
so, given a dataframe, how do I make it print itself out as CSV?
And given CSV data in my clipboard, how do I
On 4/6/2020 8:51 PM, Reto wrote:
out = df.to_csv(None)
new = pd.read_csv(io.StringIO(out), index_col=0)
Thank you, brother. It works
--
https://mail.python.org/mailman/listinfo/python-list
On 4/6/2020 11:05 PM, Luca wrote:
On 4/6/2020 8:51 PM, Reto wrote:
out = df.to_csv(None)
new = pd.read_csv(io.StringIO(out), index_col=0)
Thank you, brother. It works
BTW, a little gotcha (I write this in case someone gets here in the
future through Google or something)
"&quo
code for grep command when it not found any match.
The error instance object reported that the command run is:
*** ErrorReturnCode_1:
RAN: '/usr/bin/grep abc /Users/keul/test_sh'
Obviously manually running the command I get some output and exit code 0.
Where I'm wrong?
Hello at all.
I have to use a vb dll called ndxComm.dll
I have do this but i get the following error:
from win32com import client
from win32com.client import Dispatch
avatar = Dispatch("NdxComm")
avatar.Reset(1, 20, True)
pywintypes.com_error:(-2147221005, "s
I have solve
Thanks
--
http://mail.python.org/mailman/listinfo/python-list
ke me.
In any case thanks for your help, and you cordility.
Best Regards
Luca
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
I was trying to make to work directly l i2c with python with the
calls ioctl. But I have of the problems and I do not succeed to go
ahead.
this and l error
[EMAIL PROTECTED] /usr/local/wrap]129# python pcf8591_ioctl.py
Reading from 4 ch 8 bit A/D converter PCF8591
Traceback (most recent cal
Hi, Ive written this easy and fast function cause there it was
impossible for me to find one that zip a directory without external
libraries:
import zipfile
import sys
import os
def zipdir(zipPath,directory="./"):
"""Store the cdontent of directory to a zipPath file, if directory is
not given st
Hi all.
There is standard or sugested way in python to read the content of a P7M file?
I don't need no feature like verify sign, or sign using a certificate.
I only need to extract the content file of the p7m (a doc, a pdf, ...)
Thanks!
--
-- luca
--
http://mail.python.org/mailman/lis
On Wed, Mar 11, 2009 at 5:05 PM, Luca wrote:
> There is standard or sugested way in python to read the content of a P7M file?
>
> I don't need no feature like verify sign, or sign using a certificate.
> I only need to extract the content file of the p7m (a doc, a pdf, ...)
I&
text, but I
don't remember how.
There is a official refence about this?
--
-- luca
--
http://mail.python.org/mailman/listinfo/python-list
cribed there (i know i had a small problem with
> some detail being inconsistent with that convention used in sphinx).
It works! Thanks you!
--
-- luca
--
http://mail.python.org/mailman/listinfo/python-list
ide the main __init__.py
>From the mommy.py file I need to import the __version__ var, but I'm
really not able to do this! I fear this is a very stupid task to do...
my problem is that the file is called like the module.
Anyone can point me to the solution?
--
-- luca
--
http://mail.python.org/mailman/listinfo/python-list
7;t you switch the place where __version__ is defined? It
> looks like a constant, so you could have it actually defined in mommy.py,
> and inside __init__.py just import the value.
>
Ok, thanks all for helping.
--
-- luca
--
http://mail.python.org/mailman/listinfo/python-list
Hi all.
I think this is a newbie question... what is the best method to know
if a property of an object is a function?
I'm thinking something as
if type(obj.methodName)==???
Can someone help me?
--
-- luca
--
http://mail.python.org/mailman/listinfo/python-list
'function' object is not callable
>
>
> But not so easy to fool a type check:
>
>>>> type(x) == new.function
> False
>
> Of course that's not bullet-proof either. I leave it as an exercise to
> discover how you might break that piece of code.
>
Ok, so...
What is the best way to do this? The "most pythonic"?
--
-- luca
--
http://mail.python.org/mailman/listinfo/python-list
e using:
>
> isinstance(obj.methodName, new.instancemethod)
>
> But remember that not all callable attributes are instancemethods!
>
> There is no one right way of doing this.
>
> Hope this helps.
Yes, this helps a lot. In facts I need to do something like a language parser.
Tha
Dear all, excuse me if i post a simple question.. I am trying to find
a software/algorythm that can "cluster" simple data on an excel sheet
Example:
Variable a Variable b Variable c
Case 11 0 0
Case 20 1
l pre-assign which task
gets done by each process, or is this done at runtime, on a get-first-
task-to-be-done basis?
Many thanks,
Luca
--
http://mail.python.org/mailman/listinfo/python-list
On Sat, Nov 14, 2009 at 6:51 PM, Philip Semanchuk wrote:
> Hi Luca,
> You have to define what you mean by "text" file. It might seem obvious, but
> it's not.
>
> Do you mean just ASCII text? Or will you accept Unicode too? Unicode text
> can be more difficult to
ded python?
Thank you,
Luca
--
http://mail.python.org/mailman/listinfo/python-list
Chris Rebert wrote:
On Thu, Feb 25, 2010 at 7:26 AM, Luca wrote:
Hello, i am trying to develop an application to teach programming to young
kids in a similar way as Logo did in the past. I would like to use an
embedded Python as underlying language but this raises a problem.
The target of my
some tests with turtle-graphics and it seems to work. My
next problem was to translate the language.
http://img192.imageshack.us/img192/3093/zzz5.png
[Btw... i took too much time to write this post so the ladybug fell
asleep...]
Thanx,
Luca
--
http://mail.python.org/mailman/listinfo/python-list
ecial-purpose application that
only incorporates python as a library.
Thanx,
Luca
--
http://mail.python.org/mailman/listinfo/python-list
is also a matter of users-target. If i am
talking to a young kid i should use words and concepts that are easy for
him/her to understand... so, for my target, it would be very important
not only a correct translation in my language, but also the use of words
and concepts that are familiar to a kid.
Thanx,
Luca
--
http://mail.python.org/mailman/listinfo/python-list
e the language in his own language but the
computer will actually work with the standard-python file.
Once i have this "ready" i can proceed to other steps and try to
implement other ideas that i have (remember c-robots and p-robots?).
Bye,
Luca
--
http://mail.python.org/mailman/listinfo/python-list
path.
--
-- luca
--
http://mail.python.org/mailman/listinfo/python-list
On Sat, Jun 20, 2009 at 6:38 PM, Chris Rebert wrote:
> On Sat, Jun 20, 2009 at 7:17 AM, Luca wrote:
>> Hi all.
>>
>> I need to use a function like the raw_input to read data from user
>> command line, but I really like to pre-compile the choice and I'm not
>>
hn")
>
Thanks! It works! This is working on Linux and MacOS too.
> The readline module is specific to Unix implementations.
> I don't know what OS the OP was using.
Any one knows is this working also on Windows? I've no Win system
right no to test this...
--
-- luca
--
http://mail.python.org/mailman/listinfo/python-list
On Fri, Mar 20, 2009 at 4:12 PM, Emanuele Rocca wrote:
> On 11/03/09 - 05:05, Luca wrote:
>> There is standard or sugested way in python to read the content of a P7M
>> file?
>>
>> I don't need no feature like verify sign, or sign using a certificate.
>> I on
On Oct 9, 11:39 am, Johny wrote:
> Is it possible to control any webbrowser from Python ? For example to
> issue http POST and GET command
> Thanks
> Johny
I'm using funkload and it is awesome!
http://funkload.nuxeo.org/
FunkLoad is a functional and load web tester, written in Python, whose
ma
Can you please help me understanding what's the difference between the two
cases?
Thanks a lot in advance for the help,
Cheers, Luca
--
http://mail.python.org/mailman/listinfo/python-list
>
> Can you please help me understanding what's the difference between the two
> cases?
>
Hi guys has some of you ideas on what is causing my issue?
--
http://mail.python.org/mailman/listinfo/python-list
//plumbum.readthedocs.org/en/latest/ , which makes it easier to do
> pipelining and other such "fancy" things with subprocesses, while still
> avoiding the many perils of the shell.
>
>
Thanks, I didn't know this library, I'll give it a try.
Though I forgot to mention t
>
>
> Will it violate privacy / NDA to post the command line? Even if we
>
> can't actually replicate your system, we may be able to see something
>
> from the commands given.
>
>
Unfortunately yes..
--
http://mail.python.org/mailman/listinfo/python-list
> fd = open('/etc/file','w')
>
> fd.write('jpdas')
>
> fd.close()
>
>
Hi Bibhu, that is not a Python problem, but a permission one.
You should configure the permissions so that you have write access to the
folder.
However unless you know what you are doing it is discouraged to save your
file i
>
> That's because stdin/stdout/stderr take file descriptors or file
>
> objects, not path strings.
>
Thanks Chris, how do I set the file descriptor to /dev/null then?
--
http://mail.python.org/mailman/listinfo/python-list
et_address is not None:
print "found target bluetooth device with address", target_address
else:
print "could not find target bluetooth device nearby"
the error
luca@luca-XPS-M1330:~/py-temperature/py-temperature$ python bluetooth.py
Traceback (most recent call last):
Il giorno venerdì 5 ottobre 2012 13:33:14 UTC+2, Hans Mulder ha scritto:
> On 5/10/12 10:51:42, Luca Sanna wrote:
>
>
>
> > from bluetooth import *
>
>
>
> [..]
>
>
>
> > luca@luca-XPS-M1330:~/py-temperature/py-temperature$ python bluetoo
hi,
I enter a calendar in an html page
in each calendar day, I enter a time that is used by the program to perform
actions with python
What can I use to do this?
thanks
--
http://mail.python.org/mailman/listinfo/python-list
hi,
how do I send a ping in bluetooth?
because android phones are not always visible.
I can not find the ping command
thanks
--
http://mail.python.org/mailman/listinfo/python-list
Hello
try this code
def selectionsort(arr):
#le=len(arr)
for b in range(0,len(arr)-1):
# pos=b
for a in range(b+1,len(arr)):
if arr[b]>arr[a]:
arr[b],arr[a]=arr[a],arr[b]
return arr
arr=[3,5,9,8,2,6]
print(selectionsort(arr))
Il giorno ven 24 d
Hello i'm using python with pyqt but i have a problem on varable:
I have two class:
from PyQt5.QtCore import pyqtSlot
from PyQt5.QtWidgets import QWidget
from PyQt5.QtSql import QSqlDatabase, QSqlTableModel
from PyQt5 import QtWidgets
from PyQt5.QtCore import Qt
from Ui_form import Ui_Form
from f
Thanks Cameron
but my problem is that i can't access to a line edit of the class Form from the
class Form_cli i get this error:
'Form_cli' object has no attribute 'lineEdit_29'
--
https://mail.python.org/mailman/listinfo/python-list
On Sat, Nov 23, 2013 at 5:29 PM, Peter Otten <__pete...@web.de> wrote:
> Luca wrote:
>
>> I'm trying to use sh (https://pypi.python.org/pypi/sh) for calling
>> system grep command but it's now working as expected.
>>
>> An example:
>>
>
Popen and redirect stdout to fw...
next open named_pipe for reading and giving it as input to cat (still using
Popen).
I know it is a simple (and rather stupid) example, but I can't manage to make
it work..
How would you implement such simple scenario?
Thanks a lot in advance for the help!!!
Luca
--
http://mail.python.org/mailman/listinfo/python-list
k it is because there is not process that reads the
content of the pipe, so the system waits for the pipe to be emptied.
Thanks a lot in advance for the help in any case.
Luca
--
http://mail.python.org/mailman/listinfo/python-list
how do I overcome the block?
As you said in bash I run the ls process in background. How do I do that in
Python?
Thanks again for the help,
Luca
--
http://mail.python.org/mailman/listinfo/python-list
learn how to handle named pipes in Python, which I find it
easier to do by using a simple example that I am comfortable to use :)
Thanks in any case for your answer,
Luca
--
http://mail.python.org/mailman/listinfo/python-list
; in background and writes
into a named pipe? And how do I open a thread that reads from the named pipe?
Can you please post a small example, so that I have something to work on?
Thanks a lot in advance for your help!
Luca
--
http://mail.python.org/mailman/listinfo/python-list
thanks and what about python 2.7?
>
>
> In Python 3.3 and above:
>
>
>
> p = subprocess.Popen(..., stderr=subprocess.DEVNULL)
P.s. sorry for the late reply, I discovered I don't receive notifications from
google groups..
--
http://mail.python.org/mailman/listinfo/python-list
Thanks this works (if you add shell=True in Popen).
If I don't want to use shell = True, how can I redirect the stdout to
named_pipe? Popen accepts an open file handle for stdout, which I can't open
for writing because that blocks the process...
>
>
> os.mkfifo("named_pipe", 0777)
>
> ls_proc
> You're back to using separate threads for the reader and the writer.
>
And how do I create separate threads in Python? I was trying to use the
threading library without not too success..
--
http://mail.python.org/mailman/listinfo/python-list
> my_thread.join()
Thanks! I managed to make it work using the threading library :)
--
http://mail.python.org/mailman/listinfo/python-list
ain__ module be
importable by the children.", which is obscure to me).
I would like to understand two things: why my code fails and when I can expect
it to fail? what is a possible workaround?
Thanks a lot in advance to everybody for the help!
Cheers,
Luca
--
http://mail.python.org/mailman/listinfo/python-list
On Tuesday, 6 August 2013 18:12:26 UTC+1, Luca Cerone wrote:
> Hi guys,
>
> I would like to apply the Pool.map method to a member of a class.
>
>
>
> Here is a small example that shows what I would like to do:
>
>
>
> from multiprocessing import Pool
>
thon 3.2 neither (I am mostly
interested in a solution for Python 2.7, sorry I forgot to mention that).
Thanks in any case for the help, hopefully there will be some other advice in
the ML :)
Cheers,
Luca
--
http://mail.python.org/mailman/listinfo/python-list
ading it and relaying further questions back to us. Or use Python 3
:) Thanks, but of course I googled and found this link before posting. I don't
understand much of the details as well, that's why I posted here.
Anyway, thanks for the attempt :)
Luca
--
http://mail.python.org/mailman/listinfo/python-list
calls will work on the proxy.
>
> """
>
> return partial(_getattr_proxy_partialable, instance, name)
>
>
>
> l = range(100)
>
> p = Pool(4)
>
> op = p.map(getattr_proxy(A(3), "fun"), l)
>
> print(op)
I can't try it now, I'll let you know later if it works!
(Though just by reading I can't really understand what the code does).
Thanks for the help,
Luca
--
http://mail.python.org/mailman/listinfo/python-list
Thanks for the post.
I actually don't know exactly what can and can't be pickles..
not what partialing a function means..
Maybe can you link me to some resources?
I still can't understand all the details in your code :)
--
http://mail.python.org/mailman/listinfo/python-list
Thanks for the help Peter!
>
>
>
> >> def make_instancemethod(inst, methodname):
>
> >> return getattr(inst, methodname)
>
> >
>
> > This is just getattr -- you can replace the two uses of
>
> > make_instancemethod with getattr and delete this ;).
>
>
>
> D'oh ;)
--
http://mail.py
ackages a
virtual environment should be able to access the packages of an other one.
Thanks a lot in advance for the help,
Luca
--
http://mail.python.org/mailman/listinfo/python-list
gt;
>
>
>
>
> [1] https://wheel.readthedocs.org
> [2]
> http://www.pip-installer.org/en/latest/cookbook.html#building-and-installing-wheels
>
>
>
>
>
>
> 2013/8/9 Luca Cerone
>
> Dear all, is there a way to "nest" virtual environments?
>
>
base_h.cookies == job_h.cookies
#returns True
So, why does this script fail to access the job page?
How can I change it so that I it works as intended and job_page prints
the content of the page that displays the email address to use for the job
applications?
Thanks a lot in advance for the help!
Best Wishes,
Luca
--
http://mail.python.org/mailman/listinfo/python-list
;t understand how you use the ones that the site
sends to you when you perform the initial request.
Have you tried this code to check if this work?
If it works as intended can you explain a bit better
what it does exactly?
Thanks again!
Luca
--
http://mail.python.org/mailman/listinfo/python-list
), I preferred to ask for the specific case.
I am sorry if I gave you the impression I didn't appreciate your answer,
it was absolutely not my intention.
Cheers,
Luca
> Let me make an additional remark however: you should
>
> not expect to get complete details in a list like t
ng wrong? Do I misunderstand something in the process?
Thanks again in advance for the help,
Cheers,
Luca
--
http://mail.python.org/mailman/listinfo/python-list
Thanks Dieter,
> With respect to cookie handling, you do everything right.
>
>
>
> There may be other problems with the (wider) process.
>
> Analysing the responses of your requests (reading the status codes,
>
> the response headers and the response bodies) may provide hints
>
> towards th
uence, but I don't know how to do that.
I know that I could skip the execution of print(str(x)) but this is not what I
want; I really would like the command to be executed the output ignored.
Can you point me to any solution for this issue?
Thanks a lot in advance for your help,
Cheers,
Luca
--
https://mail.python.org/mailman/listinfo/python-list
ing them.)
>
You are right, I modified an example that uses x in one of my functions that
requires a string in input, and didn't change that.
Thanks again for the help anyway,
Cheers,
Luca
--
https://mail.python.org/mailman/listinfo/python-list
> And if you ignore the output, the error won't be caught either. What's
>
> the difference?
>
> >>> 1 + 1 #doctest:+IGNORE_OUTPUT (not a real directive)
>
> 1000
>
>
The difference is that in that case you want to check whether the result is
correct or not, because you expect a certain r
> but if you're using this for a
>
> tutorial, you risk creating a breed of novice programmers who believe
>
> their first priority is to stop the program crashing. Smoke testing is
Hi Chris,
actually my priority is to check that the code is correct. I changed the syntax
during the development,
a bad choice, but in my case is what I want/need.
Thanks for the help,
Luca
--
https://mail.python.org/mailman/listinfo/python-list
> This makes no sense. If you ignore the output, the code could do ANYTHING
>
> and the test would still pass. Raise an exception? Pass. SyntaxError?
>
> Pass. Print "99 bottles of beer"? Pass.
>
if you try the commands, you can see that the tests fail..
for example
.. doctest::
>>> rais
On Sunday, 22 September 2013 14:39:07 UTC+1, Ned Batchelder wrote:
> On 9/22/13 12:09 AM, Luca Cerone wrote:
>
> > Hi Chris,
>
> > actually my priority is to check that the code is correct. I changed the
> > syntax
>
> > during the development, and I want
> It won't be very good documenation any more but nothing stops you
>
> from examining the result in the next doctest and making yourself
>
> happy about it.
>
>
>
> >>> x = input("indeterminate:")
>
> >>> result = "'{}'".format(x))
>
> >>> result.startswith("'") and result.endswith("'
I don't know why but it seems that google groups stripped the indentation from
the code. I just wanted to ensure you that in the examples that I have run
the definition of myfunc contained correctly indented code!
On Monday, 23 September 2013 15:45:43 UTC+1, Luca Cerone wrote:
> ..
>
> The docstring for doctest.DocTestRunner contains the example code
>
> I was looking for.
>
>
Thanks, I will give it a try!
>
> --
>
> Neil Cerutti
--
https://mail.python.org/mailman/listinfo/python-list
al newlines
cr = csv.reader(fo)
values_list = [(r[2],r[4]) for r in cr] #you have a list of tuples containing
the values you need
Cheers,
Luca
--
https://mail.python.org/mailman/listinfo/python-list
Hello everybody.
One of the common rules i like most is: when you enter in a community,
introduce yourself!
So here I am! Luca, old developer (50 and still running!), Python (and
not only) developer, from Marostica, a lovely small town in the
north-eastern part of Italy.
It's a ple
hi ,
I try to run this code MQTT but I can not read the messages in the topic , can
you help me ?
thanks
class MyMQTTClass(Thread):
#def __init__(self, clientid=None):
clientid=None
_mqttc = mqtt.Client(clientid)
#_mqttc.on_message = mqtt_on_message
#_mqttc.on_connect = mqtt_o
a
dictionary? it takes 20 seconds, if you are slow.
Else if you want a function that prints time and result, why don't you
print result more or less in the same manner you do with the time
elapsed? it takes 20 seconds, if you are slow.
Else, can you explain exactly what do you
hat's a good point. IMHO test the time execution of a function makes
sense only if all these assetions are true:
- the function takes a long time to be executed;
- the execution is iterated a certain (large) number of times.
--
Ciao!
Luca
--
https://mail.python.org/mailman/listinfo/python-list
Il 07/06/2015 13:45, Steven D'Aprano ha scritto:
As far as I know, python-list a.k.a. comp.lang.python is the only one of the
Python mailing lists with an official newsgroup mirror.
OK. So let me rephrase: Thank God the list is mirrired to a newsgroup...
--
Ciao!
Luca
--
e 'import', and not 'from xyz import', you avoid any conflict.
Ah: 'from ... import' has caused me a lot of terrible headaches. I don't
use this statement if not strictly necessary.
--
Bye.
Luca
--
https://mail.python.org/mailman/listinfo/python-list
ode from one OS to another with no pain.
So, why should I loose this wonderful freedom?
--
Ciao!
Luca
--
https://mail.python.org/mailman/listinfo/python-list
e are distros
with Python3.x as default (Fedora?)
--
Ciao!
Luca
--
https://mail.python.org/mailman/listinfo/python-list
installed it or not.
--
Ciao!
Luca
--
https://mail.python.org/mailman/listinfo/python-list
efers to the nearest loop; so, if you have two nested loops, it refers
to the inner one; another stupid example:
for i in range(10):
for j in range(10):
if j < 5: continue
do_something(i, j) # called only if j >= 5
--
Ciao!
Luca
--
https://mail.python.org/mailman/listinfo/python-list
5.04 comes with Python 2.7.
I don't remember if Python 3 was preinstalled or if I had to install it
manually.
--
Ciao!
Luca
--
https://mail.python.org/mailman/listinfo/python-list
Il 29/09/2015 23:04, Random832 ha scritto:
How about x not in range(11)?
Remember: simpler is better.
--
Ciao!
Luca
--
https://mail.python.org/mailman/listinfo/python-list
object of a class
wherever you want in your code (even if it is very dangerous and
discouraged).
--
Ciao!
Luca
--
https://mail.python.org/mailman/listinfo/python-list
Il 20/10/2015 08:38, Nagy László Zsolt ha scritto:
When you say "they have nothing to do", it is almost true but not 100%.
I know it, but when it comes to eradicate an idea that comes directly
from C++-like languages, you must be drastic.
Nuances come after...
--
Ciao!
Luc
Il 20/10/2015 23:33, JonRob ha scritto:
Hello Luca,
I very much appreciated your comments. And I understand the
importance of "doing something right" (i.e. convention).
This leads me to another question.
Because I am interfacing with an I2C sensor I have many register
defi
is can be written as:
class SensorA():
GYROXREG = 0x0010
GYROYREG = 0x0011
GYROZREG = 0x0001
_registers = [GYROXREG, GYROYREG, GYROZREG]
And then you can invoke those constants as:
SensorA.GYROXREG
to emphasize that they are significant to this class, and to this class
only
1 - 100 of 118 matches
Mail list logo