>with open(dirFichero,'r') as reader:
> for line in reader:
> print line
>
>the problem is that shown is :
>{\rtf1\ansi\ansicpg1252\cocoartf1504\cocoasubrtf810
>{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
>{\colortbl;\red255\green255\blue255;}
>{\*\expandedcolortbl;;}
>\paperw11900\paperh1
>I have an SCP script that auto completes just fine from the terminal window in
>Pi. When I use either subprocess or os to try and have it run under Python it
>does not do the file >transfer from Pi to my Ubuntu machine. What am I doing
>wrong? Here is the script:
>from subprocess import cal
> Need help
I need a beer
Put your question in the mailing list I think you can get the help needed.
This email is confidential and may be subject to privilege. If you are not the
intended recipient, please do not copy or disclose its content but contact the
sender immediately upon receipt.
--
>> elements. For example, if we have a list_a=["a","b","c","d"] and
>> list_b=["a","b"] I want to obtain a new list_c containing elements that
>> match between these lists (a and b here),
>Perhaps this might work:
list(set(list_a).intersection(set(list_b)))
>['a', 'b']
>>> list_a={"a","b","
> How to match latter(caps and small) ,numbers and # symbol in python pexpect.
With a .*
child = pexpect.spawnu("ssh cbpapp@%s"% CBP[cust_cbp_server])
child.setecho(False)
child.logfile = open("/opt/webapi/logs/delete_accountID.log", "w")
child.expect(".*assword:")
>Now, this puzzles me:
[x,y for a in data]
> File "", line 1
>[x,y for a in data]
> ^
>SyntaxError: invalid syntax
>I expected:
>[(1, 2), (3, 4)]
You can try [(x,z) for x,z in data].
In your situation a takes the values (1,2) or (3,4) in the one that I put x and
z take the
>def return_files(file_list):
>"""
>Take a list of files and return file when called.
>
>Calling function to supply attributes
>"""
>for file in file_list:
>with open(os.path.join(dir_path, file), 'rb') as fd:
>if os.stat(fd.name).st_size == 0:
>
On Thu, Dec 1, 2016 at 10:30 AM, Cecil Westerhof wrote:
> I would prefer when it would generate:
> '[
> "An array",
> "with several strings",
> "as a demo"
> ]'
>
> Is this possible, or do I have to code this myself?
> https://docs.python.org/3/library/json.html?highlight=
> [root@bart /]# ./dataman.py
>Enter a domain name: aslfhafja
>Your domain is aslfhafja
>Traceback (most recent call last):
> File "./dataman.py", line 7, in
> print socket.gethostbyname(str)
>socket.gaierror: [Errno -2] Name or service not known
>[root@bart /]#
>I would like to be able to h
>Not surprisingly, the exception you should catch is simply TimeoutError:
>try:
>server.sendmail(sender, receivers, msg.as_string())
>except TimeoutError as e:
>print("SMTP could not be contacted: %s" % e)
>finally:
> server.quit()
The error was thrown by a
Hi Guys
Try to connect to the smtp via smtplib.
The connection is down because the Firewall has not been open yet so the
exception is something that should appear.
Now I want to catch this timeout in case error happens in future.
Here the exception trace.
[2016-10-12 14:14:06,289] ERROR in app
>I have worked places where they put stuff like this at the bottom of emails
>sent to the person sitting next to them :) -raising entropy-ly yrs- Robin
>Becker
Cannot do anything about it. It is not on my MTA client and it is added by the
company server :(
If it depended on my I will remove i
Hi Ben
Thanks for the advice.
> * Complain
Basically what all comes down is to complain. I wonder if in a company of
80,000 people I will manage to change that behaviour.
This email is confidential and may be subject to privilege. If you are not the
intended recipient, please do not copy or di
https://mail.python.org/mailman/listinfo/python-list
> where is a comma there should start new line ... How can i do it ?
Use the split
a.split(",")
for x in a:
print(x)
This email is confidential and may be subject to privilege. If you are not the
intended recipient, please do not copy or disclose its content but contact the
sender immediately
On Wednesday, September 7, 2016 at 8:25:42 PM UTC-4, p...@blacktoli.com wrote:
> Hello,
>
> any ideas why this does not work?
>
> >>> def add(key, num):
> ... a[key] += num
> ...
> >>> a={}
> >>> a["007-12"] = 22 if not a.has_key("007-12") else add("007-12",22)
> >>> a
> {'007-12': 22} # OK her
>> One might guess a.extend(a) would turn into an infinite loop. It turns out
>> here Python first gets all the items of `a' and then append them to `a', so
>> the infinite loop is avoided.
>>> a = [1,2]
>>> for x in a: a.append(x)
>...
>^CTraceback (most recent call last):
> File "", line 1, i
>I installed the version for windows 64. After a succesfull installation, the
>same system error occurs on the lounch of the program:
>api-ms-win-crt-runtime-l1-1-0.dll is missing.
Sometimes google save you time more than the list:
https://www.smartftp.com/support/kb/the-program-cant-start-bec
>I am having problems when installing Python on a 64bit windows7 laptop.
>I am guessing that the problem is happening because of the 64bit architecture.
>Could you please take a look at the attached file that has screen shots of the
>problem I am facing?
>Could you tell me how I can fix these issu
Hi Guys
I have a question related to unittest.
I suppose a SW that is going to live will not have any trace of unittest module
along their code.
So is it the way to do it to put all unittest in a preproduction environment
and then remove all lines relate to unittest once the SW is release into
Hi Guys
I have the following script which will be used in Spark.
#!/usr/bin/env python3
from pyspark_cassandra import CassandraSparkContext, Row
from pyspark import SparkContext, SparkConf
from pyspark.sql import SQLContext
import os
os.environ['CLASSPATH']="/mnt/spark/lib"
conf =
SparkConf().se
>That gives me many .so files but no python*.so* file :(
Install the python-devel.
This email is confidential and may be subject to privilege. If you are not the
intended recipient, please do not copy or disclose its content but contact the
sender immediately upon receipt.
--
https://mail.pytho
>ImportError: No module named 'ConfigParser'
It is telling you the error
This email is confidential and may be subject to privilege. If you are not the
intended recipient, please do not copy or disclose its content but contact the
sender immediately upon receipt.
--
https://mail.python.org/
>I tried to use Cassandra and multiprocessing to insert rows (dummy data)
>concurrently based on the examples in
Same situation here. I was going to try this solution but on the reading side.
Was even thinking of putting Spark-Cassandra just to avoid Python to do
multiprocessing.
This email is c
> What I meant was that you would have a dict of dicts, where the key was the
> country:
Thanks MRAB I could not see that solution. That save me a lot of lines of code.
Certainly my previous solution also manage to do that but yours is more
clean-code wise.
This email is confidential and may be
>thanks I will look at them.
As an example for your guide:
##log_handler###
import sys
import logging
import logging.handlers
from configfile_read import *
def LogHandler(logger):
CONFIG_FILE = ('./conf/' + 'config.ini')
config = configfile(CONFIG_FILE)
FORMAT = '%(ascti
>> The dictionary that I am using in the classes:
>> {'Country':'Empty','Service':'Empty','TimeStamp':'Empty','Ocg':'see3',
>> 'DiameterCodes':{'2001':0,'4010':0,'4012':0,'4998':0,'4999':0,'5007':0
>> ,'5012':0}}
>>
>> Wanted help from your side on how to focus this just because I want to read
>>
>logging please.
Check this modules:
import logging
import logging.handlers
This email is confidential and may be subject to privilege. If you are not the
intended recipient, please do not copy or disclose its content but contact the
sender immediately upon receipt.
--
https://mail.python.org/m
Hi Guys
I am doing program that reads into a directory for the files that were created
the last 5 mins. (working)
Inside those files there are 242 fields in each line separated by | (pipe).
Each file has about 5k records and there are about 5 files per 5 mins.
I will look for field 29 and 200
> I am planning design an encrypted time-limited API on both Client and Server
> sides,
If you want client/server communitation in an encypted way you can use the ssl
module.
This email is confidential and may be subject to privilege. If you are not the
intended recipient, please do not copy or
>plt.plot(np.array(code_2001),label="2001")
Simple solution:
ax.plot(date_nump,np.array(code_2001),label="2001")
Didn't see it until I took a rest.
This email is confidential and may be subject to privilege. If you are not the
intended recipient, please do not copy or disclose its content but co
Hi Guys
Have been all day looking for a solution on the x-axis and the time plot.
The output that I get is this with all the dates shift to the right overlapping
each other. http://postimg.org/image/fs4tx83or/
I want the x-axis to start at 0 and to finish after the 3 entries on the DB.
X Axis
>I am starting a docker container from a subprocess.Popen and it works, but
>when the script returns, the terminal settings of my shell are messed up.
>Nothing is echoed and return doesn't cause a >newline. I can fix this with
>'tset' in the terminal, but I don't want to require that. Has anyone
>>> x = 4
>>> x + 5
9
-Original Message-
From: Python-list
[mailto:python-list-bounces+joaquin.alzola=lebara@python.org] On Behalf Of
Smith
Sent: 27 April 2016 10:29
To: python-list@python.org
Subject: Basic Concepts
Fill in the blanks to declare a variable, add 5 to it and print it
import csv
Use dictionary {key:value}
-Original Message-
From: Python-list
[mailto:python-list-bounces+joaquin.alzola=lebara@python.org] On Behalf Of
peakgraph...@gmail.com
Sent: 26 April 2016 17:01
To: python-list@python.org
Subject: Howw to prevent the duplication of any value in
Just an example. Didn't use the csv but just hope that it helps.
name=[]
name_exist="Dop"
with open("dop.csv") as f:
for line in f:
line_split=line.split(',')
name.append(line_strip[0])
if name_exist in name:
print "found name " + na
Strip() = white spaces.
Description
The method strip() returns a copy of the string in which all chars have been
stripped from the beginning and the end of the string (default whitespace
characters).
Use to remove return carriage--> line[:-1]
-Original Message-
From: Python-list
[mailt
I put some code I did before for the xmlns:
xml_root =
ET.ElementTree(ET.fromstring(xml_decoded)).getroot()
for elem in xml_root.getiterator():
if('{http://request.messagepush.interfaces.comv
>> The problem:
>> test\ntest\ntest<{[£ EURO&%]}>
>If I had to make a guess, you need to escape the <, >, and &characters or else
>they'll get parsed by the XML parser. Try sending
>"test\ntest\ntest<{[£ EURO&%>]}>"
Yes it is the xml itself.
Putting the & and also the < I can make it work wit
Hi Guys
I am currently doing this:
IP client(Python) --> send SOAPXML request --> IP Server (Python)
SOAP request:
http://schemas.xmlsoap.org/soap/envelope/";
xmlns:req="http:/
/request.messagepush.interfaces.comviva.com"
xmlns:xsd="http://request.messagepush.interfaces
.comviva.com/xsd">
test
Hi,
Try to use the xml module.
import xml.etree.ElementTree as ET
That might help.
BR
Joaquin
-Original Message-
From: Python-list
[mailto:python-list-bounces+joaquin.alzola=lebara@python.org] On Behalf Of
harirammano...@gmail.com
Sent: 18 April 2016 08:08
To: python-list@python
list_append = []
with open('filename') as f:
for line in f:
t_line = line.split(' ')
if (t_line[0] == 'ABC'):
print(t_line[1])
list_append.append(t_line[1])
-Original Message-
From: Python-list
[mailto:python-list-bounces+joaquin.alzola=lebara@python.org] On Behalf Of
durgadevi1
Se
Joaquin Alzola wrote:
> Hi People
>
> I need to covert this string:
>
> hello there
> this is a test
>
> (also \n important)
>
> To this Unicode:
>
00680065006c006c006f0020002000740068006500720065000a00740068006900730020006900730020006100200074006500730074000a
>
Hi People
I need to covert this string:
hello there
this is a test
(also \n important)
To this Unicode:
00680065006c006c006f0020002000740068006500720065000a00740068006900730020006900730020006100200074006500730074000a
Without the \u and space.
https://www.branah.com/unicode-converter
I seem n
>"Gordon( Hotmail )" writes:
>> I am struggling to understand the basic principles of Python
>Welcome! Congratulations for embarking on Python as a language to learn.
>Since as you say you are trying to learn the very basics, please participate
>in our collaborative tutoring forum
>https://m
Den 13-03-2016 kl. 14:45 skrev kamaraju kusumanchi:
> Is there a pdf version of the python tutorial
> https://docs.python.org/3/tutorial/index.html that I can download? The
> idea is to have everything in one file so I can search easily, be able
> to work offline.
>
> thanks
> raju
>
>Try here: ht
You could do something like ...
If len(my_iterable) is not 0:
for x in my_iterable:
# do
else:
# do something else
There should be a more code efficient way to do this.
-Original Message-
From: Python-list
[mailto:python-list-bounces+joaquin.alzola=lebara@python.org] On Be
> I received this from a socket connection. This is the received data:
>
> Adding more info --> the response is a mixture of hex numbers + ascii
>
> [...]
>
> How is the best way to decode such reply from server?
>https://docs.python.org/3/library/struct.html#examples
Thank Marko will take alook i
HI Guys
I received this from a socket connection. This is the received data:
Adding more info --> the response is a mixture of hex numbers + ascii
>From python function --> data = s.recv(2048)
b'\x01\x00\x00D\x00\x00\x01\x18\x00\x00\x00\x00p2E\xe1+\xe8xG\x00\x00\x01\x08@\x00\x00\x0bmmm\x00\x00\
HI Guys
I received this from a socket connection. This is the received data:
>From python function --> data = s.recv(2048)
b'\x01\x00\x00D\x00\x00\x01\x18\x00\x00\x00\x00p2E\xe1+\xe8xG\x00\x00\x01\x08@\x00\x00\x0bmmm\x00\x00\x00\x01(@\x00\x00\x16mmm.xx.com\x00\x00\x00\x00\x01\x0c@\x00\x00\x0
SQL doesn't allow decimal numbers for LIMIT.
Use decimal numbers it still work but is the proper way.
Then clean up a bit your code and remove the commented lines #
-Original Message-
From: Python-list
[mailto:python-list-bounces+joaquin.alzola=lebara@python.org] On Behalf Of
subhab
Try to do a .split(' ') and then add field 0 and 1 to an list.
For open the file you can do it easier:
with open(file) as f:
for line in f:
print('line')
-Original Message-
From: Python-list
[mailto:python-list-bounces+joaquin.alzola=lebara@python.org] On Behalf Of
Val Krem via Pyt
> root.wm_iconphoto(True, img)
What are the images format allowed?
This email is confidential and may be subject to privilege. If you are not the
intended recipient, please do not copy or disclose its content but contact the
sender immediately upon receipt.
--
https://mail.python.org/mailm
53 matches
Mail list logo