Hi guys,
I've to deal with CSVs that look like following
CSV (with one header and 3 legit rows where each legit row has 3 columns)
Some info
Date: 12/6/2012
Author: Some guy
Total records: 100
header1, header2, header3
one, two, three
one, "Python is great, so are other languages, isn't ?",
On Apr 26, 7:39 pm, Thomas Rachel wrote:
> Am 26.04.2011 15:48, schrieb Oltmans:
>
>
>
>
>
>
>
>
>
> > Following doesn't work
>
> > config = ConfigParser.ConfigParser()
> > config.read('configs.txt')
> > server_info
Greetings, I hope you're doing well. I'm stuck in a strange issue,
most likely due to my own ignorance. I'm reading a config file using
ConfigParser module and passing database related info to _mssql.
Following doesn't work
config = ConfigParser.ConfigParser()
config.read('configs.txt')
server_in
Hi Python gurus, hope you're doing well. I've a small problem.
When I run the following code
___
>>> names = ['oltmans','abramhovic','\n','sal','lee']
>
Hi all,
I'm writing a very small TCP server(written in Python) and now I want
to host it on some ISP so that it can be accessed anywhere from the
Internet. I've never done that before so I thought I should ask for
some advice. Do you guys know any good ISP that can let me do that?
Most importantl
If I dump a Python dictionary into a file named "data.pkl" using
Pickle module on a Linux operating system, will the data contained in
"data.pkl" load fine in a Windows OS? I mean will I be able to load
the dictionary data contained in "data.pkl" just fine on Windows XP?
I could have tested it but
I've a small multi-threaded program that is written by keeping
Producer-Consumer pattern in mind. In the Producer part of the program
we create new users by doing a POST to a certain web URL whereas in
the Consumer part of the program we try to login newly created users.
Problem is that program sor
On May 9, 1:53 am, superpollo wrote:
> add = lambda a,b: a+b
> for i in reduce(add,a):
> print i
This is very neat. Thank you. Sounds like magic to me. Can you please
explain how does that work? Many thanks again.
--
http://mail.python.org/mailman/listinfo/python-list
Hi, I've a list that looks like following
a = [ [1,2,3,4], [5,6,7,8] ]
Currently, I'm iterating through it like
for i in [k for k in a]:
for a in i:
print a
but I was wondering if there is a shorter, more elegant way to do it?
--
http://mail.python.org/mailman/listinfo/
int me to a more Pythonic, more readable and
possible more short way to acheive this? I will really appreciate any
help. Many thanks in advance.
Best regards,
Oltmans
--
http://mail.python.org/mailman/listinfo/python-list
so I will really appreciate all the
help. Thanks in advance and kindly pardon my ignorance.
Thanks,
Oltmans
--
http://mail.python.org/mailman/listinfo/python-list
On Feb 2, 2:14 am, Steve Holden wrote:
>
> Should not tee be subclassing test, not unittest.TestCase?
>
Thank you, Steve. This worked, but I've not clue why? Can you please
enlighten me why sub-classing 'test' made it happen? Please. Thanks
again.
> regards
> Steve
> --
> Steve Holden
thod):
if name.find('test_')!= -1:
setattr(tee, name, new.instancemethod(func,None,tee))
suite = unittest.defaultTestLoader.loadTestsFromName('check.tee')
suite.run(r)
---
Then line suite.run(r) should have run the methods that we just
attached, but it's not. I
Hello Python gurus,
I'm quite new when it comes to Python so I will appreciate any help.
Here is what I'm trying to do. I've two classes like below
import new
import unittest
class test(unittest.TestCase):
def test_first(self):
print 'first test'
def test_second(self):
pr
On Jan 14, 11:46 pm, exar...@twistedmatrix.com wrote:
> When you run test.py, it gets to the loadTestsFromName line. There, it
> imports the module named "test" in order to load tests from it. To
> import
> that module, it runs test.py again. By the time it finishes running the
> contents of t
Hi Python gurus,
I'm quite new to Python and have a problem. Following code resides in
a file named test.py
---
import unittest
class result(unittest.TestResult):
pass
class tee(unittest.TestCase):
def test_first(self):
print 'first test'
print '-'
def
lksjdfls kdjff lsdfs sdjfls sdfsdwelcome
hello, my age is 86 years old and I was born in 1945. Do you know that
PI is roughly 3.1443534534534534534
> ~uk
>
> On Dec 21, 4:38 pm, Oltmans wrote:
>
> > Hello,. everyone.
>
> > I've a string that looks som
Hello,. everyone.
I've a string that looks something like
lksjdfls kdjff lsdfs sdjfls sdfsdwelcome
>From above string I need the digits within the ID attribute. For
example, required output from above string is
- 35343433
- 345343
- 8898
I've written this regex that's kind of working
Hi, all. All I'm trying to do is to print the error message using the
following code (copying/pasting from IDLE).
def div(a,b):
print a/b
try:
div(5,0)
except Exception as msg:
print msg
but IDLE says (while highlighting the 'as' keyword)
except Exception as msg:
SyntaxError: i
Hello fellow python hackers,
I'm not an expert when it comes to Python and I'm totally stuck in a
situation. All of our unit tests are written using built-in 'unittest'
module. We've a requirement where we want to run a method only once
for our unit tests. Some background: all of our tests are sub
call like
are_elements_present([div1,div2,div10,inp1]) it should return False.
So I hope I've explained myself. Now all I'm looking for is to write
are_elements_presents() in a more Pythonic way. So please let me know
if I can write are_elements_present() in more smart/shorter way.
Than
ea of using a variable named
'result' inside elementsPresent() doesn't sound very good. Any ideas
will be highly appreciated.
Thanks,
Oltmans
--
http://mail.python.org/mailman/listinfo/python-list
Hi, all. I'm trying to use Mechanize in a multithreaded program--
purpose of which is to fill out a form on a website using concurrent
threads. Guys, trust me I've spent a lot of time to figure out the
problem but I'm completed puzzled. Firstly, I've listed the errors and
then the program listing (
On Mar 11, 11:00 pm, Piet van Oostrum wrote:
> self.html=self.SendRequest()
> --
Thank you, everyone, for the help. Appreciate that.
> Piet van Oostrum
> URL:http://pietvanoostrum.com[PGP 8DAE142BE17999C4]
> Private email: p...@vanoostrum.org- Hide quoted text -
>
> - Show q
On Mar 11, 10:08 pm, Oltmans wrote:
> self.html=SendRequest() # This line throws an error
and error says
NameError: global name '_Requests_SendRequest' is not defined.
--
http://mail.python.org/mailman/listinfo/python-list
I've a multithreaded program in which I've to call class methods from
class methods. Here is how my code look like (excluding imports),. Any
help is highly appreciated.
#!/usr/bin/env python
class Requests(Thread):
def __init__(self, times):
Thread.__init__(self)
self.times=ti
On Mar 9, 3:37 am, Chris Rebert wrote:
> Learn about the methods of the string class
> (str):http://docs.python.org/library/stdtypes.html#id4
>
> You'll probably be most interested in .split()
OK, thanks I got it. I was trying to use Regex but .split() just
worked like a charm. Thank you ;)
>
>
rom the above string. Any ideas/
help is highly appreciated.
Thanks,
Oltmans
--
http://mail.python.org/mailman/listinfo/python-list
Python? I want to check following
types
1- integers
2- strings
3- testing types of a particular class
4- decimal/floats
Please excuse my ignorance & enlighten me. I will really appreciate
any help.
Thanks,
Oltmans
--
http://mail.python.org/mailman/listinfo/python-list
ghten me.
Thanks,
Oltmans
--
http://mail.python.org/mailman/listinfo/python-list
Here is the scenario:
It's a command line program. I ask user for a input string. Based on
that input string I retrieve text from a text file. My text file looks
like following
Text-file:
-
AbcManager=C:\source\code\Modules\Code-AbcManager\
AbcTest=C:\source\code\Modules\Code-AbcTest\
Hey all,
I've been using Paramiko for sometime now and I never had any
problems. I've already submitted this question to Paramiko mailling
list but I thought I should post it in CLP as someone might have used
it in past. I'm using Paramiko for SSH. Are there any other good SSH
libraries that you'v
On Jan 8, 1:55 am, "Sebastian Bassi" wrote:
> In general you don't store the password, but a "hash" of it. Then when
> the user logs-in, you hash it and compare the result with the stored
> hash.
> About hash, use sha, look
> here:http://docs.python.org/library/hashlib.html#module-hashlib
But t
I'm writing a program in which I will ask users to enter user name and
password once only. It's a console based program that will run on
Windows XP. Actually, I'm trying to provide the similar functionality
as "Remember me" thing in browsers. For that, I will need to store
user name and passwords o
I'm writing a file-transfer program and I'm receiving bytes
transferred in a function. Now I would like to print bytes transfered
in one place e.g.
Bytes Transfered so far X
and X will increase and cursor should stay at this position. I don't
want to use any 3rd party module for this. Can I someh
Hi,
I'm new to Python (and admittedly not a very good programmer) and I've
come across a scenario where I've to search and replace text in a
file.
For the sake of an example, I'm searching for every occurence of the
text
[[http://www.hotmail.com -> Hotmail]]
I've to replace it with
[http://www.h
Hi all,
I'm new to Python and am automating few tasks using Pamie. Everything
worked well until I had to handle the File Open Dialog. I mean I'm
trying to automate the file upload process using Pamie. Basically I
just want to automate the process of file upload. I want to
automatically hit the Br
37 matches
Mail list logo