i just finished learning oop as a beginner and trying to practice with it
but i ran into this typeerror issue, help please.
Traceback (most recent call last):
File
"c:\Users\ojomo\OneDrive\Desktop\myexcel\oop_learn.py\myExperiment.py\mainMain.py",
line 36, in
print(invest_crypto.client_list
i am trying to print this code but it keeps giving me this typeerror,
please help. the csv file format i am trying to change into a list is in a
different module.
class invest_crypto:
crypto_current_rate = 0.05
client_list = []
def __init__(self, name, surname, amount_Deposited, amount
im trying to upgrade my pip so i can install openpyxl. i though i had
successfully upgraded pip, and then I was trying to install openpyxl, but I
was getting this:
C:\Users\ojomo>"C:\Program Files\Python310\python.exe" -m pip install
--upgrade
Traceback (most recent call last):
File "C:\Program
hello, i successfully installed openpyxl but it is saying this about my pip:
WARNING: You are using pip version 22.0.2; however, version 22.0.4 is
available.You should consider upgrading via the 'C:\Program
Files\Python310\python.exe -m pip install --upgrade pip' command.
And then when I try to u
given a number n, for each integer i in the range from 1 to n inclusive,
print one value per line as follows:
. if i is a multiple of both 3 but not 5, print fizz.
.if i is a multiple of 5 but not 3, print buzz
.if i is not a multiple of 3 or 5, print the value of i.
the above is the question. the
i = int(input())
lis = list(map(int,input().strip().split()))[:i]
z = max(lis)
while max(lis) == z:
lis.remove(max(lis))
print (max(lis))
this is an answer to a question from the discussion chat in hackerrank. i
didn't know the answer so i found an answer that fitted well to the
question, however
I can no longer open the Idle IDE for Python on Windows 7.
For 3-5 years I used Idle for all my python work. But in January this happens:
When I right click on a python file and choose "open with Idle" nothing happens.
If I double-click on the file itself, it briefly opens an MS-DOS looking
wi
On 26 March 2011 12:55, OJ wrote:
>> 1. Use c_char_p instead of POINTER(c_char).
>> 2. Use msg.value to obtain a Python string from the pointer.
>>
>
> If I change to c_char_p, my program segfaults.
>
> If I use msg.value, I get this error message:
> Traceback
Hi
I am trying to implement a python frontend for a c library. I can open
the library successfully and call functions using ctypes. My challenge
now is that this library are using plugins, which is also libraries
(.so on linux).
The library function for adding these plugins expects a viod * to the
Hi I am opening a shared library which has defined the following
callback prototype:
extern void DebugMessage(int level, const char *message, ...);
My implementation in Python looks like this:
DEBUGFUNC = ctypes.CFUNCTYPE(None, ctypes.c_int, ctypes.POINTER(ctypes.c_char))
def DebugMessage(lvl, msg
On Jul 31, 11:37 am, Nikolaus Rath <[EMAIL PROTECTED]> wrote:
> So why does Python distinguish between e.g. the type 'int' and the
> class 'myclass'? Why can't I say that 'int' is a class and 'myclass'
> is a type?
I might be wrong here, but I think the point is that there is no
distinction. A cla
On Jul 25, 3:44 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote:
> Because usually if a program *prompts* the user to enter input (and that
> was what I read from the OP's post), one has to deal with pseudo
> terminals, not with stdin/out.
How does the program writing some text before taking inpu
On Jul 21, 11:04 am, Fredrik Lundh <[EMAIL PROTECTED]> wrote:
> The drawback is that it's a lot easier to mess up the edge cases if you
> do that (as this thread has shown). The small speedup you get in
> typical cases is quickly offset by extra debugging/testing time (or, for
> that matter, argui
On Jul 19, 3:04 am, Andrew Freeman <[EMAIL PROTECTED]> wrote:
> let me revise it please:
>
> To show if valid:
>
> if re.search(r'^[LRM]*$', 'LM'):
> print 'Valid'
Fine, this works, although match instead of search blah blah blah as
has already been mentioned. I still think searching for one i
>
> > Why not just use * instead of + like:
>
> > if re.search(r'^[^LRM]*$', var): # note: ^ outside [] is start of
> > string; $ means end of string
> > print "Invalid"
>
> > This will *only* print invalid when there is a character other than L,
> > R, or M or a empty string.
>
> Sorry, forget
On Jul 18, 12:10 pm, John Machin <[EMAIL PROTECTED]> wrote:
> On Jul 18, 9:05 pm, oj <[EMAIL PROTECTED]> wrote:
>
>
>
> > On Jul 18, 11:33 am, [EMAIL PROTECTED] wrote:
>
> > > Hi,
>
> > > Hi,
>
> > > I am taking a string as an input
On Jul 18, 11:33 am, [EMAIL PROTECTED] wrote:
> Hi,
>
> Hi,
>
> I am taking a string as an input from the user and it should only
> contain the chars:L , M or R
>
> I tried the folllowing in kodos but they are still not perfect:
>
> [^A-K,^N-Q,^S-Z,^0-9]
> [L][M][R]
> [LRM]?L?[LRM]? etc but they do
On Jul 16, 1:09 pm, Jeff <[EMAIL PROTECTED]> wrote:
> On Jul 15, 7:21 pm, Michael Torrie <[EMAIL PROTECTED]> wrote:
>
> > iu2 wrote:
> > > I still don't understand: In each recursive call to flatten, acc
> > > should be bound to a new [], shouldn't it? Why does the binding happen
> > > only on the
On Jul 14, 11:41 am, srinivasan srinivas <[EMAIL PROTECTED]>
wrote:
> Thanks,
> Srini
>
> Bollywood, fun, friendship, sports and more. You name it, we have it
> onhttp://in.promos.yahoo.com/groups/bestofyahoo/
You might have more luck asking for help if you explained what Perl's
Data::Dumpe
On Jul 5, 1:57 am, Phoe6 <[EMAIL PROTECTED]> wrote:
> I have a requirement for using caseless dict. I searched the web for
> many different implementations and found one snippet which was
> implemented in minimal and useful way.
>
> #
> import UserDict
>
> class CaseInsensitiveDict(dict
On Jul 2, 2:39 pm, noydb <[EMAIL PROTECTED]> wrote:
> Can someone help me with this script, which I found posted elsewhere?
> I'm trying to figure out what is going on here so that I can alter it
> for my needs, but the lack of descriptive names is making it
> difficult. And, the script doesn't qu
On Jul 2, 7:25 am, [EMAIL PROTECTED] wrote:
> This simple script writes html color codes that can be viewed in a
> browser. I used short form hex codes (fff or 000, etc) and my list
> has only six hex numbers otherwise the results get rather large. I
> invite criticism as to whether my code is "py
On Jul 2, 12:41 pm, Sallu <[EMAIL PROTECTED]> wrote:
> Hi All, import re
> msg=raw_input('Enter the email : ')
>
> def validateEmail(email):
>
> #if re.match("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]
> {1,3})(\\]?)$", email) != None:
> if re.match("^([EMAIL PROTECTED]
Hi, I'm just toying around with some ideas at the moment.
Is there an easy and safe way to recursivly import all modules under a
particular namespace?
Say, I had modules:
foo
foo.bar
foo.bar.baz
foo.baz
bar
bar.baz
I want to import all the modules in the foo namespace, so the first
four modules
On Jan 11, 4:29 pm, [EMAIL PROTECTED] wrote:
> Hi all,
>
> I'm part of a small team writing a Python package for a scientific
> computing project. The idea is to make it easy to use for relatively
> inexperienced programmers. As part of that aim, we're using what we're
> calling 'magic functions',
Hi all!
As is about to become apparent, I really don't know what I'm doing
when it comes to using eggs.
I'm writing some software that is going to be deployed on a machine as
a number of eggs. Which is all well and good.
These eggs all end up depending on each other; modules in egg A want
to imp
On Dec 12, 4:34 am, "Terry Reedy" <[EMAIL PROTECTED]> wrote:
> "Ron Provost" <[EMAIL PROTECTED]> wrote in message
>
> news:[EMAIL PROTECTED]
> But here's my problem, most of my coworkers, when they see my apps and
> learn that they are written in Python ask questions like, "Why would you
> write th
On Dec 6, 8:21 pm, Kelie <[EMAIL PROTECTED]> wrote:
> Hello group,
>
> If I need store and use a couple thousand of people's contact info:
> first name, last name, phone, fax, email, address, etc. I'm thinking
> of using either sqlite or xml. Which one is better? My understanding
> is if there is l
On Nov 22, 3:58 am, NoName <[EMAIL PROTECTED]> wrote:
> Is it possible to interrupt loop (program) by pressing Q key like Ctrl-
> C?
> how can i hook user's keypress while program running?
>
> thnx
There's a quite complicated example here:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/2
On Nov 22, 3:02 pm, Ant <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I've just been reading with interest this
> article:http://caos.di.uminho.pt/~ulisses/blog/2007/11/20/foldr-the-magic-fun...
>
> It's a useful function that (with a more intuitive name) could prove a
> compelling addition to the iter
On Nov 22, 11:09 am, Neil Webster <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I'm sure I'm doing something wrong but after lots of searching and
> reading I can't work it out and was wondering if anybody can help?
>
> I've got the following block of code:
> if a >= 20 and a < 100:
>
On Nov 22, 5:44 am, Vinay Sajip <[EMAIL PROTECTED]> wrote:
> On Nov 21, 11:38 am, oj <[EMAIL PROTECTED]> wrote:
>
>
>
> > Hi,
>
> > I want to setuploggingwith two loggers:
>
> > The child logger is used when something different needs to be done
On Nov 20, 8:32 pm, Vinay Sajip <[EMAIL PROTECTED]> wrote:
> On Nov 20, 1:47 pm, oj <[EMAIL PROTECTED]> wrote:
>
> > On Nov 20, 12:26 pm, Vinay Sajip <[EMAIL PROTECTED]> wrote:
>
> > > Can you confirm that if you add the while loop back in, all messages
&
On Nov 21, 11:48 am, Paul Rudin <[EMAIL PROTECTED]> wrote:
> oj <[EMAIL PROTECTED]> writes:
> > Hi,
>
> > I want to setup logging with two loggers:
>
> > The child logger is used when something different needs to be done
> > with the log record, an
Hi,
I want to setup logging with two loggers:
The child logger is used when something different needs to be done
with the log record, and the log record will propagate and be logged
by the root logger as usual.
However, there are certain times when I don't want a log record to
propagate from the
On Nov 20, 12:26 pm, Vinay Sajip <[EMAIL PROTECTED]> wrote:
>
> Can you confirm that if you add the while loop back in, all messages
> are seen by the server? It worked for me.
Yes, it works in that case. This was meant to be implied by my earlier
messages, but on reflection, isn't obvious.
As I
On Nov 19, 5:30 pm, Vinay Sajip <[EMAIL PROTECTED]> wrote:
> On Nov 19, 10:27 am, oj <[EMAIL PROTECTED]> wrote:
>
>
>
> > On Nov 16, 2:31 pm, Vinay Sajip <[EMAIL PROTECTED]> wrote:
>
> > Here is the server code. Pretty much directly copied from t
On Nov 16, 2:31 pm, Vinay Sajip <[EMAIL PROTECTED]> wrote:
> On Nov 15, 3:23 pm, oj <[EMAIL PROTECTED]> wrote:
>
>
>
> > However, initially, I had tried it with a server that closed the
> > connection after receiving each record, and the SocketHandler does
Hi folks,
I'm writing some fairly simple logging code that makes use of the
SocketHandler.
The example server code works fine, as expected. (http://
docs.python.org/lib/network-logging.html)
However, initially, I had tried it with a server that closed the
connection after receiving each record,
39 matches
Mail list logo